您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ BAIL_ON_INVALID_PTR函数代码示例

51自学网 2021-06-01 19:48:50
  C++
这篇教程C++ BAIL_ON_INVALID_PTR函数代码示例写得很实用,希望能帮到您。

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

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

示例1: PvfsListAddTail

NTSTATUSPvfsListAddTail(    PPVFS_LIST pList,    PLW_LIST_LINKS pItem    ){    NTSTATUS ntError = STATUS_UNSUCCESSFUL;    BAIL_ON_INVALID_PTR(pList, ntError);    BAIL_ON_INVALID_PTR(pItem, ntError);    /* Using >= here to be safe.  Technically, == should       be fine */    if (PvfsListIsFull(pList)) {        ntError = STATUS_INSUFFICIENT_RESOURCES;        BAIL_ON_NT_STATUS(ntError);    }    LwListInsertTail(&pList->DataList, pItem);    pList->CurrentSize++;    ntError = STATUS_SUCCESS;cleanup:    return ntError;error:    goto cleanup;}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:30,


示例2: NetrAllocateRidWithAttribute

staticNTSTATUSNetrAllocateRidWithAttribute(    OUT PRID_WITH_ATTRIBUTE  pOut,    IN OUT PDWORD            pdwOffset,    IN OUT PDWORD            pdwSpaceLeft,    IN  PRID_WITH_ATTRIBUTE  pRids,    IN OUT PDWORD            pdwSize    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    DWORD dwError = ERROR_SUCCESS;    PVOID pBuffer = pOut;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pRids, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);    LWBUF_ALLOC_DWORD(pBuffer, pRids->dwRid);    LWBUF_ALLOC_DWORD(pBuffer, pRids->dwAttributes);cleanup:    if (ntStatus == STATUS_SUCCESS &&        dwError != ERROR_SUCCESS)    {        ntStatus = LwWin32ErrorToNtStatus(dwError);    }    return ntStatus;error:    goto cleanup;}
开发者ID:borland667,项目名称:pbis,代码行数:33,


示例3: LsaSetSecurity

NTSTATUSLsaSetSecurity(    IN LSA_BINDING                    hBinding,    IN void                          *hObject,    IN DWORD                          SecurityInfo,    IN PSECURITY_DESCRIPTOR_RELATIVE  pSecDesc,    IN DWORD                          SecDescLen    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    LSA_SECURITY_DESCRIPTOR_BUFFER SecurityDescBuffer = {0};    BAIL_ON_INVALID_PTR(hBinding, ntStatus);    BAIL_ON_INVALID_PTR(hObject, ntStatus);    BAIL_ON_INVALID_PTR(pSecDesc, ntStatus);    SecurityDescBuffer.BufferLen = SecDescLen;    SecurityDescBuffer.pBuffer   = (PBYTE)pSecDesc;    DCERPC_CALL(ntStatus, cli_LsaSetSecurity(                              (handle_t)hBinding,                              hObject,                              SecurityInfo,                              &SecurityDescBuffer));    BAIL_ON_NT_STATUS(ntStatus);error:    return ntStatus;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:29,


示例4: PvfsListRemoveItem

NTSTATUSPvfsListRemoveItem(    PPVFS_LIST pList,    PLW_LIST_LINKS pItem    ){    NTSTATUS ntError = STATUS_UNSUCCESSFUL;    BAIL_ON_INVALID_PTR(pList, ntError);    BAIL_ON_INVALID_PTR(pItem, ntError);    if (PvfsListIsEmpty(pList))    {        ntError = STATUS_NOT_FOUND;        BAIL_ON_NT_STATUS(ntError);    }    LwListRemove(pItem);    pList->CurrentSize--;    ntError = STATUS_SUCCESS;cleanup:    return ntError;error:    goto cleanup;}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:28,


示例5: LsaSrvClose

NTSTATUSLsaSrvClose(    /* [in] */ handle_t hBinding,    /* [out, context_handle] */ void **phInOut    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    PLSA_GENERIC_CONTEXT pContext = NULL;    BAIL_ON_INVALID_PTR(phInOut);    BAIL_ON_INVALID_PTR(*phInOut);    pContext = (PLSA_GENERIC_CONTEXT)(*phInOut);    switch (pContext->Type)    {    case LsaContextPolicy:        ntStatus = LsaSrvPolicyContextClose((PPOLICY_CONTEXT)pContext);        break;    default:        /* Something is seriously wrong if we get a context           we haven't created */        ntStatus = STATUS_INTERNAL_ERROR;    }    BAIL_ON_NTSTATUS_ERROR(ntStatus);    *phInOut = NULL;cleanup:    return ntStatus;error:    goto cleanup;}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:35,


示例6: DsrAllocateDsRoleInfo

DWORDDsrAllocateDsRoleInfo(    OUT PDSR_ROLE_INFO  pOut,    IN OUT PDWORD       pdwOffset,    IN OUT PDWORD       pdwSpaceLeft,    IN  PDSR_ROLE_INFO  pIn,    IN  WORD            swLevel,    IN OUT PDWORD       pdwSize    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    DWORD dwError = ERROR_SUCCESS;    PVOID pBuffer = pOut;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);    switch(swLevel)    {    case DS_ROLE_BASIC_INFORMATION:        LWBUF_ALLOC_DWORD(pBuffer, pIn->Basic.dwRole);        LWBUF_ALLOC_DWORD(pBuffer, pIn->Basic.dwFlags);        LWBUF_ALLOC_PWSTR(pBuffer, pIn->Basic.pwszDomain);        LWBUF_ALLOC_PWSTR(pBuffer, pIn->Basic.pwszDnsDomain);        LWBUF_ALLOC_PWSTR(pBuffer, pIn->Basic.pwszForest);        LWBUF_ALLOC_BLOB(pBuffer,                         sizeof(pIn->Basic.DomainGuid),                         &pIn->Basic.DomainGuid);        break;    case DS_ROLE_UPGRADE_STATUS:        LWBUF_ALLOC_WORD(pBuffer, pIn->Upgrade.swUpgradeStatus);        LWBUF_ALIGN_TYPE(pdwOffset, pdwSize, pdwSpaceLeft, DWORD);        LWBUF_ALLOC_DWORD(pBuffer, pIn->Upgrade.dwPrevious);        break;    case DS_ROLE_OP_STATUS:        LWBUF_ALLOC_WORD(pBuffer, pIn->OpStatus.swStatus);        break;    default:        ntStatus = STATUS_INVALID_PARAMETER;        break;    }    BAIL_ON_WIN_ERROR(dwError);cleanup:    if (dwError == ERROR_SUCCESS &&        ntStatus != STATUS_SUCCESS)    {        dwError = LwNtStatusToWin32Error(dwError);    }    return dwError;error:    goto cleanup;}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:60,


示例7: LsaAllocateSecurityDescriptor

NTSTATUSLsaAllocateSecurityDescriptor(    OUT PSECURITY_DESCRIPTOR_RELATIVE   *ppOut,    IN  PLSA_SECURITY_DESCRIPTOR_BUFFER  pIn    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    PSECURITY_DESCRIPTOR_RELATIVE pSecDesc = NULL;    BAIL_ON_INVALID_PTR(ppOut, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    ntStatus = LsaRpcAllocateMemory(OUT_PPVOID(&pSecDesc),                                    pIn->BufferLen);    BAIL_ON_NT_STATUS(ntStatus);    memcpy(pSecDesc, pIn->pBuffer, pIn->BufferLen);    *ppOut = pSecDesc;cleanup:    return ntStatus;error:    if (pSecDesc)    {        LsaRpcFreeMemory(pSecDesc);    }    *ppOut = NULL;    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:33,


示例8: WkssAllocateNetrWkstaUserInfo1

staticDWORDWkssAllocateNetrWkstaUserInfo1(    OUT PVOID                      pOut,    IN OUT PDWORD                  pdwOffset,    IN OUT PDWORD                  pdwSpaceLeft,    IN  PNETR_WKSTA_USER_INFO_1    pIn,    IN OUT PDWORD                  pdwSize    ){    DWORD dwError = ERROR_SUCCESS;    NTSTATUS ntStatus = STATUS_SUCCESS;    PVOID pBuffer = pOut;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);    LWBUF_ALLOC_WC16STR(pBuffer, pIn->wkui1_username);    LWBUF_ALLOC_WC16STR(pBuffer, pIn->wkui1_logon_domain);    LWBUF_ALLOC_WC16STR(pBuffer, pIn->wkui1_oth_domains);    LWBUF_ALLOC_WC16STR(pBuffer, pIn->wkui1_logon_server);cleanup:    if (ntStatus == STATUS_SUCCESS &&        dwError != ERROR_SUCCESS)    {        ntStatus = LwWin32ErrorToNtStatus(dwError);    }    return dwError;error:    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:35,


示例9: NetrAllocateSamInfo2

staticNTSTATUSNetrAllocateSamInfo2(    OUT NetrSamInfo2    *pOut,    IN OUT PDWORD        pdwOffset,    IN OUT PDWORD        pdwSpaceLeft,    IN  NetrSamInfo2    *pIn,    IN OUT PDWORD        pdwSize    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    PVOID pBuffer = pOut;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);    ntStatus = NetrInitSamBaseInfo(pBuffer,                                   pdwOffset,                                   pdwSpaceLeft,                                   &pIn->base,                                   pdwSize);    BAIL_ON_NT_STATUS(ntStatus);cleanup:    return ntStatus;error:    goto cleanup;}
开发者ID:borland667,项目名称:pbis,代码行数:30,


示例10: NetrAllocateSidAttr

staticNTSTATUSNetrAllocateSidAttr(    OUT NetrSidAttr  *pOut,    IN OUT PDWORD     pdwOffset,    IN OUT PDWORD     pdwSpaceLeft,    IN  NetrSidAttr  *pIn,    IN OUT PDWORD     pdwSize    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    DWORD dwError = ERROR_SUCCESS;    PVOID pBuffer = pOut;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);        LWBUF_ALLOC_PSID(pBuffer, pIn->sid);    LWBUF_ALLOC_DWORD(pBuffer, pIn->attribute);    LWBUF_ALIGN(pdwOffset, pdwSize, pdwSpaceLeft);cleanup:    if (ntStatus == STATUS_SUCCESS &&        dwError != ERROR_SUCCESS)    {        ntStatus = LwWin32ErrorToNtStatus(dwError);    }    return ntStatus;error:    goto cleanup;}
开发者ID:borland667,项目名称:pbis,代码行数:34,


示例11: LsaQuerySecurity

NTSTATUSLsaQuerySecurity(    IN  LSA_BINDING                    hBinding,    IN  void                          *hObject,    IN  DWORD                          SecurityInfo,    OUT PSECURITY_DESCRIPTOR_RELATIVE *ppSecDesc,    OUT PDWORD                         pSecDescLen    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    PLSA_SECURITY_DESCRIPTOR_BUFFER pSecurityDescBuffer = NULL;    PSECURITY_DESCRIPTOR_RELATIVE pSecurityDesc = NULL;    BAIL_ON_INVALID_PTR(hBinding, ntStatus);    BAIL_ON_INVALID_PTR(hObject, ntStatus);    BAIL_ON_INVALID_PTR(ppSecDesc, ntStatus);    BAIL_ON_INVALID_PTR(pSecDescLen, ntStatus);    DCERPC_CALL(ntStatus, cli_LsaQuerySecurity(                              (handle_t)hBinding,                              hObject,                              SecurityInfo,                              &pSecurityDescBuffer));    BAIL_ON_NT_STATUS(ntStatus);    ntStatus = LsaAllocateSecurityDescriptor(                              &pSecurityDesc,                              pSecurityDescBuffer);    BAIL_ON_NT_STATUS(ntStatus);    *ppSecDesc   = pSecurityDesc;    *pSecDescLen = pSecurityDescBuffer->BufferLen;cleanup:    if (pSecurityDescBuffer)    {        LsaFreeStubSecurityDescriptorBuffer(pSecurityDescBuffer);    }    return ntStatus;error:    if (pSecurityDesc)    {        LsaRpcFreeMemory(pSecurityDesc);    }    if (ppSecDesc)    {        *ppSecDesc = NULL;    }    if (pSecDescLen)    {        *pSecDescLen = 0;    }    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:59,


示例12: LsaAllocateTranslatedSids3

NTSTATUSLsaAllocateTranslatedSids3(    OUT TranslatedSid3       *pOut,    IN OUT PDWORD             pdwOffset,    IN OUT PDWORD             pdwSpaceLeft,    IN  TranslatedSidArray3  *pIn,    IN OUT PDWORD             pdwSize    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    DWORD dwError = ERROR_SUCCESS;    PVOID pBuffer = pOut;    DWORD iTransSid = 0;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);    for (iTransSid = 0; iTransSid < pIn->count; iTransSid++)    {        LWBUF_ALLOC_WORD(pBuffer, pIn->sids[iTransSid].type);        LWBUF_ALIGN_PTR(pdwOffset, pdwSize, pdwSpaceLeft);        if (pIn->sids[iTransSid].sid)        {            LWBUF_ALLOC_PSID(pBuffer, pIn->sids[iTransSid].sid);        }        else if (pIn->sids[iTransSid].type == SID_TYPE_DOMAIN ||                 pIn->sids[iTransSid].type == SID_TYPE_INVALID ||                 pIn->sids[iTransSid].type == SID_TYPE_UNKNOWN)        {            LWBUF_ALLOC_PSID(pBuffer, NULL);        }        else        {            ntStatus = STATUS_INVALID_SID;            BAIL_ON_NT_STATUS(ntStatus);        }        LWBUF_ALLOC_DWORD(pBuffer, pIn->sids[iTransSid].index);        LWBUF_ALLOC_DWORD(pBuffer, pIn->sids[iTransSid].unknown1);    }cleanup:    if (ntStatus == STATUS_SUCCESS &&        dwError != ERROR_SUCCESS)    {        ntStatus = LwWin32ErrorToNtStatus(dwError);    }    return ntStatus;error:    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:55,


示例13: LsaEnumPrivilegesAccount

NTSTATUSLsaEnumPrivilegesAccount(    IN  LSA_BINDING          hBinding,    IN  LSAR_ACCOUNT_HANDLE  hAccount,    OUT PPRIVILEGE_SET      *ppPrivileges    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    size_t privilegesSize = 0;    PPRIVILEGE_SET pPrivs = NULL;    PPRIVILEGE_SET pPrivileges = NULL;    BAIL_ON_INVALID_PTR(hBinding, ntStatus);    BAIL_ON_INVALID_PTR(hAccount, ntStatus);    BAIL_ON_INVALID_PTR(ppPrivileges, ntStatus);    DCERPC_CALL(ntStatus, cli_LsaEnumPrivilegesAccount(                              (handle_t)hBinding,                              hAccount,                              &pPrivs));    BAIL_ON_NT_STATUS(ntStatus);    privilegesSize = RtlLengthPrivilegeSet(pPrivs);    ntStatus = LsaRpcAllocateMemory(                        OUT_PPVOID(&pPrivileges),                        privilegesSize);    BAIL_ON_NT_STATUS(ntStatus);    ntStatus = RtlCopyPrivilegeSet(                        privilegesSize,                        pPrivileges,                        pPrivs);    BAIL_ON_NT_STATUS(ntStatus);    *ppPrivileges = pPrivileges;error:    if (ntStatus)    {        if (ppPrivileges)        {            LW_SAFE_FREE_MEMORY(pPrivileges);            *ppPrivileges = NULL;        }    }    if (pPrivs)    {        LsaFreeStubPrivilegeSet(pPrivs);    }    return ntStatus;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:54,


示例14: PvfsRead

NTSTATUSPvfsRead(    PPVFS_IRP_CONTEXT pIrpContext    ){    NTSTATUS ntError = STATUS_UNSUCCESSFUL;    IRP_ARGS_READ_WRITE Args = pIrpContext->pIrp->Args.ReadWrite;    PPVFS_CCB pCcb = NULL;    ntError =  PvfsAcquireCCB(pIrpContext->pIrp->FileHandle, &pCcb);    BAIL_ON_NT_STATUS(ntError);    if (!IsSetFlag(pCcb->Flags, PVFS_CCB_FLAG_CREATE_COMPLETE))    {        ntError = STATUS_INVALID_PARAMETER;        BAIL_ON_NT_STATUS(ntError);    }    switch (pIrpContext->pIrp->Args.ReadWrite.ZctOperation)    {    case IRP_ZCT_OPERATION_NONE:        ntError = PvfsReadInternal(pIrpContext);        break;    case IRP_ZCT_OPERATION_PREPARE:        BAIL_ON_INVALID_PTR(Args.Zct, ntError);        ntError = PvfsReadInternal(pIrpContext);        break;    case IRP_ZCT_OPERATION_COMPLETE:        BAIL_ON_INVALID_PTR(Args.ZctCompletionContext, ntError);        ntError = PvfsZctCompleteRead(pIrpContext);        break;    default:        ntError = STATUS_INVALID_PARAMETER;        BAIL_ON_NT_STATUS(ntError);    }cleanup:    if (pCcb)    {        PvfsReleaseCCB(pCcb);    }    return ntError;error:    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:48,


示例15: NetrFileGetInfo

NET_API_STATUSNetrFileGetInfo(    PSRVSVC_CONTEXT pContext,          /* IN              */    PCWSTR          pwszServername,    /* IN    OPTIONAL  */    DWORD           dwFileId,          /* IN              */    DWORD           dwInfoLevel,       /* IN              */    PBYTE*          ppBuffer           /*    OUT          */    ){    NET_API_STATUS status = ERROR_SUCCESS;    srvsvc_NetFileInfo info;    BAIL_ON_INVALID_PTR(pContext, status);    BAIL_ON_INVALID_PTR(ppBuffer, status);    memset(&info, 0, sizeof(info));    *ppBuffer = NULL;    TRY    {        status = _NetrFileGetInfo(                    pContext->hBinding,                    (PWSTR)pwszServername,                    dwFileId,                    dwInfoLevel,                    &info);    }    CATCH_ALL(pDceException)    {        NTSTATUS ntStatus = LwRpcStatusToNtStatus(pDceException->match.value);        status = LwNtStatusToWin32Error(ntStatus);    }    ENDTRY;    BAIL_ON_WIN_ERROR(status);    status = SrvSvcCopyNetFileInfo(dwInfoLevel, &info, ppBuffer);    BAIL_ON_WIN_ERROR(status);cleanup:    SrvSvcClearNetFileInfo(dwInfoLevel, &info);    return status;error:    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:48,


示例16: PvfsScheduleCancelNotify

NTSTATUSPvfsScheduleCancelNotify(    PPVFS_IRP_CONTEXT pIrpContext    ){    NTSTATUS ntError = STATUS_UNSUCCESSFUL;    PPVFS_IRP_CONTEXT pIrpCtx = NULL;    BAIL_ON_INVALID_PTR(pIrpContext->pScb, ntError);    pIrpCtx = PvfsReferenceIrpContext(pIrpContext);    ntError = LwRtlQueueWorkItem(                  gPvfsDriverState.ThreadPool,                  PvfsNotifyCleanIrpList,                  pIrpCtx,                  LW_SCHEDULE_HIGH_PRIORITY);    BAIL_ON_NT_STATUS(ntError);error:    if (!NT_SUCCESS(ntError))    {        if (pIrpCtx)        {            PvfsReleaseIrpContext(&pIrpCtx);        }    }    return ntError;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:30,


示例17: PvfsSysOpen

staticNTSTATUSPvfsSysOpen(    int *pFd,    PSTR pszFilename,    int iFlags,    mode_t Mode){    NTSTATUS ntError = STATUS_SUCCESS;    int fd = -1;    int unixerr = 0;    BAIL_ON_INVALID_PTR(pszFilename, ntError);    if ((fd = open(pszFilename, iFlags, Mode)) == -1) {        PVFS_BAIL_ON_UNIX_ERROR(unixerr, ntError);    }    *pFd = fd;cleanup:    return ntError;error:    PvfsSysClose(fd);    goto cleanup;}
开发者ID:numberer6,项目名称:likewise-open-1,代码行数:29,


示例18: NetrFileClose

NET_API_STATUSNetrFileClose(    PSRVSVC_CONTEXT pContext,    const wchar16_t *servername,    UINT32 fileid    ){    NET_API_STATUS status = ERROR_SUCCESS;    BAIL_ON_INVALID_PTR(pContext, status);    TRY    {        status = _NetrFileClose(                    pContext->hBinding,                    (wchar16_t *)servername,                    fileid);    }    CATCH_ALL(pDceException)    {        NTSTATUS ntStatus = LwRpcStatusToNtStatus(pDceException->match.value);        status = LwNtStatusToWin32Error(ntStatus);    }    ENDTRY;    BAIL_ON_WIN_ERROR(status);cleanup:    return status;error:    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:32,


示例19: PvfsListSetMaxSize

NTSTATUSPvfsListSetMaxSize(    PPVFS_LIST pList,    DWORD dwNewLength    ){    NTSTATUS ntError = STATUS_UNSUCCESSFUL;    BAIL_ON_INVALID_PTR(pList, ntError);    /* We can set the List to an unlimited size       or larger that the current size */    if ((dwNewLength != 0) && (dwNewLength < pList->CurrentSize))    {        ntError = STATUS_BUFFER_TOO_SMALL;        BAIL_ON_NT_STATUS(ntError);    }    pList->MaxSize = dwNewLength;    ntError = STATUS_SUCCESS;cleanup:    return ntError;error:    goto cleanup;}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:29,


示例20: PvfsListInit

NTSTATUSPvfsListInit(    PPVFS_LIST *ppNewList,    DWORD dwMaxSize,    PPVFS_LIST_FREE_DATA_FN pfnFreeData    ){    NTSTATUS ntError = STATUS_UNSUCCESSFUL;    PPVFS_LIST pList = NULL;    BAIL_ON_INVALID_PTR(ppNewList, ntError);    ntError = RTL_ALLOCATE(&pList, PVFS_LIST, sizeof(PVFS_LIST));    BAIL_ON_NT_STATUS(ntError);    pList->MaxSize = dwMaxSize;    pList->CurrentSize = 0;    pList->pfnFreeData = pfnFreeData;    LwListInit(&pList->DataList);    *ppNewList = pList;    pList = NULL;    ntError = STATUS_SUCCESS;cleanup:    RTL_FREE(&pList);    return ntError;error:    goto cleanup;}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:35,


示例21: SamrSrvGetUserPwInfo

NTSTATUSSamrSrvGetUserPwInfo(    IN  handle_t        hBinding,    IN  ACCOUNT_HANDLE  hUser,    OUT PwInfo         *pInfo    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    PACCOUNT_CONTEXT pAcctCtx = NULL;    PDOMAIN_CONTEXT pDomCtx = NULL;    BAIL_ON_INVALID_PTR(hBinding);    BAIL_ON_INVALID_PTR(hUser);    BAIL_ON_INVALID_PTR(pInfo);    pAcctCtx = (PACCOUNT_CONTEXT)hUser;    pDomCtx  = pAcctCtx->pDomCtx;    if (pAcctCtx == NULL || pAcctCtx->Type != SamrContextAccount)    {        ntStatus = STATUS_INVALID_HANDLE;        BAIL_ON_NTSTATUS_ERROR(ntStatus);    }    /* Check access rights required */    if (!(pAcctCtx->dwAccessGranted & USER_ACCESS_GET_ATTRIBUTES))    {        ntStatus = STATUS_ACCESS_DENIED;        BAIL_ON_NTSTATUS_ERROR(ntStatus);    }    /*     * This is in fact returning domain- not user-specific     * settings     */    pInfo->min_password_length = pDomCtx->dwMinPasswordLen;    pInfo->password_properties = pDomCtx->dwPasswordProperties;cleanup:    return ntStatus;error:    pInfo->min_password_length = 0;    pInfo->password_properties = 0;    goto cleanup;}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:47,


示例22: PvfsNotifyAddFilter

staticNTSTATUSPvfsNotifyAddFilter(    PPVFS_FCB pFcb,    PPVFS_IRP_CONTEXT pIrpContext,    PPVFS_CCB pCcb,    FILE_NOTIFY_CHANGE NotifyFilter,    BOOLEAN bWatchTree,    PULONG pMaxBufferSize    ){    NTSTATUS ntError = STATUS_UNSUCCESSFUL;    PPVFS_NOTIFY_FILTER_RECORD pFilter = NULL;    BOOLEAN bLocked = FALSE;    BAIL_ON_INVALID_PTR(pFcb, ntError);    ntError = PvfsNotifyAllocateFilter(                  &pFilter,                  pIrpContext,                  pCcb,                  NotifyFilter,                  bWatchTree);    BAIL_ON_NT_STATUS(ntError);    /* Add a buffer log to this filter if specified.  We'll move       the record to the buffer list after first processing the Irp */    if (pMaxBufferSize && (*pMaxBufferSize > 0))    {        ntError = PvfsNotifyAllocateChangeBuffer(                      &pFilter->Buffer,                      *pMaxBufferSize);        BAIL_ON_NT_STATUS(ntError);    }    LWIO_LOCK_MUTEX(bLocked, &pFcb->BaseControlBlock.Mutex);    ntError = PvfsListAddTail(                  pFcb->pNotifyListIrp,                  &pFilter->NotifyList);    LWIO_UNLOCK_MUTEX(bLocked, &pFcb->BaseControlBlock.Mutex);    BAIL_ON_NT_STATUS(ntError);cleanup:    return ntError;error:    if (pFilter)    {        PvfsFreeNotifyRecord(&pFilter);    }    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:59,


示例23: NetrAllocateDomainTrusts

NTSTATUSNetrAllocateDomainTrusts(    OUT NetrDomainTrust      *pOut,    IN OUT PDWORD             pdwOffset,    IN OUT PDWORD             pdwSpaceLeft,    IN  NetrDomainTrustList  *pIn,    IN OUT PDWORD             pdwSize    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    DWORD dwError = ERROR_SUCCESS;    PVOID pBuffer = pOut;    UINT32 i = 0;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);    for (i = 0; i < pIn->count; i++)    {        LWBUF_ALLOC_PWSTR(pBuffer, pIn->array[i].netbios_name);        LWBUF_ALLOC_PWSTR(pBuffer, pIn->array[i].dns_name);        LWBUF_ALLOC_DWORD(pBuffer, pIn->array[i].trust_flags);        LWBUF_ALLOC_DWORD(pBuffer, pIn->array[i].parent_index);        LWBUF_ALLOC_WORD(pBuffer, pIn->array[i].trust_type);        LWBUF_ALIGN_TYPE(pdwOffset, pdwSize, pdwSpaceLeft, DWORD);        LWBUF_ALLOC_DWORD(pBuffer, pIn->array[i].trust_attrs);        LWBUF_ALLOC_PSID(pBuffer, pIn->array[i].sid);        LWBUF_ALLOC_BLOB(pBuffer,                         sizeof(pIn->array[i].guid),                         &(pIn->array[i].guid));    }cleanup:    if (ntStatus == STATUS_SUCCESS &&        dwError != ERROR_SUCCESS)    {        ntStatus = LwWin32ErrorToNtStatus(dwError);    }    return ntStatus;error:    goto cleanup;}
开发者ID:borland667,项目名称:pbis,代码行数:45,


示例24: NetShareEnum

NET_API_STATUSNetShareEnum(    IN  PCWSTR   pwszServername,    IN  DWORD    dwLevel,    OUT PBYTE   *ppBuffer,    IN  DWORD    dwMaxLen,    OUT PDWORD   pdwNumEntries,    OUT PDWORD   pdwTotalEntries,    OUT PDWORD   pdwResume    ){    NET_API_STATUS err = ERROR_SUCCESS;    PSRVSVC_CONTEXT pContext = NULL;    BAIL_ON_INVALID_PTR(ppBuffer, err);    BAIL_ON_INVALID_PTR(pdwNumEntries, err);    BAIL_ON_INVALID_PTR(pdwTotalEntries, err);    err = SrvSvcCreateContext(pwszServername, &pContext);    BAIL_ON_WIN_ERROR(err);    err = NetrShareEnum(                pContext,                pwszServername,                dwLevel,                ppBuffer,                dwMaxLen,                pdwNumEntries,                pdwTotalEntries,                pdwResume);    BAIL_ON_WIN_ERROR(err);cleanup:    if (pContext)    {        SrvSvcCloseContext(pContext);    }    return err;error:    goto cleanup;}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:44,


示例25: PvfsNotifyProcessEvent

staticVOIDPvfsNotifyProcessEvent(    PVOID pContext    ){    NTSTATUS ntError = STATUS_SUCCESS;    PPVFS_NOTIFY_REPORT_RECORD pReport = (PPVFS_NOTIFY_REPORT_RECORD)pContext;    PPVFS_FCB pParentFcb = NULL;    PPVFS_FCB pCursor = NULL;    PPVFS_FCB pReportParentFcb = NULL;    BAIL_ON_INVALID_PTR(pReport, ntError);    /* Simply walk up the ancestory and process the notify filter       record on top if there is a match */    pCursor = PvfsReferenceFCB(pReport->pFcb);    pReportParentFcb = PvfsGetParentFCB(pReport->pFcb);    while ((pParentFcb = PvfsGetParentFCB(pCursor)) != NULL)    {        PvfsReleaseFCB(&pCursor);        /* Process buffers before Irp so we don't doubly report           a change on a pending Irp that has requested buffering a           change log (which shouldn't start until the existing Irp           has been completed). */        PvfsNotifyFullReportBuffer(pParentFcb, pReportParentFcb, pReport);        PvfsNotifyFullReportIrp(pParentFcb, pReportParentFcb, pReport);        pCursor = pParentFcb;    }error:    if (pCursor)    {        PvfsReleaseFCB(&pCursor);    }    if (pReportParentFcb)    {        PvfsReleaseFCB(&pReportParentFcb);    }    if (pReport)    {        PvfsNotifyFullReportCtxFree(&pReport);    }    return;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:54,


示例26: PvfsQuerySecurityFile

NTSTATUSPvfsQuerySecurityFile(    PPVFS_IRP_CONTEXT pIrpContext    ){    NTSTATUS ntError = STATUS_NOT_SUPPORTED;    PIRP pIrp = pIrpContext->pIrp;    PPVFS_CCB pCcb = NULL;    PSECURITY_DESCRIPTOR_RELATIVE pReturnSecDesc = NULL;    ULONG SecDescLength = 0;    SECURITY_INFORMATION SecInfo = 0;    IRP_ARGS_QUERY_SET_SECURITY Args = pIrpContext->pIrp->Args.QuerySetSecurity;    /* Sanity checks */    ntError =  PvfsAcquireCCB(pIrp->FileHandle, &pCcb);    BAIL_ON_NT_STATUS(ntError);    if (!IsSetFlag(pCcb->Flags, PVFS_CCB_FLAG_CREATE_COMPLETE))    {        ntError = STATUS_INVALID_PARAMETER;        BAIL_ON_NT_STATUS(ntError);    }    BAIL_ON_INVALID_PTR(Args.SecurityDescriptor, ntError);    ntError = PvfsAccessCheckFileHandle(pCcb, READ_CONTROL);    BAIL_ON_NT_STATUS(ntError);    pReturnSecDesc = Args.SecurityDescriptor;    SecDescLength = Args.Length;    SecInfo  = Args.SecurityInformation;    /* Real work starts here */    ntError = PvfsGetSecurityDescriptorFile(pCcb,                                            SecInfo,                                            pReturnSecDesc,                                            &SecDescLength);    BAIL_ON_NT_STATUS(ntError);    pIrp->IoStatusBlock.BytesTransferred = SecDescLength;    ntError = STATUS_SUCCESS;cleanup:    if (pCcb) {        PvfsReleaseCCB(pCcb);    }    return ntError;error:    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:54,


示例27: PvfsQueryFilePositionInfo

static NTSTATUSPvfsQueryFilePositionInfo(    PPVFS_IRP_CONTEXT pIrpContext    ){    NTSTATUS ntError = STATUS_UNSUCCESSFUL;    PIRP pIrp = pIrpContext->pIrp;    PPVFS_CCB pCcb = NULL;    PFILE_POSITION_INFORMATION pFileInfo = NULL;    IRP_ARGS_QUERY_SET_INFORMATION Args = pIrpContext->pIrp->Args.QuerySetInformation;    off_t CurrentOffset = 0;    /* Sanity checks */    ntError =  PvfsAcquireCCB(pIrp->FileHandle, &pCcb);    BAIL_ON_NT_STATUS(ntError);    BAIL_ON_INVALID_PTR(Args.FileInformation, ntError);    ntError = PvfsAccessCheckAnyFileHandle(                  pCcb,                  (FILE_READ_DATA|FILE_WRITE_DATA));    BAIL_ON_NT_STATUS(ntError);    if (Args.Length < sizeof(*pFileInfo))    {        ntError = STATUS_BUFFER_TOO_SMALL;        BAIL_ON_NT_STATUS(ntError);    }    pFileInfo = (PFILE_POSITION_INFORMATION)Args.FileInformation;    /* Real work starts here */    /* Position */    ntError = PvfsSysLseek(pCcb->fd, 0, SEEK_CUR, &CurrentOffset);    BAIL_ON_NT_STATUS(ntError);    pFileInfo->CurrentByteOffset = CurrentOffset;    pIrp->IoStatusBlock.BytesTransferred = sizeof(*pFileInfo);    ntError = STATUS_SUCCESS;cleanup:    if (pCcb) {        PvfsReleaseCCB(pCcb);    }    return ntError;error:    goto cleanup;}
开发者ID:FarazShaikh,项目名称:LikewiseSMB2,代码行数:54,


示例28: LsaAllocateTranslatedNames

NTSTATUSLsaAllocateTranslatedNames(    OUT TranslatedName       *pOut,    IN OUT PDWORD             pdwOffset,    IN OUT PDWORD             pdwSpaceLeft,    IN  TranslatedNameArray  *pIn,    IN OUT PDWORD             pdwSize    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    DWORD dwError = ERROR_SUCCESS;    PVOID pBuffer = pOut;    DWORD iTransName = 0;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);    for (iTransName = 0; iTransName < pIn->count; iTransName++)    {        LWBUF_ALIGN(pdwOffset, pdwSize, pdwSpaceLeft);        LWBUF_ALLOC_WORD(pBuffer, pIn->names[iTransName].type);        LWBUF_ALIGN_PTR(pdwOffset, pdwSize, pdwSpaceLeft);        LWBUF_ALLOC_UNICODE_STRING(                             pBuffer,                             (PUNICODE_STRING)&pIn->names[iTransName].name);        LWBUF_ALLOC_DWORD(pBuffer, pIn->names[iTransName].sid_index);    }cleanup:    if (ntStatus == STATUS_SUCCESS &&        dwError != ERROR_SUCCESS)    {        ntStatus = LwWin32ErrorToNtStatus(dwError);    }    return ntStatus;error:    goto cleanup;}
开发者ID:bhanug,项目名称:likewise-open,代码行数:41,


示例29: NetrAllocateSamInfo6

staticNTSTATUSNetrAllocateSamInfo6(    OUT NetrSamInfo6  *pOut,    IN OUT PDWORD      pdwOffset,    IN OUT PDWORD      pdwSpaceLeft,    IN  NetrSamInfo6  *pIn,    IN OUT PDWORD      pdwSize    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    DWORD dwError = ERROR_SUCCESS;    PVOID pBuffer = pOut;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);    ntStatus = NetrAllocateSamInfo3((NetrSamInfo3*)pBuffer,                                    pdwOffset,                                    pdwSpaceLeft,                                    (NetrSamInfo3*)pIn,                                    pdwSize);    BAIL_ON_NT_STATUS(ntStatus);    LWBUF_ALLOC_UNICODE_STRING(pBuffer, (PUNICODE_STRING)&pIn->forest);    LWBUF_ALLOC_UNICODE_STRING(pBuffer, (PUNICODE_STRING)&pIn->principal);    LWBUF_ALLOC_BLOB(pBuffer, sizeof(pIn->unknown), pIn->unknown);cleanup:    if (ntStatus == STATUS_SUCCESS &&        dwError != ERROR_SUCCESS)    {        ntStatus = LwWin32ErrorToNtStatus(dwError);    }    return ntStatus;error:    goto cleanup;}
开发者ID:borland667,项目名称:pbis,代码行数:41,


示例30: NetrAllocateDomainTrustInfo

staticNTSTATUSNetrAllocateDomainTrustInfo(    OUT NetrDomainTrustInfo *pOut,    IN OUT PDWORD            pdwOffset,    IN OUT PDWORD            pdwSpaceLeft,    IN  NetrDomainTrustInfo *pIn,    IN OUT PDWORD            pdwSize    ){    NTSTATUS ntStatus = STATUS_SUCCESS;    DWORD dwError = ERROR_SUCCESS;    NetrDomainTrustInfo *pBuffer = pOut;    BAIL_ON_INVALID_PTR(pdwOffset, ntStatus);    BAIL_ON_INVALID_PTR(pIn, ntStatus);    BAIL_ON_INVALID_PTR(pdwSize, ntStatus);    LWBUF_ALIGN(pdwOffset, pdwSize, pdwSpaceLeft);    LWBUF_ALLOC_UNICODE_STRING(pBuffer,                               (PUNICODE_STRING)&pIn->domain_name);    LWBUF_ALLOC_UNICODE_STRING(pBuffer,                               (PUNICODE_STRING)&pIn->full_domain_name);    LWBUF_ALLOC_UNICODE_STRING(pBuffer,                               (PUNICODE_STRING)&pIn->forest);    LWBUF_ALLOC_BLOB(pBuffer, sizeof(pIn->guid), &pIn->guid);    LWBUF_ALLOC_PSID(pBuffer, pIn->sid);cleanup:    if (ntStatus == STATUS_SUCCESS &&        dwError != ERROR_SUCCESS)    {        ntStatus = LwWin32ErrorToNtStatus(dwError);    }    return ntStatus;error:    goto cleanup;}
开发者ID:borland667,项目名称:pbis,代码行数:41,



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


C++ BAIL_ON_LSA_ERROR函数代码示例
C++ BAIL_ON_FAILURE函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。