本文整理汇总了C++中RTL_FREE函数的典型用法代码示例。如果您正苦于以下问题:C++ RTL_FREE函数的具体用法?C++ RTL_FREE怎么用?C++ RTL_FREE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTL_FREE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RegSafeFreeValueAttributes
void
RegSafeFreeValueAttributes(
PLWREG_VALUE_ATTRIBUTES* ppValueAttrs
)
{
PLWREG_VALUE_ATTRIBUTES pValueAttrs = NULL;
if ((ppValueAttrs == NULL) || (*ppValueAttrs == NULL)) {
return;
}
pValueAttrs = *ppValueAttrs;
RTL_FREE(&pValueAttrs->pDefaultValue);
RTL_FREE(&pValueAttrs->pwszDocString);
if (LWREG_VALUE_RANGE_TYPE_ENUM == pValueAttrs->RangeType)
{
if (pValueAttrs->Range.ppwszRangeEnumStrings)
{
RegFreeWC16StringArrayWithNullTerminator(pValueAttrs->Range.ppwszRangeEnumStrings);
}
pValueAttrs->Range.ppwszRangeEnumStrings = NULL;
}
RTL_FREE(&pValueAttrs);
*ppValueAttrs = NULL;
return;
}
示例2: RdrQueryDfsReferral2Complete
static
BOOLEAN
RdrQueryDfsReferral2Complete(
PRDR_OP_CONTEXT pContext,
NTSTATUS status,
PVOID pParam
)
{
PSMB_PACKET pPacket = pParam;
PBYTE pOutput = NULL;
ULONG ulOutputSize = 0;
BAIL_ON_NT_STATUS(status);
status = pPacket->pSMB2Header->error;
switch (status)
{
case STATUS_NO_SUCH_FILE:
case STATUS_NO_SUCH_DEVICE:
case STATUS_NOT_FOUND:
/* Referral failed -- insert negative cache entry */
pOutput = NULL;
ulOutputSize = 0;
status = STATUS_SUCCESS;
break;
default:
BAIL_ON_NT_STATUS(status);
status = RdrSmb2DecodeIoctlResponse(pPacket, &pOutput, &ulOutputSize);
BAIL_ON_NT_STATUS(status);
}
status = RdrDfsRegisterNamespace(
pContext->State.DfsConnect.pwszNamespace,
(PDFS_RESPONSE_HEADER) pOutput,
(USHORT) ulOutputSize);
BAIL_ON_NT_STATUS(status);
status = RdrDfsConnectAttempt(pContext);
BAIL_ON_NT_STATUS(status);
cleanup:
RdrFreePacket(pPacket);
if (status != STATUS_PENDING)
{
RdrContinueContext(pContext->State.DfsConnect.pContinue, status, NULL);
RTL_FREE(&pContext->State.DfsConnect.pwszNamespace);
RTL_FREE(pContext->State.DfsConnect.ppwszCanonicalPath);
RTL_FREE(pContext->State.DfsConnect.ppwszFilePath);
RdrFreeContext(pContext);
}
return FALSE;
error:
goto cleanup;
}
示例3: RdrFreePacket
VOID
RdrFreePacket(
PSMB_PACKET pPacket
)
{
if (pPacket)
{
RTL_FREE(&pPacket->pRawBuffer);
RTL_FREE(&pPacket);
}
}
示例4: RdrFreeContext
VOID
RdrFreeContext(
PRDR_OP_CONTEXT pContext
)
{
if (pContext)
{
LWIO_LOG_DEBUG("Freed op context %p", pContext);
RTL_FREE(&pContext->Packet.pRawBuffer);
RTL_FREE(&pContext);
}
}
示例5: RdrIsInPlaceRename
static
NTSTATUS
RdrIsInPlaceRename(
PRDR_CCB pFile,
PFILE_RENAME_INFORMATION pRenameInfo,
PBOOLEAN pbIsInPlace
)
{
NTSTATUS status = STATUS_SUCCESS;
PWSTR pwszShare = NULL;
PWSTR pwszFile = NULL;
PWSTR pwszExisting = NULL;
PWSTR pwszNew = NULL;
status = RdrConvertPath(
pRenameInfo->FileName,
NULL,
&pwszShare,
&pwszFile
);
BAIL_ON_NT_STATUS(status);
status = LwRtlWC16StringAllocatePrintfW(
&pwszNew,
L"%ws%ws",
pwszShare,
pwszFile);
BAIL_ON_NT_STATUS(status);
status = LwRtlWC16StringDuplicate(&pwszExisting, pFile->pwszCanonicalPath);
BAIL_ON_NT_STATUS(status);
RdrTrimLastPathElement(pwszNew);
RdrTrimLastPathElement(pwszExisting);
*pbIsInPlace = LwRtlWC16StringIsEqual(pwszNew, pwszExisting, FALSE);
cleanup:
RTL_FREE(&pwszShare);
RTL_FREE(&pwszFile);
RTL_FREE(&pwszExisting);
RTL_FREE(&pwszNew);
return status;
error:
*pbIsInPlace = FALSE;
goto cleanup;
}
示例6: LwRtlAnsiStringAllocatePrintfV
LW_NTSTATUS
LwRtlAnsiStringAllocatePrintfV(
LW_OUT LW_PANSI_STRING pNewString,
LW_IN LW_PCSTR Format,
LW_IN va_list Args
)
{
NTSTATUS status = 0;
PSTR pOutputString = NULL;
ANSI_STRING newString = { 0 };
status = LwRtlCStringAllocatePrintfV(
&pOutputString,
Format,
Args);
GOTO_CLEANUP_ON_STATUS(status);
status = LwRtlAnsiStringInitEx(&newString, pOutputString);
GOTO_CLEANUP_ON_STATUS(status);
pOutputString = NULL;
cleanup:
if (status)
{
RTL_ANSI_STRING_FREE(&newString);
}
RTL_FREE(&pOutputString);
*pNewString = newString;
return status;
}
示例7: LwIoRdrFreePhysicalPath
VOID
LwIoRdrFreePhysicalPath(
LW_PWSTR pResolved
)
{
RTL_FREE(&pResolved);
}
示例8: PvfsListInit
NTSTATUS
PvfsListInit(
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;
}
示例9: DestroyEventThread
static
VOID
DestroyEventThread(
PKQUEUE_THREAD pThread
)
{
pthread_mutex_destroy(&pThread->Lock);
pthread_cond_destroy(&pThread->Event);
if (pThread->KqueueFd >= 0)
{
close(pThread->KqueueFd);
}
if (pThread->SignalFds[0] >= 0)
{
close(pThread->SignalFds[0]);
}
if (pThread->SignalFds[1] >= 0)
{
close(pThread->SignalFds[1]);
}
RTL_FREE(&pThread->Commands.pCommands);
}
示例10: StartWorkItem
static
VOID
StartWorkItem(
PLW_WORK_ITEM pItem,
PVOID pContext
)
{
NTSTATUS status = STATUS_SUCCESS;
PSVCM_START_STATE pState = pContext;
status = pState->pInstance->pTable->Start(
pState->pInstance,
pState->ArgCount,
pState->ppArgs,
pState->FdCount,
pState->pFds);
if (pState->Notify)
{
pState->Notify(pState->pInstance, status, pState->pNotifyContext);
}
RTL_FREE(&pState);
LwRtlFreeWorkItem(&pItem);
}
示例11: LwRtlWC16StringAllocateFromUnicodeString
LW_NTSTATUS
LwRtlWC16StringAllocateFromUnicodeString(
LW_OUT LW_PWSTR* ppszNewString,
LW_IN LW_PUNICODE_STRING pOriginalString
)
{
NTSTATUS status = 0;
UNICODE_STRING terminatedOriginalString = { 0 };
PWSTR pszNewString = NULL;
// Since duplicate always does NULL-termination, we can
// safely use the Buffer field as a WC16String.
status = LwRtlUnicodeStringDuplicate(&terminatedOriginalString, pOriginalString);
GOTO_CLEANUP_ON_STATUS(status);
pszNewString = terminatedOriginalString.Buffer;
terminatedOriginalString.Buffer = NULL;
terminatedOriginalString.Length = 0;
terminatedOriginalString.MaximumLength = 0;
cleanup:
if (!NT_SUCCESS(status))
{
RTL_FREE(&pszNewString);
}
LwRtlUnicodeStringFree(&terminatedOriginalString);
*ppszNewString = pszNewString;
return status;
}
示例12: create_sid_list
/*
* Converts array of sid strings to array of sids
*/
static
PSID* create_sid_list(char **strlist)
{
int list_len = 0;
PSID* sid_list = NULL;
int i = 0;
if (strlist == NULL) return NULL;
/* count the elements (including terminating zero) */
while (strlist[list_len++]);
/* allocate the wchar16_t strings array */
sid_list = (PSID*) malloc(sizeof(PSID) * list_len);
if (sid_list == NULL) return NULL;
memset((void*)sid_list, 0, sizeof(PSID) * list_len);
/* copy mbs strings to wchar16_t strings */
for (i = 0; strlist[i] && i < list_len; i++) {
RtlAllocateSidFromCString(&sid_list[i], strlist[i]);
if (sid_list[i] == NULL) {
i--;
while (i >= 0) {
RTL_FREE(&sid_list[i--]);
}
free(sid_list);
return NULL;
}
}
return sid_list;
}
示例13: LwRtlWC16StringDuplicate
NTSTATUS
LwRtlWC16StringDuplicate(
OUT PWSTR* ppszNewString,
IN PCWSTR pszOriginalString
)
{
NTSTATUS status = 0;
int EE ATTRIBUTE_UNUSED = 0;
size_t size = 0;
PWSTR pszNewString = NULL;
if (!pszOriginalString)
{
status = STATUS_INVALID_PARAMETER;
GOTO_CLEANUP_ON_STATUS_EE(status, EE);
}
size = (LwRtlWC16StringNumChars(pszOriginalString) + 1) * sizeof(pszOriginalString[0]);
status = RTL_ALLOCATE(&pszNewString, wchar16_t, size);
GOTO_CLEANUP_ON_STATUS_EE(status, EE);
memcpy(pszNewString, pszOriginalString, size);
cleanup:
if (status)
{
RTL_FREE(&pszNewString);
}
*ppszNewString = pszNewString;
return status;
}
示例14: LwRtlWC16StringFree
VOID
LwRtlWC16StringFree(
OUT PWSTR* ppszString
)
{
RTL_FREE(ppszString);
}
示例15: RtlDuplicateSid
NTSTATUS
RtlDuplicateSid(
OUT PSID* NewSid,
IN PSID OriginalSid
)
{
NTSTATUS status = STATUS_SUCCESS;
ULONG length = RtlLengthSid(OriginalSid);
PSID resultSid = NULL;
status = RTL_ALLOCATE(&resultSid, SID, length);
GOTO_CLEANUP_ON_STATUS(status);
RtlCopyMemory(resultSid, OriginalSid, length);
cleanup:
if (!NT_SUCCESS(status))
{
RTL_FREE(&resultSid);
}
*NewSid = resultSid;
return status;
}