28 typedef struct _HANDLE_PROPERTIES_CONTEXT
41 static NTSTATUS PhpDuplicateHandleFromProcess(
43 _In_ ACCESS_MASK DesiredAccess,
44 _In_opt_ PVOID Context
62 context->HandleItem->Handle,
74 context->HandleItem->Handle,
83 NtClose(processHandle);
89 _In_ HWND ParentWindowHandle,
94 PROPSHEETHEADER propSheetHeader = {
sizeof(propSheetHeader) };
95 PROPSHEETPAGE propSheetPage;
96 HPROPSHEETPAGE pages[16];
100 ULONG numberOfAccessEntries;
103 context.HandleItem = HandleItem;
105 propSheetHeader.dwFlags =
109 propSheetHeader.hwndParent = ParentWindowHandle;
110 propSheetHeader.pszCaption = L
"Handle";
111 propSheetHeader.nPages = 0;
112 propSheetHeader.nStartPage = 0;
113 propSheetHeader.phpage = pages;
116 memset(&propSheetPage, 0,
sizeof(PROPSHEETPAGE));
117 propSheetPage.dwSize =
sizeof(PROPSHEETPAGE);
120 propSheetPage.lParam = (LPARAM)&context;
121 pages[propSheetHeader.nPages++] = CreatePropertySheetPage(&propSheetPage);
124 if (!HandleItem->TypeName)
131 PhpDuplicateHandleFromProcess,
138 PhpDuplicateHandleFromProcess,
145 PhpDuplicateHandleFromProcess,
153 PhpDuplicateHandleFromProcess,
160 PhpDuplicateHandleFromProcess,
167 PhpDuplicateHandleFromProcess,
174 PhpDuplicateHandleFromProcess,
181 PhpDuplicateHandleFromProcess,
188 stdObjectSecurity.
OpenObject = PhpDuplicateHandleFromProcess;
189 stdObjectSecurity.
ObjectType = HandleItem->TypeName->Buffer;
190 stdObjectSecurity.
Context = &context;
192 if (
PhGetAccessEntries(HandleItem->TypeName->Buffer, &accessEntries, &numberOfAccessEntries))
200 numberOfAccessEntries
213 objectProperties.
Parameter = &propertiesContext;
216 objectProperties.
Pages = pages;
223 PropertySheet(&propSheetHeader);
237 LPPROPSHEETPAGE propSheetPage = (LPPROPSHEETPAGE)lParam;
240 ULONG numberOfAccessEntries;
241 HANDLE processHandle;
243 BOOLEAN haveBasicInfo =
FALSE;
248 SetDlgItemText(hwndDlg,
IDC_TYPE, context->HandleItem->TypeName->Buffer);
249 SetDlgItemText(hwndDlg,
IDC_ADDRESS, context->HandleItem->ObjectString);
252 context->HandleItem->TypeName->Buffer,
254 &numberOfAccessEntries
261 context->HandleItem->GrantedAccess,
263 numberOfAccessEntries
266 if (accessString->
Length != 0)
270 context->HandleItem->GrantedAccessString,
278 SetDlgItemText(hwndDlg,
IDC_GRANTED_ACCESS, context->HandleItem->GrantedAccessString);
287 SetDlgItemText(hwndDlg,
IDC_GRANTED_ACCESS, context->HandleItem->GrantedAccessString);
298 context->HandleItem->Handle,
308 SetDlgItemInt(hwndDlg,
IDC_PAGED, basicInfo.PagedPoolCharge,
FALSE);
311 haveBasicInfo =
TRUE;
314 NtClose(processHandle);
321 SetDlgItemText(hwndDlg,
IDC_PAGED, L
"Unknown");
333 LPNMHDR header = (LPNMHDR)lParam;
335 switch (header->code)
337 case PSN_QUERYINITIALFOCUS: