Author: ion
Date: Mon Jul 17 21:32:58 2006
New Revision: 23127
URL:
http://svn.reactos.org/svn/reactos?rev=23127&view=rev
Log:
[FORMATTING] - Cleanup win32.c
[AUDIT] - Only function of interest is PsConverToGuiThread, heavily documented at:
http://www.windowsitlibrary.com/Content/356/07/1.html
http://www.osronline.com/lists_archive/ntdev/thread4614.html
http://www.i.u-tokyo.ac.jp/edu/training/ss/lecture/new-documents/Lectures/1…
Modified:
trunk/reactos/ntoskrnl/include/internal/ke.h
trunk/reactos/ntoskrnl/ps/win32.c (contents, props changed)
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ke.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/ke.h Mon Jul 17 21:32:58 2006
@@ -310,6 +310,13 @@
IN OUT PKTHREAD Thread
);
+PVOID
+NTAPI
+KeSwitchKernelStack(
+ IN PVOID StackBase,
+ IN PVOID StackLimit
+);
+
VOID
STDCALL
KeRundownThread(VOID);
Modified: trunk/reactos/ntoskrnl/ps/win32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/win32.c?rev=23…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/win32.c (original)
+++ trunk/reactos/ntoskrnl/ps/win32.c Mon Jul 17 21:32:58 2006
@@ -1,11 +1,9 @@
-/* $Id$
- *
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/ps/win32.c
- * PURPOSE: win32k support
- *
- * PROGRAMMERS: Eric Kohl (ekohl(a)rz-online.de)
+ * PURPOSE: Process Manager: Win32K Initialization and Support
+ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
*/
/* INCLUDES ****************************************************************/
@@ -22,43 +20,7 @@
extern PKWIN32_DELETEMETHOD_CALLOUT ExpWindowStationObjectDelete;
extern PKWIN32_DELETEMETHOD_CALLOUT ExpDesktopObjectDelete;
-#ifndef ALEX_CB_REWRITE
-typedef struct _NTW32CALL_SAVED_STATE
-{
- ULONG_PTR SavedStackLimit;
- PVOID SavedStackBase;
- PVOID SavedInitialStack;
- PVOID CallerResult;
- PULONG CallerResultLength;
- PNTSTATUS CallbackStatus;
- PKTRAP_FRAME SavedTrapFrame;
- PVOID SavedCallbackStack;
- PVOID SavedExceptionStack;
-} NTW32CALL_SAVED_STATE, *PNTW32CALL_SAVED_STATE;
-#endif
-
-PVOID
-STDCALL
-KeSwitchKernelStack(
- IN PVOID StackBase,
- IN PVOID StackLimit
-);
-
-/* FUNCTIONS ***************************************************************/
-
-/*
- * @implemented
- */
-VOID
-STDCALL
-PsEstablishWin32Callouts(PWIN32_CALLOUTS_FPNS CalloutData)
-{
- PspW32ProcessCallout = CalloutData->ProcessCallout;
- PspW32ThreadCallout = CalloutData->ThreadCallout;
- ExpWindowStationObjectParse = CalloutData->WindowStationParseProcedure;
- ExpWindowStationObjectDelete = CalloutData->WindowStationDeleteProcedure;
- ExpDesktopObjectDelete = CalloutData->DesktopDeleteProcedure;
-}
+/* PRIVATE FUNCTIONS *********************************************************/
NTSTATUS
NTAPI
@@ -134,6 +96,23 @@
return Status;
}
+/* PUBLIC FUNCTIONS **********************************************************/
+
+/*
+ * @implemented
+ */
+VOID
+NTAPI
+PsEstablishWin32Callouts(IN PWIN32_CALLOUTS_FPNS CalloutData)
+{
+ /* Setup the callback pointers */
+ PspW32ProcessCallout = CalloutData->ProcessCallout;
+ PspW32ThreadCallout = CalloutData->ThreadCallout;
+ ExpWindowStationObjectParse = CalloutData->WindowStationParseProcedure;
+ ExpWindowStationObjectDelete = CalloutData->WindowStationDeleteProcedure;
+ ExpDesktopObjectDelete = CalloutData->DesktopDeleteProcedure;
+}
+
NTSTATUS
STDCALL
NtW32Call(IN ULONG RoutineIndex,
@@ -145,24 +124,23 @@
PVOID RetResult;
ULONG RetResultLength;
NTSTATUS Status = STATUS_SUCCESS;
-
- DPRINT("NtW32Call(RoutineIndex %d, Argument %p, ArgumentLength %d)\n",
- RoutineIndex, Argument, ArgumentLength);
-
- /* must not be called as KernelMode! */
ASSERT(KeGetPreviousMode() != KernelMode);
+ /* Enter SEH for probing */
_SEH_TRY
{
+ /* Probe arguments */
ProbeForWritePointer(Result);
ProbeForWriteUlong(ResultLength);
}
_SEH_HANDLE
{
+ /* Get exception code */
Status = _SEH_GetExceptionCode();
}
_SEH_END;
+ /* Make sure we got success */
if (NT_SUCCESS(Status))
{
/* Call kernel function */
@@ -171,16 +149,18 @@
ArgumentLength,
&RetResult,
&RetResultLength);
-
if (NT_SUCCESS(Status))
{
+ /* Enter SEH for write back */
_SEH_TRY
{
+ /* Return results to user mode */
*Result = RetResult;
*ResultLength = RetResultLength;
}
_SEH_HANDLE
{
+ /* Get the exception code */
Status = _SEH_GetExceptionCode();
}
_SEH_END;
Propchange: trunk/reactos/ntoskrnl/ps/win32.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*