本文整理汇总了C++中PhCreateList函数的典型用法代码示例。如果您正苦于以下问题:C++ PhCreateList函数的具体用法?C++ PhCreateList怎么用?C++ PhCreateList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PhCreateList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateDotNetTraceQueryThread
VOID CreateDotNetTraceQueryThread(
_In_ HWND WindowHandle,
_In_ ULONG ClrVersions,
_In_ HANDLE ProcessId
)
{
HANDLE threadHandle;
PASMPAGE_QUERY_CONTEXT context;
context = PhAllocate(sizeof(ASMPAGE_QUERY_CONTEXT));
memset(context, 0, sizeof(ASMPAGE_QUERY_CONTEXT));
context->WindowHandle = WindowHandle;
context->ClrVersions = ClrVersions;
context->ProcessId = ProcessId;
context->NodeList = PhCreateList(64);
context->NodeRootList = PhCreateList(2);
if (threadHandle = PhCreateThread(0, DotNetTraceQueryThreadStart, context))
{
NtClose(threadHandle);
}
else
{
DestroyDotNetTraceQuery(context);
}
}
示例2: InitializeVirusTotalProcessMonitor
VOID InitializeVirusTotalProcessMonitor(
VOID
)
{
VirusTotalList = PhCreateList(100);
VirusTotalHandle = PhCreateThread(0, VirusTotalProcessApiThread, NULL);
}
示例3: PhGetSelectedListViewItemParams
VOID PhGetSelectedListViewItemParams(
_In_ HWND hWnd,
_Out_ PVOID **Items,
_Out_ PULONG NumberOfItems
)
{
PPH_LIST list;
ULONG index;
PVOID param;
list = PhCreateList(2);
index = -1;
while ((index = PhFindListViewItemByFlags(
hWnd,
index,
LVNI_SELECTED
)) != -1)
{
if (PhGetListViewItemParam(
hWnd,
index,
¶m
))
{
PhAddItemList(list, param);
}
}
*Items = PhAllocateCopy(list->Items, sizeof(PVOID) * list->Count);
*NumberOfItems = list->Count;
PhDereferenceObject(list);
}
示例4: PhShowGdiHandlesDialog
VOID PhShowGdiHandlesDialog(
_In_ HWND ParentWindowHandle,
_In_ PPH_PROCESS_ITEM ProcessItem
)
{
GDI_HANDLES_CONTEXT context;
ULONG i;
context.ProcessItem = ProcessItem;
context.List = PhCreateList(20);
DialogBoxParam(
PhInstanceHandle,
MAKEINTRESOURCE(IDD_GDIHANDLES),
ParentWindowHandle,
PhpGdiHandlesDlgProc,
(LPARAM)&context
);
for (i = 0; i < context.List->Count; i++)
{
PPH_GDI_HANDLE_ITEM gdiHandleItem = context.List->Items[i];
if (gdiHandleItem->Information)
PhDereferenceObject(gdiHandleItem->Information);
PhFree(context.List->Items[i]);
}
PhDereferenceObject(context.List);
}
示例5: PhShowChooseColumnsDialog
VOID PhShowChooseColumnsDialog(
__in HWND ParentWindowHandle,
__in HWND ControlHandle,
__in ULONG Type
)
{
COLUMNS_DIALOG_CONTEXT context;
context.ControlHandle = ControlHandle;
context.Type = Type;
if (Type == PH_CONTROL_TYPE_TREE_NEW)
context.Columns = PhCreateList(TreeNew_GetColumnCount(ControlHandle));
else
return;
DialogBoxParam(
PhInstanceHandle,
MAKEINTRESOURCE(IDD_CHOOSECOLUMNS),
ParentWindowHandle,
PhpColumnsDlgProc,
(LPARAM)&context
);
PhDereferenceObject(context.Columns);
}
示例6: NetAdaptersInitialize
VOID NetAdaptersInitialize(
VOID
)
{
NetworkAdaptersList = PhCreateList(1);
NetAdapterEntryType = PhCreateObjectType(L"NetAdapterEntry", 0, AdapterEntryDeleteProcedure);
}
示例7: PhpEnumHiddenProcessesCsrHandles
NTSTATUS PhpEnumHiddenProcessesCsrHandles(
_In_ PPH_ENUM_HIDDEN_PROCESSES_CALLBACK Callback,
_In_opt_ PVOID Context
)
{
NTSTATUS status;
PVOID processes;
PSYSTEM_PROCESS_INFORMATION process;
PPH_LIST pids;
CSR_HANDLES_CONTEXT context;
if (!NT_SUCCESS(status = PhEnumProcesses(&processes)))
return status;
pids = PhCreateList(40);
process = PH_FIRST_PROCESS(processes);
do
{
PhAddItemList(pids, process->UniqueProcessId);
} while (process = PH_NEXT_PROCESS(process));
PhFree(processes);
context.Callback = Callback;
context.Context = Context;
context.Pids = pids;
status = PhEnumCsrProcessHandles(PhpCsrProcessHandlesCallback, &context);
PhDereferenceObject(pids);
return status;
}
示例8: 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;
}
示例9: DiskDrivesInitialize
VOID DiskDrivesInitialize(
VOID
)
{
DiskDrivesList = PhCreateList(1);
DiskDriveEntryType = PhCreateObjectType(L"DiskDriveEntry", 0, DiskEntryDeleteProcedure);
}
示例10: VirusTotalJsonToResultList
PPH_LIST VirusTotalJsonToResultList(
_In_ PVOID JsonObject
)
{
ULONG i;
ULONG arrayLength;
PPH_LIST results;
if (!(arrayLength = PhGetJsonArrayLength(JsonObject)))
return NULL;
results = PhCreateList(arrayLength);
for (i = 0; i < arrayLength; i++)
{
PVIRUSTOTAL_API_RESULT result;
PVOID jsonArrayObject;
if (!(jsonArrayObject = PhGetJsonArrayIndexObject(JsonObject, i)))
continue;
result = PhAllocate(sizeof(VIRUSTOTAL_API_RESULT));
memset(result, 0, sizeof(VIRUSTOTAL_API_RESULT));
result->FileHash = PhGetJsonValueAsString(jsonArrayObject, "hash");
result->Found = PhGetJsonObjectBool(jsonArrayObject, "found") == TRUE;
result->Positives = PhGetJsonValueAsLong64(jsonArrayObject, "positives");
result->Total = PhGetJsonValueAsLong64(jsonArrayObject, "total");
PhAddItemList(results, result);
}
return results;
}
示例11: StatusBarLoadSettings
VOID StatusBarLoadSettings(
VOID
)
{
ULONG64 buttonCount = 0;
PPH_STRING settingsString;
PH_STRINGREF remaining;
PH_STRINGREF part;
settingsString = PhaGetStringSetting(SETTING_NAME_STATUSBAR_CONFIG);
remaining = settingsString->sr;
if (remaining.Length == 0)
{
// Load default settings
StatusBarLoadDefault();
return;
}
// Query the number of buttons to insert
if (!PhSplitStringRefAtChar(&remaining, '|', &part, &remaining))
{
// Load default settings
StatusBarLoadDefault();
return;
}
if (!PhStringToInteger64(&part, 10, &buttonCount))
{
// Load default settings
StatusBarLoadDefault();
return;
}
StatusBarItemList = PhCreateList((ULONG)buttonCount);
for (ULONG i = 0; i < (ULONG)buttonCount; i++)
{
PH_STRINGREF idPart;
ULONG64 idInteger;
if (remaining.Length == 0)
break;
PhSplitStringRefAtChar(&remaining, '|', &idPart, &remaining);
if (PhStringToInteger64(&idPart, 10, &idInteger))
{
PSTATUSBAR_ITEM statusItem;
statusItem = PhAllocate(sizeof(STATUSBAR_ITEM));
memset(statusItem, 0, sizeof(STATUSBAR_ITEM));
statusItem->Id = (ULONG)idInteger;
PhInsertItemList(StatusBarItemList, i, statusItem);
}
}
}
示例12: PhpRefreshThreadStack
static NTSTATUS PhpRefreshThreadStack(
_In_ HWND hwnd,
_In_ PTHREAD_STACK_CONTEXT ThreadStackContext
)
{
ULONG i;
ThreadStackContext->StopWalk = FALSE;
PhSwapReference2(&ThreadStackContext->StatusMessage, PhCreateString(L"Loading stack..."));
DialogBoxParam(
PhInstanceHandle,
MAKEINTRESOURCE(IDD_PROGRESS),
hwnd,
PhpThreadStackProgressDlgProc,
(LPARAM)ThreadStackContext
);
if (!ThreadStackContext->StopWalk && NT_SUCCESS(ThreadStackContext->WalkStatus))
{
for (i = 0; i < ThreadStackContext->List->Count; i++)
PhpFreeThreadStackItem(ThreadStackContext->List->Items[i]);
PhDereferenceObject(ThreadStackContext->List);
ThreadStackContext->List = ThreadStackContext->NewList;
ThreadStackContext->NewList = PhCreateList(10);
ListView_DeleteAllItems(ThreadStackContext->ListViewHandle);
SendMessage(ThreadStackContext->ListViewHandle, WM_SETREDRAW, FALSE, 0);
for (i = 0; i < ThreadStackContext->List->Count; i++)
{
PTHREAD_STACK_ITEM item = ThreadStackContext->List->Items[i];
INT lvItemIndex;
WCHAR integerString[PH_INT32_STR_LEN_1];
PhPrintUInt32(integerString, item->Index);
lvItemIndex = PhAddListViewItem(ThreadStackContext->ListViewHandle, MAXINT, integerString, item);
PhSetListViewSubItem(ThreadStackContext->ListViewHandle, lvItemIndex, 1, PhGetStringOrDefault(item->Symbol, L"???"));
}
SendMessage(ThreadStackContext->ListViewHandle, WM_SETREDRAW, TRUE, 0);
InvalidateRect(ThreadStackContext->ListViewHandle, NULL, FALSE);
}
else
{
for (i = 0; i < ThreadStackContext->NewList->Count; i++)
PhpFreeThreadStackItem(ThreadStackContext->NewList->Items[i]);
PhClearList(ThreadStackContext->NewList);
}
if (ThreadStackContext->StopWalk)
return STATUS_ABANDONED;
return ThreadStackContext->WalkStatus;
}
示例13: PhRegisterDialog
VOID PhRegisterDialog(
_In_ HWND DialogWindowHandle
)
{
if (!DialogList)
DialogList = PhCreateList(2);
PhAddItemList(DialogList, (PVOID)DialogWindowHandle);
}
示例14: PhWorkQueueInitialization
VOID PhWorkQueueInitialization(
VOID
)
{
PhInitializeFreeList(&PhWorkQueueItemFreeList, sizeof(PH_WORK_QUEUE_ITEM), 32);
#ifdef DEBUG
PhDbgWorkQueueList = PhCreateList(4);
#endif
}
示例15: PhCreateEMenu
/**
* Creates a root menu.
*/
PPH_EMENU PhCreateEMenu(
VOID
)
{
PPH_EMENU menu;
menu = PhAllocate(sizeof(PH_EMENU));
memset(menu, 0, sizeof(PH_EMENU));
menu->Items = PhCreateList(16);
return menu;
}