本文整理汇总了C++中BAIL_ON_LSA_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ BAIL_ON_LSA_ERROR函数的具体用法?C++ BAIL_ON_LSA_ERROR怎么用?C++ BAIL_ON_LSA_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BAIL_ON_LSA_ERROR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: LsaPcacheGetMachinePasswordInfoW
DWORD
LsaPcacheGetMachinePasswordInfoW(
IN LSA_MACHINEPWD_CACHE_HANDLE pPcache,
OUT PLSA_MACHINE_PASSWORD_INFO_W* ppPasswordInfo
)
{
DWORD dwError = 0;
BOOLEAN bInLock = FALSE;
PLSA_MACHINE_PASSWORD_INFO_W pPasswordInfo = NULL;
dwError = LsaPcachepEnsurePasswordInfoAndLock(pPcache);
BAIL_ON_LSA_ERROR(dwError);
bInLock = TRUE;
pPasswordInfo = &pPcache->pEntry->PasswordInfoW;
LwInterlockedIncrement(&pPcache->pEntry->RefCount);
error:
if (bInLock)
{
PTHREAD_CALL_MUST_SUCCEED(pthread_rwlock_unlock(pPcache->pStateLock));
}
if (dwError)
{
if (pPasswordInfo)
{
LsaPcacheReleaseMachinePasswordInfoW(pPasswordInfo);
pPasswordInfo = NULL;
}
}
*ppPasswordInfo = pPasswordInfo;
return dwError;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:36,代码来源:pwdcache.c
示例17: ValidateParameters
static
DWORD
ValidateParameters(
PCSTR pszName
)
{
DWORD dwError = 0;
BAIL_ON_INVALID_STRING(pszName);
if (strlen(pszName) > 15)
{
fprintf(stdout, "Machine name can have up to 15 characters\n");
dwError = LW_ERROR_INVALID_PARAMETER;
BAIL_ON_LSA_ERROR(dwError);
}
cleanup:
return dwError;
error:
goto cleanup;
}
开发者ID:borland667,项目名称:pbis,代码行数:24,代码来源:set_machine_name_main.c
示例18: LsaSrvAuthProviderAllocateProviderList
static
DWORD
LsaSrvAuthProviderAllocateProviderList(
PLSA_AUTH_PROVIDER *ppProviderList
)
{
DWORD dwError = 0;
PSTR pszLoadOrder = NULL; // Multistring
PCSTR pszProvider = NULL;
PSTR pszProviderKey = NULL;
PLSA_AUTH_PROVIDER pProvider = NULL;
PLSA_AUTH_PROVIDER pProviderList = NULL;
dwError = LsaSrvAuthProviderRegGetLoadOrder(&pszLoadOrder);
BAIL_ON_LSA_ERROR(dwError);
if (!pszLoadOrder)
{
/* We should only get here if there is some problem with the
* registry -- can't access it, the key isn't there, ...
* -- so we will try a default set of providers.
*/
LSA_LOG_ERROR("Problem accessing provider configuration in registry. Trying compiled defaults [ActiveDirectory, Local].");
dwError = LsaSrvAllocateProvider(
LSA_PROVIDER_TAG_AD,
LSA_PROVIDER_PATH_AD,
&pProvider);
BAIL_ON_LSA_ERROR(dwError);
if (pProvider)
{
LsaSrvAppendAuthProviderList(&pProviderList, pProvider);
pProvider = NULL;
}
dwError = LsaSrvAllocateProvider(
LSA_PROVIDER_TAG_LOCAL,
LSA_PROVIDER_PATH_LOCAL,
&pProvider);
BAIL_ON_LSA_ERROR(dwError);
if (pProvider)
{
LsaSrvAppendAuthProviderList(&pProviderList, pProvider);
pProvider = NULL;
}
}
else
{
pszProvider = pszLoadOrder;
while ( pszProvider != NULL && *pszProvider != '\0' )
{
dwError = LwAllocateStringPrintf(
&pszProviderKey,
"Services\\lsass\\Parameters\\Providers\\%s",
pszProvider);
BAIL_ON_LSA_ERROR(dwError);
dwError = LsaSrvAuthLoadProvider(
pszProvider,
pszProviderKey,
&pProvider);
BAIL_ON_LSA_ERROR(dwError);
if (pProvider)
{
LsaSrvAppendAuthProviderList(&pProviderList, pProvider);
pProvider = NULL;
}
LW_SAFE_FREE_STRING(pszProviderKey);
pszProvider = pszProvider + strlen(pszProvider) + 1;
}
}
cleanup:
*ppProviderList = pProviderList;
LW_SAFE_FREE_MEMORY(pszLoadOrder);
LW_SAFE_FREE_STRING(pszProviderKey);
return dwError;
error:
LsaSrvFreeAuthProviderList(pProviderList);
pProviderList = NULL;
goto cleanup;
}
开发者ID:borland667,项目名称:pbis,代码行数:92,代码来源:auth_provider.c
示例19: LsaSrvInitAuthProviders
DWORD
LsaSrvInitAuthProviders(
IN OPTIONAL PLSA_STATIC_PROVIDER pStaticProviders
)
{
DWORD dwError = 0;
PLSA_AUTH_PROVIDER pUninitializedProviderList = NULL;
PLSA_AUTH_PROVIDER pProviderList = NULL;
PLSA_AUTH_PROVIDER pProvider = NULL;
BOOLEAN bInLock = FALSE;
dwError = LsaSrvAuthProviderAllocateProviderList(
&pUninitializedProviderList);
BAIL_ON_LSA_ERROR(dwError);
while(pUninitializedProviderList)
{
pProvider = pUninitializedProviderList;
pUninitializedProviderList = pUninitializedProviderList->pNext;
pProvider->pNext = NULL;
dwError = LsaSrvInitAuthProvider(pProvider, pStaticProviders);
if (dwError)
{
LSA_LOG_ERROR("Failed to load provider '%s' from '%s' - error %u (%s)",
LSA_SAFE_LOG_STRING(pProvider->pszId),
LSA_SAFE_LOG_STRING(pProvider->pszProviderLibpath),
dwError,
LwWin32ExtErrorToName(dwError));
LsaSrvFreeAuthProvider(pProvider);
pProvider = NULL;
dwError = 0;
}
else
{
LsaSrvAppendAuthProviderList(&pProviderList, pProvider);
pProvider = NULL;
}
}
ENTER_AUTH_PROVIDER_LIST_WRITER_LOCK(bInLock);
LsaSrvFreeAuthProviderList(gpAuthProviderList);
gpAuthProviderList = pProviderList;
pProviderList = NULL;
LEAVE_AUTH_PROVIDER_LIST_WRITER_LOCK(bInLock);
cleanup:
if (pUninitializedProviderList)
{
LsaSrvFreeAuthProviderList(pUninitializedProviderList);
}
return dwError;
error:
if (pProviderList) {
LsaSrvFreeAuthProviderList(pProviderList);
}
goto cleanup;
}
开发者ID:borland667,项目名称:pbis,代码行数:67,代码来源:auth_provider.c
示例20: LsaSrvAuthLoadProvider
static
DWORD
LsaSrvAuthLoadProvider(
PCSTR pszProviderName,
PCSTR pszProviderKey,
PLSA_AUTH_PROVIDER *ppProvider
)
{
DWORD dwError = 0;
PSTR pszId = NULL;
PSTR pszPath = NULL;
PLSA_AUTH_PROVIDER pProvider = NULL;
LWREG_CONFIG_ITEM Config[] =
{
{
"Id",
FALSE,
LwRegTypeString,
0,
MAXDWORD,
NULL,
&pszId,
NULL
},
{
"Path",
FALSE,
LwRegTypeString,
0,
MAXDWORD,
NULL,
&pszPath,
NULL
},
};
dwError = RegProcessConfig(
pszProviderKey,
pszProviderKey,
Config,
sizeof(Config)/sizeof(Config[0]));
BAIL_ON_LSA_ERROR(dwError);
if (LW_IS_NULL_OR_EMPTY_STR(pszId))
{
goto error;
}
if (LW_IS_NULL_OR_EMPTY_STR(pszPath))
{
goto error;
}
dwError = LsaSrvAllocateProvider(pszId, pszPath, &pProvider);
BAIL_ON_LSA_ERROR(dwError);
cleanup:
*ppProvider = pProvider;
LW_SAFE_FREE_STRING(pszId);
LW_SAFE_FREE_STRING(pszPath);
return dwError;
error:
if (pProvider)
{
LsaSrvFreeAuthProvider(pProvider);
pProvider = NULL;
}
goto cleanup;
}
开发者ID:borland667,项目名称:pbis,代码行数:74,代码来源:auth_provider.c
注:本文中的BAIL_ON_LSA_ERROR函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论