Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenguicheck.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS kernel 00004 * PURPOSE: GUI state check 00005 * FILE: subsys/win32k/ntuser/guicheck.c 00006 * PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net) 00007 * NOTES: The GuiCheck() function performs a few delayed operations: 00008 * 1) A GUI process is assigned a window station 00009 * 2) A message queue is created for a GUI thread before use 00010 * 3) The system window classes are registered for a process 00011 */ 00012 00013 #include <win32k.h> 00014 00015 /* GLOBALS *******************************************************************/ 00016 00017 static LONG NrGuiAppsRunning = 0; 00018 00019 /* FUNCTIONS *****************************************************************/ 00020 00021 static BOOL FASTCALL 00022 co_AddGuiApp(PPROCESSINFO W32Data) 00023 { 00024 W32Data->W32PF_flags |= W32PF_CREATEDWINORDC; 00025 if (InterlockedIncrement(&NrGuiAppsRunning) == 1) 00026 { 00027 BOOL Initialized; 00028 00029 Initialized = co_IntInitializeDesktopGraphics(); 00030 00031 if (!Initialized) 00032 { 00033 W32Data->W32PF_flags &= ~W32PF_CREATEDWINORDC; 00034 InterlockedDecrement(&NrGuiAppsRunning); 00035 return FALSE; 00036 } 00037 } 00038 return TRUE; 00039 } 00040 00041 static void FASTCALL 00042 RemoveGuiApp(PPROCESSINFO W32Data) 00043 { 00044 W32Data->W32PF_flags &= ~W32PF_CREATEDWINORDC; 00045 if (InterlockedDecrement(&NrGuiAppsRunning) == 0) 00046 { 00047 IntEndDesktopGraphics(); 00048 } 00049 } 00050 00051 BOOL FASTCALL 00052 co_IntGraphicsCheck(BOOL Create) 00053 { 00054 PPROCESSINFO W32Data; 00055 00056 W32Data = PsGetCurrentProcessWin32Process(); 00057 if (Create) 00058 { 00059 if (! (W32Data->W32PF_flags & W32PF_CREATEDWINORDC) && ! (W32Data->W32PF_flags & W32PF_MANUALGUICHECK)) 00060 { 00061 return co_AddGuiApp(W32Data); 00062 } 00063 } 00064 else 00065 { 00066 if ((W32Data->W32PF_flags & W32PF_CREATEDWINORDC) && ! (W32Data->W32PF_flags & W32PF_MANUALGUICHECK)) 00067 { 00068 RemoveGuiApp(W32Data); 00069 } 00070 } 00071 00072 return TRUE; 00073 } 00074 00075 VOID 00076 FASTCALL 00077 IntUserManualGuiCheck(LONG Check) 00078 { 00079 PPROCESSINFO W32Data; 00080 00081 W32Data = PsGetCurrentProcessWin32Process(); 00082 if (0 == Check) 00083 { 00084 W32Data->W32PF_flags |= W32PF_MANUALGUICHECK; 00085 } 00086 else if (0 < Check) 00087 { 00088 if (! (W32Data->W32PF_flags & W32PF_CREATEDWINORDC)) 00089 { 00090 co_AddGuiApp(W32Data); 00091 } 00092 } 00093 else 00094 { 00095 if (W32Data->W32PF_flags & W32PF_CREATEDWINORDC) 00096 { 00097 RemoveGuiApp(W32Data); 00098 } 00099 } 00100 } 00101 00102 /* EOF */ Generated on Sun May 27 2012 04:38:31 for ReactOS by
1.7.6.1
|