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


C++ LW_IS_NULL_OR_EMPTY_STR函数代码示例

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


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

示例1: LsaNssComputeUserStringLength

DWORD
LsaNssComputeUserStringLength(
    PLSA_USER_INFO_0 pUserInfo
    )
{
    DWORD dwLength = 0;

    if (!LW_IS_NULL_OR_EMPTY_STR(pUserInfo->pszName)) {
       dwLength += strlen(pUserInfo->pszName) + 1;
    }

    if (!LW_IS_NULL_OR_EMPTY_STR(pUserInfo->pszPasswd)) {
       dwLength += strlen(pUserInfo->pszPasswd) + 1;
    }

    if (!LW_IS_NULL_OR_EMPTY_STR(pUserInfo->pszShell)) {
       dwLength += strlen(pUserInfo->pszShell) + 1;
    }

    if (!LW_IS_NULL_OR_EMPTY_STR(pUserInfo->pszGecos)) {
       dwLength += strlen(pUserInfo->pszGecos) + 1;
    }

    if (!LW_IS_NULL_OR_EMPTY_STR(pUserInfo->pszHomedir)) {
       dwLength += strlen(pUserInfo->pszHomedir) + 1;
    }

    return dwLength;
}
开发者ID:bhanug,项目名称:likewise-open,代码行数:29,代码来源:nss-user.c

示例2: SamrSrvConfigGetHomedirTemplate

DWORD
SamrSrvConfigGetHomedirTemplate(
    PSTR *ppszHomedirTemplate
    )
{
    DWORD dwError = 0;
    BOOL bLocked = 0;
    PSTR pszHomedirTemplate = NULL;

    GLOBAL_DATA_LOCK(bLocked);

    if (LW_IS_NULL_OR_EMPTY_STR(gSamrSrvConfig.pszHomedirTemplate)) {
        goto cleanup;
    }

    dwError = LwAllocateString(gSamrSrvConfig.pszHomedirTemplate,
                                &pszHomedirTemplate);
    BAIL_ON_LSA_ERROR(dwError);

    *ppszHomedirTemplate = pszHomedirTemplate;

cleanup:
    GLOBAL_DATA_UNLOCK(bLocked);
    return dwError;

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

示例3: SamrSrvConfigGetDefaultLoginShell

DWORD
SamrSrvConfigGetDefaultLoginShell(
    PSTR *ppszDefaultLoginShell
    )
{
    DWORD dwError = 0;
    BOOL bLocked = 0;
    PSTR pszDefaultLoginShell = NULL;

    GLOBAL_DATA_LOCK(bLocked);

    if (LW_IS_NULL_OR_EMPTY_STR(gSamrSrvConfig.pszDefaultLoginShell)) {
        goto cleanup;
    }

    dwError = LwAllocateString(gSamrSrvConfig.pszDefaultLoginShell,
                               &pszDefaultLoginShell);
    BAIL_ON_LSA_ERROR(dwError);

    *ppszDefaultLoginShell = pszDefaultLoginShell;

cleanup:
    GLOBAL_DATA_UNLOCK(bLocked);
    return dwError;

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

示例4: PrintUserInfo_2

VOID
PrintUserInfo_2(
    PLSA_USER_INFO_2 pUserInfo,
    BOOLEAN bCheckUserInList,
    BOOLEAN bAllowedLogon
    )
{
    fprintf(stdout, "User info (Level-2):\n");
    fprintf(stdout, "====================\n");
    fprintf(stdout, "Name:                         %s\n", LW_PRINTF_STRING(pUserInfo->pszName));
    fprintf(stdout, "UPN:                          %s\n", LW_PRINTF_STRING(pUserInfo->pszUPN));
    fprintf(stdout, "Generated UPN:                %s\n", LW_PRINTF_YES_NO(pUserInfo->bIsGeneratedUPN));
    fprintf(stdout, "DN:                           %s\n",
            LW_IS_NULL_OR_EMPTY_STR(pUserInfo->pszDN) ? "<null>" : pUserInfo->pszDN);
    fprintf(stdout, "Uid:                          %u\n", (unsigned int)pUserInfo->uid);
    fprintf(stdout, "Gid:                          %u\n", (unsigned int)pUserInfo->gid);
    fprintf(stdout, "Gecos:                        %s\n", LW_PRINTF_STRING(pUserInfo->pszGecos));
    fprintf(stdout, "Shell:                        %s\n", LW_PRINTF_STRING(pUserInfo->pszShell));
    fprintf(stdout, "Home dir:                     %s\n", LW_PRINTF_STRING(pUserInfo->pszHomedir));
    fprintf(stdout, "LMHash length:                %u\n", pUserInfo->dwLMHashLen);
    fprintf(stdout, "NTHash length:                %u\n", pUserInfo->dwNTHashLen);
    fprintf(stdout, "Local User:                   %s\n", LW_PRINTF_YES_NO(pUserInfo->bIsLocalUser));
    fprintf(stdout, "Account disabled (or locked): %s\n", LW_PRINTF_TRUE_FALSE(pUserInfo->bAccountDisabled));
    fprintf(stdout, "Account Expired:              %s\n", LW_PRINTF_TRUE_FALSE(pUserInfo->bAccountExpired));
    fprintf(stdout, "Password never expires:       %s\n", LW_PRINTF_TRUE_FALSE(pUserInfo->bPasswordNeverExpires));
    fprintf(stdout, "Password Expired:             %s\n", LW_PRINTF_TRUE_FALSE(pUserInfo->bPasswordExpired));
    fprintf(stdout, "Prompt for password change:   %s\n", LW_PRINTF_YES_NO(pUserInfo->bPromptPasswordChange));
    fprintf(stdout, "User can change password:     %s\n", LW_PRINTF_YES_NO(pUserInfo->bUserCanChangePassword));
    fprintf(stdout, "Days till password expires:   %u\n", pUserInfo->dwDaysToPasswordExpiry);
    if (bCheckUserInList)
    {
        fprintf(stdout, "Logon restriction:            %s\n", LW_PRINTF_YES_NO(bAllowedLogon));
    }
    fprintf(stdout, "\n");
}
开发者ID:borland667,项目名称:pbis,代码行数:35,代码来源:enum_users_main.c

示例5: UpLocalCfgNameValuePair

DWORD
UpLocalCfgNameValuePair(
    PCSTR    pszName,
    PCSTR    pszValue,
    PVOID    pData,
    PBOOLEAN pbContinue
    )
{
    DWORD dwError = 0;
    DWORD iHandler = 0;
    DWORD nHandlers = sizeof(gLocalCfgHandlers)/sizeof(gLocalCfgHandlers[0]);

    if (!LW_IS_NULL_OR_EMPTY_STR(pszName))
    {
        for (; iHandler < nHandlers; iHandler++)
        {
            if (!strcasecmp(gLocalCfgHandlers[iHandler].pszId, pszName))
            {
                gLocalCfgHandlers[iHandler].pfnHandler(
                                                (PLOCAL_CONFIG)pData,
                                                pszName,
                                                pszValue);
                break;
            }
        }
    }

    *pbContinue = TRUE;

    return dwError;
}
开发者ID:twistround,项目名称:pbis,代码行数:31,代码来源:lsass_provider_local.c

示例6: LsaAdBatchMarshalUserInfoFixShell

static
DWORD
LsaAdBatchMarshalUserInfoFixShell(
    IN PLSA_AD_PROVIDER_STATE pState,
    IN OUT PSTR* ppszShell
    )
{
    DWORD dwError = 0;
    PSTR pszShell = *ppszShell;

    if (LW_IS_NULL_OR_EMPTY_STR(pszShell))
    {
        dwError = AD_GetUnprovisionedModeShell(
                      pState,
                      &pszShell);
        BAIL_ON_LSA_ERROR(dwError);
        BAIL_ON_INVALID_STRING(pszShell);
    }

cleanup:
    *ppszShell = pszShell;
    return dwError;

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

示例7: LocalCfgSetSkeletonDirs

static
DWORD
LocalCfgSetSkeletonDirs(
    PLOCAL_CONFIG pConfig,
    PCSTR          pszName,
    PCSTR          pszValue
    )
{
    DWORD dwError = 0;
    PSTR  pszSkelDirs = NULL;

    if (!LW_IS_NULL_OR_EMPTY_STR(pszValue))
    {
        dwError = LwAllocateString(
                      pszValue,
                      &pszSkelDirs);
        BAIL_ON_UP_ERROR(dwError);
    }

    LW_SAFE_FREE_STRING(pConfig->pszSkelDirs);

    pConfig->pszSkelDirs = pszSkelDirs;

cleanup:

    return dwError;

error:

    LW_SAFE_FREE_STRING(pszSkelDirs);

    goto cleanup;
}
开发者ID:twistround,项目名称:pbis,代码行数:33,代码来源:lsass_provider_local.c

示例8: LsaSrvIsPrivilegeNameValid

BOOLEAN
LsaSrvIsPrivilegeNameValid(
    PCSTR pszPrivilegeName
    )
{
    BOOLEAN Valid = FALSE;
    PSTR ppszPrefixes[] = LSA_PRIVILEGE_VALID_PREFIXES;
    DWORD i = 0;
    PSTR pszPref = NULL;

    if (!LW_IS_NULL_OR_EMPTY_STR(pszPrivilegeName))
    {
        for (i = 0;
             !Valid && i < sizeof(ppszPrefixes)/sizeof(ppszPrefixes[0]);
             i++)
        {
            LwStrStr(pszPrivilegeName,
                     ppszPrefixes[i],
                     &pszPref);
            if (pszPrivilegeName == pszPref)
            {
                Valid = TRUE;
            }
        }
    }

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

示例9: WkssSrvConfigGetLsaLpcSocketPath

DWORD
WkssSrvConfigGetLsaLpcSocketPath(
    PSTR *ppszLsaLpcSocketPath
    )
{
    DWORD dwError = 0;
    BOOL bLocked = 0;
    PSTR pszLpcSocketPath = NULL;

    GLOBAL_DATA_LOCK(bLocked);

    if (LW_IS_NULL_OR_EMPTY_STR(gWkssSrvConfig.pszLsaLpcSocketPath)) {
        goto cleanup;
    }

    dwError = LwAllocateString(gWkssSrvConfig.pszLsaLpcSocketPath,
                               &pszLpcSocketPath);
    BAIL_ON_LSA_ERROR(dwError);

    *ppszLsaLpcSocketPath = pszLpcSocketPath;

cleanup:
    GLOBAL_DATA_UNLOCK(bLocked);
    return dwError;

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

示例10: LsaPamConfigNameValuePair

DWORD
LsaPamConfigNameValuePair(
    PCSTR    pszName,
    PCSTR    pszValue,
    PVOID    pData,
    PBOOLEAN pbContinue
)
{
    DWORD dwError = 0;

    if (!LW_IS_NULL_OR_EMPTY_STR(pszName))
    {
        DWORD iHandler = 0;
        DWORD nHandlers = sizeof(gConfigHandlers)/sizeof(gConfigHandlers[0]);

        for (; iHandler < nHandlers; iHandler++)
        {
            if (!strcasecmp(gConfigHandlers[iHandler].pszId, pszName))
            {
                PLSA_PAM_CONFIG pConfig = (PLSA_PAM_CONFIG)pData;

                gConfigHandlers[iHandler].pfnHandler(
                    pConfig,
                    pszName,
                    pszValue);
                break;
            }
        }
    }

    *pbContinue = TRUE;

    return dwError;
}
开发者ID:numberer6,项目名称:likewise-open-1,代码行数:34,代码来源:pam-config.c

示例11: PrintGroupInfo_1

static
VOID
PrintGroupInfo_1(
    PLSA_GROUP_INFO_1 pGroupInfo
    )
{
    PSTR* ppszMembers = NULL;

    fprintf(stdout, "Group info (Level-1):\n");
    fprintf(stdout, "====================\n");
    fprintf(stdout, "Name: %s\n", LW_PRINTF_STRING(pGroupInfo->pszName));
    fprintf(stdout, "Gid:  %u\n", (unsigned int)pGroupInfo->gid);
    fprintf(stdout, "SID:  %s\n", LW_PRINTF_STRING(pGroupInfo->pszSid));
    fprintf(stdout, "Members:\n");

    ppszMembers = pGroupInfo->ppszMembers;
    if (ppszMembers)
    {
        while (!LW_IS_NULL_OR_EMPTY_STR(*ppszMembers))
        {
            fprintf(stdout, "  %s\n", *ppszMembers);
            ppszMembers++;
        }
    }
    fprintf(stdout, "\n");
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:26,代码来源:enum_groups_main.c

示例12: LsaPam_SetConfig_UserNotAllowedError

static
DWORD
LsaPam_SetConfig_UserNotAllowedError(
    PLSA_PAM_CONFIG pConfig,
    PCSTR           pszName,
    PCSTR           pszValue
)
{
    DWORD dwError = 0;
    PSTR  pszMessage = NULL;

    if (!LW_IS_NULL_OR_EMPTY_STR(pszValue))
    {
        dwError = LwAllocateString(
                      pszValue,
                      &pszMessage);
        BAIL_ON_UP_ERROR(dwError);

        LW_SAFE_FREE_STRING(pConfig->pszAccessDeniedMessage);
        pConfig->pszAccessDeniedMessage = pszMessage;
    }

cleanup:

    return dwError;

error:

    LW_SAFE_FREE_STRING(pszMessage);

    goto cleanup;
}
开发者ID:numberer6,项目名称:likewise-open-1,代码行数:32,代码来源:pam-config.c

示例13: LsaSrvGetPrefixPath

DWORD
LsaSrvGetPrefixPath(
    PSTR* ppszPath
    )
{
    DWORD dwError = 0;
    PSTR pszPath = NULL;
    BOOLEAN bInLock = FALSE;

    LSA_LOCK_SERVERINFO(bInLock);

    if (LW_IS_NULL_OR_EMPTY_STR(gpServerInfo->szPrefixPath)) {
      dwError = LW_ERROR_INVALID_PREFIX_PATH;
      BAIL_ON_LSA_ERROR(dwError);
    }

    dwError = LwAllocateString(gpServerInfo->szPrefixPath, &pszPath);
    BAIL_ON_LSA_ERROR(dwError);

    *ppszPath = pszPath;

 cleanup:

    LSA_UNLOCK_SERVERINFO(bInLock);

    return dwError;

 error:

    LW_SAFE_FREE_STRING(pszPath);

    *ppszPath = NULL;

    goto cleanup;
}
开发者ID:virtual-void,项目名称:pbis,代码行数:35,代码来源:main-svcm.c

示例14: LsaCheckInvalidRpcServer

DWORD
LsaCheckInvalidRpcServer(
    PVOID pSymbol,
    PCSTR pszLibPath
    )
{
    DWORD dwError = 0;
    PCSTR pszError = NULL;

    if (pSymbol == NULL) {
        LSA_LOG_ERROR("Ignoring invalid rpc server at path [%s]",
                      (pszLibPath ? pszLibPath : "(unknown)"));

        pszError = dlerror();
        if (!LW_IS_NULL_OR_EMPTY_STR(pszError)) {
            LSA_LOG_ERROR("%s", pszError);
        }

        dwError = LW_ERROR_INVALID_RPC_SERVER;
        BAIL_ON_LSA_ERROR(dwError);
    }

    
cleanup:
    return dwError;

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

示例15: LocalCfgSetHomedirPrefix

static
DWORD
LocalCfgSetHomedirPrefix(
    PLOCAL_CONFIG   pConfig,
    PCSTR           pszName,
    PCSTR           pszValue
    )
{
    DWORD dwError = 0;
    PSTR pszHomedirPrefix = NULL;

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

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

    LwStripWhitespace(pszHomedirPrefix, TRUE, TRUE);

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

    if (*pszHomedirPrefix != '/')
    {
        LSA_LOG_ERROR("Invalid home directory prefix [%s]", pszHomedirPrefix);
        goto error;
    }

    LW_SAFE_FREE_STRING(pConfig->pszHomedirPrefix);

    pConfig->pszHomedirPrefix = pszHomedirPrefix;
    pszHomedirPrefix = NULL;

cleanup:

    return dwError;

error:
    LW_SAFE_FREE_STRING(pszHomedirPrefix);

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


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