ReactOS  0.4.15-dev-3165-gdf6fff7
ntuser.c File Reference
#include <win32k.h>
Include dependency graph for ntuser.c:

Go to the source code of this file.

Functions

 DBG_DEFAULT_CHANNEL (UserMisc)
 
BOOL FASTCALL RegisterControlAtoms (VOID)
 
static NTSTATUS FASTCALL InitUserAtoms (VOID)
 
NTSTATUS NTAPI InitUserImpl (VOID)
 
NTSTATUS NTAPI InitVideo (VOID)
 
NTSTATUS NTAPI UserInitialize (VOID)
 
NTSTATUS APIENTRY NtUserInitialize (DWORD dwWinVersion, HANDLE hPowerRequestEvent, HANDLE hMediaRequestEvent)
 
BOOL FASTCALL UserIsEntered (VOID)
 
BOOL FASTCALL UserIsEnteredExclusive (VOID)
 
VOID FASTCALL CleanupUserImpl (VOID)
 
VOID FASTCALL UserEnterShared (VOID)
 
VOID FASTCALL UserEnterExclusive (VOID)
 
VOID FASTCALL UserLeave (VOID)
 

Variables

PTHREADINFO gptiCurrent = NULL
 
PPROCESSINFO gppiInputProvider = NULL
 
BOOL g_AlwaysDisplayVersion = FALSE
 
ERESOURCE UserLock
 
ATOM AtomMessage
 
ATOM AtomWndObj
 
ATOM AtomLayer
 
ATOM AtomFlashWndState
 
ATOM AtomDDETrack
 
ATOM AtomQOS
 
HINSTANCE hModClient = NULL
 
BOOL ClientPfnInit = FALSE
 
ATOM gaGuiConsoleWndClass
 

Function Documentation

◆ CleanupUserImpl()

VOID FASTCALL CleanupUserImpl ( VOID  )

Definition at line 234 of file ntuser.c.

235 {
237 }
NTSTATUS NTAPI ExDeleteResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1456
ERESOURCE UserLock
Definition: ntuser.c:18

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( UserMisc  )

◆ InitUserAtoms()

static NTSTATUS FASTCALL InitUserAtoms ( VOID  )
static

Definition at line 33 of file ntuser.c.

34 {
36 
37  gpsi->atomSysClass[ICLS_MENU] = 32768;
38  gpsi->atomSysClass[ICLS_DESKTOP] = 32769;
39  gpsi->atomSysClass[ICLS_DIALOG] = 32770;
40  gpsi->atomSysClass[ICLS_SWITCH] = 32771;
43 
44  /* System Message Atom */
45  AtomMessage = IntAddGlobalAtom(L"Message", TRUE);
46  gpsi->atomSysClass[ICLS_HWNDMESSAGE] = AtomMessage;
47 
48  /* System Context Help Id Atom */
50 
53 
54  gpsi->atomFrostedWindowProp = IntAddGlobalAtom(L"SysFrostedWindow", TRUE);
55 
57  AtomQOS = IntAddGlobalAtom(L"SysQOS", TRUE);
58 
59  /*
60  * FIXME: AddPropW uses the global kernel atom table, thus leading to conflicts if we use
61  * the win32k atom table for this one. What is the right thing to do ?
62  */
63  // AtomWndObj = IntAddGlobalAtom(L"SysWNDO", TRUE);
64  NtAddAtom(L"SysWNDO", 14, &AtomWndObj);
65 
66  AtomLayer = IntAddGlobalAtom(L"SysLayer", TRUE);
67  AtomFlashWndState = IntAddGlobalAtom(L"FlashWState", TRUE);
68 
69  return STATUS_SUCCESS;
70 }
#define ICLS_ICONTITLE
Definition: ntuser.h:903
ATOM atomFrostedWindowProp
Definition: ntuser.h:1030
#define TRUE
Definition: types.h:120
#define ICLS_DESKTOP
Definition: ntuser.h:899
ATOM atomContextHelpIdProp
Definition: ntuser.h:1029
PSERVERINFO gpsi
Definition: main.c:27
#define ICLS_DIALOG
Definition: ntuser.h:900
#define ICLS_TOOLTIPS
Definition: ntuser.h:904
BOOL FASTCALL RegisterControlAtoms(VOID)
Definition: class.c:396
#define ICLS_SWITCH
Definition: ntuser.h:902
ATOM AtomDDETrack
Definition: ntuser.c:23
NTSTATUS NTAPI NtAddAtom(IN PWSTR AtomName, IN ULONG AtomNameLength, OUT PRTL_ATOM Atom)
Definition: atom.c:88
static const WCHAR L[]
Definition: oid.c:1250
ATOM atomIconProp
Definition: ntuser.h:1028
ATOM AtomWndObj
Definition: ntuser.c:20
ATOM AtomMessage
Definition: ntuser.c:19
ATOM atomIconSmProp
Definition: ntuser.h:1027
ATOM AtomLayer
Definition: ntuser.c:21
ATOM AtomQOS
Definition: ntuser.c:24
#define STATUS_SUCCESS
Definition: shellext.h:65
#define ICLS_MENU
Definition: ntuser.h:901
ATOM AtomFlashWndState
Definition: ntuser.c:22
RTL_ATOM FASTCALL IntAddGlobalAtom(LPWSTR lpBuffer, BOOL PinAtom)
Definition: useratom.c:62
ATOM atomSysClass[ICLS_NOTUSED+1]
Definition: ntuser.h:1022

Referenced by InitUserImpl().

◆ InitUserImpl()

NTSTATUS NTAPI InitUserImpl ( VOID  )

Definition at line 77 of file ntuser.c.

78 {
80  HKEY hKey;
81 
82  if (!UserCreateHandleTable())
83  {
84  ERR("Failed creating handle table\n");
86  }
87 
89  if (!NT_SUCCESS(Status))
90  {
91  ERR("Error init session impl.\n");
92  return Status;
93  }
94 
95  InitUserAtoms();
96 
97  Status = RegOpenKey(L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows",
98  &hKey);
99  if (NT_SUCCESS(Status))
100  {
101  DWORD dwValue = 0;
102  RegReadDWORD(hKey, L"DisplayVersion", &dwValue);
103  g_AlwaysDisplayVersion = !!dwValue;
104  ZwClose(hKey);
105  }
106 
107  InitSysParams();
108 
109  return STATUS_SUCCESS;
110 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
BOOL g_AlwaysDisplayVersion
Definition: ntuser.c:17
BOOL InitSysParams(VOID)
Definition: sysparams.c:348
Status
Definition: gdiplustypes.h:24
static NTSTATUS FASTCALL InitUserAtoms(VOID)
Definition: ntuser.c:33
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOL NTAPI RegReadDWORD(HKEY hkey, PWSTR pwszValue, PDWORD pdwData)
Definition: registry.c:150
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:110
BOOL FASTCALL UserCreateHandleTable(VOID)
Definition: object.c:503
FxAutoRegKey hKey
NTSTATUS FASTCALL InitSessionImpl(VOID)
Definition: session.c:18
#define STATUS_SUCCESS
Definition: shellext.h:65
#define RegOpenKey
Definition: winreg.h:519

Referenced by DriverEntry().

◆ InitVideo()

NTSTATUS NTAPI InitVideo ( VOID  )

Definition at line 156 of file display.c.

157 {
159  HKEY hkey;
160 
161  TRACE("----------------------------- InitVideo() -------------------------------\n");
162 
163  /* Check if VGA mode is requested, by finding the special volatile key created by VIDEOPRT */
164  Status = RegOpenKey(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\GraphicsDrivers\\BaseVideo", &hkey);
165  if (NT_SUCCESS(Status))
166  ZwClose(hkey);
168  if (gbBaseVideo)
169  ERR("VGA mode requested.\n");
170 
171  /* Initialize all display devices */
173  if (!NT_SUCCESS(Status))
174  return Status;
175 
176  /* Check if we had any success */
178  {
179  /* Check if there is a VGA device we skipped */
181  {
182  /* There is, use the VGA device */
184  }
185  else
186  {
187  ERR("No usable display driver was found.\n");
188  return STATUS_UNSUCCESSFUL;
189  }
190  }
191 
192  InitSysParams();
193 
194  return STATUS_SUCCESS;
195 }
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
PGRAPHICS_DEVICE gpVgaGraphicsDevice
Definition: device.c:16
PGRAPHICS_DEVICE gpPrimaryGraphicsDevice
Definition: device.c:15
BOOL InitSysParams(VOID)
Definition: sysparams.c:348
BOOL gbBaseVideo
Definition: display.c:12
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
static const WCHAR L[]
Definition: oid.c:1250
#define ERR(fmt,...)
Definition: debug.h:110
NTSTATUS EngpUpdateGraphicsDeviceList(VOID)
Definition: device.c:36
#define STATUS_SUCCESS
Definition: shellext.h:65
#define RegOpenKey
Definition: winreg.h:519

Referenced by UserInitialize().

◆ NtUserInitialize()

NTSTATUS APIENTRY NtUserInitialize ( DWORD  dwWinVersion,
HANDLE  hPowerRequestEvent,
HANDLE  hMediaRequestEvent 
)

Definition at line 173 of file ntuser.c.

177 {
179 
180  TRACE("Enter NtUserInitialize(%lx, %p, %p)\n",
181  dwWinVersion, hPowerRequestEvent, hMediaRequestEvent);
182 
183  /* Check if we are already initialized */
184  if (gpepCSRSS)
185  return STATUS_UNSUCCESSFUL;
186 
187  /* Check Windows USER subsystem version */
188  if (dwWinVersion != USER_VERSION)
189  {
190  /* No match, bugcheck */
191  KeBugCheckEx(WIN32K_INIT_OR_RIT_FAILURE, 0, 0, dwWinVersion, USER_VERSION);
192  }
193 
194  /* Acquire exclusive lock */
196 
197  /* Save the EPROCESS of CSRSS */
198  InitCsrProcess(/*PsGetCurrentProcess()*/);
199 
200 // Initialize Power Request List (use hPowerRequestEvent).
201 // Initialize Media Change (use hMediaRequestEvent).
202 
203 // InitializeGreCSRSS();
204 // {
205 // Startup DxGraphics.
206 // calls ** UserGetLanguageID() and sets it **.
207 // Enables Fonts drivers, Initialize Font table & Stock Fonts.
208 // }
209 
210  /* Initialize USER */
212 
213  /* Return */
214  UserLeave();
215  return Status;
216 }
PEPROCESS gpepCSRSS
Definition: csr.c:15
LONG NTSTATUS
Definition: precomp.h:26
#define USER_VERSION
Definition: ntuser.h:1107
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
VOID InitCsrProcess(VOID)
Definition: csr.c:20
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:253
NTSTATUS NTAPI UserInitialize(VOID)
Definition: ntuser.c:118
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:108

Referenced by CSR_SERVER_DLL_INIT().

◆ RegisterControlAtoms()

BOOL FASTCALL RegisterControlAtoms ( VOID  )

Definition at line 396 of file class.c.

397 {
398  RTL_ATOM Atom;
399  UNICODE_STRING ClassName;
400  INT i = 0;
401 
402  while ( i < ICLS_DESKTOP)
403  {
404  RtlInitUnicodeString(&ClassName, ControlsList[i]);
405  if (IntRegisterClassAtom(&ClassName, &Atom))
406  {
407  gpsi->atomSysClass[i] = Atom;
408  TRACE("Reg Control Atom %ls: 0x%x\n", ControlsList[i], Atom);
409  }
410  i++;
411  }
412  return TRUE;
413 }
unsigned short RTL_ATOM
Definition: atom.c:42
#define TRUE
Definition: types.h:120
#define ICLS_DESKTOP
Definition: ntuser.h:899
PSERVERINFO gpsi
Definition: main.c:27
int32_t INT
Definition: typedefs.h:58
#define TRACE(s)
Definition: solgame.cpp:4
_Out_ RTL_ATOM * Atom
Definition: class.h:54
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
Definition: glfuncs.h:248
static PWSTR ControlsList[]
Definition: class.c:12
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
static BOOL IntRegisterClassAtom(IN PUNICODE_STRING ClassName, OUT RTL_ATOM *pAtom)
Definition: class.c:334
ATOM atomSysClass[ICLS_NOTUSED+1]
Definition: ntuser.h:1022

Referenced by InitUserAtoms().

◆ UserEnterExclusive()

VOID FASTCALL UserEnterExclusive ( VOID  )

Definition at line 245 of file ntuser.c.

246 {
251 }
#define TRUE
Definition: types.h:120
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
ERESOURCE UserLock
Definition: ntuser.c:18
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
PTHREADINFO gptiCurrent
Definition: ntuser.c:15
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
#define ASSERT_NOGDILOCKS()
Definition: gdidebug.h:10

Referenced by _Success_(), co_IntGetPeekMessage(), DesktopThreadMain(), DriverEntry(), EngCreateWnd(), EngDeleteWnd(), IntDesktopObjectClose(), NtGdiSetPixelFormat(), NtGdiSwapBuffers(), NtGdiUpdateColors(), NtUserActivateKeyboardLayout(), NtUserAlterWindowStyle(), NtUserAttachThreadInput(), NtUserBeginPaint(), NtUserBitBltSysBmp(), NtUserBlockInput(), NtUserCalcMenuBar(), NtUserCallHwnd(), NtUserCallHwndLock(), NtUserCallHwndParam(), NtUserCallHwndParamLock(), NtUserCallMsgFilter(), NtUserCallNextHookEx(), NtUserCallNoParam(), NtUserCallOneParam(), NtUserCallTwoParam(), NtUserChangeClipboardChain(), NtUserChangeDisplaySettings(), NtUserCheckMenuItem(), NtUserChildWindowFromPointEx(), NtUserClipCursor(), NtUserCloseClipboard(), NtUserCloseDesktop(), NtUserConsoleControl(), NtUserConvertMemHandle(), NtUserCreateAcceleratorTable(), NtUserCreateCaret(), NtUserCreateDesktop(), NtUserCreateWindowEx(), NtUserCreateWindowStation(), NtUserDeferWindowPos(), NtUserDefSetText(), NtUserDeleteMenu(), NtUserDestroyAcceleratorTable(), NtUserDestroyCursor(), NtUserDestroyMenu(), NtUserDestroyWindow(), NtUserDispatchMessage(), NtUserDragDetect(), NtUserDrawCaptionTemp(), NtUserDrawIconEx(), NtUserDrawMenuBarTemp(), NtUserEmptyClipboard(), NtUserEnableMenuItem(), NtUserEnableScrollBar(), NtUserEndDeferWindowPosEx(), NtUserEndMenu(), NtUserEndPaint(), NtUserExcludeUpdateRgn(), NtUserFillWindow(), NtUserFlashWindowEx(), NtUserGetAncestor(), NtUserGetAsyncKeyState(), NtUserGetClassInfo(), NtUserGetControlBrush(), NtUserGetControlColor(), NtUserGetCPD(), NtUserGetDCEx(), NtUserGetForegroundWindow(), NtUserGetLayeredWindowAttributes(), NtUserGetMessage(), NtUserGetScrollBarInfo(), NtUserGetSystemMenu(), NtUserGetThreadDesktop(), NtUserGetThreadState(), NtUserGetTitleBarInfo(), NtUserGetUpdateRect(), NtUserGetUpdateRgn(), NtUserGetWOWClass(), NtUserHideCaret(), NtUserHiliteMenuItem(), NtUserInitialize(), NtUserInitializeClientPfnArrays(), NtUserKillTimer(), NtUserLoadKeyboardLayoutEx(), NtUserLockWorkStation(), NtUserMenuItemFromPoint(), NtUserMessageCall(), NtUserMinMaximize(), NtUserNotifyWinEvent(), NtUserOpenClipboard(), NtUserOpenInputDesktop(), NtUserPaintDesktop(), NtUserPaintMenuBar(), NtUserPeekMessage(), NtUserPostMessage(), NtUserPostThreadMessage(), NtUserPrintWindow(), NtUserQueryInformationThread(), NtUserRedrawWindow(), NtUserRegisterClassExWOW(), NtUserRegisterHotKey(), NtUserRegisterUserApiHook(), NtUserRegisterWindowMessage(), NtUserRemoveMenu(), NtUserRemoveProp(), NtUserScrollDC(), NtUserScrollWindowEx(), NtUserSelectPalette(), NtUserSendInput(), NtUserSetActiveWindow(), NtUserSetCapture(), NtUserSetClassLong(), NtUserSetClipboardData(), NtUserSetClipboardViewer(), NtUserSetCursor(), NtUserSetCursorIconData(), NtUserSetFocus(), NtUserSetInformationThread(), NtUserSetInternalWindowPos(), NtUserSetKeyboardState(), NtUserSetLayeredWindowAttributes(), NtUserSetMenu(), NtUserSetMenuContextHelpId(), NtUserSetMenuDefaultItem(), NtUserSetMenuFlagRtoL(), NtUserSetParent(), NtUserSetProcessWindowStation(), NtUserSetProp(), NtUserSetScrollBarInfo(), NtUserSetScrollInfo(), NtUserSetShellWindowEx(), NtUserSetSysColors(), NtUserSetSystemCursor(), NtUserSetSystemMenu(), NtUserSetSystemTimer(), NtUserSetThreadDesktop(), NtUserSetThreadState(), NtUserSetTimer(), NtUserSetWindowFNID(), NtUserSetWindowLong(), NtUserSetWindowPlacement(), NtUserSetWindowPos(), NtUserSetWindowRgn(), NtUserSetWindowsHookEx(), NtUserSetWindowStationUser(), NtUserSetWindowWord(), NtUserSetWinEventHook(), NtUserShowCaret(), NtUserShowScrollBar(), NtUserShowWindow(), NtUserShowWindowAsync(), NtUserSwitchDesktop(), NtUserSystemParametersInfo(), NtUserThunkedMenuInfo(), NtUserThunkedMenuItemInfo(), NtUserToUnicodeEx(), NtUserTrackMouseEvent(), NtUserTrackPopupMenuEx(), NtUserTranslateMessage(), NtUserUnhookWindowsHookEx(), NtUserUnhookWinEvent(), NtUserUnloadKeyboardLayout(), NtUserUnregisterClass(), NtUserUnregisterHotKey(), NtUserUnregisterUserApiHook(), NtUserUpdateLayeredWindow(), NtUserUpdatePerUserSystemParameters(), NtUserValidateHandleSecure(), NtUserWaitForInputIdle(), NtUserWaitMessage(), NtUserWindowFromPoint(), RawInputThreadMain(), UserGetDesktopDC(), UserGhostThreadEntry(), Win32kProcessCallback(), and Win32kThreadCallback().

◆ UserEnterShared()

VOID FASTCALL UserEnterShared ( VOID  )

Definition at line 239 of file ntuser.c.

240 {
243 }
#define TRUE
Definition: types.h:120
ERESOURCE UserLock
Definition: ntuser.c:18
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885

Referenced by NtUserBuildPropList(), NtUserCallHwnd(), NtUserCopyAcceleratorTable(), NtUserCountClipboardFormats(), NtUserCreateLocalMemHandle(), NtUserEnumDisplayDevices(), NtUserEnumDisplayMonitors(), NtUserEnumDisplaySettings(), NtUserFindExistingCursorIcon(), NtUserFindWindowEx(), NtUserGetCaretBlinkTime(), NtUserGetCaretPos(), NtUserGetClassName(), NtUserGetClipboardData(), NtUserGetClipboardFormatName(), NtUserGetClipboardOwner(), NtUserGetClipboardSequenceNumber(), NtUserGetClipboardViewer(), NtUserGetClipCursor(), NtUserGetComboBoxInfo(), NtUserGetCursorFrameInfo(), NtUserGetCursorInfo(), NtUserGetDoubleClickTime(), NtUserGetGuiResources(), NtUserGetGUIThreadInfo(), NtUserGetIconSize(), NtUserGetInternalWindowPos(), NtUserGetKeyboardLayoutList(), NtUserGetKeyboardLayoutName(), NtUserGetKeyboardState(), NtUserGetKeyNameText(), NtUserGetKeyState(), NtUserGetListBoxInfo(), NtUserGetMenuBarInfo(), NtUserGetMenuIndex(), NtUserGetMenuItemRect(), NtUserGetMonitorInfo(), NtUserGetMouseMovePointsEx(), NtUserGetOpenClipboardWindow(), NtUserGetPriorityClipboardFormat(), NtUserGetThreadState(), NtUserGetWindowPlacement(), NtUserInternalGetWindowText(), NtUserIsClipboardFormatAvailable(), NtUserMapVirtualKeyEx(), NtUserMonitorFromPoint(), NtUserMonitorFromRect(), NtUserMonitorFromWindow(), NtUserProcessConnect(), NtUserQueryWindow(), NtUserRealChildWindowFromPoint(), NtUserSBGetParms(), NtUserTranslateAccelerator(), NtUserValidateTimerCallback(), NtUserVkKeyScanEx(), and UserSystemThreadProc().

◆ UserInitialize()

NTSTATUS NTAPI UserInitialize ( VOID  )

Definition at line 118 of file ntuser.c.

119 {
120  static const DWORD wPattern55AA[] = /* 32 bit aligned */
121  { 0x55555555, 0xaaaaaaaa, 0x55555555, 0xaaaaaaaa,
122  0x55555555, 0xaaaaaaaa, 0x55555555, 0xaaaaaaaa };
123  HBITMAP hPattern55AABitmap = NULL;
125 
127 
128 // Create Event for Disconnect Desktop.
129 
131  if (!NT_SUCCESS(Status)) return Status;
132 
133  /* Initialize the Video */
134  Status = InitVideo();
135  if (!NT_SUCCESS(Status))
136  {
137  /* We failed, bugcheck */
138  KeBugCheckEx(VIDEO_DRIVER_INIT_FAILURE, Status, 0, 0, USER_VERSION);
139  }
140 
141 // {
142 // DrvInitConsole.
143 // DrvChangeDisplaySettings.
144 // Update Shared Device Caps.
145 // Initialize User Screen.
146 // }
147 
148 // Set Global SERVERINFO Error flags.
149 // Load Resources.
150 
152 
153  if (gpsi->hbrGray == NULL)
154  {
155  hPattern55AABitmap = GreCreateBitmap(8, 8, 1, 1, (LPBYTE)wPattern55AA);
156  if (hPattern55AABitmap == NULL)
158 
159  gpsi->hbrGray = IntGdiCreatePatternBrush(hPattern55AABitmap);
160 
161  if (gpsi->hbrGray == NULL)
163  }
164 
165  return STATUS_SUCCESS;
166 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define TRUE
Definition: types.h:120
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
LONG NTSTATUS
Definition: precomp.h:26
#define USER_VERSION
Definition: ntuser.h:1107
PSERVERINFO gpsi
Definition: main.c:27
HBRUSH NTAPI IntGdiCreatePatternBrush(HBITMAP hbmPattern)
Definition: brush.cpp:292
unsigned char * LPBYTE
Definition: typedefs.h:53
NTSTATUS NTAPI UserCreateWinstaDirectory(VOID)
Definition: winsta.c:51
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL NTAPI NtUserUpdatePerUserSystemParameters(DWORD dwReserved, BOOL bEnable)
Definition: sysparams.c:358
#define NULL
Definition: types.h:112
static HBITMAP
Definition: button.c:44
#define STATUS_SUCCESS
Definition: shellext.h:65
NTSTATUS NTAPI InitVideo(VOID)
Definition: display.c:156
static const WORD wPattern55AA[]
Definition: commctrl.c:86
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:108
#define NT_ASSERT
Definition: rtlfuncs.h:3310
HBITMAP NTAPI GreCreateBitmap(_In_ ULONG nWidth, _In_ ULONG nHeight, _In_ ULONG cPlanes, _In_ ULONG cBitsPixel, _In_opt_ PVOID pvBits)
Definition: bitmaps.c:172

Referenced by NtUserInitialize().

◆ UserIsEntered()

BOOL FASTCALL UserIsEntered ( VOID  )

Definition at line 223 of file ntuser.c.

224 {
227 }
ERESOURCE UserLock
Definition: ntuser.c:18
BOOLEAN NTAPI ExIsResourceAcquiredExclusiveLite(IN PERESOURCE Resource)
Definition: resource.c:1619
ULONG NTAPI ExIsResourceAcquiredSharedLite(IN PERESOURCE Resource)
Definition: resource.c:1658

Referenced by IntGetProp(), NtGdiUpdateColors(), UserGetProp(), and UserLeave().

◆ UserIsEnteredExclusive()

BOOL FASTCALL UserIsEnteredExclusive ( VOID  )

◆ UserLeave()

VOID FASTCALL UserLeave ( VOID  )

Definition at line 253 of file ntuser.c.

254 {
259 }
BOOL FASTCALL UserIsEntered(VOID)
Definition: ntuser.c:223
ERESOURCE UserLock
Definition: ntuser.c:18
#define ASSERT(a)
Definition: mode.c:44
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119
#define ASSERT_NOGDILOCKS()
Definition: gdidebug.h:10

Referenced by _Success_(), co_IntGetPeekMessage(), DesktopThreadMain(), DriverEntry(), EngCreateWnd(), EngDeleteWnd(), IntDesktopObjectClose(), NtGdiSetPixelFormat(), NtGdiSwapBuffers(), NtGdiUpdateColors(), NtUserActivateKeyboardLayout(), NtUserAlterWindowStyle(), NtUserAttachThreadInput(), NtUserBeginPaint(), NtUserBitBltSysBmp(), NtUserBlockInput(), NtUserBuildPropList(), NtUserCalcMenuBar(), NtUserCallHwnd(), NtUserCallHwndLock(), NtUserCallHwndParam(), NtUserCallHwndParamLock(), NtUserCallMsgFilter(), NtUserCallNextHookEx(), NtUserCallNoParam(), NtUserCallOneParam(), NtUserCallTwoParam(), NtUserChangeClipboardChain(), NtUserChangeDisplaySettings(), NtUserCheckMenuItem(), NtUserChildWindowFromPointEx(), NtUserClipCursor(), NtUserCloseClipboard(), NtUserCloseDesktop(), NtUserConsoleControl(), NtUserConvertMemHandle(), NtUserCopyAcceleratorTable(), NtUserCountClipboardFormats(), NtUserCreateAcceleratorTable(), NtUserCreateCaret(), NtUserCreateDesktop(), NtUserCreateLocalMemHandle(), NtUserCreateWindowEx(), NtUserCreateWindowStation(), NtUserDeferWindowPos(), NtUserDefSetText(), NtUserDeleteMenu(), NtUserDestroyAcceleratorTable(), NtUserDestroyCursor(), NtUserDestroyMenu(), NtUserDestroyWindow(), NtUserDispatchMessage(), NtUserDragDetect(), NtUserDrawCaptionTemp(), NtUserDrawIconEx(), NtUserDrawMenuBarTemp(), NtUserEmptyClipboard(), NtUserEnableMenuItem(), NtUserEnableScrollBar(), NtUserEndDeferWindowPosEx(), NtUserEndMenu(), NtUserEndPaint(), NtUserEnumDisplayDevices(), NtUserEnumDisplayMonitors(), NtUserEnumDisplaySettings(), NtUserExcludeUpdateRgn(), NtUserFillWindow(), NtUserFindExistingCursorIcon(), NtUserFindWindowEx(), NtUserFlashWindowEx(), NtUserGetAncestor(), NtUserGetAsyncKeyState(), NtUserGetCaretBlinkTime(), NtUserGetCaretPos(), NtUserGetClassInfo(), NtUserGetClassName(), NtUserGetClipboardData(), NtUserGetClipboardFormatName(), NtUserGetClipboardOwner(), NtUserGetClipboardSequenceNumber(), NtUserGetClipboardViewer(), NtUserGetClipCursor(), NtUserGetComboBoxInfo(), NtUserGetControlBrush(), NtUserGetControlColor(), NtUserGetCPD(), NtUserGetCursorFrameInfo(), NtUserGetCursorInfo(), NtUserGetDCEx(), NtUserGetDoubleClickTime(), NtUserGetForegroundWindow(), NtUserGetGuiResources(), NtUserGetGUIThreadInfo(), NtUserGetIconSize(), NtUserGetInternalWindowPos(), NtUserGetKeyboardLayoutList(), NtUserGetKeyboardLayoutName(), NtUserGetKeyboardState(), NtUserGetKeyNameText(), NtUserGetKeyState(), NtUserGetLayeredWindowAttributes(), NtUserGetListBoxInfo(), NtUserGetMenuBarInfo(), NtUserGetMenuIndex(), NtUserGetMenuItemRect(), NtUserGetMessage(), NtUserGetMonitorInfo(), NtUserGetMouseMovePointsEx(), NtUserGetOpenClipboardWindow(), NtUserGetPriorityClipboardFormat(), NtUserGetScrollBarInfo(), NtUserGetSystemMenu(), NtUserGetThreadDesktop(), NtUserGetThreadState(), NtUserGetTitleBarInfo(), NtUserGetUpdateRect(), NtUserGetUpdateRgn(), NtUserGetWindowPlacement(), NtUserGetWOWClass(), NtUserHideCaret(), NtUserHiliteMenuItem(), NtUserInitialize(), NtUserInitializeClientPfnArrays(), NtUserInternalGetWindowText(), NtUserIsClipboardFormatAvailable(), NtUserKillTimer(), NtUserLoadKeyboardLayoutEx(), NtUserLockWorkStation(), NtUserMapVirtualKeyEx(), NtUserMenuItemFromPoint(), NtUserMessageCall(), NtUserMinMaximize(), NtUserMonitorFromPoint(), NtUserMonitorFromRect(), NtUserMonitorFromWindow(), NtUserNotifyWinEvent(), NtUserOpenClipboard(), NtUserOpenInputDesktop(), NtUserPaintDesktop(), NtUserPaintMenuBar(), NtUserPeekMessage(), NtUserPostMessage(), NtUserPostThreadMessage(), NtUserPrintWindow(), NtUserProcessConnect(), NtUserQueryInformationThread(), NtUserQueryWindow(), NtUserRealChildWindowFromPoint(), NtUserRedrawWindow(), NtUserRegisterClassExWOW(), NtUserRegisterHotKey(), NtUserRegisterUserApiHook(), NtUserRegisterWindowMessage(), NtUserRemoveMenu(), NtUserRemoveProp(), NtUserSBGetParms(), NtUserScrollDC(), NtUserScrollWindowEx(), NtUserSelectPalette(), NtUserSendInput(), NtUserSetActiveWindow(), NtUserSetCapture(), NtUserSetClassLong(), NtUserSetClipboardData(), NtUserSetClipboardViewer(), NtUserSetCursor(), NtUserSetCursorIconData(), NtUserSetFocus(), NtUserSetInformationThread(), NtUserSetInternalWindowPos(), NtUserSetKeyboardState(), NtUserSetLayeredWindowAttributes(), NtUserSetMenu(), NtUserSetMenuContextHelpId(), NtUserSetMenuDefaultItem(), NtUserSetMenuFlagRtoL(), NtUserSetParent(), NtUserSetProcessWindowStation(), NtUserSetProp(), NtUserSetScrollBarInfo(), NtUserSetScrollInfo(), NtUserSetShellWindowEx(), NtUserSetSysColors(), NtUserSetSystemCursor(), NtUserSetSystemMenu(), NtUserSetSystemTimer(), NtUserSetThreadDesktop(), NtUserSetThreadState(), NtUserSetTimer(), NtUserSetWindowFNID(), NtUserSetWindowLong(), NtUserSetWindowPlacement(), NtUserSetWindowPos(), NtUserSetWindowRgn(), NtUserSetWindowsHookEx(), NtUserSetWindowStationUser(), NtUserSetWindowWord(), NtUserSetWinEventHook(), NtUserShowCaret(), NtUserShowScrollBar(), NtUserShowWindow(), NtUserShowWindowAsync(), NtUserSwitchDesktop(), NtUserSystemParametersInfo(), NtUserThunkedMenuInfo(), NtUserThunkedMenuItemInfo(), NtUserToUnicodeEx(), NtUserTrackMouseEvent(), NtUserTrackPopupMenuEx(), NtUserTranslateAccelerator(), NtUserTranslateMessage(), NtUserUnhookWindowsHookEx(), NtUserUnhookWinEvent(), NtUserUnloadKeyboardLayout(), NtUserUnregisterClass(), NtUserUnregisterHotKey(), NtUserUnregisterUserApiHook(), NtUserUpdateLayeredWindow(), NtUserUpdatePerUserSystemParameters(), NtUserValidateHandleSecure(), NtUserValidateTimerCallback(), NtUserVkKeyScanEx(), NtUserWaitForInputIdle(), NtUserWaitMessage(), NtUserWindowFromPoint(), RawInputThreadMain(), UserGetDesktopDC(), UserGhostThreadEntry(), UserSystemThreadProc(), Win32kProcessCallback(), and Win32kThreadCallback().

Variable Documentation

◆ AtomDDETrack

ATOM AtomDDETrack

Definition at line 23 of file ntuser.c.

Referenced by InitUserAtoms(), IntDdeGetMessageHook(), and IntDdeSendMessageHook().

◆ AtomFlashWndState

ATOM AtomFlashWndState

Definition at line 22 of file ntuser.c.

Referenced by InitUserAtoms(), and IntFlashWindowEx().

◆ AtomLayer

◆ AtomMessage

ATOM AtomMessage

Definition at line 19 of file ntuser.c.

Referenced by InitUserAtoms().

◆ AtomQOS

ATOM AtomQOS

Definition at line 24 of file ntuser.c.

Referenced by InitUserAtoms().

◆ AtomWndObj

ATOM AtomWndObj

Definition at line 20 of file ntuser.c.

Referenced by EngCreateWnd(), EngDeleteWnd(), InitUserAtoms(), IntEngWindowChanged(), and UserGethWnd().

◆ ClientPfnInit

BOOL ClientPfnInit = FALSE

Definition at line 26 of file ntuser.c.

Referenced by NtUserInitializeClientPfnArrays().

◆ g_AlwaysDisplayVersion

BOOL g_AlwaysDisplayVersion = FALSE

Definition at line 17 of file ntuser.c.

Referenced by InitUserImpl(), and IntPaintDesktop().

◆ gaGuiConsoleWndClass

ATOM gaGuiConsoleWndClass

◆ gppiInputProvider

◆ gptiCurrent

◆ hModClient

◆ UserLock