From 1ffe9401f6a2cb9fbf2571bf264a7aff1c30c10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Wed, 3 Dec 2003 21:50:50 +0000 Subject: [PATCH] Remove direct references from csrss to win32k (call via user32/gdi32 only) svn path=/trunk/; revision=6858 --- reactos/iface/addsys/genw32k.c | 38 +++------------------- reactos/iface/addsys/makefile | 6 ++-- reactos/iface/addsys/w32ksvc.db | 2 +- reactos/include/win32k/misc.h | 4 +-- reactos/lib/user32/misc/misc.c | 12 ++++++- reactos/lib/user32/user32.def | 3 +- reactos/lib/user32/user32.edf | 3 +- reactos/subsys/csrss/init.c | 4 +-- reactos/subsys/csrss/makefile | 5 ++- reactos/subsys/csrss/win32csr/guiconsole.c | 7 +++- reactos/subsys/win32k/main/dllmain.c | 26 ++++++++------- reactos/subsys/win32k/ntuser/guicheck.c | 9 ++++- 12 files changed, 55 insertions(+), 64 deletions(-) diff --git a/reactos/iface/addsys/genw32k.c b/reactos/iface/addsys/genw32k.c index 7fd71625294..18ea4062c39 100644 --- a/reactos/iface/addsys/genw32k.c +++ b/reactos/iface/addsys/genw32k.c @@ -1,4 +1,4 @@ -/* $Id: genw32k.c,v 1.5 2003/08/01 09:06:54 weiden Exp $ +/* $Id: genw32k.c,v 1.6 2003/12/03 21:50:49 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS version of ntdll @@ -170,8 +170,7 @@ int process( FILE * in, FILE * out1, - FILE * out2, - FILE * out3 + FILE * out2 ) { char line [INPUT_BUFFER_SIZE]; @@ -194,12 +193,6 @@ process( fprintf(out2,"// Machine generated, don't edit\n"); fprintf(out2,"\n\n"); - /* - * CSRSS stubs file header - */ - fprintf(out3,"// Machine generated, don't edit\n"); - fprintf(out3,"\n\n"); - /* * Scan the database. DB is a text file; each line * is a record, which contains data for one system @@ -280,21 +273,6 @@ process( fprintf(out2,"\t\"int\t$0x2E\\n\\t\"\n"); fprintf(out2,"\t\"ret\t$%d\\n\\t\");\n\n",stacksize); - /* - * Write the CSRSS stub for the current system call - */ -#ifdef PARAMETERIZED_LIBS - fprintf(out3,"__asm__(\"\\n\\t.global _%s@%d\\n\\t\"\n",name,stacksize); - fprintf(out3,"\"_%s@%d:\\n\\t\"\n",name,stacksize); -#else - fprintf(out3,"__asm__(\"\\n\\t.global _%s\\n\\t\"\n",name); - fprintf(out3,"\"_%s:\\n\\t\"\n",name); -#endif - fprintf(out3,"\t\"mov\t$%d,%%eax\\n\\t\"\n",sys_call_idx | INDEX); - fprintf(out3,"\t\"lea\t4(%%esp),%%edx\\n\\t\"\n"); - fprintf(out3,"\t\"int\t$0x2E\\n\\t\"\n"); - fprintf(out3,"\t\"ret\t$%d\\n\\t\");\n\n",stacksize); - /* Next system call index */ sys_call_idx++; } @@ -321,10 +299,9 @@ int main(int argc, char* argv[]) FILE * out1; /* SERVICE_TABLE */ FILE * out2; /* GDI32 stubs */ FILE * out3; /* USER32 stubs */ - FILE * out4; /* CSRSS stubs */ int ret; - if (argc != 6) + if (argc != 5) { usage(argv[0]); return(1); @@ -358,14 +335,7 @@ int main(int argc, char* argv[]) return(1); } - out4 = fopen(argv[5],"wb"); - if (out4 == NULL) - { - perror("Failed to open output file (CSRSS stubs)"); - return(1); - } - - ret = process(in,out2,out3,out4); + ret = process(in,out2,out3); rewind(in); ret = makeSystemServiceTable(in, out1); diff --git a/reactos/iface/addsys/makefile b/reactos/iface/addsys/makefile index 1d2a5fdcd99..a85b94f209e 100644 --- a/reactos/iface/addsys/makefile +++ b/reactos/iface/addsys/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.12 2003/11/14 17:13:29 weiden Exp $ +# $Id: makefile,v 1.13 2003/12/03 21:50:49 gvg Exp $ # # ReactOS Operating System # @@ -17,7 +17,6 @@ SVC_MASK=0x1000 SVC_SERVICE_TABLE=../../subsys/win32k/main/svctab.c SVC_GDI_STUBS=../../lib/gdi32/misc/win32k.c SVC_USER_STUBS=../../lib/user32/misc/win32k.c -SVC_CSRSS_STUBS=../../subsys/csrss/win32k.c SVC_FILES = $(SVC_GDI_STUBS) $(SVC_USER_STUBS) $(SVC_SERVICE_TABLE) @@ -41,8 +40,7 @@ $(SVC_FILES): $(SVC_DB) $(TARGETNAME)$(EXE_POSTFIX) $(SVC_DB) \ $(SVC_SERVICE_TABLE) \ $(SVC_GDI_STUBS) \ - $(SVC_USER_STUBS) \ - $(SVC_CSRSS_STUBS) + $(SVC_USER_STUBS) clean: diff --git a/reactos/iface/addsys/w32ksvc.db b/reactos/iface/addsys/w32ksvc.db index cf724c9df44..063fc22332f 100644 --- a/reactos/iface/addsys/w32ksvc.db +++ b/reactos/iface/addsys/w32ksvc.db @@ -174,7 +174,6 @@ NtGdiGetWinMetaFileBits 5 NtGdiGetWindowExtEx 2 NtGdiGetWindowOrgEx 2 NtGdiGetWorldTransform 2 -Win32kInitialize 0 NtGdiIntersectClipRect 5 NtGdiInvertRgn 2 NtGdiLPtoDP 3 @@ -564,6 +563,7 @@ NtUserGetWindow 2 NtUserGetLastActivePopup 1 NtUserGetShellWindow 0 NtUserDereferenceWndProcHandle 2 +NtUserGraphicsDone 0 # DirectDraw system calls NtGdiD3dContextCreate 4 NtGdiD3dContextDestroy 1 diff --git a/reactos/include/win32k/misc.h b/reactos/include/win32k/misc.h index c0b689370e1..76c03151f97 100644 --- a/reactos/include/win32k/misc.h +++ b/reactos/include/win32k/misc.h @@ -1,9 +1,9 @@ #ifndef __WIN32K_MISC_H #define __WIN32K_MISC_H -BOOLEAN +VOID STDCALL -Win32kInitialize (VOID); +NtUserGraphicsDone(VOID); VOID FASTCALL diff --git a/reactos/lib/user32/misc/misc.c b/reactos/lib/user32/misc/misc.c index 15287bc0a50..450262d865f 100644 --- a/reactos/lib/user32/misc/misc.c +++ b/reactos/lib/user32/misc/misc.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: misc.c,v 1.1 2003/11/19 12:33:32 weiden Exp $ +/* $Id: misc.c,v 1.2 2003/12/03 21:50:49 gvg Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/misc/misc.c @@ -46,3 +46,13 @@ GetGuiResources( return NtUserGetGuiResources(hProcess, uiFlags); } + +/* + * Private call for CSRSS + */ +VOID +STDCALL +PrivateCsrssGraphicsDone(VOID) +{ + NtUserGraphicsDone(); +} diff --git a/reactos/lib/user32/user32.def b/reactos/lib/user32/user32.def index b6924983df5..ff4cac75a9b 100644 --- a/reactos/lib/user32/user32.def +++ b/reactos/lib/user32/user32.def @@ -520,8 +520,9 @@ PostQuitMessage@4 PostThreadMessageA@16 PostThreadMessageW@16 PrintWindow@12 -PrivateCsrssRegisterPrimitive@0 PrivateCsrssAcquireOrReleaseInputOwnership@4 +PrivateCsrssRegisterPrimitive@0 +PrivateCsrssGraphicsDone@0 PrivateExtractIconExA@20 PrivateExtractIconExW@20 PrivateExtractIconsA@32 diff --git a/reactos/lib/user32/user32.edf b/reactos/lib/user32/user32.edf index aea59a08f95..2186ec352b1 100644 --- a/reactos/lib/user32/user32.edf +++ b/reactos/lib/user32/user32.edf @@ -521,8 +521,9 @@ PostQuitMessage=PostQuitMessage@4 PostThreadMessageA=PostThreadMessageA@16 PostThreadMessageW=PostThreadMessageW@16 PrintWindow=PrintWindow@12 -PrivateCsrssRegisterPrimitive=PrivateCsrssRegisterPrimitive@0 PrivateCsrssAcquireOrReleaseInputOwnership=PrivateCsrssAcquireOrReleaseInputOwnership@4 +PrivateCsrssRegisterPrimitive=PrivateCsrssRegisterPrimitive@0 +PrivateCsrssGraphicsDone=PrivateCsrssGraphicsDone@0 PrivateExtractIconExA=PrivateExtractIconExA@20 PrivateExtractIconExW=PrivateExtractIconExW@20 PrivateExtractIconsA=PrivateExtractIconsA@32 diff --git a/reactos/subsys/csrss/init.c b/reactos/subsys/csrss/init.c index 3e99ff7e591..b7c745bf689 100644 --- a/reactos/subsys/csrss/init.c +++ b/reactos/subsys/csrss/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.24 2003/12/02 11:38:47 gvg Exp $ +/* $Id: init.c,v 1.25 2003/12/03 21:50:49 gvg Exp $ * * reactos/subsys/csrss/init.c * @@ -195,8 +195,6 @@ CsrServerInitialization ( CsrIsCsrss( ); CsrInitVideo(); - Win32kInitialize(); - CsrssApiHeap = RtlCreateHeap(HEAP_GROWABLE, NULL, 65536, diff --git a/reactos/subsys/csrss/makefile b/reactos/subsys/csrss/makefile index dfaab47dbfd..8c64c6c940e 100644 --- a/reactos/subsys/csrss/makefile +++ b/reactos/subsys/csrss/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.25 2003/12/02 11:38:47 gvg Exp $ +# $Id: makefile,v 1.26 2003/12/03 21:50:49 gvg Exp $ PATH_TO_TOP = ../.. @@ -32,8 +32,7 @@ OBJECTS_MISC = \ $(TARGET_NAME).o \ init.o \ print.o \ - video.o \ - win32k.o + video.o TARGET_OBJECTS = \ $(OBJECTS_API) \ diff --git a/reactos/subsys/csrss/win32csr/guiconsole.c b/reactos/subsys/csrss/win32csr/guiconsole.c index e96ac3f6d17..4ac6ef5a5c9 100644 --- a/reactos/subsys/csrss/win32csr/guiconsole.c +++ b/reactos/subsys/csrss/win32csr/guiconsole.c @@ -1,4 +1,4 @@ -/* $Id: guiconsole.c,v 1.1 2003/12/02 11:38:46 gvg Exp $ +/* $Id: guiconsole.c,v 1.2 2003/12/03 21:50:49 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -13,6 +13,9 @@ #include "guiconsole.h" #include "win32csr.h" +/* Not defined in any header file */ +extern VOID STDCALL PrivateCsrssGraphicsDone(VOID); + /* GLOBALS *******************************************************************/ typedef struct GUI_CONSOLE_DATA_TAG @@ -493,7 +496,9 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) SetWindowLongW(hWnd, GWL_USERDATA, WindowCount); if (0 == WindowCount) { + NotifyWnd = NULL; DestroyWindow(hWnd); + PrivateCsrssGraphicsDone(); } return 0; default: diff --git a/reactos/subsys/win32k/main/dllmain.c b/reactos/subsys/win32k/main/dllmain.c index c38459cfe0b..71e8a49e6a5 100644 --- a/reactos/subsys/win32k/main/dllmain.c +++ b/reactos/subsys/win32k/main/dllmain.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dllmain.c,v 1.55 2003/11/25 22:06:31 gvg Exp $ +/* $Id: dllmain.c,v 1.56 2003/12/03 21:50:50 gvg Exp $ * * Entry Point for win32k.sys */ @@ -271,6 +271,19 @@ DllMain ( return(Status); } + InitGdiObjectHandleTable (); + + /* Initialize FreeType library */ + if (! InitFontSupport()) + { + DPRINT1("Unable to initialize font support\n"); + return STATUS_UNSUCCESSFUL; + } + + /* Create stock objects, ie. precreated objects commonly + used by win32 applications */ + CreateStockObjects(); + return STATUS_SUCCESS; } @@ -278,17 +291,6 @@ DllMain ( BOOLEAN STDCALL Win32kInitialize (VOID) { - DPRINT("in Win32kInitialize\n"); - - InitGdiObjectHandleTable (); - - // Initialize FreeType library - if (!InitFontSupport()) - return FALSE; - - // Create stock objects, ie. precreated objects commonly used by win32 applications - CreateStockObjects(); - return TRUE; } diff --git a/reactos/subsys/win32k/ntuser/guicheck.c b/reactos/subsys/win32k/ntuser/guicheck.c index cc22f5137a7..134e9d7e06b 100644 --- a/reactos/subsys/win32k/ntuser/guicheck.c +++ b/reactos/subsys/win32k/ntuser/guicheck.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: guicheck.c,v 1.15 2003/11/25 22:06:31 gvg Exp $ +/* $Id: guicheck.c,v 1.16 2003/12/03 21:50:50 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -77,6 +77,7 @@ IntGraphicsCheck(BOOL Create) { if (W32Data->CreatedWindowOrDC) { + W32Data->CreatedWindowOrDC = FALSE; if (0 < NrGuiApplicationsRunning) { NrGuiApplicationsRunning--; @@ -91,4 +92,10 @@ IntGraphicsCheck(BOOL Create) return TRUE; } +VOID STDCALL +NtUserGraphicsDone() +{ + IntGraphicsCheck(FALSE); +} + /* EOF */