2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: GUI state check
5 * FILE: subsys/win32k/ntuser/guicheck.c
6 * PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * NOTES: The GuiCheck() function performs a few delayed operations:
8 * 1) A GUI process is assigned a window station
9 * 2) A message queue is created for a GUI thread before use
10 * 3) The system window classes are registered for a process
15 /* GLOBALS *******************************************************************/
17 static LONG NrGuiAppsRunning
= 0;
19 /* FUNCTIONS *****************************************************************/
22 co_AddGuiApp(PPROCESSINFO W32Data
)
24 W32Data
->W32PF_flags
|= W32PF_CREATEDWINORDC
;
25 if (InterlockedIncrement(&NrGuiAppsRunning
) == 1)
29 Initialized
= co_IntInitializeDesktopGraphics();
33 W32Data
->W32PF_flags
&= ~W32PF_CREATEDWINORDC
;
34 InterlockedDecrement(&NrGuiAppsRunning
);
42 RemoveGuiApp(PPROCESSINFO W32Data
)
44 W32Data
->W32PF_flags
&= ~W32PF_CREATEDWINORDC
;
45 if (InterlockedDecrement(&NrGuiAppsRunning
) == 0)
47 IntEndDesktopGraphics();
52 co_IntGraphicsCheck(BOOL Create
)
56 W32Data
= PsGetCurrentProcessWin32Process();
59 if (! (W32Data
->W32PF_flags
& W32PF_CREATEDWINORDC
) && ! (W32Data
->W32PF_flags
& W32PF_MANUALGUICHECK
))
61 return co_AddGuiApp(W32Data
);
66 if ((W32Data
->W32PF_flags
& W32PF_CREATEDWINORDC
) && ! (W32Data
->W32PF_flags
& W32PF_MANUALGUICHECK
))
68 RemoveGuiApp(W32Data
);
77 IntUserManualGuiCheck(LONG Check
)
81 W32Data
= PsGetCurrentProcessWin32Process();
84 W32Data
->W32PF_flags
|= W32PF_MANUALGUICHECK
;
88 if (! (W32Data
->W32PF_flags
& W32PF_CREATEDWINORDC
))
90 co_AddGuiApp(W32Data
);
95 if (W32Data
->W32PF_flags
& W32PF_CREATEDWINORDC
)
97 RemoveGuiApp(W32Data
);