31 static PVOID imageBase = NULL;
34 imageBase = GetModuleHandle(L
"ProcessHacker.exe");
36 return (PVOID)GetProcAddress(imageBase, Name);
40 _In_ PWSTR OriginalName,
41 _Inout_updates_(256) PWCHAR Buffer,
46 SIZE_T originalNameLength;
49 if (NtCurrentPeb()->SessionId != 0)
51 memcpy(Buffer, L
"\\Sessions\\", 10 *
sizeof(WCHAR));
52 _ultow(NtCurrentPeb()->SessionId, Buffer + 10, 10);
53 length = wcslen(Buffer);
54 originalNameLength = wcslen(OriginalName);
55 memcpy(Buffer + length, OriginalName, (originalNameLength + 1) *
sizeof(WCHAR));
56 length += originalNameLength;
58 ObjectName->Buffer = Buffer;
59 ObjectName->MaximumLength = (ObjectName->Length = (USHORT)(length *
sizeof(WCHAR))) +
sizeof(WCHAR);
74 GetWindowRect(hWnd, &rect);
75 hdc = GetWindowDC(hWnd);
79 ULONG penWidth = GetSystemMetrics(SM_CXBORDER) * 3;
89 pen = CreatePen(PS_INSIDEFRAME, penWidth, RGB(0x00, 0x00, 0x00));
90 SelectObject(hdc, pen);
92 brush = GetStockObject(NULL_BRUSH);
93 SelectObject(hdc, brush);
96 Rectangle(hdc, 0, 0, rect.right - rect.left, rect.bottom - rect.top);
101 RestoreDC(hdc, oldDc);
102 ReleaseDC(hWnd, hdc);