本文整理汇总了C++中PhAllocate函数的典型用法代码示例。如果您正苦于以下问题:C++ PhAllocate函数的具体用法?C++ PhAllocate怎么用?C++ PhAllocate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PhAllocate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PhGetDrawInfoGraphBuffers
/**
* Sets up a graphing information structure with information
* from a graph buffer management structure.
*
* \param Buffers The buffer management structure.
* \param DrawInfo The graphing information structure.
* \param DataCount The number of data points currently required.
* The buffers are resized if needed.
*/
VOID PhGetDrawInfoGraphBuffers(
__inout PPH_GRAPH_BUFFERS Buffers,
__inout PPH_GRAPH_DRAW_INFO DrawInfo,
__in ULONG DataCount
)
{
DrawInfo->LineDataCount = min(DataCount, PH_GRAPH_DATA_COUNT(DrawInfo->Width, DrawInfo->Step));
// Do we need to allocate or re-allocate the data buffers?
if (Buffers->AllocatedCount < DrawInfo->LineDataCount)
{
if (Buffers->Data1)
PhFree(Buffers->Data1);
if ((DrawInfo->Flags & PH_GRAPH_USE_LINE_2) && Buffers->Data2)
PhFree(Buffers->Data2);
Buffers->AllocatedCount *= 2;
if (Buffers->AllocatedCount < DrawInfo->LineDataCount)
Buffers->AllocatedCount = DrawInfo->LineDataCount;
Buffers->Data1 = PhAllocate(Buffers->AllocatedCount * sizeof(FLOAT));
if (DrawInfo->Flags & PH_GRAPH_USE_LINE_2)
{
Buffers->Data2 = PhAllocate(Buffers->AllocatedCount * sizeof(FLOAT));
}
Buffers->Valid = FALSE;
}
DrawInfo->LineData1 = Buffers->Data1;
DrawInfo->LineData2 = Buffers->Data2;
}
开发者ID:john-peterson,项目名称:processhacker,代码行数:43,代码来源:graph.c
示例2: PhpGetObjectName
NTSTATUS PhpGetObjectName(
__in HANDLE ProcessHandle,
__in HANDLE Handle,
__out PPH_STRING *ObjectName
)
{
NTSTATUS status;
POBJECT_NAME_INFORMATION buffer;
ULONG bufferSize;
ULONG attempts = 8;
bufferSize = 0x200;
buffer = PhAllocate(bufferSize);
// A loop is needed because the I/O subsystem likes to give us the wrong return lengths...
do
{
if (KphIsConnected())
{
status = KphQueryInformationObject(
ProcessHandle,
Handle,
KphObjectNameInformation,
buffer,
bufferSize,
&bufferSize
);
}
else
{
status = NtQueryObject(
Handle,
ObjectNameInformation,
buffer,
bufferSize,
&bufferSize
);
}
if (status == STATUS_BUFFER_OVERFLOW || status == STATUS_INFO_LENGTH_MISMATCH ||
status == STATUS_BUFFER_TOO_SMALL)
{
PhFree(buffer);
buffer = PhAllocate(bufferSize);
}
else
{
break;
}
} while (--attempts);
if (NT_SUCCESS(status))
{
*ObjectName = PhCreateStringEx(buffer->Name.Buffer, buffer->Name.Length);
}
PhFree(buffer);
return status;
}
开发者ID:john-peterson,项目名称:processhacker,代码行数:60,代码来源:hndlinfo.c
示例3: AddNetworkAdapterToListView
VOID AddNetworkAdapterToListView(
_In_ PDV_NETADAPTER_CONTEXT Context,
_In_ BOOLEAN AdapterPresent,
_In_ IF_INDEX IfIndex,
_In_ IF_LUID Luid,
_In_ PPH_STRING Guid,
_In_ PPH_STRING Description
)
{
DV_NETADAPTER_ID adapterId;
INT lvItemIndex;
BOOLEAN found = FALSE;
PDV_NETADAPTER_ID newId = NULL;
InitializeNetAdapterId(&adapterId, IfIndex, Luid, Guid);
for (ULONG i = 0; i < NetworkAdaptersList->Count; i++)
{
PDV_NETADAPTER_ENTRY entry = PhReferenceObjectSafe(NetworkAdaptersList->Items[i]);
if (!entry)
continue;
if (EquivalentNetAdapterId(&entry->AdapterId, &adapterId))
{
newId = PhAllocate(sizeof(DV_NETADAPTER_ID));
CopyNetAdapterId(newId, &entry->AdapterId);
if (entry->UserReference)
found = TRUE;
}
PhDereferenceObjectDeferDelete(entry);
if (newId)
break;
}
if (!newId)
{
newId = PhAllocate(sizeof(DV_NETADAPTER_ID));
CopyNetAdapterId(newId, &adapterId);
PhMoveReference(&newId->InterfaceGuid, Guid);
}
lvItemIndex = PhAddListViewGroupItem(
Context->ListViewHandle,
AdapterPresent ? 0 : 1,
MAXINT,
Description->Buffer,
newId
);
if (found)
ListView_SetCheckState(Context->ListViewHandle, lvItemIndex, TRUE);
DeleteNetAdapterId(&adapterId);
}
开发者ID:PKRoma,项目名称:ProcessHacker,代码行数:58,代码来源:netoptions.c
示例4: AddDiskDriveToListView
VOID AddDiskDriveToListView(
_In_ PDV_DISK_OPTIONS_CONTEXT Context,
_In_ BOOLEAN DiskPresent,
_In_ PPH_STRING DiskPath,
_In_ PPH_STRING DiskName
)
{
DV_DISK_ID adapterId;
INT lvItemIndex;
BOOLEAN found = FALSE;
PDV_DISK_ID newId = NULL;
InitializeDiskId(&adapterId, DiskPath);
for (ULONG i = 0; i < DiskDrivesList->Count; i++)
{
PDV_DISK_ENTRY entry = PhReferenceObjectSafe(DiskDrivesList->Items[i]);
if (!entry)
continue;
if (EquivalentDiskId(&entry->Id, &adapterId))
{
newId = PhAllocate(sizeof(DV_DISK_ID));
CopyDiskId(newId, &entry->Id);
if (entry->UserReference)
found = TRUE;
}
PhDereferenceObjectDeferDelete(entry);
if (newId)
break;
}
if (!newId)
{
newId = PhAllocate(sizeof(DV_DISK_ID));
CopyDiskId(newId, &adapterId);
PhMoveReference(&newId->DevicePath, DiskPath);
}
lvItemIndex = AddListViewItemGroupId(
Context->ListViewHandle,
DiskPresent ? 0 : 1,
MAXINT,
DiskName->Buffer,
newId
);
if (found)
ListView_SetItemState(Context->ListViewHandle, lvItemIndex, ITEM_CHECKED, LVIS_STATEIMAGEMASK);
DeleteDiskId(&adapterId);
}
开发者ID:MaximeFrancoeur,项目名称:processhacker2,代码行数:56,代码来源:diskoptions.c
示例5: EsEnumDependentServices
LPENUM_SERVICE_STATUS EsEnumDependentServices(
__in SC_HANDLE ServiceHandle,
__in_opt ULONG State,
__out PULONG Count
)
{
LOGICAL result;
PVOID buffer;
ULONG bufferSize;
ULONG returnLength;
ULONG servicesReturned;
if (!State)
State = SERVICE_STATE_ALL;
bufferSize = 0x800;
buffer = PhAllocate(bufferSize);
if (!(result = EnumDependentServices(
ServiceHandle,
State,
buffer,
bufferSize,
&returnLength,
&servicesReturned
)))
{
if (GetLastError() == ERROR_MORE_DATA)
{
PhFree(buffer);
bufferSize = returnLength;
buffer = PhAllocate(bufferSize);
result = EnumDependentServices(
ServiceHandle,
State,
buffer,
bufferSize,
&returnLength,
&servicesReturned
);
}
if (!result)
{
PhFree(buffer);
return NULL;
}
}
*Count = servicesReturned;
return buffer;
}
开发者ID:john-peterson,项目名称:processhacker,代码行数:54,代码来源:depend.c
示例6: AddNetworkAdapterToListView
static VOID AddNetworkAdapterToListView(
_In_ PDV_NETADAPTER_CONTEXT Context,
_In_ PIP_ADAPTER_ADDRESSES Adapter
)
{
DV_NETADAPTER_ID adapterId;
INT lvItemIndex;
BOOLEAN found = FALSE;
PDV_NETADAPTER_ID newId = NULL;
InitializeNetAdapterId(&adapterId, Adapter->IfIndex, Adapter->Luid, NULL);
for (ULONG i = 0; i < NetworkAdaptersList->Count; i++)
{
PDV_NETADAPTER_ENTRY entry = PhReferenceObjectSafe(NetworkAdaptersList->Items[i]);
if (!entry)
continue;
if (EquivalentNetAdapterId(&entry->Id, &adapterId))
{
newId = PhAllocate(sizeof(DV_NETADAPTER_ID));
CopyNetAdapterId(newId, &entry->Id);
found = TRUE;
}
PhDereferenceObjectDeferDelete(entry);
if (newId)
break;
}
if (!newId)
{
newId = PhAllocate(sizeof(DV_NETADAPTER_ID));
CopyNetAdapterId(newId, &adapterId);
PhMoveReference(&newId->InterfaceGuid, PhConvertMultiByteToUtf16(Adapter->AdapterName));
}
lvItemIndex = PhAddListViewItem(
Context->ListViewHandle,
MAXINT,
Adapter->Description,
newId
);
if (found)
ListView_SetItemState(Context->ListViewHandle, lvItemIndex, ITEM_CHECKED, LVIS_STATEIMAGEMASK);
DeleteNetAdapterId(&adapterId);
}
开发者ID:batidiane,项目名称:processhacker2,代码行数:51,代码来源:options.c
示例7: PhMapDisplayIndexTreeNew
VOID PhMapDisplayIndexTreeNew(
__in HWND TreeNewHandle,
__out_opt PULONG *DisplayToId,
__out_opt PWSTR **DisplayToText,
__out PULONG NumberOfColumns
)
{
PPH_TREENEW_COLUMN fixedColumn;
ULONG numberOfColumns;
PULONG displayToId;
PWSTR *displayToText;
ULONG i;
PH_TREENEW_COLUMN column;
fixedColumn = TreeNew_GetFixedColumn(TreeNewHandle);
numberOfColumns = TreeNew_GetVisibleColumnCount(TreeNewHandle);
displayToId = PhAllocate(numberOfColumns * sizeof(ULONG));
if (fixedColumn)
{
TreeNew_GetColumnOrderArray(TreeNewHandle, numberOfColumns - 1, displayToId + 1);
displayToId[0] = fixedColumn->Id;
}
else
{
TreeNew_GetColumnOrderArray(TreeNewHandle, numberOfColumns, displayToId);
}
if (DisplayToText)
{
displayToText = PhAllocate(numberOfColumns * sizeof(PWSTR));
for (i = 0; i < numberOfColumns; i++)
{
if (TreeNew_GetColumn(TreeNewHandle, displayToId[i], &column))
{
displayToText[i] = column.Text;
}
}
*DisplayToText = displayToText;
}
if (DisplayToId)
*DisplayToId = displayToId;
else
PhFree(displayToId);
*NumberOfColumns = numberOfColumns;
}
开发者ID:john-peterson,项目名称:processhacker,代码行数:51,代码来源:cpysave.c
示例8: PhpGetObjectSecurityWithTimeout
NTSTATUS PhpGetObjectSecurityWithTimeout(
_In_ HANDLE Handle,
_In_ SECURITY_INFORMATION SecurityInformation,
_Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor
)
{
NTSTATUS status;
ULONG bufferSize;
PVOID buffer;
bufferSize = 0x100;
buffer = PhAllocate(bufferSize);
// This is required (especially for File objects) because some drivers don't seem to handle
// QuerySecurity properly.
memset(buffer, 0, bufferSize);
status = PhCallNtQuerySecurityObjectWithTimeout(
Handle,
SecurityInformation,
buffer,
bufferSize,
&bufferSize
);
if (status == STATUS_BUFFER_TOO_SMALL)
{
PhFree(buffer);
buffer = PhAllocate(bufferSize);
memset(buffer, 0, bufferSize);
status = PhCallNtQuerySecurityObjectWithTimeout(
Handle,
SecurityInformation,
buffer,
bufferSize,
&bufferSize
);
}
if (!NT_SUCCESS(status))
{
PhFree(buffer);
return status;
}
*SecurityDescriptor = (PSECURITY_DESCRIPTOR)buffer;
return status;
}
开发者ID:ventsislav-georgiev,项目名称:processhacker2,代码行数:49,代码来源:secedit.c
示例9: NtClose
ICLRDataTarget *DnCLRDataTarget_Create(
__in HANDLE ProcessId
)
{
DnCLRDataTarget *dataTarget;
HANDLE processHandle;
BOOLEAN isWow64;
if (!NT_SUCCESS(PhOpenProcess(&processHandle, ProcessQueryAccess | PROCESS_VM_READ, ProcessId)))
return NULL;
#ifdef _M_X64
if (!NT_SUCCESS(PhGetProcessIsWow64(processHandle, &isWow64)))
{
NtClose(processHandle);
return NULL;
}
#else
isWow64 = FALSE;
#endif
dataTarget = PhAllocate(sizeof(DnCLRDataTarget));
dataTarget->VTable = &DnCLRDataTarget_VTable;
dataTarget->RefCount = 1;
dataTarget->ProcessId = ProcessId;
dataTarget->ProcessHandle = processHandle;
dataTarget->IsWow64 = isWow64;
return (ICLRDataTarget *)dataTarget;
}
开发者ID:john-peterson,项目名称:processhacker,代码行数:31,代码来源:clrsup.c
示例10: CreateClrProcessSupport
PCLR_PROCESS_SUPPORT CreateClrProcessSupport(
__in HANDLE ProcessId
)
{
PCLR_PROCESS_SUPPORT support;
ICLRDataTarget *dataTarget;
IXCLRDataProcess *dataProcess;
dataTarget = DnCLRDataTarget_Create(ProcessId);
if (!dataTarget)
return NULL;
dataProcess = NULL;
CreateXCLRDataProcess(ProcessId, dataTarget, &dataProcess);
ICLRDataTarget_Release(dataTarget);
if (!dataProcess)
return NULL;
support = PhAllocate(sizeof(CLR_PROCESS_SUPPORT));
support->DataProcess = dataProcess;
return support;
}
开发者ID:john-peterson,项目名称:processhacker,代码行数:25,代码来源:clrsup.c
示例11: PhpReadSignature
PUCHAR PhpReadSignature(
_In_ PWSTR FileName,
_Out_ PULONG SignatureSize
)
{
NTSTATUS status;
HANDLE fileHandle;
PUCHAR signature;
ULONG bufferSize;
IO_STATUS_BLOCK iosb;
if (!NT_SUCCESS(PhCreateFileWin32(&fileHandle, FileName, FILE_GENERIC_READ, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ, FILE_OPEN, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT)))
{
return NULL;
}
bufferSize = 1024;
signature = PhAllocate(bufferSize);
status = NtReadFile(fileHandle, NULL, NULL, NULL, &iosb, signature, bufferSize, NULL, NULL);
NtClose(fileHandle);
if (NT_SUCCESS(status))
{
*SignatureSize = (ULONG)iosb.Information;
return signature;
}
else
{
PhFree(signature);
return NULL;
}
}
开发者ID:Azarien,项目名称:processhacker2,代码行数:34,代码来源:main.c
示例12: PhpCreateDisabledPlugin
PPH_PLUGIN PhpCreateDisabledPlugin(
_In_ PPH_STRINGREF BaseName
)
{
PPH_PLUGIN plugin;
plugin = PhAllocate(sizeof(PH_PLUGIN));
memset(plugin, 0, sizeof(PH_PLUGIN));
plugin->Name.Length = BaseName->Length;
plugin->Name.Buffer = PhAllocate(BaseName->Length + sizeof(WCHAR));
memcpy(plugin->Name.Buffer, BaseName->Buffer, BaseName->Length);
plugin->Name.Buffer[BaseName->Length / 2] = 0;
return plugin;
}
开发者ID:MaximeFrancoeur,项目名称:processhacker2,代码行数:16,代码来源:plugman.c
示例13: DiskDriveQueryMountPointHandles
PPH_LIST DiskDriveQueryMountPointHandles(
_In_ ULONG DeviceNumber
)
{
ULONG driveMask;
PPH_LIST deviceList;
WCHAR deviceNameBuffer[7] = L"\\\\.\\?:";
driveMask = DiskDriveQueryDeviceMap();
deviceList = PhCreateList(2);
// NOTE: This isn't the best way of doing this but it works.
for (INT i = 0; i < 0x1A; i++)
{
if (driveMask & (0x1 << i))
{
HANDLE deviceHandle;
deviceNameBuffer[4] = (WCHAR)('A' + i);
if (NT_SUCCESS(PhCreateFileWin32(
&deviceHandle,
deviceNameBuffer,
PhGetOwnTokenAttributes().Elevated ? FILE_GENERIC_READ : FILE_READ_ATTRIBUTES | FILE_TRAVERSE | SYNCHRONIZE,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
FILE_OPEN,
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT
)))
{
ULONG deviceNumber = ULONG_MAX; // Note: Do not initialize to zero.
DEVICE_TYPE deviceType = 0;
if (NT_SUCCESS(DiskDriveQueryDeviceTypeAndNumber(
deviceHandle,
&deviceNumber,
&deviceType
)))
{
// BUG: Device numbers are re-used on seperate device controllers and this
// causes drive letters to be assigned to disks at those same indexes.
// For now, just filter CD_ROM devices but we may need to be a lot more strict and
// only allow devices of type FILE_DEVICE_DISK to be scanned for mount points.
if (deviceNumber == DeviceNumber && deviceType != FILE_DEVICE_CD_ROM)
{
PDISK_HANDLE_ENTRY entry = PhAllocate(sizeof(DISK_HANDLE_ENTRY));
memset(entry, 0, sizeof(DISK_HANDLE_ENTRY));
entry->DeviceLetter = deviceNameBuffer[4];
entry->DeviceHandle = deviceHandle;
PhAddItemList(deviceList, entry);
}
}
}
}
}
return deviceList;
}
开发者ID:Azarien,项目名称:processhacker2,代码行数:60,代码来源:storage.c
示例14: PhCreateServiceListControl
/**
* Creates a service list property page.
*
* \param ParentWindowHandle The parent of the service list.
* \param Services An array of service items. Each
* service item must have a reference that is transferred
* to this function. The array must be allocated using
* PhAllocate() and must not be freed by the caller; it
* will be freed automatically when no longer needed.
* \param NumberOfServices The number of service items
* in \a Services.
*/
HWND PhCreateServiceListControl(
_In_ HWND ParentWindowHandle,
_In_ PPH_SERVICE_ITEM *Services,
_In_ ULONG NumberOfServices
)
{
HWND windowHandle;
PPH_SERVICES_CONTEXT servicesContext;
servicesContext = PhAllocate(sizeof(PH_SERVICES_CONTEXT));
memset(servicesContext, 0, sizeof(PH_SERVICES_CONTEXT));
servicesContext->Services = Services;
servicesContext->NumberOfServices = NumberOfServices;
windowHandle = CreateDialogParam(
PhInstanceHandle,
MAKEINTRESOURCE(IDD_SRVLIST),
ParentWindowHandle,
PhpServicesPageProc,
(LPARAM)servicesContext
);
if (!windowHandle)
{
PhFree(servicesContext);
return windowHandle;
}
return windowHandle;
}
开发者ID:Azarien,项目名称:processhacker2,代码行数:43,代码来源:srvctl.c
示例15: ExtractResourceToBuffer
PVOID ExtractResourceToBuffer(
_In_ PWSTR Resource
)
{
ULONG resourceLength;
HRSRC resourceHandle = NULL;
HGLOBAL resourceData;
PVOID resourceBuffer;
PVOID buffer = NULL;
if (!(resourceHandle = FindResource(PhInstanceHandle, Resource, RT_RCDATA)))
goto CleanupExit;
resourceLength = SizeofResource(PhInstanceHandle, resourceHandle);
if (!(resourceData = LoadResource(PhInstanceHandle, resourceHandle)))
goto CleanupExit;
if (!(resourceBuffer = LockResource(resourceData)))
goto CleanupExit;
if (!(buffer = PhAllocate(resourceLength)))
goto CleanupExit;
memcpy(buffer, resourceBuffer, resourceLength);
CleanupExit:
if (resourceHandle)
FreeResource(resourceHandle);
return buffer;
}
开发者ID:poizan42,项目名称:processhacker2,代码行数:33,代码来源:appsup.c
示例16: PhSetExtendedListView
/**
* Enables extended list view support for a list view control.
*
* \param hWnd A handle to the list view control.
*/
VOID PhSetExtendedListView(
_In_ HWND hWnd
)
{
WNDPROC oldWndProc;
PPH_EXTLV_CONTEXT context;
oldWndProc = (WNDPROC)GetWindowLongPtr(hWnd, GWLP_WNDPROC);
SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)PhpExtendedListViewWndProc);
context = PhAllocate(sizeof(PH_EXTLV_CONTEXT));
context->Handle = hWnd;
context->OldWndProc = oldWndProc;
context->Context = NULL;
context->TriState = FALSE;
context->SortColumn = 0;
context->SortOrder = AscendingSortOrder;
context->SortFast = FALSE;
context->TriStateCompareFunction = NULL;
memset(context->CompareFunctions, 0, sizeof(context->CompareFunctions));
context->NumberOfFallbackColumns = 0;
context->ItemColorFunction = NULL;
context->ItemFontFunction = NULL;
context->EnableRedraw = 1;
context->Cursor = NULL;
SetProp(hWnd, PhpMakeExtLvContextAtom(), (HANDLE)context);
ExtendedListView_Init(hWnd);
}
开发者ID:Azarien,项目名称:processhacker2,代码行数:38,代码来源:extlv.c
示例17: PhEnumAtomTable
static NTSTATUS PhEnumAtomTable(
_Out_ PATOM_TABLE_INFORMATION* AtomTable
)
{
NTSTATUS status;
PVOID buffer;
ULONG bufferSize = 0x1000;
buffer = PhAllocate(bufferSize);
memset(buffer, 0, bufferSize);
status = NtQueryInformationAtom(
RTL_ATOM_INVALID_ATOM,
AtomTableInformation,
buffer,
bufferSize,
&bufferSize // Not used...
);
if (!NT_SUCCESS(status))
{
PhFree(buffer);
return status;
}
*AtomTable = buffer;
return status;
}
开发者ID:phplugins,项目名称:plugins-extra,代码行数:29,代码来源:main.c
示例18: PhCreateSearchControl
VOID PhCreateSearchControl(
_In_ HWND Parent,
_In_ HWND WindowHandle,
_In_opt_ PWSTR BannerText
)
{
PEDIT_CONTEXT context;
context = (PEDIT_CONTEXT)PhAllocate(sizeof(EDIT_CONTEXT));
memset(context, 0, sizeof(EDIT_CONTEXT));
context->WindowHandle = WindowHandle;
//PhpSearchInitializeTheme(context);
PhpSearchInitializeImages(context);
// Set initial text
if (BannerText)
Edit_SetCueBannerText(context->WindowHandle, BannerText);
// Subclass the Edit control window procedure.
SetWindowSubclass(context->WindowHandle, PhpSearchWndSubclassProc, 0, (ULONG_PTR)context);
// Initialize the theme parameters.
SendMessage(context->WindowHandle, WM_THEMECHANGED, 0, 0);
}
开发者ID:amitamitamitamit,项目名称:processhacker2,代码行数:26,代码来源:searchbox.c
示例19: PhShowMemoryResultsDialog
VOID PhShowMemoryResultsDialog(
_In_ HANDLE ProcessId,
_In_ PPH_LIST Results
)
{
HWND windowHandle;
PMEMORY_RESULTS_CONTEXT context;
ULONG i;
context = PhAllocate(sizeof(MEMORY_RESULTS_CONTEXT));
context->ProcessId = ProcessId;
context->Results = Results;
PhReferenceObject(Results);
for (i = 0; i < Results->Count; i++)
PhReferenceMemoryResult(Results->Items[i]);
windowHandle = CreateDialogParam(
PhInstanceHandle,
MAKEINTRESOURCE(IDD_MEMRESULTS),
NULL,
PhpMemoryResultsDlgProc,
(LPARAM)context
);
ShowWindow(windowHandle, SW_SHOW);
}
开发者ID:evaluation-alex,项目名称:processhacker2,代码行数:27,代码来源:memrslt.c
示例20: PhQueryAtomTableEntry
static NTSTATUS PhQueryAtomTableEntry(
_In_ RTL_ATOM Atom,
_Out_ PATOM_BASIC_INFORMATION* AtomInfo
)
{
NTSTATUS status;
PVOID buffer;
ULONG bufferSize = 0x1000;
buffer = PhAllocate(bufferSize);
memset(buffer, 0, bufferSize);
status = NtQueryInformationAtom(
Atom,
AtomBasicInformation,
buffer,
bufferSize,
&bufferSize // Not used...
);
if (!NT_SUCCESS(status))
{
PhFree(buffer);
return status;
}
*AtomInfo = buffer;
return status;
}
开发者ID:phplugins,项目名称:plugins-extra,代码行数:30,代码来源:main.c
注:本文中的PhAllocate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论