ReactOS  0.4.12-dev-934-g9a4676f
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)
 
INIT_FUNCTION 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 236 of file ntuser.c.

237 {
239 }
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 TRUE
Definition: types.h:120
#define ICLS_ICONTITLE
Definition: ntuser.h:894
ATOM atomFrostedWindowProp
Definition: ntuser.h:1021
#define ICLS_DESKTOP
Definition: ntuser.h:890
ATOM atomContextHelpIdProp
Definition: ntuser.h:1020
PSERVERINFO gpsi
Definition: main.c:27
#define ICLS_DIALOG
Definition: ntuser.h:891
#define ICLS_TOOLTIPS
Definition: ntuser.h:895
BOOL FASTCALL RegisterControlAtoms(VOID)
Definition: class.c:373
#define ICLS_SWITCH
Definition: ntuser.h:893
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:1019
ATOM AtomWndObj
Definition: ntuser.c:20
ATOM AtomMessage
Definition: ntuser.c:19
ATOM atomIconSmProp
Definition: ntuser.h:1018
ATOM AtomLayer
Definition: ntuser.c:21
ATOM AtomQOS
Definition: ntuser.c:24
#define ICLS_MENU
Definition: ntuser.h:892
return STATUS_SUCCESS
Definition: btrfs.c:2725
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:1013

Referenced by InitUserImpl().

◆ InitUserImpl()

INIT_FUNCTION NTSTATUS NTAPI InitUserImpl ( VOID  )

Definition at line 77 of file ntuser.c.

78 {
80  HKEY hKey;
81 
83 
84  if (!UserCreateHandleTable())
85  {
86  ERR("Failed creating handle table\n");
88  }
89 
91  if (!NT_SUCCESS(Status))
92  {
93  ERR("Error init session impl.\n");
94  return Status;
95  }
96 
97  InitUserAtoms();
98 
99  Status = RegOpenKey(L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows",
100  &hKey);
101  if (NT_SUCCESS(Status))
102  {
103  DWORD dwValue = 0;
104  RegReadDWORD(hKey, L"DisplayVersion", &dwValue);
105  g_AlwaysDisplayVersion = !!dwValue;
106  ZwClose(hKey);
107  }
108 
109  InitSysParams();
110 
111  return STATUS_SUCCESS;
112 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
ERESOURCE UserLock
Definition: ntuser.c:18
BOOL g_AlwaysDisplayVersion
Definition: ntuser.c:17
BOOL InitSysParams(VOID)
Definition: sysparams.c:335
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
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
BOOL FASTCALL UserCreateHandleTable(VOID)
Definition: object.c:503
NTSTATUS FASTCALL InitSessionImpl(VOID)
Definition: session.c:18
#define RegOpenKey
Definition: winreg.h:519
return STATUS_SUCCESS
Definition: btrfs.c:2725

Referenced by DriverEntry().

◆ InitVideo()

NTSTATUS NTAPI InitVideo ( VOID  )

Definition at line 156 of file display.c.

157 {
158  ULONG iDevNum, iVGACompatible = -1, ulMaxObjectNumber = 0;
159  WCHAR awcDeviceName[20];
160  WCHAR awcBuffer[256];
162  PGRAPHICS_DEVICE pGraphicsDevice;
163  ULONG cbValue;
164  HKEY hkey;
165 
166  TRACE("----------------------------- InitVideo() -------------------------------\n");
167 
168  /* Open the key for the boot command line */
169  Status = RegOpenKey(L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Control", &hkey);
170  if (NT_SUCCESS(Status))
171  {
172  cbValue = sizeof(awcBuffer);
173  Status = RegQueryValue(hkey, L"SystemStartOptions", REG_SZ, awcBuffer, &cbValue);
174  if (NT_SUCCESS(Status))
175  {
176  /* Check if VGA mode is requested. */
177  if (wcsstr(awcBuffer, L"BASEVIDEO") != 0)
178  {
179  ERR("VGA mode requested.\n");
180  gbBaseVideo = TRUE;
181  }
182  }
183 
184  ZwClose(hkey);
185  }
186 
187  /* Open the key for the adapters */
188  Status = RegOpenKey(KEY_VIDEO, &hkey);
189  if (!NT_SUCCESS(Status))
190  {
191  ERR("Could not open HARDWARE\\DEVICEMAP\\VIDEO registry key:0x%lx\n", Status);
192  return Status;
193  }
194 
195  /* Read the name of the VGA adapter */
196  cbValue = sizeof(awcDeviceName);
197  Status = RegQueryValue(hkey, L"VgaCompatible", REG_SZ, awcDeviceName, &cbValue);
198  if (NT_SUCCESS(Status))
199  {
200  iVGACompatible = _wtoi(&awcDeviceName[sizeof("\\Device\\Video")-1]);
201  ERR("VGA adapter = %lu\n", iVGACompatible);
202  }
203 
204  /* Get the maximum mumber of adapters */
205  if (!RegReadDWORD(hkey, L"MaxObjectNumber", &ulMaxObjectNumber))
206  {
207  ERR("Could not read MaxObjectNumber, defaulting to 0.\n");
208  }
209 
210  TRACE("Found %lu devices\n", ulMaxObjectNumber + 1);
211 
212  /* Loop through all adapters */
213  for (iDevNum = 0; iDevNum <= ulMaxObjectNumber; iDevNum++)
214  {
215  /* Create the adapter's key name */
216  swprintf(awcDeviceName, L"\\Device\\Video%lu", iDevNum);
217 
218  /* Read the reg key name */
219  cbValue = sizeof(awcBuffer);
220  Status = RegQueryValue(hkey, awcDeviceName, REG_SZ, awcBuffer, &cbValue);
221  if (!NT_SUCCESS(Status))
222  {
223  ERR("failed to query the registry path:0x%lx\n", Status);
224  continue;
225  }
226 
227  /* Initialize the driver for this device */
228  pGraphicsDevice = InitDisplayDriver(awcDeviceName, awcBuffer);
229  if (!pGraphicsDevice) continue;
230 
231  /* Check if this is a VGA compatible adapter */
232  if (pGraphicsDevice->StateFlags & DISPLAY_DEVICE_VGA_COMPATIBLE)
233  {
234  /* Save this as the VGA adapter */
235  if (!gpVgaGraphicsDevice)
236  gpVgaGraphicsDevice = pGraphicsDevice;
237  TRACE("gpVgaGraphicsDevice = %p\n", gpVgaGraphicsDevice);
238  }
239  else
240  {
241  /* Set the first one as primary device */
243  gpPrimaryGraphicsDevice = pGraphicsDevice;
244  TRACE("gpPrimaryGraphicsDevice = %p\n", gpPrimaryGraphicsDevice);
245  }
246  }
247 
248  /* Close the device map registry key */
249  ZwClose(hkey);
250 
251  /* Was VGA mode requested? */
252  if (gbBaseVideo)
253  {
254  /* Check if we found a VGA compatible device */
256  {
257  /* Set the VgaAdapter as primary */
259  // FIXME: DEVMODE
260  }
261  else
262  {
263  ERR("Could not find VGA compatible driver. Trying normal.\n");
264  }
265  }
266 
267  /* Check if we had any success */
269  {
270  /* Check if there is a VGA device we skipped */
272  {
273  /* There is, use the VGA device */
275  }
276  else
277  {
278  ERR("No usable display driver was found.\n");
279  return STATUS_UNSUCCESSFUL;
280  }
281  }
282 
283  InitSysParams();
284 
285  return 1;
286 }
static const PWCHAR KEY_VIDEO
Definition: display.c:15
#define TRUE
Definition: types.h:120
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
DWORD StateFlags
Definition: pdevobj.h:66
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
LONG NTSTATUS
Definition: precomp.h:26
PGRAPHICS_DEVICE gpVgaGraphicsDevice
Definition: device.c:14
PGRAPHICS_DEVICE NTAPI InitDisplayDriver(IN PWSTR pwszDeviceName, IN PWSTR pwszRegKey)
Definition: display.c:66
PGRAPHICS_DEVICE gpPrimaryGraphicsDevice
Definition: device.c:13
BOOL InitSysParams(VOID)
Definition: sysparams.c:335
BOOL gbBaseVideo
Definition: display.c:12
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define swprintf(buf, format,...)
Definition: sprintf.c:56
BOOL NTAPI RegReadDWORD(HKEY hkey, PWSTR pwszValue, PDWORD pdwData)
Definition: registry.c:150
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
#define DISPLAY_DEVICE_VGA_COMPATIBLE
Definition: wingdi.h:1382
#define RegQueryValue
Definition: winreg.h:523
unsigned int ULONG
Definition: retypes.h:1
#define RegOpenKey
Definition: winreg.h:519
#define REG_SZ
Definition: layer.c:22

Referenced by UserInitialize().

◆ NtUserInitialize()

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

Definition at line 175 of file ntuser.c.

179 {
181 
182  TRACE("Enter NtUserInitialize(%lx, %p, %p)\n",
183  dwWinVersion, hPowerRequestEvent, hMediaRequestEvent);
184 
185  /* Check if we are already initialized */
186  if (gpepCSRSS)
187  return STATUS_UNSUCCESSFUL;
188 
189  /* Check Windows USER subsystem version */
190  if (dwWinVersion != USER_VERSION)
191  {
192  /* No match, bugcheck */
193  KeBugCheckEx(WIN32K_INIT_OR_RIT_FAILURE, 0, 0, dwWinVersion, USER_VERSION);
194  }
195 
196  /* Acquire exclusive lock */
198 
199  /* Save the EPROCESS of CSRSS */
200  InitCsrProcess(/*PsGetCurrentProcess()*/);
201 
202 // Initialize Power Request List (use hPowerRequestEvent).
203 // Initialize Media Change (use hMediaRequestEvent).
204 
205 // InitializeGreCSRSS();
206 // {
207 // Startup DxGraphics.
208 // calls ** UserGetLanguageID() and sets it **.
209 // Enables Fonts drivers, Initialize Font table & Stock Fonts.
210 // }
211 
212  /* Initialize USER */
214 
215  /* Return */
216  UserLeave();
217  return Status;
218 }
PEPROCESS gpepCSRSS
Definition: csr.c:15
LONG NTSTATUS
Definition: precomp.h:26
#define USER_VERSION
Definition: ntuser.h:1098
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
VOID InitCsrProcess(VOID)
Definition: csr.c:20
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
NTSTATUS NTAPI UserInitialize(VOID)
Definition: ntuser.c:120
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:107

Referenced by CSR_SERVER_DLL_INIT().

◆ RegisterControlAtoms()

BOOL FASTCALL RegisterControlAtoms ( VOID  )

Definition at line 373 of file class.c.

374 {
375  RTL_ATOM Atom;
376  UNICODE_STRING ClassName;
377  INT i = 0;
378 
379  while ( i < ICLS_DESKTOP)
380  {
381  RtlInitUnicodeString(&ClassName, ControlsList[i]);
382  if (IntRegisterClassAtom(&ClassName, &Atom))
383  {
384  gpsi->atomSysClass[i] = Atom;
385  TRACE("Reg Control Atom %ls: 0x%x\n", ControlsList[i], Atom);
386  }
387  i++;
388  }
389  return TRUE;
390 }
#define TRUE
Definition: types.h:120
unsigned short RTL_ATOM
Definition: atom.c:42
#define ICLS_DESKTOP
Definition: ntuser.h:890
_Out_ RTL_ATOM * Atom
Definition: class.h:54
PSERVERINFO gpsi
Definition: main.c:27
int32_t INT
Definition: typedefs.h:56
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
#define TRACE(s)
Definition: solgame.cpp:4
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:1013

Referenced by InitUserAtoms().

◆ UserEnterExclusive()

VOID FASTCALL UserEnterExclusive ( VOID  )

Definition at line 247 of file ntuser.c.

248 {
253 }
#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:83
#define ASSERT_NOGDILOCKS()
Definition: gdidebug.h:10

Referenced by _Success_(), co_IntGetPeekMessage(), DesktopThreadMain(), EngCreateWnd(), EngDeleteWnd(), 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(), 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 241 of file ntuser.c.

242 {
245 }
#define TRUE
Definition: types.h:120
ERESOURCE UserLock
Definition: ntuser.c:18
#define KeEnterCriticalRegion()
Definition: ke_x.h:83
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 120 of file ntuser.c.

121 {
122  static const DWORD wPattern55AA[] = /* 32 bit aligned */
123  { 0x55555555, 0xaaaaaaaa, 0x55555555, 0xaaaaaaaa,
124  0x55555555, 0xaaaaaaaa, 0x55555555, 0xaaaaaaaa };
125  HBITMAP hPattern55AABitmap = NULL;
127 
129 
130 // Create Event for Disconnect Desktop.
131 
133  if (!NT_SUCCESS(Status)) return Status;
134 
135  /* Initialize the Video */
136  Status = InitVideo();
137  if (!NT_SUCCESS(Status))
138  {
139  /* We failed, bugcheck */
140  KeBugCheckEx(VIDEO_DRIVER_INIT_FAILURE, Status, 0, 0, USER_VERSION);
141  }
142 
143 // {
144 // DrvInitConsole.
145 // DrvChangeDisplaySettings.
146 // Update Shared Device Caps.
147 // Initialize User Screen.
148 // }
149 
150 // Set Global SERVERINFO Error flags.
151 // Load Resources.
152 
154 
155  if (gpsi->hbrGray == NULL)
156  {
157  hPattern55AABitmap = GreCreateBitmap(8, 8, 1, 1, (LPBYTE)wPattern55AA);
158  if (hPattern55AABitmap == NULL)
160 
161  gpsi->hbrGray = IntGdiCreatePatternBrush(hPattern55AABitmap);
162 
163  if (gpsi->hbrGray == NULL)
165  }
166 
167  return STATUS_SUCCESS;
168 }
#define TRUE
Definition: types.h:120
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
LONG NTSTATUS
Definition: precomp.h:26
#define USER_VERSION
Definition: ntuser.h:1098
PSERVERINFO gpsi
Definition: main.c:27
HBRUSH NTAPI IntGdiCreatePatternBrush(HBITMAP hbmPattern)
Definition: brush.cpp:292
unsigned char * LPBYTE
Definition: typedefs.h:52
NTSTATUS NTAPI UserCreateWinstaDirectory(VOID)
Definition: winsta.c:51
smooth NULL
Definition: ftsmooth.c:416
#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:345
Status
Definition: gdiplustypes.h:24
static HBITMAP
Definition: button.c:44
NTSTATUS NTAPI InitVideo(VOID)
Definition: display.c:156
return STATUS_SUCCESS
Definition: btrfs.c:2725
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:107
#define NT_ASSERT
Definition: rtlfuncs.h:3312
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 225 of file ntuser.c.

226 {
229 }
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  )

Definition at line 231 of file ntuser.c.

232 {
234 }
ERESOURCE UserLock
Definition: ntuser.c:18
BOOLEAN NTAPI ExIsResourceAcquiredExclusiveLite(IN PERESOURCE Resource)
Definition: resource.c:1619

Referenced by _Success_(), IntDestroyMenu(), IntDestroyMenuObject(), IntGetWindowProc(), UserCreateSystemThread(), and UserRemoveWindowProps().

◆ UserLeave()

VOID FASTCALL UserLeave ( VOID  )

Definition at line 255 of file ntuser.c.

256 {
261 }
BOOL FASTCALL UserIsEntered(VOID)
Definition: ntuser.c:225
ERESOURCE UserLock
Definition: ntuser.c:18
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define KeLeaveCriticalRegion()
Definition: ke_x.h:114
#define ASSERT_NOGDILOCKS()
Definition: gdidebug.h:10

Referenced by _Success_(), co_IntGetPeekMessage(), DesktopThreadMain(), EngCreateWnd(), EngDeleteWnd(), 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(), 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