Author: ion
Date: Fri May 26 00:03:13 2006
New Revision: 22044
URL:
http://svn.reactos.ru/svn/reactos?rev=22044&view=rev
Log:
- Convert all Win32k Object callback functions to the correct NT prototypes.
- Get rid of ROS-internal WIN32_CALLOUT_DATA and use the real WIN32_CALLOUTS_FPNS type.
- Get rid of the callout.h hack.
Removed:
trunk/reactos/include/reactos/win32k/callout.h
Modified:
trunk/reactos/include/ndk/pstypes.h
trunk/reactos/ntoskrnl/ex/win32k.c
trunk/reactos/ntoskrnl/ps/win32.c
trunk/reactos/subsystems/win32/win32k/include/desktop.h
trunk/reactos/subsystems/win32/win32k/include/winsta.h
trunk/reactos/subsystems/win32/win32k/main/dllmain.c
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c
Modified: trunk/reactos/include/ndk/pstypes.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=2…
==============================================================================
--- trunk/reactos/include/ndk/pstypes.h (original)
+++ trunk/reactos/include/ndk/pstypes.h Fri May 26 00:03:13 2006
@@ -334,7 +334,7 @@
struct _WIN32_POWERSTATE_PARAMETERS;
struct _WIN32_JOBCALLOUT_PARAMETERS;
struct _WIN32_OPENMETHOD_PARAMETERS;
-struct _WIN32_OKTOCLOSEMETHOD_PARAMETERS;
+struct _WIN32_OKAYTOCLOSEMETHOD_PARAMETERS;
struct _WIN32_CLOSEMETHOD_PARAMETERS;
struct _WIN32_DELETEMETHOD_PARAMETERS;
struct _WIN32_PARSEMETHOD_PARAMETERS;
@@ -342,69 +342,82 @@
//
// Win32K Process and Thread Callbacks
//
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_PROCESS_CALLOUT)(
struct _EPROCESS *Process,
BOOLEAN Create
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_THREAD_CALLOUT)(
struct _ETHREAD *Thread,
PSW32THREADCALLOUTTYPE Type
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_GLOBALATOMTABLE_CALLOUT)(
VOID
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_POWEREVENT_CALLOUT)(
struct _WIN32_POWEREVENT_PARAMETERS *Parameters
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_POWERSTATE_CALLOUT)(
struct _WIN32_POWERSTATE_PARAMETERS *Parameters
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_JOB_CALLOUT)(
struct _WIN32_JOBCALLOUT_PARAMETERS *Parameters
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PGDI_BATCHFLUSH_ROUTINE)(
VOID
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_OPENMETHOD_CALLOUT)(
struct _WIN32_OPENMETHOD_PARAMETERS *Parameters
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_OKTOCLOSEMETHOD_CALLOUT)(
- struct _WIN32_OKTOCLOSEMETHOD_PARAMETERS *Parameters
+ struct _WIN32_OKAYTOCLOSEMETHOD_PARAMETERS *Parameters
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_CLOSEMETHOD_CALLOUT)(
struct _WIN32_CLOSEMETHOD_PARAMETERS *Parameters
);
-typedef NTSTATUS
+typedef
+VOID
(NTAPI *PKWIN32_DELETEMETHOD_CALLOUT)(
struct _WIN32_DELETEMETHOD_PARAMETERS *Parameters
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_PARSEMETHOD_CALLOUT)(
struct _WIN32_PARSEMETHOD_PARAMETERS *Parameters
);
-typedef NTSTATUS
+typedef
+NTSTATUS
(NTAPI *PKWIN32_WIN32DATACOLLECTION_CALLOUT)(
struct _EPROCESS *Process,
PVOID Callback,
Removed: trunk/reactos/include/reactos/win32k/callout.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/reactos/win32k/call…
==============================================================================
--- trunk/reactos/include/reactos/win32k/callout.h (original)
+++ trunk/reactos/include/reactos/win32k/callout.h (removed)
@@ -1,18 +1,0 @@
-#ifndef _CALLOUT_
-#define _CALLOUT_
-
-#include <internal/ob.h>
-
-typedef struct _W32_CALLOUT_DATA
-{
- PKWIN32_PROCESS_CALLOUT W32ProcessCallout;
- PKWIN32_THREAD_CALLOUT W32ThreadCallout;
- OB_OPEN_METHOD DesktopOpen;
- OB_DELETE_METHOD DesktopDelete;
- OB_DELETE_METHOD WinStaDelete;
- OB_PARSE_METHOD WinStaParse;
- OB_OPEN_METHOD WinStaOpen;
- OB_PARSE_METHOD DesktopParse;
-} W32_CALLOUT_DATA, *PW32_CALLOUT_DATA;
-
-#endif
Modified: trunk/reactos/ntoskrnl/ex/win32k.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ex/win32k.c?rev=22…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/win32k.c (original)
+++ trunk/reactos/ntoskrnl/ex/win32k.c Fri May 26 00:03:13 2006
@@ -19,7 +19,7 @@
POBJECT_TYPE ExWindowStationObjectType = NULL;
POBJECT_TYPE ExDesktopObjectType = NULL;
-static GENERIC_MAPPING ExpWindowStationMapping =
+GENERIC_MAPPING ExpWindowStationMapping =
{
STANDARD_RIGHTS_READ,
STANDARD_RIGHTS_WRITE,
@@ -27,7 +27,7 @@
STANDARD_RIGHTS_REQUIRED
};
-static GENERIC_MAPPING ExpDesktopMapping =
+GENERIC_MAPPING ExpDesktopMapping =
{
STANDARD_RIGHTS_READ,
STANDARD_RIGHTS_WRITE,
@@ -35,11 +35,10 @@
STANDARD_RIGHTS_REQUIRED
};
-OB_OPEN_METHOD ExpWindowStationObjectOpen = NULL;
-OB_PARSE_METHOD ExpWindowStationObjectParse = NULL;
-OB_DELETE_METHOD ExpWindowStationObjectDelete = NULL;
-OB_PARSE_METHOD ExpDesktopObjectParse = NULL;
-OB_DELETE_METHOD ExpDesktopObjectDelete = NULL;
+PKWIN32_OPENMETHOD_CALLOUT ExpWindowStationObjectOpen = NULL;
+PKWIN32_PARSEMETHOD_CALLOUT ExpWindowStationObjectParse = NULL;
+PKWIN32_DELETEMETHOD_CALLOUT ExpWindowStationObjectDelete = NULL;
+PKWIN32_DELETEMETHOD_CALLOUT ExpDesktopObjectDelete = NULL;
/* FUNCTIONS ****************************************************************/
@@ -51,20 +50,30 @@
ACCESS_MASK GrantedAccess,
ULONG HandleCount)
{
+ WIN32_OPENMETHOD_PARAMETERS Parameters;
+
+ /* Fill out the callback structure */
+ Parameters.OpenReason = Reason;
+ Parameters.Process = Process;
+ Parameters.Object = ObjectBody;
+ Parameters.GrantedAccess = GrantedAccess;
+ Parameters.HandleCount = HandleCount;
+
/* Call the Registered Callback */
- return ExpWindowStationObjectOpen(Reason,
- Process,
- ObjectBody,
- GrantedAccess,
- HandleCount);
+ return ExpWindowStationObjectOpen(&Parameters);
}
VOID
STDCALL
ExpWinStaObjectDelete(PVOID DeletedObject)
{
+ WIN32_DELETEMETHOD_PARAMETERS Parameters;
+
+ /* Fill out the callback structure */
+ Parameters.Object = DeletedObject;
+
/* Call the Registered Callback */
- ExpWindowStationObjectDelete(DeletedObject);
+ ExpWindowStationObjectDelete(&Parameters);
}
NTSTATUS
@@ -80,24 +89,34 @@
IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
OUT PVOID *Object)
{
+ WIN32_PARSEMETHOD_PARAMETERS Parameters;
+
+ /* Fill out the callback structure */
+ Parameters.ParseObject = ParseObject;
+ Parameters.ObjectType = ObjectType;
+ Parameters.AccessState = AccessState;
+ Parameters.AccessMode = AccessMode;
+ Parameters.Attributes = Attributes;
+ Parameters.CompleteName = CompleteName;
+ Parameters.RemainingName = RemainingName;
+ Parameters.Context = Context;
+ Parameters.SecurityQos = SecurityQos;
+ Parameters.Object = Object;
+
/* Call the Registered Callback */
- return ExpWindowStationObjectParse(ParseObject,
- ObjectType,
- AccessState,
- AccessMode,
- Attributes,
- CompleteName,
- RemainingName,
- Context,
- SecurityQos,
- Object);
+ return ExpWindowStationObjectParse(&Parameters);
}
VOID
STDCALL
ExpDesktopDelete(PVOID DeletedObject)
{
+ WIN32_DELETEMETHOD_PARAMETERS Parameters;
+
+ /* Fill out the callback structure */
+ Parameters.Object = DeletedObject;
+
/* Call the Registered Callback */
- ExpDesktopObjectDelete(DeletedObject);
+ ExpDesktopObjectDelete(&Parameters);
}
VOID
Modified: trunk/reactos/ntoskrnl/ps/win32.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/ntoskrnl/ps/win32.c?rev=220…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/win32.c (original)
+++ trunk/reactos/ntoskrnl/ps/win32.c Fri May 26 00:03:13 2006
@@ -13,18 +13,15 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
-#include <win32k/callout.h>
/* GLOBALS ******************************************************************/
static PKWIN32_PROCESS_CALLOUT PspWin32ProcessCallback = NULL;
static PKWIN32_THREAD_CALLOUT PspWin32ThreadCallback = NULL;
-
-extern OB_OPEN_METHOD ExpWindowStationObjectOpen;
-extern OB_PARSE_METHOD ExpWindowStationObjectParse;
-extern OB_DELETE_METHOD ExpWindowStationObjectDelete;
-extern OB_PARSE_METHOD ExpDesktopObjectParse;
-extern OB_DELETE_METHOD ExpDesktopObjectDelete;
+extern PKWIN32_OPENMETHOD_CALLOUT ExpWindowStationObjectOpen;
+extern PKWIN32_PARSEMETHOD_CALLOUT ExpWindowStationObjectParse;
+extern PKWIN32_DELETEMETHOD_CALLOUT ExpWindowStationObjectDelete;
+extern PKWIN32_DELETEMETHOD_CALLOUT ExpDesktopObjectDelete;
#ifndef ALEX_CB_REWRITE
typedef struct _NTW32CALL_SAVED_STATE
@@ -55,16 +52,14 @@
*/
VOID
STDCALL
-PsEstablishWin32Callouts(PWIN32_CALLOUTS_FPNS calloutData)
-{
- PW32_CALLOUT_DATA CalloutData = (PW32_CALLOUT_DATA)calloutData;
- PspWin32ProcessCallback = CalloutData->W32ProcessCallout;
- PspWin32ThreadCallback = CalloutData->W32ThreadCallout;
- ExpWindowStationObjectOpen = CalloutData->WinStaOpen;
- ExpWindowStationObjectParse = CalloutData->WinStaParse;
- ExpWindowStationObjectDelete = CalloutData->WinStaDelete;
- ExpDesktopObjectParse = CalloutData->DesktopParse;
- ExpDesktopObjectDelete = CalloutData->DesktopDelete;
+PsEstablishWin32Callouts(PWIN32_CALLOUTS_FPNS CalloutData)
+{
+ PspWin32ProcessCallback = CalloutData->ProcessCallout;
+ PspWin32ThreadCallback = CalloutData->ThreadCallout;
+ ExpWindowStationObjectOpen = CalloutData->WindowStationOpenProcedure;
+ ExpWindowStationObjectParse = CalloutData->WindowStationParseProcedure;
+ ExpWindowStationObjectDelete = CalloutData->WindowStationDeleteProcedure;
+ ExpDesktopObjectDelete = CalloutData->DesktopDeleteProcedure;
}
NTSTATUS
Modified: trunk/reactos/subsystems/win32/win32k/include/desktop.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/desktop.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/desktop.h Fri May 26 00:03:13 2006
@@ -61,7 +61,7 @@
OUT PVOID *Object);
VOID STDCALL
-IntDesktopObjectDelete(PVOID DeletedObject);
+IntDesktopObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters);
VOID FASTCALL
IntGetDesktopWorkArea(PDESKTOP_OBJECT Desktop, PRECT Rect);
Modified: trunk/reactos/subsystems/win32/win32k/include/winsta.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/winsta.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/winsta.h Fri May 26 00:03:13 2006
@@ -54,32 +54,14 @@
NTSTATUS
STDCALL
-IntWinStaObjectOpen(IN OB_OPEN_REASON Reason,
- IN PEPROCESS Process OPTIONAL,
- IN PVOID ObjectBody,
- IN ACCESS_MASK GrantedAccess,
- IN ULONG HandleCount);
+IntWinStaObjectOpen(PWIN32_OPENMETHOD_PARAMETERS Parameters);
VOID STDCALL
-IntWinStaObjectDelete(PVOID DeletedObject);
-
-PVOID STDCALL
-IntWinStaObjectFind(PVOID Object,
- PWSTR Name,
- ULONG Attributes);
+IntWinStaObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters);
NTSTATUS
STDCALL
-IntWinStaObjectParse(IN PVOID ParseObject,
- IN PVOID ObjectType,
- IN OUT PACCESS_STATE AccessState,
- IN KPROCESSOR_MODE AccessMode,
- IN ULONG Attributes,
- IN OUT PUNICODE_STRING CompleteName,
- IN OUT PUNICODE_STRING RemainingName,
- IN OUT PVOID Context OPTIONAL,
- IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
- OUT PVOID *Object);
+IntWinStaObjectParse(PWIN32_PARSEMETHOD_PARAMETERS Parameters);
NTSTATUS FASTCALL
IntValidateWindowStationHandle(
Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/mai…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/main/dllmain.c (original)
+++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c Fri May 26 00:03:13 2006
@@ -23,7 +23,6 @@
#include <w32k.h>
#include <include/napi.h>
-#include <win32k/callout.h>
#define NDEBUG
#include <debug.h>
@@ -360,7 +359,7 @@
{
NTSTATUS Status;
BOOLEAN Result;
- W32_CALLOUT_DATA CalloutData;
+ WIN32_CALLOUTS_FPNS CalloutData;
PVOID GlobalUserHeapBase = NULL;
/*
@@ -381,13 +380,12 @@
/*
* Register Object Manager Callbacks
*/
- CalloutData.WinStaOpen = IntWinStaObjectOpen;
- CalloutData.WinStaParse = IntWinStaObjectParse;
- CalloutData.WinStaDelete = IntWinStaObjectDelete;
- CalloutData.DesktopParse = IntDesktopObjectParse;
- CalloutData.DesktopDelete = IntDesktopObjectDelete;
- CalloutData.W32ProcessCallout = Win32kProcessCallback;
- CalloutData.W32ThreadCallout = Win32kThreadCallback;
+ CalloutData.WindowStationOpenProcedure = IntWinStaObjectOpen;
+ CalloutData.WindowStationParseProcedure = IntWinStaObjectParse;
+ CalloutData.WindowStationDeleteProcedure = IntWinStaObjectDelete;
+ CalloutData.DesktopDeleteProcedure = IntDesktopObjectDelete;
+ CalloutData.ProcessCallout = Win32kProcessCallback;
+ CalloutData.ThreadCallout = Win32kThreadCallback;
/*
* Register our per-process and per-thread structures.
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c Fri May 26 00:03:13 2006
@@ -93,7 +93,6 @@
PUNICODE_STRING DesktopName;
/* Set the list pointers and loop the window station */
- DPRINT1("Creating desktop(%wZ)\n", RemainingName);
ListHead = &WinStaObject->DesktopListHead;
NextEntry = ListHead->Flink;
while (NextEntry != ListHead)
@@ -174,9 +173,9 @@
}
VOID STDCALL
-IntDesktopObjectDelete(PVOID DeletedObject)
-{
- PDESKTOP_OBJECT Desktop = (PDESKTOP_OBJECT)DeletedObject;
+IntDesktopObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters)
+{
+ PDESKTOP_OBJECT Desktop = (PDESKTOP_OBJECT)Parameters->Object;
DPRINT("Deleting desktop (0x%X)\n", Desktop);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c Fri May 26 00:03:13 2006
@@ -96,15 +96,11 @@
NTSTATUS
STDCALL
-IntWinStaObjectOpen(OB_OPEN_REASON Reason,
- PEPROCESS Process,
- PVOID ObjectBody,
- ACCESS_MASK GrantedAccess,
- ULONG HandleCount)
-{
- PWINSTATION_OBJECT WinSta = (PWINSTATION_OBJECT)ObjectBody;
- NTSTATUS Status;
-
+IntWinStaObjectOpen(PWIN32_OPENMETHOD_PARAMETERS Parameters)
+{
+ PWINSTATION_OBJECT WinSta = (PWINSTATION_OBJECT)Parameters->Object;
+ OB_OPEN_REASON Reason = Parameters->OpenReason;
+ NTSTATUS Status;
if (Reason == ObCreateHandle)
{
@@ -125,9 +121,9 @@
}
VOID STDCALL
-IntWinStaObjectDelete(PVOID DeletedObject)
-{
- PWINSTATION_OBJECT WinSta = (PWINSTATION_OBJECT)DeletedObject;
+IntWinStaObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters)
+{
+ PWINSTATION_OBJECT WinSta = (PWINSTATION_OBJECT)Parameters->Object;
DPRINT("Deleting window station (0x%X)\n", WinSta);
@@ -138,27 +134,18 @@
NTSTATUS
STDCALL
-IntWinStaObjectParse(IN PVOID Object,
- IN PVOID ObjectType,
- IN OUT PACCESS_STATE AccessState,
- IN KPROCESSOR_MODE AccessMode,
- IN ULONG Attributes,
- IN OUT PUNICODE_STRING FullPath,
- IN OUT PUNICODE_STRING RemainingName,
- IN OUT PVOID Context OPTIONAL,
- IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
- OUT PVOID *NextObject)
-{
- DPRINT("Object (0x%X) Path (0x%X) *Path (%wZ)\n", Object, RemainingName,
RemainingName);
+IntWinStaObjectParse(PWIN32_PARSEMETHOD_PARAMETERS Parameters)
+{
+ PUNICODE_STRING RemainingName = Parameters->RemainingName;
/* Assume we don't find anything */
- *NextObject = NULL;
+ *Parameters->Object = NULL;
/* Check for an empty name */
if (!RemainingName->Length)
{
/* Make sure this is a window station, can't parse a desktop now */
- if (ObjectType != ExWindowStationObjectType)
+ if (Parameters->ObjectType != ExWindowStationObjectType)
{
/* Fail */
return STATUS_OBJECT_TYPE_MISMATCH;
@@ -191,19 +178,19 @@
* FIXME: ROS Sends the wrong Object Type. The parsed object's type
* should be sent, not the parsed parent's.
*/
- if (ObjectType == ExWindowStationObjectType)
+ if (Parameters->ObjectType == ExWindowStationObjectType)
{
/* Then call the desktop parse routine */
- return IntDesktopObjectParse(Object,
- ObjectType,
- AccessState,
- AccessMode,
- Attributes,
- FullPath,
+ return IntDesktopObjectParse(Parameters->ParseObject,
+ Parameters->ObjectType,
+ Parameters->AccessState,
+ Parameters->AccessMode,
+ Parameters->Attributes,
+ Parameters->CompleteName,
RemainingName,
- Context,
- SecurityQos,
- NextObject);
+ Parameters->Context,
+ Parameters->SecurityQos,
+ Parameters->Object);
}
/* Should hopefully never get here */