当前位置: 首页>>代码示例>>C++>>正文


C++ BAIL_ON_LSA_ERROR函数代码示例

本文整理汇总了C++中BAIL_ON_LSA_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ BAIL_ON_LSA_ERROR函数的具体用法?C++ BAIL_ON_LSA_ERROR怎么用?C++ BAIL_ON_LSA_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了BAIL_ON_LSA_ERROR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NtlmClientExportSecurityContext

DWORD
NtlmClientExportSecurityContext(
    IN PNTLM_CONTEXT_HANDLE phContext,
    IN DWORD fFlags,
    OUT PSecBuffer pPackedContext
    )
{
    DWORD dwError = LW_ERROR_SUCCESS;

    BAIL_ON_INVALID_POINTER(phContext);

    dwError = NtlmTransactExportSecurityContext(
        *phContext,
        fFlags,
        pPackedContext);
    BAIL_ON_LSA_ERROR(dwError);

error:
    return(dwError);
}
开发者ID:borland667,项目名称:pbis,代码行数:20,代码来源:exportsecctxt.c

示例2: LocalCheckForModifyAccess

DWORD
LocalCheckForModifyAccess(
    HANDLE hProvider
    )
{
    DWORD dwError = 0;
    BOOLEAN bIsAdmin = FALSE;

    dwError = LocalCheckIsAdministrator(hProvider, &bIsAdmin);
    BAIL_ON_LSA_ERROR(dwError);

    if (!bIsAdmin)
    {
        dwError = LW_ERROR_ACCESS_DENIED;
    }

error:

    return dwError;
}
开发者ID:bhanug,项目名称:likewise-open,代码行数:20,代码来源:lpaccess.c

示例3: ParseArgs

static
DWORD
ParseArgs(
    int argc,
    char *argv[],
    PSTR *ppszSid
    )
{
    DWORD dwError = 0;
    PSTR pszSid = NULL;

    if (argc < 2) {
        dwError = LW_ERROR_INVALID_PARAMETER;
        ShowUsage();
        exit(1);
    }

    if (strcmp(argv[1], "--help") == 0 ||
        strcmp(argv[1], "-h") == 0)
    {
        ShowUsage();
        exit(0);
    }

    dwError = LwAllocateString(argv[1], &pszSid);
    BAIL_ON_LSA_ERROR(dwError);

    *ppszSid = pszSid;

cleanup:
    return dwError;

error:
    if (pszSid) {
        LW_SAFE_FREE_STRING(pszSid);
    }

    *ppszSid = NULL;

    goto cleanup;
}
开发者ID:borland667,项目名称:pbis,代码行数:41,代码来源:set_machine_sid_main.c

示例4: LsaTraceUnsetFlag

DWORD
LsaTraceUnsetFlag(
    DWORD dwTraceFlag
    )
{
    DWORD dwError = 0;

    if (!gpTraceFlags)
    {
        dwError = LW_ERROR_TRACE_NOT_INITIALIZED;
        BAIL_ON_LSA_ERROR(dwError);
    }

    dwError = LsaBitVectorUnsetBit(
                    gpTraceFlags,
                    dwTraceFlag);

error:

    return dwError;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:21,代码来源:lsalogger.c

示例5: ParseTraceFlag

static
DWORD
ParseTraceFlag(
    PCSTR  pszArg,
    PDWORD pdwTraceFlag
    )
{
    DWORD dwError = 0;
    DWORD dwTraceFlag = 0;

    if (!strcasecmp(pszArg, LSA_TRACE_FLAG_USER_GROUP_QUERIES_TEXT))
    {
       dwTraceFlag = LSA_TRACE_FLAG_USER_GROUP_QUERIES;
    }
    else if (!strcasecmp(pszArg, LSA_TRACE_FLAG_AUTHENTICATION_TEXT))
    {
       dwTraceFlag = LSA_TRACE_FLAG_AUTHENTICATION;
    }
    else if (!strcasecmp(pszArg, LSA_TRACE_FLAG_USER_GROUP_ADMINISTRATION_TEXT))
    {
       dwTraceFlag = LSA_TRACE_FLAG_USER_GROUP_ADMINISTRATION;
    }
    else
    {
       dwError = LW_ERROR_INVALID_PARAMETER;
       BAIL_ON_LSA_ERROR(dwError);
    }

    *pdwTraceFlag = dwTraceFlag;

cleanup:

    return dwError;

error:

    *pdwTraceFlag = 0;

    goto cleanup;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:40,代码来源:trace_info_main.c

示例6: ADNonSchemaKeywordGetString

DWORD
ADNonSchemaKeywordGetString(
    PSTR *ppszValues,
    DWORD dwNumValues,
    PCSTR pszAttributeName,
    PSTR *ppszResult
    )
{
    DWORD dwError = 0;
    size_t i;
    size_t sNameLen = strlen(pszAttributeName);
    PSTR pszResult = NULL;

    for (i = 0; i < dwNumValues; i++)
    {
        PCSTR pszValue = ppszValues[i];

        // Look for ldap values which are in the form <attributename>=<value>
        if (!strncasecmp(pszValue, pszAttributeName, sNameLen) &&
                pszValue[sNameLen] == '=')
        {
            dwError = LwAllocateString(
                        pszValue + sNameLen + 1,
                        &pszResult);
            BAIL_ON_LSA_ERROR(dwError);
            break;
        }
    }

    *ppszResult = pszResult;

cleanup:
    return dwError;

error:
    *ppszResult = NULL;
    LW_SAFE_FREE_STRING(pszResult);

    goto cleanup;
}
开发者ID:bhanug,项目名称:likewise-open,代码行数:40,代码来源:ad_marshal_user.c

示例7: SetQueryType

static
DWORD
SetQueryType(
    LSA_QUERY_TYPE type
    )
{
    DWORD dwError = 0;

    if (gState.QueryType != LSA_QUERY_TYPE_UNDEFINED)
    {
        dwError = LW_ERROR_INVALID_PARAMETER;
        BAIL_ON_LSA_ERROR(dwError);
    }
    else
    {
        gState.QueryType = type;
    }

error:

    return dwError;
}
开发者ID:borland667,项目名称:pbis,代码行数:22,代码来源:query_member_of.c

示例8: LsaDataBlobCopy

DWORD
LsaDataBlobCopy(
    PLSA_DATA_BLOB *ppDst,
    PLSA_DATA_BLOB pSrc
    )
{
    DWORD dwError = LW_ERROR_INTERNAL;

    BAIL_ON_INVALID_POINTER(ppDst);
    BAIL_ON_INVALID_POINTER(pSrc);

    dwError = LsaDataBlobStore(ppDst,
                               pSrc->dwLen,
                               pSrc->pData);
    BAIL_ON_LSA_ERROR(dwError);

cleanup:
    return dwError;
    
error:
    goto cleanup;    
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:22,代码来源:datablob.c

示例9: LocalCfgSetDefaultLoginShell

static
DWORD
LocalCfgSetDefaultLoginShell(
    PLOCAL_CONFIG pConfig,
    PCSTR          pszName,
    PCSTR          pszValue
    )
{
    DWORD dwError = 0;

    PSTR pszLoginShell = NULL;

    if (LW_IS_NULL_OR_EMPTY_STR(pszValue))
    {
        goto error;
    }

    if (access(pszValue, X_OK) != 0)
    {
        LSA_LOG_ERROR("Invalid login shell [%s]", pszValue);
        goto error;
    }

    dwError = LwAllocateString(pszValue, &pszLoginShell);
    BAIL_ON_LSA_ERROR(dwError);

    LW_SAFE_FREE_STRING(pConfig->pszLoginShell);

    pConfig->pszLoginShell = pszLoginShell;
    pszLoginShell = NULL;

cleanup:
    return dwError;

error:
    LW_SAFE_FREE_STRING(pszLoginShell);

    goto cleanup;
}
开发者ID:bhanug,项目名称:likewise-open,代码行数:39,代码来源:lpcfg.c

示例10: LsaSrvAddPrivilegesToAccount

NTSTATUS
LsaSrvAddPrivilegesToAccount(
    /* [in] */ handle_t hBinding,
    /* [in] */ LSAR_ACCOUNT_HANDLE hAccount,
    /* [in] */ PPRIVILEGE_SET pPrivileges
    )
{
    NTSTATUS ntStatus = STATUS_SUCCESS;
    DWORD err = ERROR_SUCCESS;
    PLSAR_ACCOUNT_CONTEXT pAccountCtx = (PLSAR_ACCOUNT_CONTEXT)hAccount;
    PPOLICY_CONTEXT pPolicyCtx = NULL;

    BAIL_ON_INVALID_PTR(hAccount);
    BAIL_ON_INVALID_PTR(pPrivileges);

    if (pAccountCtx->Type != LsaContextAccount)
    {
        ntStatus = STATUS_INVALID_HANDLE;
        BAIL_ON_NT_STATUS(ntStatus);
    }

    pPolicyCtx = pAccountCtx->pPolicyCtx;

    err = LsaSrvPrivsAddPrivilegesToAccount(
                        NULL,
                        pPolicyCtx->pUserToken,
                        pAccountCtx->pAccountContext,
                        pPrivileges);
    BAIL_ON_LSA_ERROR(err);

error:
    if (ntStatus == STATUS_SUCCESS &&
        err != ERROR_SUCCESS)
    {
        ntStatus = LwWin32ErrorToNtStatus(err);
    }

    return ntStatus;
}
开发者ID:bhanug,项目名称:likewise-open,代码行数:39,代码来源:lsa_addprivilegestoaccount.c

示例11: LsaValidateGroupName

DWORD
LsaValidateGroupName(
    PCSTR pszName
    )
{
    DWORD dwError = 0;
    size_t sNameLen = 0;

    sNameLen = strlen(pszName);
    if (sNameLen > LSA_MAX_GROUP_NAME_LENGTH || sNameLen == 0)
    {
        dwError = LW_ERROR_INVALID_GROUP_NAME;
        BAIL_ON_LSA_ERROR(dwError);
    }

cleanup:
    return dwError;

error:

    goto cleanup;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:22,代码来源:lsagroupinfo.c

示例12: SamDbBuildDirectoryContext

DWORD
SamDbBuildDirectoryContext(
    PSAMDB_OBJECTCLASS_TO_ATTR_MAP_INFO pObjectClassAttrMaps,
    DWORD                               dwNumObjectClassAttrMaps,
    PSAM_DB_ATTR_LOOKUP                 pAttrLookup,
    PSAM_DIRECTORY_CONTEXT*             ppDirContext
    )
{
    DWORD dwError = 0;
    PSAM_DIRECTORY_CONTEXT pDirContext = NULL;

    dwError = DirectoryAllocateMemory(
                    sizeof(SAM_DIRECTORY_CONTEXT),
                    (PVOID*)&pDirContext);
    BAIL_ON_SAMDB_ERROR(dwError);

    pDirContext->pObjectClassAttrMaps = pObjectClassAttrMaps;
    pDirContext->dwNumObjectClassAttrMaps = dwNumObjectClassAttrMaps;
    pDirContext->pAttrLookup = pAttrLookup;

    dwError = SamDbAcquireDbContext(&pDirContext->pDbContext);
    BAIL_ON_LSA_ERROR(dwError);

    *ppDirContext = pDirContext;

cleanup:
    return dwError;

error:
    if (pDirContext)
    {
        SamDbFreeDirectoryContext(pDirContext);
    }

    *ppDirContext = NULL;

    goto cleanup;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:38,代码来源:samdbcontext.c

示例13: LsaAdBatchMarshalGroupInfo

static
DWORD
LsaAdBatchMarshalGroupInfo(
    IN PAD_PROVIDER_DATA pProviderData,
    IN OUT PLSA_AD_BATCH_ITEM_GROUP_INFO pGroupInfo,
    OUT PLSA_SECURITY_OBJECT_GROUP_INFO pObjectGroupInfo,
    IN PCSTR pszDnsDomainName,
    IN PCSTR pszNetbiosDomainName,
    IN PCSTR pszSamAccountName,
    IN PCSTR pszSid
    )
{
    DWORD dwError = 0;

    if (LsaAdBatchIsUnprovisionedMode(pProviderData))
    {
        dwError = LsaAdBatchMarshalUnprovisionedGroup(
                        pProviderData,
                        pGroupInfo,
                        pszDnsDomainName,
                        pszNetbiosDomainName,
                        pszSamAccountName,
                        pszSid);
        BAIL_ON_LSA_ERROR(dwError);
    }

    pObjectGroupInfo->gid = pGroupInfo->gid;

    LSA_XFER_STRING(pGroupInfo->pszAlias, pObjectGroupInfo->pszAliasName);
    LSA_XFER_STRING(pGroupInfo->pszPasswd, pObjectGroupInfo->pszPasswd);

cleanup:
    return dwError;

error:
    goto cleanup;
}
开发者ID:borland667,项目名称:pbis,代码行数:37,代码来源:batch_marshal.c

示例14: ADGetDomainQualifiedString

DWORD
ADGetDomainQualifiedString(
    PCSTR pszNetBIOSDomainName,
    PCSTR pszName,
    PSTR* ppszQualifiedName
    )
{
    DWORD dwError = 0;
    PSTR  pszQualifiedName = NULL;

    dwError = LwAllocateStringPrintf(
                    &pszQualifiedName,
                    "%s%c%s",
                    pszNetBIOSDomainName,
                    LsaSrvDomainSeparator(),
                    pszName);
    BAIL_ON_LSA_ERROR(dwError);

    LwStrnToUpper(pszQualifiedName, strlen(pszNetBIOSDomainName));

    LwStrToLower(pszQualifiedName + strlen(pszNetBIOSDomainName) + 1);

    *ppszQualifiedName = pszQualifiedName;

cleanup:

    return dwError;

error:

    *ppszQualifiedName = NULL;

    LW_SAFE_FREE_STRING(pszQualifiedName);

    goto cleanup;
}
开发者ID:borland667,项目名称:pbis,代码行数:36,代码来源:adldap.c

示例15: LsaDataBlobStore

DWORD
LsaDataBlobStore(
    PLSA_DATA_BLOB *ppBlob,
    DWORD dwSize,
    const PBYTE pBuffer
    )
{
    DWORD dwError = LW_ERROR_INTERNAL;

    BAIL_ON_INVALID_POINTER(ppBlob);

    dwError = LsaDataBlobAllocate(ppBlob, dwSize);
    BAIL_ON_LSA_ERROR(dwError);

    if (dwSize > 0) {        
        memcpy((*ppBlob)->pData, pBuffer, dwSize);
    }
    
cleanup:
    return dwError;
    
error:
    goto cleanup;    
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:24,代码来源:datablob.c


注:本文中的BAIL_ON_LSA_ERROR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。