diff --git a/reactos/include/ndk/mmfuncs.h b/reactos/include/ndk/mmfuncs.h new file mode 100644 index 00000000000..43a073798d4 --- /dev/null +++ b/reactos/include/ndk/mmfuncs.h @@ -0,0 +1,23 @@ +/* + * PROJECT: ReactOS Native Headers + * FILE: include/ndk/halfuncs.h + * PURPOSE: Prototypes for exported HAL Functions not defined in DDK/IFS + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + * UPDATE HISTORY: + * Created 06/10/04 + */ +#ifndef _MMFUNCS_H +#define _MMFUNCS_H + +/* DEPENDENCIES **************************************************************/ + + +/* PROTOTYPES ****************************************************************/ +NTSTATUS +STDCALL +MmUnmapViewOfSection( + struct _EPROCESS* Process, + PVOID BaseAddress +); + +#endif diff --git a/reactos/include/ndk/ntndk.h b/reactos/include/ndk/ntndk.h index 34f3a414831..fb17b27702f 100644 --- a/reactos/include/ndk/ntndk.h +++ b/reactos/include/ndk/ntndk.h @@ -26,6 +26,7 @@ #include "ldrfuncs.h" /* Loader Functions */ #include "lpctypes.h" /* Local Procedure Call Types */ #include "mmtypes.h" /* Memory Manager Types */ + #include "mmfuncs.h" /* Memory Manager Functions */ #include "obtypes.h" /* Object Manager Types */ #include "obfuncs.h" /* Object Manager Functions */ #include "potypes.h" /* Power Manager Types */ diff --git a/reactos/include/ndk/obfuncs.h b/reactos/include/ndk/obfuncs.h index e583239cd49..09ef7366349 100644 --- a/reactos/include/ndk/obfuncs.h +++ b/reactos/include/ndk/obfuncs.h @@ -93,4 +93,14 @@ ObReferenceObjectByName ( OUT PVOID *Object ); +NTSTATUS +STDCALL +ObFindHandleForObject( + IN PEPROCESS Process, + IN PVOID Object, + IN POBJECT_TYPE ObjectType, + IN POBJECT_HANDLE_INFORMATION HandleInformation, + OUT PHANDLE Handle +); + #endif diff --git a/reactos/include/ndk/obtypes.h b/reactos/include/ndk/obtypes.h index 7ada5ae51d9..d34e210e264 100644 --- a/reactos/include/ndk/obtypes.h +++ b/reactos/include/ndk/obtypes.h @@ -115,6 +115,17 @@ typedef NTSTATUS /* TYPES *********************************************************************/ +/* FIXME: Does this match NT's? */ +typedef struct _W32_OBJECT_CALLBACK +{ + OB_OPEN_METHOD WinStaCreate; + OB_PARSE_METHOD WinStaParse; + OB_DELETE_METHOD WinStaDelete; + OB_FIND_METHOD WinStaFind; + OB_CREATE_METHOD DesktopCreate; + OB_DELETE_METHOD DesktopDelete; +} W32_OBJECT_CALLBACK, *PW32_OBJECT_CALLBACK; + typedef struct _OBJECT_BASIC_INFORMATION { ULONG Attributes; diff --git a/reactos/include/ndk/psfuncs.h b/reactos/include/ndk/psfuncs.h index 10c8ba1ac5c..a7be1086053 100644 --- a/reactos/include/ndk/psfuncs.h +++ b/reactos/include/ndk/psfuncs.h @@ -10,6 +10,7 @@ #define _PSFUNCS_H /* DEPENDENCIES **************************************************************/ +#include "pstypes.h" /* PROTOTYPES ****************************************************************/ @@ -31,4 +32,19 @@ PsGetWin32Process( VOID ); +VOID +STDCALL +PsEstablishWin32Callouts( + PW32_PROCESS_CALLBACK W32ProcessCallback, + PW32_THREAD_CALLBACK W32ThreadCallback, + PW32_OBJECT_CALLBACK W32ObjectCallback, + PVOID Param4, + ULONG W32ThreadSize, + ULONG W32ProcessSize +); + +HANDLE +STDCALL +PsGetProcessId(struct _EPROCESS *Process); + #endif diff --git a/reactos/include/win32k/kapi.h b/reactos/include/win32k/kapi.h index 9582c29d2f1..e45b90d0971 100644 --- a/reactos/include/win32k/kapi.h +++ b/reactos/include/win32k/kapi.h @@ -6,6 +6,8 @@ #endif #include +#include +#include #include #include #include diff --git a/reactos/ntoskrnl/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h index ff840d83ed5..7f3322631a1 100644 --- a/reactos/ntoskrnl/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -1,70 +1,6 @@ #ifndef __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H #define __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H -typedef enum -{ - wmCenter = 0, - wmTile, - wmStretch -} WALLPAPER_MODE; - -typedef struct _WINSTATION_OBJECT -{ - PVOID SharedHeap; /* points to kmode memory! */ - - CSHORT Type; - CSHORT Size; - KSPIN_LOCK Lock; - UNICODE_STRING Name; - LIST_ENTRY DesktopListHead; - PRTL_ATOM_TABLE AtomTable; - PVOID HandleTable; - HANDLE SystemMenuTemplate; - PVOID SystemCursor; - UINT CaretBlinkRate; - HANDLE ShellWindow; - HANDLE ShellListView; - - /* Wallpaper */ - HANDLE hbmWallpaper; - ULONG cxWallpaper, cyWallpaper; - WALLPAPER_MODE WallpaperMode; - - ULONG Flags; - struct _DESKTOP_OBJECT* ActiveDesktop; - /* FIXME: Clipboard */ - LIST_ENTRY HotKeyListHead; - FAST_MUTEX HotKeyListLock; -} WINSTATION_OBJECT, *PWINSTATION_OBJECT; - -typedef struct _DESKTOP_OBJECT -{ - PVOID DesktopHeap; /* points to kmode memory! */ - - CSHORT Type; - CSHORT Size; - LIST_ENTRY ListEntry; - KSPIN_LOCK Lock; - UNICODE_STRING Name; - /* Pointer to the associated window station. */ - struct _WINSTATION_OBJECT *WindowStation; - /* Pointer to the active queue. */ - PVOID ActiveMessageQueue; - /* Rectangle of the work area */ -#ifdef __WIN32K__ - RECT WorkArea; -#else - LONG WorkArea[4]; -#endif - /* Handle of the desktop window. */ - HANDLE DesktopWindow; - HANDLE PrevActiveWindow; - /* Thread blocking input */ - PVOID BlockInputThread; - - LIST_ENTRY ShellHookWindows; -} DESKTOP_OBJECT, *PDESKTOP_OBJECT; - /* GLOBAL VARIABLES *********************************************************/ extern TIME_ZONE_INFORMATION ExpTimeZoneInfo; diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 7452dbafdeb..dd10b6dbf30 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -845,11 +845,8 @@ MmWritePageSectionView(PMADDRESS_SPACE AddressSpace, NTSTATUS MmInitSectionImplementation(VOID); -NTSTATUS STDCALL -MmUnmapViewOfSection(struct _EPROCESS* Process, PVOID BaseAddress); - -/* FIXME: it should be in ddk/mmfuncs.h */ -NTSTATUS STDCALL +NTSTATUS +STDCALL MmCreateSection (OUT PSECTION_OBJECT * SectionObject, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, diff --git a/reactos/ntoskrnl/include/internal/nt.h b/reactos/ntoskrnl/include/internal/nt.h deleted file mode 100644 index 1276503ca7a..00000000000 --- a/reactos/ntoskrnl/include/internal/nt.h +++ /dev/null @@ -1,7 +0,0 @@ -VOID NtInitializeEventImplementation(VOID); -VOID NtInitializeEventPairImplementation(VOID); -VOID NtInitializeSemaphoreImplementation(VOID); -VOID NtInitializeMutantImplementation(VOID); -VOID NtInitializeTimerImplementation(VOID); -NTSTATUS NiInitPort(VOID); -VOID NtInitializeProfileImplementation(VOID); diff --git a/reactos/ntoskrnl/include/internal/ps.h b/reactos/ntoskrnl/include/internal/ps.h index bcfcf27cd37..38654ebfdbf 100644 --- a/reactos/ntoskrnl/include/internal/ps.h +++ b/reactos/ntoskrnl/include/internal/ps.h @@ -18,15 +18,6 @@ extern LCID PsDefaultSystemLocaleId; #define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04) #define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04) -typedef struct _W32_OBJECT_CALLBACK { - OB_OPEN_METHOD WinStaCreate; - OB_PARSE_METHOD WinStaParse; - OB_DELETE_METHOD WinStaDelete; - OB_FIND_METHOD WinStaFind; - OB_CREATE_METHOD DesktopCreate; - OB_DELETE_METHOD DesktopDelete; -} W32_OBJECT_CALLBACK, *PW32_OBJECT_CALLBACK; - #define PROCESS_STATE_TERMINATED (1) #define PROCESS_STATE_ACTIVE (2) diff --git a/reactos/ntoskrnl/include/ntoskrnl.h b/reactos/ntoskrnl/include/ntoskrnl.h index fc41ac84666..19b745037da 100755 --- a/reactos/ntoskrnl/include/ntoskrnl.h +++ b/reactos/ntoskrnl/include/ntoskrnl.h @@ -1,6 +1,14 @@ -#ifndef __INCLUDE_NTOSKRNL_H -#define __INCLUDE_NTOSKRNL_H +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Kernel + * FILE: ntoskrnl/include/ntoskrnl.h + * PURPOSE: Main Kernel Header + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + */ +/* INCLUDES ******************************************************************/ + +/* We are the Kernel */ #define NTKERNELAPI /* include the ntoskrnl config.h file */ @@ -37,5 +45,3 @@ /* Internal Headers */ #include "internal/ntoskrnl.h" - -#endif /* INCLUDE_NTOSKRNL_H */ diff --git a/reactos/ntoskrnl/ps/win32.c b/reactos/ntoskrnl/ps/win32.c index de106b25de6..477549e73f1 100644 --- a/reactos/ntoskrnl/ps/win32.c +++ b/reactos/ntoskrnl/ps/win32.c @@ -45,16 +45,18 @@ typedef struct _NTW32CALL_SAVED_STATE /* FUNCTIONS ***************************************************************/ -PW32THREAD STDCALL +struct _W32THREAD* +STDCALL PsGetWin32Thread(VOID) { return(PsGetCurrentThread()->Tcb.Win32Thread); } -PW32PROCESS STDCALL +struct _W32PROCESS* +STDCALL PsGetWin32Process(VOID) { - return (PW32PROCESS)PsGetCurrentProcess()->Win32Process; + return (struct _W32PROCESS*)PsGetCurrentProcess()->Win32Process; } NTSTATUS STDCALL diff --git a/reactos/subsys/win32k/include/accelerator.h b/reactos/subsys/win32k/include/accelerator.h index 13fff1fde46..af8c482163a 100644 --- a/reactos/subsys/win32k/include/accelerator.h +++ b/reactos/subsys/win32k/include/accelerator.h @@ -1,8 +1,6 @@ #ifndef _WIN32K_ACCELERATOR_H #define _WIN32K_ACCELERATOR_H -#include -#include #include #include diff --git a/reactos/subsys/win32k/include/caret.h b/reactos/subsys/win32k/include/caret.h index a05e014cf86..8ca0548fcce 100644 --- a/reactos/subsys/win32k/include/caret.h +++ b/reactos/subsys/win32k/include/caret.h @@ -1,9 +1,6 @@ #ifndef _WIN32K_CARET_H #define _WIN32K_CARET_H -#include -#include - #define IDCARETTIMER (0xffff) BOOL FASTCALL diff --git a/reactos/subsys/win32k/include/class.h b/reactos/subsys/win32k/include/class.h index 527b50fc2d7..1a7a34c20e3 100644 --- a/reactos/subsys/win32k/include/class.h +++ b/reactos/subsys/win32k/include/class.h @@ -1,11 +1,6 @@ #ifndef _WIN32K_CLASS_H #define _WIN32K_CLASS_H -#include -#include -#include -#include - #define IS_ATOM(x) \ (((ULONG_PTR)(x) > 0x0) && ((ULONG_PTR)(x) < 0x10000)) diff --git a/reactos/subsys/win32k/include/clipboard.h b/reactos/subsys/win32k/include/clipboard.h index c932ec086ab..936b113b728 100644 --- a/reactos/subsys/win32k/include/clipboard.h +++ b/reactos/subsys/win32k/include/clipboard.h @@ -1,8 +1,6 @@ #ifndef _WIN32K_CLIPBOARD_H #define _WIN32K_CLIPBOARD_H -#include - UINT FASTCALL IntEnumClipboardFormats(UINT format); diff --git a/reactos/subsys/win32k/include/desktop.h b/reactos/subsys/win32k/include/desktop.h index fb02d862a59..b9de2f613b1 100644 --- a/reactos/subsys/win32k/include/desktop.h +++ b/reactos/subsys/win32k/include/desktop.h @@ -1,13 +1,33 @@ #ifndef _WIN32K_DESKTOP_H #define _WIN32K_DESKTOP_H -#include -#include -#include -#include #include "msgqueue.h" #include "window.h" +typedef struct _DESKTOP_OBJECT +{ + PVOID DesktopHeap; /* points to kmode memory! */ + + CSHORT Type; + CSHORT Size; + LIST_ENTRY ListEntry; + KSPIN_LOCK Lock; + UNICODE_STRING Name; + /* Pointer to the associated window station. */ + struct _WINSTATION_OBJECT *WindowStation; + /* Pointer to the active queue. */ + PVOID ActiveMessageQueue; + /* Rectangle of the work area */ + RECT WorkArea; + /* Handle of the desktop window. */ + HANDLE DesktopWindow; + HANDLE PrevActiveWindow; + /* Thread blocking input */ + PVOID BlockInputThread; + + LIST_ENTRY ShellHookWindows; +} DESKTOP_OBJECT, *PDESKTOP_OBJECT; + extern PDESKTOP_OBJECT InputDesktop; extern HDESK InputDesktopHandle; extern PWNDCLASS_OBJECT DesktopWindowClass; diff --git a/reactos/subsys/win32k/include/guicheck.h b/reactos/subsys/win32k/include/guicheck.h index 5bbb9951d96..24de8c740dc 100644 --- a/reactos/subsys/win32k/include/guicheck.h +++ b/reactos/subsys/win32k/include/guicheck.h @@ -1,9 +1,6 @@ #ifndef _WIN32K_GUICHECK_H #define _WIN32K_GUICHECK_H -#include -#include - BOOL FASTCALL IntGraphicsCheck(BOOL Create); BOOL FASTCALL IntCreatePrimarySurface(); VOID FASTCALL IntDestroyPrimarySurface(); diff --git a/reactos/subsys/win32k/include/hook.h b/reactos/subsys/win32k/include/hook.h index da4d6d98147..af8cccc08e0 100644 --- a/reactos/subsys/win32k/include/hook.h +++ b/reactos/subsys/win32k/include/hook.h @@ -1,9 +1,6 @@ #ifndef _WIN32K_HOOK_H #define _WIN32K_HOOK_H -#include -#include - #define HOOK_THREAD_REFERENCED (0x1) typedef struct tagHOOK diff --git a/reactos/subsys/win32k/include/hotkey.h b/reactos/subsys/win32k/include/hotkey.h index 9711a3a666a..d42b410df24 100644 --- a/reactos/subsys/win32k/include/hotkey.h +++ b/reactos/subsys/win32k/include/hotkey.h @@ -1,8 +1,6 @@ #ifndef _WIN32K_HOTKEY_H #define _WIN32K_HOTKEY_H -#include -#include #include #include diff --git a/reactos/subsys/win32k/include/menu.h b/reactos/subsys/win32k/include/menu.h index 5b66840ca28..cbe0cdba0d3 100644 --- a/reactos/subsys/win32k/include/menu.h +++ b/reactos/subsys/win32k/include/menu.h @@ -1,8 +1,6 @@ #ifndef _WIN32K_MENU_H #define _WIN32K_MENU_H -#include -#include #include #define IS_ATOM(x) \ diff --git a/reactos/subsys/win32k/include/monitor.h b/reactos/subsys/win32k/include/monitor.h index dfe1e68b731..ab0bf3c8755 100644 --- a/reactos/subsys/win32k/include/monitor.h +++ b/reactos/subsys/win32k/include/monitor.h @@ -1,8 +1,6 @@ #ifndef _WIN32K_MONITOR_H #define _WIN32K_MONITOR_H -#include - struct GDIDEVICE; /* monitor object */ diff --git a/reactos/subsys/win32k/include/mouse.h b/reactos/subsys/win32k/include/mouse.h index 5bd050a8cf0..a41b5813969 100644 --- a/reactos/subsys/win32k/include/mouse.h +++ b/reactos/subsys/win32k/include/mouse.h @@ -3,7 +3,6 @@ #include "../eng/misc.h" #include -//#include INT INTERNAL_CALL MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1, LONG HazardY1, LONG HazardX2, LONG HazardY2); INT INTERNAL_CALL MouseSafetyOnDrawEnd(SURFOBJ *SurfObj); diff --git a/reactos/subsys/win32k/include/msgqueue.h b/reactos/subsys/win32k/include/msgqueue.h index d9e7eeb7a80..6c32100f852 100644 --- a/reactos/subsys/win32k/include/msgqueue.h +++ b/reactos/subsys/win32k/include/msgqueue.h @@ -1,8 +1,6 @@ #ifndef _WIN32K_MSGQUEUE_H #define _WIN32K_MSGQUEUE_H -#include -#include #include "caret.h" #include "hook.h" diff --git a/reactos/subsys/win32k/include/object.h b/reactos/subsys/win32k/include/object.h index 54e73794936..8562290a292 100644 --- a/reactos/subsys/win32k/include/object.h +++ b/reactos/subsys/win32k/include/object.h @@ -1,7 +1,6 @@ #ifndef _WIN32K_OBJECT_H #define _WIN32K_OBJECT_H -#include #include #include #include diff --git a/reactos/subsys/win32k/include/painting.h b/reactos/subsys/win32k/include/painting.h index bba8478866b..b0b06d62b11 100644 --- a/reactos/subsys/win32k/include/painting.h +++ b/reactos/subsys/win32k/include/painting.h @@ -1,8 +1,6 @@ #ifndef _WIN32K_PAINTING_H #define _WIN32K_PAINTING_H -#include -#include #include #include #include diff --git a/reactos/subsys/win32k/include/useratom.h b/reactos/subsys/win32k/include/useratom.h index ff04c4347f0..4686d5269c8 100644 --- a/reactos/subsys/win32k/include/useratom.h +++ b/reactos/subsys/win32k/include/useratom.h @@ -1,9 +1,6 @@ #ifndef _WIN32K_USERATOM_H #define _WIN32K_USERATOM_H -#include -#include - RTL_ATOM FASTCALL IntAddAtom(LPWSTR AtomName); ULONG FASTCALL diff --git a/reactos/subsys/win32k/include/vis.h b/reactos/subsys/win32k/include/vis.h index ebef043211d..8f1e95f50e3 100644 --- a/reactos/subsys/win32k/include/vis.h +++ b/reactos/subsys/win32k/include/vis.h @@ -11,7 +11,6 @@ #ifndef _WIN32K_VIS_H #define _WIN32K_VIS_H -#include #include HRGN FASTCALL diff --git a/reactos/subsys/win32k/include/win32k.h b/reactos/subsys/win32k/include/win32k.h new file mode 100644 index 00000000000..c660436ffa8 --- /dev/null +++ b/reactos/subsys/win32k/include/win32k.h @@ -0,0 +1,60 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Graphics Subsystem + * FILE: subsys/win32k/include/win32k.h + * PURPOSE: Internal Win32K Header + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + */ + +/* INCLUDES ******************************************************************/ + +/* Internal Win32k Headers */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* EOF */ diff --git a/reactos/subsys/win32k/include/window.h b/reactos/subsys/win32k/include/window.h index e6529dade61..8dd0a7cd976 100644 --- a/reactos/subsys/win32k/include/window.h +++ b/reactos/subsys/win32k/include/window.h @@ -5,8 +5,6 @@ struct _PROPERTY; struct _WINDOW_OBJECT; typedef struct _WINDOW_OBJECT *PWINDOW_OBJECT; -#include -#include #include #include #include diff --git a/reactos/subsys/win32k/include/winsta.h b/reactos/subsys/win32k/include/winsta.h index 2ed589d126f..64c83eacc2f 100644 --- a/reactos/subsys/win32k/include/winsta.h +++ b/reactos/subsys/win32k/include/winsta.h @@ -1,10 +1,6 @@ #ifndef _WIN32K_WINSTA_H #define _WIN32K_WINSTA_H -#include -#include -#include -#include #include "msgqueue.h" #define WINSTA_ROOT_NAME L"\\Windows\\WindowStations" @@ -14,6 +10,42 @@ #define WSS_LOCKED (1) #define WSS_NOINTERACTIVE (2) +typedef enum +{ + wmCenter = 0, + wmTile, + wmStretch +} WALLPAPER_MODE; + +typedef struct _WINSTATION_OBJECT +{ + PVOID SharedHeap; /* points to kmode memory! */ + + CSHORT Type; + CSHORT Size; + KSPIN_LOCK Lock; + UNICODE_STRING Name; + LIST_ENTRY DesktopListHead; + PRTL_ATOM_TABLE AtomTable; + PVOID HandleTable; + HANDLE SystemMenuTemplate; + PVOID SystemCursor; + UINT CaretBlinkRate; + HANDLE ShellWindow; + HANDLE ShellListView; + + /* Wallpaper */ + HANDLE hbmWallpaper; + ULONG cxWallpaper, cyWallpaper; + WALLPAPER_MODE WallpaperMode; + + ULONG Flags; + struct _DESKTOP_OBJECT* ActiveDesktop; + /* FIXME: Clipboard */ + LIST_ENTRY HotKeyListHead; + FAST_MUTEX HotKeyListLock; +} WINSTATION_OBJECT, *PWINSTATION_OBJECT; + extern WINSTATION_OBJECT *InputWindowStation; extern PW32PROCESS LogonProcess; diff --git a/reactos/subsys/win32k/main/dllmain.c b/reactos/subsys/win32k/main/dllmain.c index b995463695b..0a6710a731c 100644 --- a/reactos/subsys/win32k/main/dllmain.c +++ b/reactos/subsys/win32k/main/dllmain.c @@ -20,7 +20,9 @@ * * Entry Point for win32k.sys */ +#include /* FIXME: FIX THIS! */ #include +#include #define NDEBUG #include diff --git a/reactos/subsys/win32k/main/svctabm.c b/reactos/subsys/win32k/main/svctabm.c deleted file mode 100644 index 0844d079368..00000000000 --- a/reactos/subsys/win32k/main/svctabm.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * ReactOS W32 Subsystem - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* - * ReactOS W32 Subsystem - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * Entry Point for win32k.sys - */ - -#undef WIN32_LEAN_AND_MEAN -#define WIN32_NO_STATUS -#include -#define NTOS_MODE_KERNEL -#include -#include -#include -#include - -/* - * NOTE: the table is actually in the file ./svctab.c, - * generated by iface/addsys/mktab.c + w32ksvc.db - */ -#include "svctab.c" - diff --git a/reactos/subsys/win32k/misc/driver.c b/reactos/subsys/win32k/misc/driver.c index 8b8492147ec..257431bbad5 100644 --- a/reactos/subsys/win32k/misc/driver.c +++ b/reactos/subsys/win32k/misc/driver.c @@ -74,7 +74,7 @@ PGD_ENABLEDRIVER DRIVER_FindDDIDriver(LPCWSTR Name) { static WCHAR DefaultPath[] = L"\\SystemRoot\\System32\\"; static WCHAR DefaultExtension[] = L".DLL"; - SYSTEM_LOAD_IMAGE GdiDriverInfo; + SYSTEM_GDI_DRIVER_INFORMATION GdiDriverInfo; GRAPHICS_DRIVER *Driver = DriverList; NTSTATUS Status; WCHAR *FullName; @@ -140,8 +140,8 @@ PGD_ENABLEDRIVER DRIVER_FindDDIDriver(LPCWSTR Name) } /* If not, then load it */ - RtlInitUnicodeString (&GdiDriverInfo.ModuleName, (LPWSTR)FullName); - Status = ZwSetSystemInformation (SystemLoadImage, &GdiDriverInfo, sizeof(SYSTEM_LOAD_IMAGE)); + RtlInitUnicodeString (&GdiDriverInfo.DriverName, (LPWSTR)FullName); + Status = ZwSetSystemInformation (SystemLoadGdiDriverInformation, &GdiDriverInfo, sizeof(SYSTEM_GDI_DRIVER_INFORMATION)); ExFreePool(FullName); if (!NT_SUCCESS(Status)) return NULL; diff --git a/reactos/subsys/win32k/ntddraw/ddraw.c b/reactos/subsys/win32k/ntddraw/ddraw.c index 15eb929e496..54304ec0d7a 100644 --- a/reactos/subsys/win32k/ntddraw/ddraw.c +++ b/reactos/subsys/win32k/ntddraw/ddraw.c @@ -8,10 +8,11 @@ * REVISION HISTORY: * 25-10-2003 PB Created */ - +/* FIXME: FOR THE LOVE OF GOD SOMEONE PLEASE FIX THIS FUCKFEST */ #include #include #include +#include #include #include #include diff --git a/reactos/subsys/win32k/ntddraw/stubs.c b/reactos/subsys/win32k/ntddraw/stubs.c index d4073a85cba..4e3bff50df9 100644 --- a/reactos/subsys/win32k/ntddraw/stubs.c +++ b/reactos/subsys/win32k/ntddraw/stubs.c @@ -8,9 +8,11 @@ * REVISION HISTORY: * 25-10-2003 PB Created */ +/* FIXME: FOR THE LOVE OF GOD SOMEONE PLEASE FIX THIS FUCKFEST */ #include #include #include +#include #include #define NDEBUG diff --git a/reactos/subsys/win32k/ntuser/csr.c b/reactos/subsys/win32k/ntuser/csr.c index d662b25e068..24736be7459 100644 --- a/reactos/subsys/win32k/ntuser/csr.c +++ b/reactos/subsys/win32k/ntuser/csr.c @@ -58,7 +58,7 @@ CsrNotify(PCSR_API_MESSAGE Request) OldProcess = PsGetCurrentProcess(); if (CsrProcess != OldProcess) { - KeAttachProcess(EPROCESS_TO_KPROCESS(CsrProcess)); + KeAttachProcess(&CsrProcess->Pcb); } Status = ZwRequestWaitReplyPort(WindowsApiPort, &Request->Header, @@ -132,7 +132,7 @@ CsrCloseHandle(HANDLE Handle) OldProcess = PsGetCurrentProcess(); if (CsrProcess != OldProcess) { - KeAttachProcess(EPROCESS_TO_KPROCESS(CsrProcess)); + KeAttachProcess(&CsrProcess->Pcb); } Status = ZwClose(Handle); diff --git a/reactos/subsys/win32k/ntuser/desktop.c b/reactos/subsys/win32k/ntuser/desktop.c index 21d1f846375..fd2904213af 100644 --- a/reactos/subsys/win32k/ntuser/desktop.c +++ b/reactos/subsys/win32k/ntuser/desktop.c @@ -30,19 +30,6 @@ /* INCLUDES ******************************************************************/ #include -#if 0 -/* not yet defined in w32api... */ -NTSTATUS STDCALL -ObFindHandleForObject(IN PEPROCESS Process, - IN PVOID Object, - IN POBJECT_TYPE ObjectType, - IN POBJECT_HANDLE_INFORMATION HandleInformation, - OUT PHANDLE Handle); -#else -#define ObFindHandleForObject(Process, Object, ObjectType, HandleInformation, Handle) \ - (STATUS_UNSUCCESSFUL) -#endif - /* GLOBALS *******************************************************************/ /* Currently active desktop */ @@ -1359,7 +1346,7 @@ NtUserGetThreadDesktop(DWORD dwThreadId, DWORD Unknown1) may be a bit safer (e.g. when the desktop is being destroyed */ /* switch into the context of the thread we're trying to get the desktop from, so we can use the handle */ - KeAttachProcess(EPROCESS_TO_KPROCESS(Thread->ThreadsProcess)); + KeAttachProcess(&Thread->ThreadsProcess->Pcb); Status = ObReferenceObjectByHandle(hThreadDesktop, GENERIC_ALL, ExDesktopObjectType, diff --git a/reactos/subsys/win32k/ntuser/menu.c b/reactos/subsys/win32k/ntuser/menu.c index f3d5d191468..411d24d3f28 100644 --- a/reactos/subsys/win32k/ntuser/menu.c +++ b/reactos/subsys/win32k/ntuser/menu.c @@ -1250,7 +1250,7 @@ IntCleanupMenus(struct _EPROCESS *Process, PW32PROCESS Win32Process) CurrentProcess = PsGetCurrentProcess(); if (CurrentProcess != Process) { - KeAttachProcess(EPROCESS_TO_KPROCESS(Process)); + KeAttachProcess(&Process->Pcb); } IntLockProcessMenus(Win32Process); diff --git a/reactos/subsys/win32k/objects/gdiobj.c b/reactos/subsys/win32k/objects/gdiobj.c index 4f280bac1f4..e4bb155d78c 100644 --- a/reactos/subsys/win32k/objects/gdiobj.c +++ b/reactos/subsys/win32k/objects/gdiobj.c @@ -22,27 +22,10 @@ * $Id$ */ #include -#include #define NDEBUG #include -#include - -#ifdef __USE_W32API -/* F*(&#$ header mess!!!! */ -HANDLE -STDCALL PsGetProcessId( - PEPROCESS Process - ); -/* ditto */ -ULONG STDCALL -KeRosGetStackFrames ( PULONG Frames, ULONG FrameCount ); -#endif /* __USE_W32API */ - - - - #define GDI_ENTRY_TO_INDEX(ht, e) \ (((ULONG_PTR)(e) - (ULONG_PTR)&((ht)->Entries[0])) / sizeof(GDI_TABLE_ENTRY)) #define GDI_HANDLE_GET_ENTRY(HandleTable, h) \ @@ -656,7 +639,7 @@ GDI_CleanupForProcess (struct _EPROCESS *Process) CurrentProcess = PsGetCurrentProcess(); if (CurrentProcess != Process) { - KeAttachProcess(EPROCESS_TO_KPROCESS(Process)); + KeAttachProcess(&Process->Pcb); } W32Process = (PW32PROCESS)Process->Win32Process; ASSERT(W32Process); diff --git a/reactos/subsys/win32k/w32k.h b/reactos/subsys/win32k/w32k.h index 5edff6a90f5..22b83904e49 100644 --- a/reactos/subsys/win32k/w32k.h +++ b/reactos/subsys/win32k/w32k.h @@ -1,92 +1,56 @@ /* - * Precompiled headers for win32k.sys + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Graphics Subsystem + * FILE: subsys/win32k/w32k.h + * PURPOSE: Main Win32K Header + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) */ -#define __WIN32K__ -#define NTOS_MODE_KERNEL +/* INCLUDES ******************************************************************/ -#include +/* We are Win32K */ +#define __WIN32K__ + +/* ReactOS Config */ +#include + +/* DDK/NDK/SDK Headers */ +#include +#include +#include +#include +#include /* FIXME ? */ +#include /* FIXME ? */ +#include +#include /* FIXME */ + +/* FIXME: ReactOS will be R-Rated if I really write what I'm about to */ +NTSTATUS +STDCALL +MmCopyFromCaller(PVOID Dest, const VOID *Src, ULONG NumberOfBytes); +NTSTATUS +STDCALL +MmCopyToCaller(PVOID Dest, const VOID *Src, ULONG NumberOfBytes); + +/* SEH Support with PSEH */ #include -#include -#include - -#include -#include -#include - -#include -#include -#include +/* CSRSS Header */ #include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - +/* FIXME: ROSRTL */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/* Helper Header */ +#include -#include -#include +/* External Win32K Header */ +#include -#include - -#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) +/* Internal Win32K Header */ +#include "include/win32k.h" +/* FIXME: This is totally wrong, why was it like this?? */ #define NDEBUG -#include +#include + diff --git a/reactos/subsys/win32k/win32k.xml b/reactos/subsys/win32k/win32k.xml index 896641aa682..34f108354aa 100644 --- a/reactos/subsys/win32k/win32k.xml +++ b/reactos/subsys/win32k/win32k.xml @@ -50,7 +50,6 @@ dllmain.c - svctabm.c driver.c diff --git a/reactos/tools/nci/nci.mak b/reactos/tools/nci/nci.mak index c442ad72cf5..f4b5a959a48 100644 --- a/reactos/tools/nci/nci.mak +++ b/reactos/tools/nci/nci.mak @@ -43,7 +43,7 @@ clean: nci_clean # WIN32K.SYS WIN32K_SVC_DB = $(NCI_BASE_)w32ksvc.db -WIN32K_SERVICE_TABLE = subsys$(SEP)win32k$(SEP)main$(SEP)svctab.c +WIN32K_SERVICE_TABLE = subsys$(SEP)win32k$(SEP)include$(SEP)napi.h WIN32K_GDI_STUBS = lib$(SEP)gdi32$(SEP)misc$(SEP)win32k.S WIN32K_USER_STUBS = lib$(SEP)user32$(SEP)misc$(SEP)win32k.S diff --git a/reactos/tools/nci/ncitool.c b/reactos/tools/nci/ncitool.c index 5b2b99ca5ed..1568cfbd08f 100644 --- a/reactos/tools/nci/ncitool.c +++ b/reactos/tools/nci/ncitool.c @@ -527,7 +527,7 @@ int main(int argc, char* argv[]) WriteFileHeader(Files[NtosKernelStubs], "System Call Stubs for Native API", argv[NtosKernelStubs + 1]); - fputs("#include \n\n", Files[NtosKernelStubs]); + fputs("#include \n\n", Files[NtosKernelStubs]); WriteFileHeader(Files[Win32kGdiStubs], "System Call Stubs for Native API",