14#include <reactos/buildno.h>
86 NextEntry = ListHead->
Flink;
87 while (NextEntry != ListHead)
129 NextEntry = NextEntry->
Flink;
178 TRACE(
"Deleting desktop object 0x%p\n", pdesk);
287 ERR(
"Failed to allocate event!\n");
330 WCHAR BuildLabBuffer[256];
331 WCHAR VersionBuffer[256];
349 RtlInitEmptyUnicodeString(&BuildLabString,
351 sizeof(BuildLabBuffer));
353 RtlInitEmptyUnicodeString(&CSDVersionString,
358 VersionConfigurationTable,
364 BuildLabString.
Length = 0;
365 CSDVersionString.
Length = 0;
371 EndBuffer = VersionBuffer;
372 if ( CSDVersionString.
Length)
376 sizeof(VersionBuffer),
399 L"ReactOS Version %S %wZ (NT %u.%u Build %u%s)\n",
410 sizeof(VersionBuffer),
416 EndBuffer =
wcsrchr(pwszzVersion,
L'\n');
426 if (EndBuffer) *EndBuffer =
L'\n';
439 L"ReactOS Version %S\n"
441 L"Reporting NT %u.%u (Build %u%s)\n",
452 sizeof(VersionBuffer),
472 L"ReactOS Version %S %wZ\n",
486 while (*pwszzVersion)
488 EndBuffer =
wcschr(pwszzVersion,
L'\n');
489 if (!EndBuffer)
break;
490 pwszzVersion = EndBuffer;
572 OUT HWINSTA* phWinSta,
573 OUT HDESK* phDesktop)
576 HWINSTA hWinSta =
NULL, hWinStaDup =
NULL;
577 HDESK hDesktop =
NULL, hDesktopDup =
NULL;
589 HWINSTA hTempWinSta =
NULL;
605 if (!ppi)
TRACE(
"IntResolveDesktop: ppi is NULL!\n");
629 ERR(
"IntResolveDesktop: Could not reference window station 0x%p\n", ppi->
prpwinsta);
643 ERR(
"IntResolveDesktop: Could not reference desktop 0x%p\n", ppi->
rpdeskStartup);
651 *phDesktop = hDesktop;
656 RtlInitEmptyUnicodeString(&WinStaName,
NULL, 0);
657 RtlInitEmptyUnicodeString(&DesktopName,
NULL, 0);
664 if (DesktopPath->Buffer !=
NULL && DesktopPath->Length >
sizeof(
WCHAR))
666 DesktopName = *DesktopPath;
676 if (DesktopName.
Length > 0)
678 RtlInitEmptyUnicodeString(&WinStaName, DesktopPath->
Buffer,
679 DesktopPath->Length - DesktopName.
Length);
690 RtlInitEmptyUnicodeString(&WinStaName,
NULL, 0);
691 DesktopName = *DesktopPath;
695 TRACE(
"IntResolveDesktop: WinStaName:'%wZ' ; DesktopName:'%wZ'\n", &WinStaName, &DesktopName);
701 ERR(
"IntResolveDesktop: Failed to retrieve the process LUID, Status 0x%08lx\n",
Status);
721 ERR(
"IntResolveDesktop: Failed to obtain a handle to process 0x%p, Status 0x%08lx\n",
Process,
Status);
745 bUseDefaultWinSta =
TRUE;
752 WinStaName = WinSta0Name;
760 TRACE(
"IntResolveDesktop: Inherited window station is: 0x%p\n", hWinSta);
781 TRACE(
"IntResolveDesktop: Inherited desktop is: 0x%p\n", hDesktop);
807 ERR(
"IntResolveDesktop: Window station name length is too long.\n");
833 ERR(
"ZwAllocateVirtualMemory() failed, Status 0x%08lx\n",
Status);
849 ASSERT(bUseDefaultWinSta);
864 ERR(
"IntResolveDesktop: Failed to duplicate the window station handle, Status 0x%08lx\n",
Status);
870 hWinSta = hWinStaDup;
881 ASSERT(bUseDefaultWinSta);
888 (
PVOID*)&WinStaObject,
892 ERR(
"Failed to reference the inherited window station, Status 0x%08lx\n",
Status);
896 ASSERT(hWinSta == hWinStaDup);
904 ERR(
"Process LUID is: 0x%x-%x, inherited window station LUID is: 0x%x-%x\n",
906 WinStaObject->luidUser.HighPart, WinStaObject->luidUser.LowPart);
909 bInteractive = !(WinStaObject->Flags &
WSS_NOIO);
924 ERR(
"Impossible to build a valid window station name, Status 0x%08lx\n",
Status);
974 if (((!bUseDefaultWinSta || bInherit) &&
RtlEqualLuid(&ProcessLuid, &SystemLuid)) ||
978 bAccessAllowed =
TRUE;
985 bAccessAllowed =
TRUE;
994 if ( bInteractive || !bAccessAllowed)
1003 if (bInteractive == bAccessAllowed)
1016 ASSERT(hWinSta == hWinStaDup);
1020 hWinSta = hTempWinSta;
1023 if (bUseDefaultWinSta)
1025 if (hWinSta ==
NULL && !bInteractive)
1030 L"%wZ\\Service-0x%x-%x$",
1036 ERR(
"Impossible to build a valid window station name, Status 0x%08lx\n",
Status);
1050 ERR(
"Failed to create a security descriptor for service window station, Status 0x%08lx\n",
Status);
1076 ERR(
"Failed to create or open the non-interactive window station '%wZ', Status 0x%08lx\n",
1093 ERR(
"Impossible to build a valid desktop name, Status 0x%08lx\n",
Status);
1119 ERR(
"Failed to create or open the desktop '%wZ' on window station 0x%p, Status 0x%08lx\n",
1138 if (hDesktop !=
NULL)
1153 ERR(
"IntResolveDesktop: Failed to duplicate the desktop handle, Status 0x%08lx\n",
Status);
1159 hDesktop = hDesktopDup;
1164 if ((hWinSta !=
NULL) && (hDesktop ==
NULL))
1172 ERR(
"Impossible to build a valid desktop name, Status 0x%08lx\n",
Status);
1197 ERR(
"Failed to open the desktop '%wZ' on window station 0x%p, Status 0x%08lx\n",
1220 *phWinSta = hWinSta;
1221 *phDesktop = hDesktop;
1226 ERR(
"IntResolveDesktop(%wZ) failed, Status 0x%08lx\n", DesktopPath,
Status);
1269 TRACE(
"IntValidateDesktopHandle: handle:0x%p obj:0x%p access:0x%x Status:0x%lx\n",
1311 ERR(
"Unable to create a desktop handle\n");
1317 TRACE(
"Got handle: 0x%p\n", hDesk);
1329 TRACE(
"No active desktop\n");
1342 TRACE(
"No active desktop\n");
1345 if (NewQueue !=
NULL)
1349 TRACE(
"Message Queue already attached to another desktop!\n");
1370 ERR(
"ptiLastInput is CLEARED!!\n");
1396 TRACE(
"No active desktop\n");
1409 TRACE(
"No active desktop\n");
1422 TRACE(
"No active desktop\n");
1435 TRACE(
"No active desktop\n");
1447 ERR(
"Thread doesn't have a desktop\n");
1484 case WM_DISPLAYCHANGE:
1535 TRACE(
"DWP calling IDWP Msg %d\n",
Msg);
1556 ERR(
"UMWP calling IDWP\n");
1593 PWND DesktopObject = 0;
1661 DesktopWnd->
style &= ~WS_VISIBLE;
1676 ListEntry =
Desktop->ShellHookWindows.Flink;
1677 while (ListEntry != &
Desktop->ShellHookWindows)
1679 ListEntry = ListEntry->
Flink;
1683 if (!entries)
return NULL;
1690 ListEntry =
Desktop->ShellHookWindows.Flink;
1691 while (ListEntry != &
Desktop->ShellHookWindows)
1694 ListEntry = ListEntry->
Flink;
1725 TRACE(
"IntShellHookNotify: No desktop!\n");
1741 TRACE(
"Sending notify\n");
1775 TRACE(
"IntRegisterShellHookWindow\n");
1816 ListEntry =
Desktop->ShellHookWindows.Flink;
1817 while (ListEntry != &
Desktop->ShellHookWindows)
1820 ListEntry = ListEntry->
Flink;
1854 static WCHAR s_wszSafeMode[] =
L"Safe Mode";
1857 HBRUSH DesktopBrush, PreviousBrush;
1886 int scaledWidth, scaledHeight;
1887 int wallpaperX, wallpaperY, wallpaperWidth, wallpaperHeight;
1896 int scaleNum, scaleDen;
1932 wallpaperY = (((scaledHeight - sz.
cy) *
gspv.
cyWallpaper) / (2 * scaledHeight));
1948 x = (sz.
cx - scaledWidth) / 2;
1949 y = (sz.
cy - scaledHeight) / 2;
1959 if (hWallpaperDC !=
NULL)
2091 static WCHAR wszzVersion[1024] =
L"\0";
2095 static POLYTEXTW VerStrs[4] = {{0},{0},{0},{0}};
2136 crText = pdc->eboFill.ulRGBColor;
2141 crText =
RGB(0, 0, 0);
2147 crText =
RGB(0, 0, 0);
2149 crText =
RGB(255, 255, 255);
2154 crText =
RGB(255, 255, 255);
2170 PWCHAR pstr = wszzVersion;
2175 pstr += (VerStrs[
i].
n + 1);
2188 LONG TotalHeight = 0;
2197 if (!VerStrs[
i].
lpstr || !*VerStrs[
i].
lpstr || (VerStrs[
i].
n == 0))
2202 TotalHeight +=
Size.cy;
2208 TotalHeight =
min(TotalHeight,
Rect.bottom);
2214 if (!VerStrs[
i].
lpstr || !*VerStrs[
i].
lpstr || (VerStrs[
i].
n == 0))
2217 TotalHeight -= VerStrs[
i].
y;
2220 Rect.bottom - TotalHeight - 5,
2285 TRACE(
"UserInitializeDesktop desktop 0x%p with name %wZ\n", pdesk, DesktopName);
2315 &DesktopHeapSystemBase,
2319 ERR(
"Failed to create desktop heap!\n");
2330 ERR(
"Failed to create the DESKTOP structure!\n");
2389 OUT HDESK* phDesktop,
2409 TRACE(
"Enter IntCreateDesktop\n");
2437 ERR(
"ObOpenObjectByName failed to open/create desktop\n");
2458 ERR(
"Failed to reference desktop object\n");
2491 ERR(
"Failed to create desktop window for the new desktop\n");
2513 Cs.
cx = Cs.
cy = 100;
2521 ERR(
"Failed to create message window for the new desktop\n");
2551 ptiCurrent->
TIF_flags &= ~TIF_DISABLEHOOKS;
2555 TRACE(
"Leave IntCreateDesktop, Status 0x%08lx\n",
Status);
2576 TRACE(
"Enter NtUserCreateDesktop\n");
2588 ERR(
"IntCreateDesktop failed, Status 0x%08lx\n",
Status);
2596 TRACE(
"Leave NtUserCreateDesktop, ret=0x%p\n", Ret);
2643 ERR(
"Failed to open desktop\n");
2669 ERR(
"Tried to open input desktop from non interactive winsta!\n");
2688 ERR(
"Failed to open input desktop object\n");
2730 TRACE(
"NtUserOpenInputDesktop returning 0x%p\n", hdesk);
2764 TRACE(
"NtUserCloseDesktop(0x%p) called\n", hDesktop);
2769 ERR(
"Attempted to close thread desktop\n");
2777 ERR(
"Validation of desktop handle 0x%p failed\n", hDesktop);
2786 ERR(
"Failed to close desktop handle 0x%p\n", hDesktop);
2794 TRACE(
"Leave NtUserCloseDesktop, ret=%i\n", Ret);
2820 TRACE(
"Enter NtUserPaintDesktop\n");
2824 TRACE(
"Leave NtUserPaintDesktop, ret=%i\n", Ret);
2869 OUT HWINSTA* phWinSta)
2873 HWINSTA hWinSta =
NULL;
2874 HDESK hDesktop =
NULL;
2915 &CapturedDesktopPath,
2921 ERR(
"IntResolveDesktop failed, Status 0x%08lx\n",
Status);
2929 *phWinSta = hWinSta;
2976 BOOL bRedrawDesktop;
2980 TRACE(
"Enter NtUserSwitchDesktop(0x%p)\n", hdesk);
2985 ERR(
"Validation of desktop handle 0x%p failed\n", hdesk);
2992 ERR(
"NtUserSwitchDesktop called for a desktop of a different session\n");
2999 WARN(
"NtUserSwitchDesktop called for active desktop\n");
3012 ERR(
"Switching desktop 0x%p denied because the window station is locked!\n", hdesk);
3019 ERR(
"Switching desktop 0x%p denied because desktop doesn't belong to the interactive winsta!\n", hdesk);
3029 bRedrawDesktop =
FALSE;
3035 bRedrawDesktop =
TRUE;
3056 TRACE(
"Leave NtUserSwitchDesktop, ret=%i\n", Ret);
3079 TRACE(
"Enter NtUserGetThreadDesktop\n");
3096 else if (hConsoleDesktop)
3103 hDesk = hConsoleDesktop;
3115 ERR(
"Desktop information of thread 0x%x broken!?\n",
dwThreadId);
3143 (
PVOID*)&DesktopObject,
3167 ERR(
"Could not retrieve or access desktop for thread 0x%x\n",
dwThreadId);
3172 TRACE(
"Leave NtUserGetThreadDesktop, hDesk = 0x%p\n", hDesk);
3184 TRACE(
"IntUnmapDesktopView called for desktop object %p\n", pdesk);
3194 HeapMapping = *PrevLink;
3195 while (HeapMapping !=
NULL)
3199 if (--HeapMapping->
Count == 0)
3201 *PrevLink = HeapMapping->
Next;
3203 TRACE(
"ppi 0x%p unmapped heap of desktop 0x%p\n", ppi, pdesk);
3214 PrevLink = &HeapMapping->
Next;
3215 HeapMapping = HeapMapping->
Next;
3231 TRACE(
"IntMapDesktopView called for desktop object 0x%p\n", pdesk);
3241 HeapMapping = *PrevLink;
3242 while (HeapMapping !=
NULL)
3246 HeapMapping->
Count++;
3250 PrevLink = &HeapMapping->
Next;
3251 HeapMapping = HeapMapping->
Next;
3268 ERR(
"Failed to map desktop\n");
3272 TRACE(
"ppi 0x%p mapped heap of desktop 0x%p\n", ppi, pdesk);
3276 if (HeapMapping ==
NULL)
3279 ERR(
"UserHeapAlloc() failed!\n");
3287 HeapMapping->
Count = 1;
3288 *PrevLink = HeapMapping;
3307 TRACE(
"IntSetThreadDesktop hDesktop:0x%p, FOF:%i\n",hDesktop, FreeOnFailure);
3313 if (hDesktop !=
NULL)
3319 ERR(
"Validation of desktop handle 0x%p failed\n", hDesktop);
3323 if (pti->
rpdesk == pdesk)
3336 ERR(
"Attempted to change thread desktop although the thread has windows!\n");
3354 ERR(
"Failed to map desktop heap!\n");
3361 if (pctiNew ==
NULL)
3363 ERR(
"Failed to allocate new pcti\n");
3397 ERR(
"The process 0x%p '%s' didn't have an assigned startup desktop before, assigning it now!\n",
3398 pti->
ppi->peProcess, pti->
ppi->peProcess->ImageFileName);
3409 ERR(
"Failed to move process classes to shared heap!\n");
3422 pctiOld = pti->
pcti;
3430 pti->
hdesk = hDesktop;
3432 pti->
pcti = pctiNew;
3439 if (pctiOld !=
NULL)
3462 if (pdeskOld !=
NULL)
3475 TRACE(
"IntSetThreadDesktop: pti 0x%p ppi 0x%p switched from object 0x%p to 0x%p\n", pti, pti->
ppi, pdeskOld, pdesk);
NTSTATUS NTAPI MmUnmapViewInSessionSpace(IN PVOID MappedBase)
NTSTATUS NTAPI MmUnmapViewOfSection(IN PEPROCESS Process, IN PVOID BaseAddress)
#define OBJ_NAME_PATH_SEPARATOR
#define UlongToHandle(ul)
#define DBG_DEFAULT_CHANNEL(ch)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
_Inout_ PFCB _Inout_ PUNICODE_STRING RemainingName
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
COLORREF FASTCALL IntGdiSetTextColor(HDC hDC, COLORREF color)
UINT FASTCALL IntGdiSetTextAlign(HDC hDC, UINT Mode)
INT FASTCALL IntGdiSetBkMode(HDC hDC, INT backgroundMode)
HDC FASTCALL IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC)
FORCEINLINE PDC DC_LockDc(HDC hdc)
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INVALID_FUNCTION
#define NT_SUCCESS(StatCode)
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
#define ERROR_INVALID_PARAMETER
#define ERROR_ACCESS_DENIED
static const WCHAR Message[]
#define InterlockedExchangePointer(Target, Value)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
UNICODE_STRING * PUNICODE_STRING
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeSetEvent(pEvt, foo, foo2)
#define InitializeListHead(ListHead)
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
PUSER_MESSAGE_QUEUE gpqForeground
PUSER_MESSAGE_QUEUE gpqForegroundPrev
BOOL APIENTRY GreExtTextOutW(IN HDC hDC, IN INT XStart, IN INT YStart, IN UINT fuOptions, IN OPTIONAL PRECTL lprc, IN LPCWSTR String, IN INT Count, IN OPTIONAL LPINT Dx, IN DWORD dwCodePage)
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define ISITHOOKED(HookId)
_Check_return_ _CRTIMP int __cdecl _scwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format,...)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define PROCESS_QUERY_INFORMATION
#define UserHMGetHandle(obj)
struct _DESKTOPINFO DESKTOPINFO
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
#define EXCEPTION_EXECUTE_HANDLER
_In_ BOOL _In_ HANDLE hProcess
#define ExFreePoolWithTag(_P, _T)
#define DESKTOP_ALL_ACCESS
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define InitializeObjectAttributes(p, n, a, r, s)
PCURICON_OBJECT FASTCALL UserSetCursor(PCURICON_OBJECT NewCursor, BOOL ForceChange)
#define IntReferenceMessageQueue(MsgQueue)
#define IntDereferenceMessageQueue(MsgQueue)
struct _USER_MESSAGE_QUEUE * PUSER_MESSAGE_QUEUE
_In_ HANDLE ProcessHandle
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
_In_ HANDLE _In_opt_ HANDLE _Out_opt_ PHANDLE _In_ ACCESS_MASK _In_ ULONG HandleAttributes
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define RTL_REGISTRY_WINDOWS_NT
#define RTL_QUERY_REGISTRY_DIRECT
#define HEAP_NO_SERIALIZE
_In_ ULONG _In_ ULONG Offset
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateCompatibleDC(_In_opt_ HDC hdc)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiBitBlt(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ DWORD rop4, _In_ DWORD crBackColor, _In_ FLONG fl)
__kernel_entry W32KAPI HBRUSH APIENTRY NtGdiSelectBrush(_In_ HDC hdc, _In_ HBRUSH hbrush)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiStretchBlt(_In_ HDC hdcDst, _In_ INT xDst, _In_ INT yDst, _In_ INT cxDst, _In_ INT cyDst, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ INT cxSrc, _In_ INT cySrc, _In_ DWORD dwRop, _In_ DWORD dwBackColor)
__kernel_entry W32KAPI HBITMAP APIENTRY NtGdiSelectBitmap(_In_ HDC hdc, _In_ HBITMAP hbm)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiPatBlt(_In_ HDC hdcDest, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_ DWORD dwRop)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiDeleteObjectApp(_In_ HANDLE hobj)
__kernel_entry W32KAPI HFONT APIENTRY NtGdiSelectFont(_In_ HDC hdc, _In_ HFONT hf)
PVOID NTAPI PsGetProcessWin32Process(PEPROCESS Process)
POBJECT_TYPE PsProcessType
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
HANDLE NTAPI PsGetCurrentProcessId(VOID)
ULONG NTAPI PsGetCurrentProcessSessionId(VOID)
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
#define STATUS_OBJECT_NAME_EXISTS
#define STATUS_NAME_TOO_LONG
NTSTRSAFEAPI RtlStringCbCopyW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
NTSTRSAFEAPI RtlStringCchCatW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
NTSTRSAFEVAPI RtlStringCbPrintfExW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTRSAFEAPI RtlStringCbCopyNW(_Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToCopy) STRSAFE_LPCWSTR pszSrc, _In_ size_t cbToCopy)
LRESULT FASTCALL IntDefWindowProc(PWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi)
LRESULT APIENTRY co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam)
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
PWINSTATION_OBJECT InputWindowStation
UNICODE_STRING gustrWindowStationsDir
NTSTATUS FASTCALL IntCreateWindowStation(OUT HWINSTA *phWinSta, IN POBJECT_ATTRIBUTES ObjectAttributes, IN KPROCESSOR_MODE AccessMode, IN KPROCESSOR_MODE OwnerMode, IN ACCESS_MASK dwDesiredAccess, DWORD Unknown2, DWORD Unknown3, DWORD Unknown4, DWORD Unknown5, DWORD Unknown6)
BOOL g_AlwaysDisplayVersion
VOID FASTCALL UserLeave(VOID)
VOID FASTCALL UserEnterExclusive(VOID)
BOOL FASTCALL UserIsEnteredExclusive(VOID)
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
BOOLEAN NTAPI ObFindHandleForObject(IN PEPROCESS Process, IN PVOID Object, IN POBJECT_TYPE ObjectType, IN POBJECT_HANDLE_INFORMATION HandleInformation, OUT PHANDLE Handle)
NTSTATUS NTAPI ObOpenObjectByPointer(IN PVOID Object, IN ULONG HandleAttributes, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PHANDLE Handle)
NTSTATUS NTAPI ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext, OUT PHANDLE Handle)
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
VOID NTAPI KeDetachProcess(VOID)
VOID NTAPI KeAttachProcess(IN PKPROCESS Process)
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
#define IntSysCreateRectpRgnIndirect(prc)
static __inline NTSTATUS ProbeAndCaptureUnicodeString(OUT PUNICODE_STRING Dest, IN KPROCESSOR_MODE CurrentMode, IN const UNICODE_STRING *UnsafeSrc)
static __inline VOID ReleaseCapturedUnicodeString(IN PUNICODE_STRING CapturedString, IN KPROCESSOR_MODE CurrentMode)
NTSTATUS NTAPI MmMapViewOfSection(IN PVOID SectionObject, IN PEPROCESS Process, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
PULONG MinorVersion OPTIONAL
base of all file and directory entries
PCLIENTTHREADINFO pClientThreadInfo
LIST_ENTRY aphkStart[NB_HOOKS]
struct _USER_MESSAGE_QUEUE * ActiveMessageQueue
struct _WINSTATION_OBJECT * rpwinstaParent
LIST_ENTRY ShellHookWindows
struct _LIST_ENTRY * Flink
GENERIC_MAPPING GenericMapping
ULONG DefaultNonPagedPoolCharge
OBJECT_TYPE_INITIALIZER TypeInfo
ULONG dwOSVersionInfoSize
W32HEAP_USER_MAPPING HeapMappings
struct _DESKTOP * rpdeskStartup
struct _WINSTATION_OBJECT * prpwinsta
WALLPAPER_MODE WallpaperMode
struct _DESKTOPINFO * pDeskInfo
struct _CLIENTINFO * pClientInfo
struct _CLIENTTHREADINFO * pcti
LIST_ENTRY WindowListHead
struct _USER_MESSAGE_QUEUE * MessageQueue
struct _DESKTOP * Desktop
struct _W32HEAP_USER_MAPPING * Next
struct _DESKTOP * ActiveDesktop
LIST_ENTRY DesktopListHead
#define RTL_CONSTANT_STRING(s)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_ACCESS_DENIED
#define STATUS_UNSUCCESSFUL
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_OBJECT_NAME_NOT_FOUND
#define ALIGN_UP(size, type)
HDC FASTCALL IntBeginPaint(PWND Window, PPAINTSTRUCT Ps)
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
BOOL FASTCALL IntEndPaint(PWND Wnd, PPAINTSTRUCT Ps)
VOID FASTCALL IntInvalidateWindows(PWND Wnd, PREGION Rgn, ULONG Flags)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
RTL_ATOM FASTCALL IntAddAtom(LPWSTR AtomName)
PWND FASTCALL UserGetWindowObject(HWND hWnd)
PWND FASTCALL IntGetWindowObject(HWND hWnd)
HDC FASTCALL UserGetWindowDC(PWND Wnd)
BOOLEAN co_UserDestroyWindow(PVOID Object)
PWIN32HEAP UserCreateHeap(OUT PVOID *SectionObject, IN OUT PVOID *SystemBase, IN SIZE_T HeapSize)
static __inline PVOID UserHeapAlloc(SIZE_T Bytes)
static __inline BOOL UserHeapFree(PVOID lpMem)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
POBJECT_TYPE ExDesktopObjectType
POBJECT_TYPE ExWindowStationObjectType
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
HFONT FASTCALL GreCreateFontIndirectW(LOGFONTW *lplf)
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
FORCEINLINE VOID RECTL_vOffsetRect(_Inout_ RECTL *prcl, _In_ INT cx, _In_ INT cy)
VOID FASTCALL REGION_Delete(PREGION pRgn)
BOOL FASTCALL GreGetTextExtentW(HDC hDC, LPCWSTR lpwsz, INT cwc, LPSIZE psize, UINT flOpts)
BOOL IntCheckProcessDesktopClasses(IN PDESKTOP Desktop, IN BOOL FreeOnFailure)
PCLS IntGetAndReferenceClass(PUNICODE_STRING ClassName, HINSTANCE hInstance, BOOL bDesktopThread)
BOOL FASTCALL UserRegisterSystemClasses(VOID)
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
static NTSTATUS IntMapDesktopView(IN PDESKTOP pdesk)
HDESK APIENTRY NtUserOpenInputDesktop(DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
BOOL APIENTRY NtUserCloseDesktop(HDESK hDesktop)
PDESKTOP FASTCALL IntGetActiveDesktop(VOID)
DWORD gdwDesktopSectionSize
PTHREADINFO gptiDesktopThread
BOOL APIENTRY NtUserSetThreadDesktop(HDESK hDesktop)
HDESK APIENTRY NtUserOpenDesktop(POBJECT_ATTRIBUTES ObjectAttributes, DWORD dwFlags, ACCESS_MASK dwDesiredAccess)
NTSTATUS FASTCALL IntCreateDesktop(OUT HDESK *phDesktop, IN POBJECT_ATTRIBUTES ObjectAttributes, IN KPROCESSOR_MODE AccessMode, IN PUNICODE_STRING lpszDesktopDevice OPTIONAL, IN LPDEVMODEW lpdmw OPTIONAL, IN DWORD dwFlags, IN ACCESS_MASK dwDesiredAccess)
HWND FASTCALL IntGetCurrentThreadDesktopWindow(VOID)
NTSTATUS NTAPI IntDesktopOkToClose(_In_ PVOID Parameters)
NTSTATUS NTAPI InitDesktopImpl(VOID)
VOID APIENTRY UserRedrawDesktop(VOID)
PKEVENT gpDesktopThreadStartedEvent
PWND FASTCALL UserGetDesktopWindow(VOID)
BOOL IntDeRegisterShellHookWindow(HWND hWnd)
HWND FASTCALL IntGetMessageWindow(VOID)
NTSTATUS FASTCALL IntHideDesktop(PDESKTOP Desktop)
VOID NTAPI DesktopThreadMain(VOID)
HDESK UserOpenInputDesktop(DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
HDESK FASTCALL IntGetDesktopObjectHandle(PDESKTOP DesktopObject)
HDESK APIENTRY NtUserGetThreadDesktop(DWORD dwThreadId, HDESK hConsoleDesktop)
VOID FASTCALL IntSetFocusMessageQueue(PUSER_MESSAGE_QUEUE NewQueue)
NTSTATUS FASTCALL co_IntShowDesktop(PDESKTOP Desktop, ULONG Width, ULONG Height, BOOL bRedraw)
HWND FASTCALL IntGetDesktopWindow(VOID)
NTSTATUS NTAPI IntDesktopObjectClose(_In_ PVOID Parameters)
BOOL IntRegisterShellHookWindow(HWND hWnd)
NTSTATUS FASTCALL IntValidateDesktopHandle(HDESK Desktop, KPROCESSOR_MODE AccessMode, ACCESS_MASK DesiredAccess, PDESKTOP *Object)
static VOID IntFreeDesktopHeap(IN PDESKTOP pdesk)
PUSER_MESSAGE_QUEUE FASTCALL IntGetFocusMessageQueue(VOID)
HDESK NTAPI NtUserResolveDesktop(IN HANDLE ProcessHandle, IN PUNICODE_STRING DesktopPath, IN BOOL bInherit, OUT HWINSTA *phWinSta)
NTSTATUS APIENTRY IntDesktopObjectParse(IN PVOID ParseObject, IN PVOID ObjectType, IN OUT PACCESS_STATE AccessState, IN KPROCESSOR_MODE AccessMode, IN ULONG Attributes, IN OUT PUNICODE_STRING CompleteName, IN OUT PUNICODE_STRING RemainingName, IN OUT PVOID Context OPTIONAL, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL, OUT PVOID *Object)
BOOL APIENTRY NtUserPaintDesktop(HDC hDC)
BOOL FASTCALL DesktopWindowProc(PWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
VOID co_IntShellHookNotify(WPARAM Message, WPARAM wParam, LPARAM lParam)
BOOL APIENTRY NtUserSwitchDesktop(HDESK hdesk)
NTSTATUS FASTCALL IntResolveDesktop(IN PEPROCESS Process, IN PUNICODE_STRING DesktopPath, IN BOOL bInherit, OUT HWINSTA *phWinSta, OUT HDESK *phDesktop)
BOOL FASTCALL IntPaintDesktop(HDC hDC)
PWND FASTCALL IntGetThreadDesktopWindow(PTHREADINFO pti)
static NTSTATUS GetSystemVersionString(OUT PWSTR pwszzVersion, IN SIZE_T cchDest, IN BOOLEAN InSafeMode, IN BOOLEAN AppendNtSystemRoot)
BOOL FASTCALL UserMessageWindowProc(PWND pwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
NTSTATUS NTAPI IntDesktopObjectOpen(_In_ PVOID Parameters)
DWORD gdwWinlogonSectionSize
HDC FASTCALL UserGetDesktopDC(ULONG DcType, BOOL bAltDc, BOOL ValidatehWnd)
NTSTATUS NTAPI IntDesktopObjectDelete(_In_ PVOID Parameters)
HDESK APIENTRY NtUserCreateDesktop(POBJECT_ATTRIBUTES ObjectAttributes, PUNICODE_STRING lpszDesktopDevice, LPDEVMODEW lpdmw, DWORD dwFlags, ACCESS_MASK dwDesiredAccess)
PDESKTOP gpdeskInputDesktop
BOOL IntSetThreadDesktop(IN HDESK hDesktop, IN BOOL FreeOnFailure)
static HWND *FASTCALL UserBuildShellHookHwndList(PDESKTOP Desktop)
PWND FASTCALL UserGetMessageWindow(VOID)
static NTSTATUS IntUnmapDesktopView(IN PDESKTOP pdesk)
static NTSTATUS UserInitializeDesktop(PDESKTOP pdesk, PUNICODE_STRING DesktopName, PWINSTATION_OBJECT pwinsta)
PWND FASTCALL co_GetDesktopWindow(PWND pWnd)
struct _DESKTOP * PDESKTOP
static __inline ULONG_PTR DesktopHeapGetUserDelta(VOID)
static __inline PVOID DesktopHeapAlloc(IN PDESKTOP Desktop, IN SIZE_T Bytes)
static __inline BOOL DesktopHeapFree(IN PDESKTOP Desktop, IN PVOID lpMem)
LRESULT FASTCALL IntDispatchMessage(PMSG pMsg)
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
BOOL APIENTRY co_IntGetPeekMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, UINT RemoveMsg, BOOL bGMSG)
LONG NTAPI UserGetSystemMetrics(ULONG Index)
NTSTATUS GetProcessLuid(IN PETHREAD Thread OPTIONAL, IN PEPROCESS Process OPTIONAL, OUT PLUID Luid)
PTHREADINFO FASTCALL IntTID2PTI(HANDLE id)
PMONITOR NTAPI UserGetPrimaryMonitor(VOID)
BOOL FASTCALL UserDereferenceObject(PVOID Object)
NTSTATUS NTAPI IntAssignDesktopSecurityOnParse(_In_ PWINSTATION_OBJECT WinSta, _In_ PDESKTOP Desktop, _In_ PACCESS_STATE AccessState)
Assigns a security descriptor to the desktop object during a desktop object parse procedure.
NTSTATUS NTAPI IntCreateServiceSecurity(_Out_ PSECURITY_DESCRIPTOR *ServiceSd)
Creates a security descriptor for the service.
VOID IntFreeSecurityBuffer(_In_ PVOID Buffer)
Frees an allocated security buffer from UM memory that is been previously allocated by IntAllocateSec...
#define WINSTA_ACCESS_ALL
BOOL g_PaintDesktopVersion
BOOL FASTCALL UserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
LONG FASTCALL co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
PWND FASTCALL IntCreateWindow(CREATESTRUCTW *Cs, PLARGE_STRING WindowName, PCLS Class, PWND ParentWindow, PWND OwnerWindow, PVOID acbiBuffer, PDESKTOP pdeskCreated, DWORD dwVer)
struct _WINSTATION_OBJECT * PWINSTATION_OBJECT
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
ENGAPI ULONG APIENTRY EngGetLastError(VOID)
ENGAPI INT APIENTRY EngMulDiv(_In_ INT a, _In_ INT b, _In_ INT c)
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
#define ERROR_INVALID_WINDOW_HANDLE
#define SM_CYVIRTUALSCREEN
#define WM_WINDOWPOSCHANGING
#define WM_SYSCOLORCHANGE
#define SM_CXVIRTUALSCREEN
struct _WINDOWPOS * PWINDOWPOS
#define SM_XVIRTUALSCREEN
#define SM_YVIRTUALSCREEN
_In_ PVOID _Out_opt_ PULONG_PTR _Outptr_opt_ PCUNICODE_STRING * ObjectName
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
_In_ ACCESS_MASK _In_opt_ POBJECT_TYPE _In_ KPROCESSOR_MODE _Out_ PVOID _Out_opt_ POBJECT_HANDLE_INFORMATION HandleInformation
#define ObDereferenceObject
#define ObReferenceObject
#define DUPLICATE_SAME_ACCESS
#define PsGetCurrentProcess
#define RtlEqualLuid(Luid1, Luid2)
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE AccessState
#define ZwCurrentProcess()