本文整理汇总了C++中IsNullOrEmptyString函数的典型用法代码示例。如果您正苦于以下问题:C++ IsNullOrEmptyString函数的具体用法?C++ IsNullOrEmptyString怎么用?C++ IsNullOrEmptyString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsNullOrEmptyString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SrvPathGetFileName
PCSTR
SrvPathGetFileName(
PCSTR pszPath
)
{
PCSTR pszCursor = pszPath;
size_t sLen = 0;
CHAR szBackSlash[] = { '\\', 0 };
CHAR szFwdSlash[] = { '/', 0 };
if (pszPath && (sLen = strlen(pszPath)))
{
pszCursor = pszPath + sLen - 1;
while (!IsNullOrEmptyString(pszCursor) && (pszCursor != pszPath))
{
if ((*pszCursor == szBackSlash[0]) || (*pszCursor == szFwdSlash[0]))
{
pszCursor++;
break;
}
pszCursor--;
}
}
return pszCursor;
}
开发者ID:bhanug,项目名称:likewise-open,代码行数:28,代码来源:path.c
示例2: VmDirSchemaAttrIdMapGetAttrId
DWORD
VmDirSchemaAttrIdMapGetAttrId(
PVDIR_SCHEMA_ATTR_ID_MAP pAttrIdMap,
PSTR pszAttrName,
USHORT* pusAttrId
)
{
DWORD dwError = 0;
uintptr_t pAttrId = 0;
if (!pAttrIdMap || IsNullOrEmptyString(pszAttrName))
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMDIR_ERROR(dwError);
}
dwError = LwRtlHashMapFindKey(pAttrIdMap->pStoredIds,
(PVOID*)&pAttrId, pszAttrName);
if (dwError)
{
dwError = LwRtlHashMapFindKey(pAttrIdMap->pNewIds,
(PVOID*)&pAttrId, pszAttrName);
}
BAIL_ON_VMDIR_ERROR(dwError);
if (pusAttrId)
{
*pusAttrId = (USHORT)pAttrId;
}
error:
return dwError;
}
开发者ID:vmware,项目名称:lightwave,代码行数:33,代码来源:idmap.c
示例3: VmDirPagedSearchCacheFind
static
PVDIR_PAGED_SEARCH_RECORD
VmDirPagedSearchCacheFind(
PCSTR pszCookie
)
{
DWORD dwError = 0;
PLW_HASHTABLE_NODE pNode = NULL;
PVDIR_PAGED_SEARCH_RECORD pSearchRecord = NULL;
BOOLEAN bInLock = FALSE;
if (IsNullOrEmptyString(pszCookie))
{
BAIL_WITH_VMDIR_ERROR(dwError, VMDIR_ERROR_INVALID_PARAMETER);
}
VMDIR_LOCK_MUTEX(bInLock, gPagedSearchCache.mutex);
dwError = LwRtlHashTableFindKey(
gPagedSearchCache.pHashTbl,
&pNode,
(PVOID)pszCookie);
dwError = LwNtStatusToWin32Error(dwError);
BAIL_ON_VMDIR_ERROR(dwError);
pSearchRecord = LW_STRUCT_FROM_FIELD(pNode, VDIR_PAGED_SEARCH_RECORD, Node);
_RefPagedSearchRecord(pSearchRecord);
cleanup:
VMDIR_UNLOCK_MUTEX(bInLock, gPagedSearchCache.mutex);
return pSearchRecord;
error:
goto cleanup;
}
开发者ID:vmware,项目名称:lightwave,代码行数:33,代码来源:pscache.c
示例4: VmDirSimpleEntryDeleteAttribute
DWORD
VmDirSimpleEntryDeleteAttribute(
PCSTR pszDN,
PCSTR pszAttr
)
{
DWORD dwError = 0;
size_t dnlen = 0;
size_t attrlen = 0;
VDIR_OPERATION ldapOp = {0};
if (IsNullOrEmptyString(pszDN) || IsNullOrEmptyString(pszAttr))
{
BAIL_WITH_VMDIR_ERROR(dwError, VMDIR_ERROR_INVALID_PARAMETER);
}
dwError = VmDirInitStackOperation(
&ldapOp,
VDIR_OPERATION_TYPE_INTERNAL,
LDAP_REQ_MODIFY,
NULL);
BAIL_ON_VMDIR_ERROR(dwError);
dnlen = VmDirStringLenA(pszDN);
attrlen = VmDirStringLenA(pszAttr);
ldapOp.pBEIF = VmDirBackendSelect(NULL);
ldapOp.reqDn.lberbv_val = (PSTR)pszDN;
ldapOp.reqDn.lberbv_len = dnlen;
ldapOp.request.modifyReq.dn.lberbv_val = ldapOp.reqDn.lberbv_val;
ldapOp.request.modifyReq.dn.lberbv_len = ldapOp.reqDn.lberbv_len;
dwError = VmDirAppendAMod(
&ldapOp, MOD_OP_DELETE, pszAttr, attrlen, NULL, 0);
BAIL_ON_VMDIR_ERROR(dwError);
dwError = VmDirInternalModifyEntry(&ldapOp);
BAIL_ON_VMDIR_ERROR(dwError);
cleanup:
VmDirFreeOperationContent(&ldapOp);
return dwError;
error:
goto cleanup;
}
开发者ID:vmware,项目名称:lightwave,代码行数:47,代码来源:vmdirentry.c
示例5: ADUSMBGetFile
DWORD
ADUSMBGetFile(
PSTR pszDomainName,
PSTR pszSourcePath,
PSTR pszDestPath
)
{
DWORD dwError = MAC_AD_ERROR_SUCCESS;
PSTR pszFQSrcPath = NULL;
PSTR pszDCHostname = NULL;
if (IsNullOrEmptyString(pszDomainName) ||
IsNullOrEmptyString(pszSourcePath) ||
IsNullOrEmptyString(pszDestPath))
{
dwError = MAC_AD_ERROR_INVALID_PARAMETER;
BAIL_ON_MAC_ERROR(dwError);
}
dwError = GetPreferredDCAddress(
pszDomainName,
&pszDCHostname);
BAIL_ON_MAC_ERROR(dwError);
dwError = LwAllocateStringPrintf(
&pszFQSrcPath,
"//%s/sysvol/%s",
pszDCHostname,
*pszSourcePath == '/' ? pszSourcePath+1 : pszSourcePath);
BAIL_ON_MAC_ERROR(dwError);
LOG("Calling ADUCopyFileFromRemote(Src:%s, Dest:%s)", pszFQSrcPath, pszDestPath);
dwError = ADUCopyFileFromRemote(pszFQSrcPath, pszDestPath);
BAIL_ON_MAC_ERROR(dwError);
cleanup:
LW_SAFE_FREE_STRING(pszFQSrcPath);
LW_SAFE_FREE_STRING(pszDCHostname);
return dwError;
error:
goto cleanup;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:47,代码来源:filexfer.c
示例6: VmDirGetKrbMasterKey
DWORD
VmDirGetKrbMasterKey(
PSTR pszFQDN, // [in] FQDN
PBYTE* ppKeyBlob,
DWORD* pSize
)
{
DWORD dwError = 0;
PBYTE pRetMasterKey = NULL;
if (IsNullOrEmptyString(pszFQDN)
|| !ppKeyBlob
|| !pSize
)
{
dwError = VMDIR_ERROR_INVALID_PARAMETER;
BAIL_ON_VMDIR_ERROR(dwError);
}
// Currently, we only support single krb realm.
// Global cache gVmdirKrbGlobals is initialized during startup stage.
if (VmDirStringCompareA( pszFQDN, VDIR_SAFE_STRING(gVmdirKrbGlobals.pszRealm), FALSE) != 0)
{
dwError = VMDIR_ERROR_INVALID_REALM;
BAIL_ON_VMDIR_ERROR(dwError);
}
dwError = VmDirAllocateMemory(
gVmdirKrbGlobals.bervMasterKey.lberbv.bv_len,
(PVOID*)&pRetMasterKey
);
BAIL_ON_VMDIR_ERROR(dwError);
dwError = VmDirCopyMemory (
pRetMasterKey,
gVmdirKrbGlobals.bervMasterKey.lberbv.bv_len,
gVmdirKrbGlobals.bervMasterKey.lberbv.bv_val,
gVmdirKrbGlobals.bervMasterKey.lberbv.bv_len
);
BAIL_ON_VMDIR_ERROR(dwError);
*ppKeyBlob = pRetMasterKey;
*pSize = (DWORD) gVmdirKrbGlobals.bervMasterKey.lberbv.bv_len;
pRetMasterKey = NULL;
cleanup:
return dwError;
error:
VMDIR_LOG_ERROR( LDAP_DEBUG_RPC, "VmDirGetKrbMasterKey failed. (%u)(%s)",
dwError, VDIR_SAFE_STRING(pszFQDN));
VMDIR_SAFE_FREE_MEMORY(pRetMasterKey);
goto cleanup;
}
开发者ID:Dan-McGee,项目名称:lightwave,代码行数:59,代码来源:krb.c
示例7: LWNetDnsGetSrvRecordQuestion
DWORD
LWNetDnsGetSrvRecordQuestion(
OUT PSTR* ppszQuestion,
IN PCSTR pszDomainName,
IN OPTIONAL PCSTR pszSiteName,
IN DWORD dwDsFlags
)
{
DWORD dwError = 0;
PSTR question = NULL;
PCSTR kind = "dc";
PCSTR service = "_ldap";
if (dwDsFlags & DS_PDC_REQUIRED)
{
kind = "pdc";
service = "_ldap";
}
else if (dwDsFlags & DS_GC_SERVER_REQUIRED)
{
kind = "gc";
service = "_ldap";
}
else if (dwDsFlags & DS_KDC_REQUIRED)
{
kind = "dc";
service = "_kerberos";
}
else
{
kind = "dc";
service = "_ldap";
}
if (IsNullOrEmptyString(pszSiteName))
{
dwError = LwAllocateStringPrintf(&question,
"%s._tcp.%s._msdcs.%s",
service, kind,
pszDomainName);
BAIL_ON_LWNET_ERROR(dwError);
}
else
{
dwError = LwAllocateStringPrintf(&question,
"%s._tcp.%s._sites.%s._msdcs.%s",
service, pszSiteName, kind,
pszDomainName);
BAIL_ON_LWNET_ERROR(dwError);
}
error:
if (dwError)
{
LWNET_SAFE_FREE_STRING(question);
}
*ppszQuestion = question;
return dwError;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:59,代码来源:lwnet-dns.c
示例8: LwCALockDN
DWORD
LwCALockDN(
PLWCA_POST_HANDLE pHandle,
PCSTR pcszDN,
PSTR *ppszUuid
)
{
DWORD dwError = 0;
PSTR pszUuid = NULL;
ULONG currTime = 0;
DWORD dwAttempt = 0;
struct timespec ts = {0};
if (IsNullOrEmptyString(pcszDN) || !ppszUuid || !pHandle)
{
dwError = LWCA_ERROR_INVALID_PARAMETER;
BAIL_ON_LWCA_ERROR(dwError);
}
dwError = LwCAUuidGenerate(&pszUuid);
BAIL_ON_LWCA_ERROR(dwError);
ts.tv_nsec = LWCA_LOCK_SLEEP_NS;
while (dwAttempt < LWCA_LOCK_MAX_ATTEMPT)
{
dwError = _LwCAGetCurrentTime(&currTime);
BAIL_ON_LWCA_ERROR(dwError);
dwError = _LwCALockDNImpl(pHandle, pszUuid, currTime, pcszDN);
if (dwError == LWCA_LOCK_APPLY_FAILED)
{
dwAttempt += 1;
nanosleep(&ts, NULL);
continue;
}
BAIL_ON_LWCA_ERROR(dwError);
break;
}
if (dwAttempt >= LWCA_LOCK_MAX_ATTEMPT)
{
dwError = LWCA_LOCK_APPLY_FAILED;
BAIL_ON_LWCA_ERROR(dwError);
}
*ppszUuid = pszUuid;
cleanup:
return dwError;
error:
LWCA_SAFE_FREE_STRINGA(pszUuid);
if (ppszUuid)
{
*ppszUuid = NULL;
}
goto cleanup;
}
开发者ID:vmware,项目名称:lightwave,代码行数:59,代码来源:lockmanager.c
示例9: SrvGetTreeRelativePath
NTSTATUS
SrvGetTreeRelativePath(
PWSTR pwszOriginalPath,
PWSTR* ppwszSpecificPath
)
{
NTSTATUS ntStatus = STATUS_SUCCESS;
wchar16_t wszBackSlash[] = { '\\', 0 };
wchar16_t wszFwdSlash[] = { '/', 0 };
if ((*pwszOriginalPath != wszBackSlash[0]) &&
(*pwszOriginalPath != wszFwdSlash[0]))
{
ntStatus = STATUS_INVALID_PARAMETER;
BAIL_ON_NT_STATUS(ntStatus);
}
pwszOriginalPath++;
// Skip the device name
while (!IsNullOrEmptyString(pwszOriginalPath) &&
(*pwszOriginalPath != wszBackSlash[0]) &&
(*pwszOriginalPath != wszFwdSlash[0]))
{
pwszOriginalPath++;
}
if (IsNullOrEmptyString(pwszOriginalPath) ||
((*pwszOriginalPath != wszBackSlash[0]) &&
(*pwszOriginalPath != wszFwdSlash[0])))
{
ntStatus = STATUS_INVALID_PARAMETER;
BAIL_ON_NT_STATUS(ntStatus);
}
*ppwszSpecificPath = pwszOriginalPath;
cleanup:
return ntStatus;
error:
*ppwszSpecificPath = NULL;
goto cleanup;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:46,代码来源:srvtree.c
示例10: VmwDeploySetupServerPartner
static
DWORD
VmwDeploySetupServerPartner(
PVMW_IC_SETUP_PARAMS pParams
)
{
DWORD dwError = 0;
PCSTR ppszServices[]=
{
VMW_DCERPC_SVC_NAME,
VMW_VMDNS_SVC_NAME,
VMW_VMAFD_SVC_NAME,
VMW_DIR_SVC_NAME,
VMW_VMCA_SVC_NAME
};
int iSvc = 0;
VMW_DEPLOY_LOG_INFO("Setting up system as Infrastructure partner node");
dwError = VmwDeployValidateHostname(pParams->pszHostname);
BAIL_ON_DEPLOY_ERROR(dwError);
dwError = VmwDeployValidatePartnerCredentials(
pParams->pszServer,
pParams->pszPassword,
pParams->pszDomainName);
BAIL_ON_DEPLOY_ERROR(dwError);
dwError = VmwDeployValidateSiteName(pParams->pszSite);
BAIL_ON_DEPLOY_ERROR(dwError);
if (!IsNullOrEmptyString(pParams->pszDNSForwarders))
{
dwError = VmwDeployValidateDNSForwarders(pParams->pszDNSForwarders);
BAIL_ON_DEPLOY_ERROR(dwError);
}
for (; iSvc < sizeof(ppszServices)/sizeof(ppszServices[0]); iSvc++)
{
PCSTR pszService = ppszServices[iSvc];
VMW_DEPLOY_LOG_INFO("Starting service [%s]", pszService);
dwError = VmwDeployStartService(pszService);
BAIL_ON_DEPLOY_ERROR(dwError);
}
dwError = VmwDeploySetupServerCommon(pParams);
BAIL_ON_DEPLOY_ERROR(dwError);
cleanup:
return dwError;
error:
goto cleanup;
}
开发者ID:kganugapati,项目名称:lightwave,代码行数:58,代码来源:cfgutils.c
示例11: VmAfWinCfgOpenRootKey
DWORD
VmAfWinCfgOpenRootKey(
PVMAF_CFG_CONNECTION pConnection,
PCSTR pszKeyName,
DWORD dwOptions,
DWORD dwAccess,
PVMAF_CFG_KEY* ppKey
)
{
DWORD dwError = 0;
PVMAF_CFG_KEY pKey = NULL;
VMAF_CFG_KEY rootKey = {0};
if (!pConnection || IsNullOrEmptyString(pszKeyName) || !ppKey)
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMAFD_ERROR(dwError);
}
if (!strcmp(pszKeyName, "HKEY_LOCAL_MACHINE"))
{
rootKey.hKey = HKEY_LOCAL_MACHINE;
}
else
{
dwError = ERROR_NOT_SUPPORTED;
BAIL_ON_VMAFD_ERROR(dwError);
}
dwError = VmAfWinCfgOpenKey(
pConnection,
&rootKey,
NULL,
dwOptions,
dwAccess,
&pKey);
BAIL_ON_VMAFD_ERROR(dwError);
*ppKey = pKey;
cleanup:
return dwError;
error:
if (ppKey)
{
*ppKey = NULL;
}
// if (pKey)
// {
// VmAfWinCfgCloseKey(pKey);
// }
goto cleanup;
}
开发者ID:vmware,项目名称:lightwave,代码行数:58,代码来源:config.c
示例12: DJFixLoginConfigFile
DWORD
DJFixLoginConfigFile(
PCSTR pszPath
)
{
DWORD ceError = ERROR_SUCCESS;
PCSTR pszFilePath = NULL;
PSTR pszTmpPath = NULL;
PSTR pszFinalPath = NULL;
BOOLEAN bFileExists = FALSE;
FILE* fp = NULL;
FILE* fp_new = NULL;
DynamicArray lines;
PSTR currentSystem = NULL;
memset(&lines, 0, sizeof(lines));
if (IsNullOrEmptyString(pszPath))
pszFilePath = LOGIN_CONFIG_PATH;
else
pszFilePath = pszPath;
GCE(ceError = CTGetFileTempPath(
pszFilePath,
&pszFinalPath,
&pszTmpPath));
GCE(ceError = CTCheckFileExists(pszFinalPath, &bFileExists));
if (!bFileExists)
goto cleanup;
GCE(ceError = CTOpenFile(pszFinalPath, "r", &fp));
GCE(ceError = CTReadLines(fp, &lines));
GCE(ceError = CTSafeCloseFile(&fp));
GCE(ceError = GetAuthType(&lines, ¤tSystem));
if(!strcmp(currentSystem, "PAM_AUTH"))
goto cleanup;
GCE(ceError = SetAuthType(&lines, "PAM_AUTH"));
GCE(ceError = CTOpenFile(pszTmpPath, "w", &fp_new));
GCE(ceError = CTWriteLines(fp_new, &lines));
GCE(ceError = CTSafeCloseFile(&fp_new));
GCE(ceError = CTSafeReplaceFile(pszFilePath, pszTmpPath));
cleanup:
CTSafeCloseFile(&fp);
CTSafeCloseFile(&fp_new);
CT_SAFE_FREE_STRING(currentSystem);
CT_SAFE_FREE_STRING(pszTmpPath);
CT_SAFE_FREE_STRING(pszFinalPath);
CTFreeLines(&lines);
return ceError;
}
开发者ID:FarazShaikh,项目名称:likewise-open,代码行数:58,代码来源:djlogincfg.c
示例13: VmwDeployValidatePassword
DWORD
VmwDeployValidatePassword(
PCSTR pszPassword
)
{
DWORD dwError = 0;
size_t iCh = 0;
size_t nUpper = 0;
size_t nLower = 0;
size_t nDigit = 0;
size_t nSpecial = 0;
size_t sLen = 0;
VMW_DEPLOY_LOG_DEBUG("Validating password");
if (IsNullOrEmptyString(pszPassword) || (sLen = strlen(pszPassword)) < 8)
{
dwError = ERROR_PASSWORD_RESTRICTION;
BAIL_ON_DEPLOY_ERROR(dwError);
}
// We are looking for at least one upper case, one lower case, one digit and
// one special case character. Added illegal chars check
for (iCh = 0; iCh < sLen; iCh++)
{
int ch = pszPassword[iCh];
if (isdigit(ch))
{
nDigit++;
}
else if (islower(ch))
{
nLower++;
}
else if (isupper(ch))
{
nUpper++;
}
else if (ispunct(ch))
{
nSpecial++;
}
}
if (!nUpper || !nLower || !nDigit || !nSpecial)
{
VMW_DEPLOY_LOG_ERROR("Password complexity requirement not satisfied");
dwError = ERROR_PASSWORD_RESTRICTION;
BAIL_ON_DEPLOY_ERROR(dwError);
}
error:
return dwError;
}
开发者ID:Dan-McGee,项目名称:lightwave,代码行数:57,代码来源:validate.c
示例14: VmDirMetaDataCreate
DWORD
VmDirMetaDataCreate(
USN localUsn,
UINT64 version,
PCSTR pszOrigInvoId,
PCSTR pszOrigTimeStamp,
USN origUsn,
PVMDIR_ATTRIBUTE_METADATA* ppMetaData
)
{
DWORD dwError = 0;
PVMDIR_ATTRIBUTE_METADATA pMetaData = NULL;
if (!ppMetaData ||
IsNullOrEmptyString(pszOrigInvoId) ||
IsNullOrEmptyString(pszOrigTimeStamp))
{
BAIL_WITH_VMDIR_ERROR(dwError, VMDIR_ERROR_INVALID_PARAMETER);
}
dwError = VmDirAllocateMemory(sizeof(VMDIR_ATTRIBUTE_METADATA), (PVOID*) &pMetaData);
BAIL_ON_VMDIR_ERROR(dwError);
pMetaData->localUsn = localUsn;
pMetaData->version = version;
dwError = VmDirAllocateStringA(pszOrigInvoId, &pMetaData->pszOrigInvoId);
BAIL_ON_VMDIR_ERROR(dwError);
dwError = VmDirAllocateStringA(pszOrigTimeStamp, &pMetaData->pszOrigTime);
BAIL_ON_VMDIR_ERROR(dwError);
pMetaData->origUsn = origUsn;
*ppMetaData = pMetaData;
cleanup:
return dwError;
error:
VmDirFreeMetaData(pMetaData);
VMDIR_LOG_ERROR(VMDIR_LOG_MASK_ALL, "failed, error (%d)", dwError);
goto cleanup;
}
开发者ID:vmware,项目名称:lightwave,代码行数:44,代码来源:metadata.c
示例15: VmDirValidateUserCreateParamsW
static
DWORD
VmDirValidateUserCreateParamsW(
PVMDIR_USER_CREATE_PARAMS_W pCreateParams
)
{
DWORD dwError = 0;
if (!pCreateParams ||
IsNullOrEmptyString(pCreateParams->pwszAccount) ||
IsNullOrEmptyString(pCreateParams->pwszFirstname) ||
IsNullOrEmptyString(pCreateParams->pwszLastname) ||
IsNullOrEmptyString(pCreateParams->pwszPassword))
{
dwError = ERROR_INVALID_PARAMETER;
}
return dwError;
}
开发者ID:vmware,项目名称:lightwave,代码行数:19,代码来源:users.c
示例16: VmDirConfigSetDefaultSiteandLduGuid
DWORD
VmDirConfigSetDefaultSiteandLduGuid(
PCSTR pszDefaultSiteGuid,
PCSTR pszDefaultLduGuid
)
#ifndef _WIN32
{
DWORD dwError = 0;
if (IsNullOrEmptyString(pszDefaultSiteGuid) || IsNullOrEmptyString(pszDefaultLduGuid))
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMDIR_ERROR(dwError);
}
dwError = RegUtilSetValue(
NULL,
HKEY_THIS_MACHINE,
VMDIR_CONFIG_PARAMETER_KEY_PATH,
NULL,
VMDIR_REG_KEY_SITE_GUID,
REG_SZ,
(PVOID)pszDefaultSiteGuid,
VmDirStringLenA(pszDefaultSiteGuid)+1);
BAIL_ON_VMDIR_ERROR(dwError);
dwError = RegUtilSetValue(
NULL,
HKEY_THIS_MACHINE,
VMDIR_CONFIG_PARAMETER_KEY_PATH,
NULL,
VMDIR_REG_KEY_LDU_GUID,
REG_SZ,
(PVOID)pszDefaultLduGuid,
VmDirStringLenA(pszDefaultLduGuid)+1);
BAIL_ON_VMDIR_ERROR(dwError);
cleanup:
return dwError;
error:
VmDirLog(LDAP_DEBUG_ANY, "VmDirConfigSetDefaultSiteandLduGuid failed with error (%u)", dwError);
goto cleanup;
}
开发者ID:DhanashreeA,项目名称:lightwave,代码行数:43,代码来源:registry.c
示例17: LWSetConfigValueBySectionName
DWORD
LWSetConfigValueBySectionName(
PCFGSECTION pSectionList,
PCSTR pszSectionName,
PCSTR pszName,
PCSTR pszValue
)
{
DWORD dwError = 0;
PCFGSECTION pSection = NULL;
if (IsNullOrEmptyString(pszSectionName) ||
IsNullOrEmptyString(pszName)) {
dwError = MAC_AD_ERROR_INVALID_PARAMETER;
BAIL_ON_MAC_ERROR(dwError);
}
while (pSectionList) {
if (!strcmp(pSectionList->pszName, pszSectionName)) {
pSection = pSectionList;
break;
}
pSectionList = pSectionList->pNext;
}
if (!pSection) {
dwError = MAC_AD_ERROR_INVALID_RECORD_TYPE;
goto error;
}
dwError = LWSetConfigValueBySection(pSection,
pszName,
pszValue);
BAIL_ON_MAC_ERROR(dwError);
cleanup:
return dwError;
error:
goto cleanup;
}
开发者ID:bhanug,项目名称:likewise-open,代码行数:43,代码来源:cfgparser.c
示例18: VmDirSchemaAttrIdMapAddNewAttr
DWORD
VmDirSchemaAttrIdMapAddNewAttr(
PVDIR_SCHEMA_ATTR_ID_MAP pAttrIdMap,
PSTR pszAttrName,
USHORT usAttrId // optional
)
{
DWORD dwError = 0;
PSTR pszKey = 0;
if (!pAttrIdMap || IsNullOrEmptyString(pszAttrName))
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMDIR_ERROR(dwError);
}
if (VmDirSchemaAttrIdMapGetAttrId(pAttrIdMap, pszAttrName, NULL) == 0)
{
dwError = ERROR_ALREADY_EXISTS;
BAIL_ON_VMDIR_ERROR(dwError);
}
dwError = VmDirAllocateStringA(pszAttrName, &pszKey);
BAIL_ON_VMDIR_ERROR(dwError);
if (usAttrId)
{
dwError = LwRtlHashMapInsert(pAttrIdMap->pNewIds,
pszKey, (PVOID)(uintptr_t)usAttrId, NULL);
BAIL_ON_VMDIR_ERROR(dwError);
if (usAttrId >= pAttrIdMap->usNextId)
{
pAttrIdMap->usNextId = usAttrId + 1;
}
}
else
{
dwError = LwRtlHashMapInsert(pAttrIdMap->pNewIds,
pszKey, (PVOID)(uintptr_t)pAttrIdMap->usNextId, NULL);
BAIL_ON_VMDIR_ERROR(dwError);
pAttrIdMap->usNextId++;
}
cleanup:
return dwError;
error:
VMDIR_LOG_ERROR( VMDIR_LOG_MASK_ALL,
"%s failed, error (%d)", __FUNCTION__, dwError );
VMDIR_SAFE_FREE_MEMORY(pszKey);
goto cleanup;
}
开发者ID:vmware,项目名称:lightwave,代码行数:55,代码来源:idmap.c
示例19: main
int
main(
int argc,
char* argv[]
)
{
DWORD dwError = 0;
handle_t bindingHandle = 0;
HANDLE hEventLog = 0;
PSTR pszBindingString = NULL;
DWORD eventTableCategoryId = (DWORD) -1;
PSTR pszFilename = NULL;
evt_init_logging_to_file(LOG_LEVEL_VERBOSE, "");
dwError = ParseArgs(argc, argv, &pszFilename, &eventTableCategoryId);
BAIL_ON_EVT_ERROR(dwError);
if (IsNullOrEmptyString(pszFilename)) {
EVT_LOG_ERROR("No path to the file containing events was specified.");
ShowUsage();
BAIL_ON_EVT_ERROR((dwError = EINVAL));
}
TRY
{
dwError = LWIOpenEventLog(&bindingHandle, &hEventLog, &pszBindingString, "127.0.0.1", "127.0.0.1");
BAIL_ON_EVT_ERROR(dwError);
dwError = ParseAndAddEvents(bindingHandle, hEventLog, pszFilename, eventTableCategoryId, AddEventRecord);
BAIL_ON_EVT_ERROR(dwError);
}
CATCH_ALL
{
exc_get_status (THIS_CATCH, &dwError);
EVT_LOG_ERROR("Unexpected error . Error code [%d]\n", dwError);
BAIL_ON_EVT_ERROR(dwError);
}
ENDTRY;
error:
if (bindingHandle && hEventLog && pszBindingString)
LWICloseEventLog(bindingHandle, hEventLog, pszBindingString);
if(dwError != 0) {
EVT_LOG_ERROR("Failed to import events. Error code [%d]\n", dwError);
}
return dwError;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:55,代码来源:main.c
示例20: CTMatchProgramToPID
DWORD
CTMatchProgramToPID(
PCSTR pszProgramName,
pid_t pid
)
{
DWORD ceError = ERROR_SUCCESS;
CHAR szBuf[PATH_MAX+1];
FILE* pFile = NULL;
#if defined(__LWI_DARWIN__) || defined(__LWI_FREEBSD__)
sprintf(szBuf, "ps -p %d -o command= | grep %s", pid, pszProgramName);
#elif defined(__LWI_SOLARIS__) || defined(__LWI_HP_UX__) || defined(__LWI_AIX__)
sprintf(szBuf, "PS=ps; [ -x /bin/ps ] && PS=/bin/ps; UNIX95=1 $PS -p %ld -o comm= | grep %s", (long)pid, pszProgramName);
#else
sprintf(szBuf, "UNIX95=1 ps -p %ld -o cmd= | grep %s", (long)pid, pszProgramName);
#endif
pFile = popen(szBuf, "r");
if (pFile == NULL) {
ceError = LwMapErrnoToLwError(errno);
BAIL_ON_CENTERIS_ERROR(ceError);
}
/* Assume that we won't find the process we are looking for */
ceError = ERROR_PROC_NOT_FOUND;
while (TRUE) {
if (NULL == fgets(szBuf, PATH_MAX, pFile)) {
if (feof(pFile)) {
break;
} else {
ceError = LwMapErrnoToLwError(errno);
BAIL_ON_CENTERIS_ERROR(ceError);
}
}
CTStripWhitespace(szBuf);
if (!IsNullOrEmptyString(szBuf)) {
/* Well what do you know, it was found! */
ceError = ERROR_SUCCESS;
break;
}
}
error:
if (pFile)
pclose(pFile);
return ceError;
}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:54,代码来源:ctprocutils.c
注:本文中的IsNullOrEmptyString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论