Remove direct references from csrss to win32k (call via user32/gdi32 only)

svn path=/trunk/; revision=6858
This commit is contained in:
Gé van Geldorp 2003-12-03 21:50:50 +00:00
parent 42158841dc
commit 1ffe9401f6
12 changed files with 55 additions and 64 deletions

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS version of ntdll * PROJECT: ReactOS version of ntdll
@ -170,8 +170,7 @@ int
process( process(
FILE * in, FILE * in,
FILE * out1, FILE * out1,
FILE * out2, FILE * out2
FILE * out3
) )
{ {
char line [INPUT_BUFFER_SIZE]; char line [INPUT_BUFFER_SIZE];
@ -194,12 +193,6 @@ process(
fprintf(out2,"// Machine generated, don't edit\n"); fprintf(out2,"// Machine generated, don't edit\n");
fprintf(out2,"\n\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 * Scan the database. DB is a text file; each line
* is a record, which contains data for one system * 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\"int\t$0x2E\\n\\t\"\n");
fprintf(out2,"\t\"ret\t$%d\\n\\t\");\n\n",stacksize); 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 */ /* Next system call index */
sys_call_idx++; sys_call_idx++;
} }
@ -321,10 +299,9 @@ int main(int argc, char* argv[])
FILE * out1; /* SERVICE_TABLE */ FILE * out1; /* SERVICE_TABLE */
FILE * out2; /* GDI32 stubs */ FILE * out2; /* GDI32 stubs */
FILE * out3; /* USER32 stubs */ FILE * out3; /* USER32 stubs */
FILE * out4; /* CSRSS stubs */
int ret; int ret;
if (argc != 6) if (argc != 5)
{ {
usage(argv[0]); usage(argv[0]);
return(1); return(1);
@ -358,14 +335,7 @@ int main(int argc, char* argv[])
return(1); return(1);
} }
out4 = fopen(argv[5],"wb"); ret = process(in,out2,out3);
if (out4 == NULL)
{
perror("Failed to open output file (CSRSS stubs)");
return(1);
}
ret = process(in,out2,out3,out4);
rewind(in); rewind(in);
ret = makeSystemServiceTable(in, out1); ret = makeSystemServiceTable(in, out1);

View file

@ -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 # ReactOS Operating System
# #
@ -17,7 +17,6 @@ SVC_MASK=0x1000
SVC_SERVICE_TABLE=../../subsys/win32k/main/svctab.c SVC_SERVICE_TABLE=../../subsys/win32k/main/svctab.c
SVC_GDI_STUBS=../../lib/gdi32/misc/win32k.c SVC_GDI_STUBS=../../lib/gdi32/misc/win32k.c
SVC_USER_STUBS=../../lib/user32/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) 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_DB) \
$(SVC_SERVICE_TABLE) \ $(SVC_SERVICE_TABLE) \
$(SVC_GDI_STUBS) \ $(SVC_GDI_STUBS) \
$(SVC_USER_STUBS) \ $(SVC_USER_STUBS)
$(SVC_CSRSS_STUBS)
clean: clean:

View file

@ -174,7 +174,6 @@ NtGdiGetWinMetaFileBits 5
NtGdiGetWindowExtEx 2 NtGdiGetWindowExtEx 2
NtGdiGetWindowOrgEx 2 NtGdiGetWindowOrgEx 2
NtGdiGetWorldTransform 2 NtGdiGetWorldTransform 2
Win32kInitialize 0
NtGdiIntersectClipRect 5 NtGdiIntersectClipRect 5
NtGdiInvertRgn 2 NtGdiInvertRgn 2
NtGdiLPtoDP 3 NtGdiLPtoDP 3
@ -564,6 +563,7 @@ NtUserGetWindow 2
NtUserGetLastActivePopup 1 NtUserGetLastActivePopup 1
NtUserGetShellWindow 0 NtUserGetShellWindow 0
NtUserDereferenceWndProcHandle 2 NtUserDereferenceWndProcHandle 2
NtUserGraphicsDone 0
# DirectDraw system calls # DirectDraw system calls
NtGdiD3dContextCreate 4 NtGdiD3dContextCreate 4
NtGdiD3dContextDestroy 1 NtGdiD3dContextDestroy 1

View file

@ -1,9 +1,9 @@
#ifndef __WIN32K_MISC_H #ifndef __WIN32K_MISC_H
#define __WIN32K_MISC_H #define __WIN32K_MISC_H
BOOLEAN VOID
STDCALL STDCALL
Win32kInitialize (VOID); NtUserGraphicsDone(VOID);
VOID VOID
FASTCALL FASTCALL

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/misc.c * FILE: lib/user32/misc/misc.c
@ -46,3 +46,13 @@ GetGuiResources(
return NtUserGetGuiResources(hProcess, uiFlags); return NtUserGetGuiResources(hProcess, uiFlags);
} }
/*
* Private call for CSRSS
*/
VOID
STDCALL
PrivateCsrssGraphicsDone(VOID)
{
NtUserGraphicsDone();
}

View file

@ -520,8 +520,9 @@ PostQuitMessage@4
PostThreadMessageA@16 PostThreadMessageA@16
PostThreadMessageW@16 PostThreadMessageW@16
PrintWindow@12 PrintWindow@12
PrivateCsrssRegisterPrimitive@0
PrivateCsrssAcquireOrReleaseInputOwnership@4 PrivateCsrssAcquireOrReleaseInputOwnership@4
PrivateCsrssRegisterPrimitive@0
PrivateCsrssGraphicsDone@0
PrivateExtractIconExA@20 PrivateExtractIconExA@20
PrivateExtractIconExW@20 PrivateExtractIconExW@20
PrivateExtractIconsA@32 PrivateExtractIconsA@32

View file

@ -521,8 +521,9 @@ PostQuitMessage=PostQuitMessage@4
PostThreadMessageA=PostThreadMessageA@16 PostThreadMessageA=PostThreadMessageA@16
PostThreadMessageW=PostThreadMessageW@16 PostThreadMessageW=PostThreadMessageW@16
PrintWindow=PrintWindow@12 PrintWindow=PrintWindow@12
PrivateCsrssRegisterPrimitive=PrivateCsrssRegisterPrimitive@0
PrivateCsrssAcquireOrReleaseInputOwnership=PrivateCsrssAcquireOrReleaseInputOwnership@4 PrivateCsrssAcquireOrReleaseInputOwnership=PrivateCsrssAcquireOrReleaseInputOwnership@4
PrivateCsrssRegisterPrimitive=PrivateCsrssRegisterPrimitive@0
PrivateCsrssGraphicsDone=PrivateCsrssGraphicsDone@0
PrivateExtractIconExA=PrivateExtractIconExA@20 PrivateExtractIconExA=PrivateExtractIconExA@20
PrivateExtractIconExW=PrivateExtractIconExW@20 PrivateExtractIconExW=PrivateExtractIconExW@20
PrivateExtractIconsA=PrivateExtractIconsA@32 PrivateExtractIconsA=PrivateExtractIconsA@32

View file

@ -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 * reactos/subsys/csrss/init.c
* *
@ -195,8 +195,6 @@ CsrServerInitialization (
CsrIsCsrss( ); CsrIsCsrss( );
CsrInitVideo(); CsrInitVideo();
Win32kInitialize();
CsrssApiHeap = RtlCreateHeap(HEAP_GROWABLE, CsrssApiHeap = RtlCreateHeap(HEAP_GROWABLE,
NULL, NULL,
65536, 65536,

View file

@ -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 = ../.. PATH_TO_TOP = ../..
@ -32,8 +32,7 @@ OBJECTS_MISC = \
$(TARGET_NAME).o \ $(TARGET_NAME).o \
init.o \ init.o \
print.o \ print.o \
video.o \ video.o
win32k.o
TARGET_OBJECTS = \ TARGET_OBJECTS = \
$(OBJECTS_API) \ $(OBJECTS_API) \

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -13,6 +13,9 @@
#include "guiconsole.h" #include "guiconsole.h"
#include "win32csr.h" #include "win32csr.h"
/* Not defined in any header file */
extern VOID STDCALL PrivateCsrssGraphicsDone(VOID);
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
typedef struct GUI_CONSOLE_DATA_TAG typedef struct GUI_CONSOLE_DATA_TAG
@ -493,7 +496,9 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
SetWindowLongW(hWnd, GWL_USERDATA, WindowCount); SetWindowLongW(hWnd, GWL_USERDATA, WindowCount);
if (0 == WindowCount) if (0 == WindowCount)
{ {
NotifyWnd = NULL;
DestroyWindow(hWnd); DestroyWindow(hWnd);
PrivateCsrssGraphicsDone();
} }
return 0; return 0;
default: default:

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * Entry Point for win32k.sys
*/ */
@ -271,6 +271,19 @@ DllMain (
return(Status); 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; return STATUS_SUCCESS;
} }
@ -278,17 +291,6 @@ DllMain (
BOOLEAN STDCALL BOOLEAN STDCALL
Win32kInitialize (VOID) 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; return TRUE;
} }

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -77,6 +77,7 @@ IntGraphicsCheck(BOOL Create)
{ {
if (W32Data->CreatedWindowOrDC) if (W32Data->CreatedWindowOrDC)
{ {
W32Data->CreatedWindowOrDC = FALSE;
if (0 < NrGuiApplicationsRunning) if (0 < NrGuiApplicationsRunning)
{ {
NrGuiApplicationsRunning--; NrGuiApplicationsRunning--;
@ -91,4 +92,10 @@ IntGraphicsCheck(BOOL Create)
return TRUE; return TRUE;
} }
VOID STDCALL
NtUserGraphicsDone()
{
IntGraphicsCheck(FALSE);
}
/* EOF */ /* EOF */