• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ LwAllocateString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: LsaNssPushNetgroup

static
NSS_STATUS
LsaNssPushNetgroup(
    PLSA_NSS_NETGROUP_LIST* ppList,
    PCSTR pszGroup
    )
{
    NSS_STATUS status = NSS_STATUS_SUCCESS;
    PLSA_NSS_NETGROUP_LIST pLink = NULL;

    status = MAP_LSA_ERROR(NULL,
                        LwAllocateMemory(
                            sizeof(*pLink),
                            (void**) &pLink));
    BAIL_ON_NSS_ERROR(status);

    status = MAP_LSA_ERROR(NULL,
                        LwAllocateString(
                            pszGroup,
                            &pLink->pszGroup));
    BAIL_ON_NSS_ERROR(status);

    pLink->pNext = *ppList;
    *ppList = pLink;

error:

    return status;
}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:29,代码来源:netsvc-netgrp.c


示例3: AD_GetHomedirPrefixPath

DWORD
AD_GetHomedirPrefixPath(
    PLSA_AD_PROVIDER_STATE pState,
    PSTR* ppszPath
    )
{
    DWORD dwError = 0;
    BOOLEAN bInLock = FALSE;
    PSTR  pszHomedirPrefixPath = NULL;

    ENTER_AD_CONFIG_RW_READER_LOCK(bInLock, pState);

    if (!LW_IS_NULL_OR_EMPTY_STR(pState->config.pszHomedirPrefix))
    {
        dwError = LwAllocateString(
                        pState->config.pszHomedirPrefix,
                        &pszHomedirPrefixPath
                        );
        BAIL_ON_LSA_ERROR(dwError);
    }

    *ppszPath = pszHomedirPrefixPath;

cleanup:

    LEAVE_AD_CONFIG_RW_READER_LOCK(bInLock, pState);

    return dwError;

error:

    *ppszPath = NULL;

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


示例4: 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


示例5: 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


示例6: 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


示例7: NtlmServerSetCredDomainNameAttribute

DWORD
NtlmServerSetCredDomainNameAttribute(
    IN NTLM_CRED_HANDLE hCred,
    IN PSecPkgCred_DomainName pDomainName
    )
{
    DWORD dwError = LW_ERROR_SUCCESS;
    PNTLM_CREDENTIALS pNtlmCreds = (PNTLM_CREDENTIALS)hCred;

    if (!hCred || !pDomainName || !pDomainName->pName)
    {
        dwError = LW_ERROR_INVALID_PARAMETER;
        BAIL_ON_LSA_ERROR(dwError);
    }

    LW_SAFE_FREE_STRING(pNtlmCreds->pszDomainName);

    dwError = LwAllocateString(
                  pDomainName->pName,
                  &pNtlmCreds->pszDomainName);
    BAIL_ON_LSA_ERROR(dwError);

error:

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


示例8: 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


示例9: LocalCfgGetSkeletonDirs

DWORD
LocalCfgGetSkeletonDirs(
    PSTR* ppszSkelDirs
    )
{
    DWORD dwError = 0;
    PSTR  pszSkelDirs = NULL;
    BOOLEAN bInLock = FALSE;

    LOCAL_LOCK_MUTEX(bInLock, &gLPGlobals.cfgMutex);

    dwError = LwAllocateString(
                    gLPGlobals.cfg.pszSkelDirs,
                    &pszSkelDirs);
    BAIL_ON_LSA_ERROR(dwError);

    *ppszSkelDirs = pszSkelDirs;

cleanup:

    LOCAL_UNLOCK_MUTEX(bInLock, &gLPGlobals.cfgMutex);

    return dwError;

error:

    *ppszSkelDirs = NULL;

    LW_SAFE_FREE_STRING(pszSkelDirs);

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


示例10: LocalCfgGetHomedirTemplate

DWORD
LocalCfgGetHomedirTemplate(
    PSTR* ppszHomedirTemplate
    )
{
    DWORD dwError = 0;
    PSTR  pszHomedirTemplate = NULL;
    BOOLEAN bInLock = FALSE;

    LOCAL_LOCK_MUTEX(bInLock, &gLPGlobals.cfgMutex);

    dwError = LwAllocateString(
                    gLPGlobals.cfg.pszHomedirTemplate,
                    &pszHomedirTemplate);
    BAIL_ON_LSA_ERROR(dwError);

    *ppszHomedirTemplate = pszHomedirTemplate;

cleanup:

    LOCAL_UNLOCK_MUTEX(bInLock, &gLPGlobals.cfgMutex);

    return dwError;

error:

    *ppszHomedirTemplate = NULL;

    LW_SAFE_FREE_STRING(pszHomedirTemplate);

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


示例11: LwLdapGetString

DWORD
LwLdapGetString(
    HANDLE hDirectory,
    LDAPMessage* pMessage,
    PCSTR pszFieldName,
    PSTR* ppszValue
    )
{
    DWORD dwError = LW_ERROR_SUCCESS;
    PLW_LDAP_DIRECTORY_CONTEXT pDirectory = NULL;
    PSTR *ppszValues = NULL;
    PSTR pszValue = NULL;

    pDirectory = (PLW_LDAP_DIRECTORY_CONTEXT)hDirectory;

    ppszValues = (PSTR*)ldap_get_values(pDirectory->ld, pMessage, pszFieldName);
    if (ppszValues && ppszValues[0]) {
        dwError = LwAllocateString(ppszValues[0], &pszValue);
        BAIL_ON_LW_ERROR(dwError);
    }
    *ppszValue = pszValue;

cleanup:
    if (ppszValues) {
        ldap_value_free(ppszValues);
    }
    return dwError;

error:
    *ppszValue = NULL;

    LW_SAFE_FREE_STRING(pszValue);

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


示例12: 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


示例13: LocalCfgGetDefaultShell

DWORD
LocalCfgGetDefaultShell(
    PSTR* ppszLoginShell
    )
{
    DWORD dwError = 0;
    PSTR  pszLoginShell = NULL;
    BOOLEAN bInLock = FALSE;

    LOCAL_LOCK_MUTEX(bInLock, &gLPGlobals.cfgMutex);

    dwError = LwAllocateString(
                    gLPGlobals.cfg.pszLoginShell,
                    &pszLoginShell);
    BAIL_ON_LSA_ERROR(dwError);

    *ppszLoginShell = pszLoginShell;

cleanup:

    LOCAL_UNLOCK_MUTEX(bInLock, &gLPGlobals.cfgMutex);

    return dwError;

error:

    *ppszLoginShell = NULL;

    LW_SAFE_FREE_STRING(pszLoginShell);

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


示例14: LADSGetGUID

DWORD
LADSGetGUID(
    PSTR* ppszGUID
    )
{
    DWORD dwError = 0;
    PSTR  pszGUID = NULL;
    uuid_t uuid = {0};
    CHAR  szUUID[37] = "";

    uuid_generate(uuid);

    uuid_unparse(uuid, szUUID);

    dwError = LwAllocateString(
                       szUUID,
                       &pszGUID);
    BAIL_ON_LSA_ERROR(dwError);

    *ppszGUID = pszGUID;

cleanup:

    return dwError;

error:

    *ppszGUID = NULL;

    LW_SAFE_FREE_STRING(pszGUID);

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


示例15: CTGetPListVersion

static
DWORD
CTGetPListVersion(
    PSTR* ppVersion
    )
{
    return LwAllocateString("Unknown", ppVersion);
}
开发者ID:josephholsten,项目名称:pbis,代码行数:8,代码来源:ctdistroinfo.c


示例16: LsaAdBatchMarshalUserInfoFixLocalWindowsHomeFolder

static
DWORD
LsaAdBatchMarshalUserInfoFixLocalWindowsHomeFolder(
    IN PLSA_AD_PROVIDER_STATE pState,
    IN OUT PSTR* ppszLocalWindowsHomeFolder,
    IN PCSTR pszNetbiosDomainName,
    IN PCSTR pszSamAccountName
    )
{
    DWORD dwError = 0;
    PSTR pszLocalWindowsHomeFolder = *ppszLocalWindowsHomeFolder;
    PSTR pszNewLocalWindowsHomeFolder = NULL;

    if (LW_IS_NULL_OR_EMPTY_STR(pszLocalWindowsHomeFolder))
    {
        dwError = AD_GetUnprovisionedModeRemoteHomeDirTemplate(
                      pState,
                      &pszLocalWindowsHomeFolder);
        BAIL_ON_LSA_ERROR(dwError);
    }

    if (pszLocalWindowsHomeFolder == NULL)
    {
        dwError = LwAllocateString("", &pszLocalWindowsHomeFolder);
        BAIL_ON_LSA_ERROR(dwError);
    }
    else if (strstr(pszLocalWindowsHomeFolder, "%"))
    {
        dwError = AD_BuildHomeDirFromTemplate(
                      pState,
                      pszLocalWindowsHomeFolder,
                      pszNetbiosDomainName,
                      pszSamAccountName,
                      &pszNewLocalWindowsHomeFolder);
        if (dwError)
        {
            // If we encounter a problem with fixing up the shell, leave the user object with the actual
            // value stored in AD and log the problem.
            LSA_LOG_INFO("While processing information for user (%s), an invalid remote homedir value was detected (homedir: '%s')",
                         LSA_SAFE_LOG_STRING(pszSamAccountName),
                         LSA_SAFE_LOG_STRING(pszLocalWindowsHomeFolder));
            dwError = 0;
            goto cleanup;
        }

        LW_SAFE_FREE_STRING(pszLocalWindowsHomeFolder);
        LSA_XFER_STRING(pszNewLocalWindowsHomeFolder, pszLocalWindowsHomeFolder);
    }

    LwStrCharReplace(pszLocalWindowsHomeFolder, ' ', '_');

cleanup:
    *ppszLocalWindowsHomeFolder = pszLocalWindowsHomeFolder;
    return dwError;

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


示例17: GetDnsHostName

long
GetDnsHostName(
    char ** hostname
    )
{
    long macError = eDSNoErr;
    char buffer[256];
    char * szLocal = NULL;
    char * szDot = NULL;
    uint len = 0;
    PSTR pszHostName = NULL;

    if ( gethostname(buffer, sizeof(buffer)) != 0 )
    {
        macError = ePlugInInitError;
        if (macError)
        {
            goto cleanup;
        }
    }

    len = strlen(buffer);
    if ( len > strlen(".local") )
    {
        szLocal = &buffer[len - strlen(".local")];
        if ( !strcasecmp( szLocal, ".local" ) )
        {
            szLocal[0] = '\0';
        }
    }

    /* Test to see if the name is still dotted. If so we will chop it down to
       just the hostname field. */
    szDot = strchr(buffer, '.');
    if ( szDot )
    {
        szDot[0] = '\0';
    }

    macError = LwAllocateString(buffer, &pszHostName);
    if (macError)
    {
        goto cleanup;
    }

    if ( hostname ) {
        *hostname = pszHostName;
        pszHostName = NULL;
    }

    // return below so that we free the unrequested out parameters.

cleanup:

    LW_SAFE_FREE_STRING(pszHostName);

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


示例18: UpLocalCfgInitialize

DWORD
UpLocalCfgInitialize(
    PLOCAL_CONFIG pConfig
    )
{
    DWORD dwError = 0;
    PCSTR pszDefaultLoginShell      = LOCAL_CFG_DEFAULT_LOGIN_SHELL;
    PCSTR pszDefaultHomedirPrefix   = LOCAL_CFG_DEFAULT_HOMEDIR_PREFIX;
    PCSTR pszDefaultHomedirTemplate = LOCAL_CFG_DEFAULT_HOMEDIR_TEMPLATE;
    PCSTR pszDefaultSkelDirs        = LOCAL_CFG_DEFAULT_SKELETON_DIRS;

    memset(pConfig, 0, sizeof(LOCAL_CONFIG));

    pConfig->bEnableEventLog = FALSE;
    pConfig->dwMaxGroupNestingLevel = LOCAL_CFG_MAX_GROUP_NESTING_LEVEL_DEFAULT;

    dwError = LwAllocateString(
                    pszDefaultLoginShell,
                    &pConfig->pszLoginShell);
    BAIL_ON_UP_ERROR(dwError);

    dwError = LwAllocateString(
                    pszDefaultHomedirPrefix,
                    &pConfig->pszHomedirPrefix);
    BAIL_ON_UP_ERROR(dwError);

    dwError = LwAllocateString(
                    pszDefaultHomedirTemplate,
                    &pConfig->pszHomedirTemplate);
    BAIL_ON_UP_ERROR(dwError);

    pConfig->bCreateHomedir = LOCAL_CFG_DEFAULT_CREATE_HOMEDIR;

    dwError = LwAllocateString(LOCAL_CFG_DEFAULT_HOMEDIR_UMASK, &pConfig->pszUmask);
    BAIL_ON_UP_ERROR(dwError);

    dwError = LwAllocateString(
                    pszDefaultSkelDirs,
                    &pConfig->pszSkelDirs);
    BAIL_ON_UP_ERROR(dwError);

error:

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


示例19: LsaAllocateGroupInfo_0

static
DWORD
LsaAllocateGroupInfo_0(
    PLSA_GROUP_INFO_0 *ppDstGroupInfo,
    DWORD dwLevel,
    PLSA_GROUP_INFO_0 pSrcGroupInfo
    )
{
    DWORD dwError = 0;
    PLSA_GROUP_INFO_0 pGroupInfo = NULL;

    dwError = LwAllocateMemory(sizeof(*pGroupInfo),
                                (PVOID*)&pGroupInfo);
    BAIL_ON_LSA_ERROR(dwError);

    if (pSrcGroupInfo) {
        pGroupInfo->gid = pSrcGroupInfo->gid;

        if (pSrcGroupInfo->pszName) {
            dwError = LwAllocateString(pSrcGroupInfo->pszName,
                                        &pGroupInfo->pszName);
            BAIL_ON_LSA_ERROR(dwError);
        }

        if (pSrcGroupInfo->pszSid) {
            dwError = LwAllocateString(pSrcGroupInfo->pszSid,
                                        &pGroupInfo->pszSid);
            BAIL_ON_LSA_ERROR(dwError);
        }
    }

    *ppDstGroupInfo = pGroupInfo;

cleanup:
    return dwError;

error:
    if (pGroupInfo) {
        LsaFreeGroupInfo(dwLevel, pGroupInfo);
    }

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


示例20: LsaNssOpen

PVOID
LsaNssOpen(
    PCSTR pszName,
    PCSTR pszDomain,
    int mode,
    PSTR pszOptions
    )
{
    DWORD dwError = LW_ERROR_SUCCESS;
    PLSA_PAM_CONFIG pConfig = NULL;

    dwError = LsaPamGetConfig(&pConfig);
    BAIL_ON_LSA_ERROR(dwError);

    LsaPamSetLogLevel(pConfig->dwLogLevel);

    LSA_LOG_PAM_DEBUG(
            "Open called for '%s' with options '%s'",
            pszName,
            pszOptions);

    LsaNssClearState(&gNssState);

    dwError = LwAllocateString(
        pszName,
        &gNssState.pszRegistryName);
    BAIL_ON_LSA_ERROR(dwError);

    if (!strcasecmp(pszOptions, "debug"))
    {
        LsaPamSetLogLevel(LSA_PAM_LOG_LEVEL_DEBUG);
    }

cleanup:

    LSA_LOG_PAM_DEBUG("Open finishing with code %u", dwError);
    if (pConfig)
    {
        LsaPamFreeConfig(pConfig);
    }

    if (dwError != LW_ERROR_SUCCESS)
    {
        LsaNssMapErrorCode(dwError, &errno);
        return NULL;
    }
    else
    {
        return &gNssState;
    }

error:

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LwAllocateStringPrintf函数代码示例发布时间:2022-05-30
下一篇:
C++ LwAllocateMemory函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap