[CONSOLE.CPL-KERNEL32-USER32-NTDLL-CSRSRV-CONSRV-BASESRV-WINSRV]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 14 Apr 2013 12:14:00 +0000 (12:14 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 14 Apr 2013 12:14:00 +0000 (12:14 +0000)
- Fix some comments.
- Remove unuseful DPRINTs and just shut-up some DPRINT1s.
- Rename remaining CSRSS_*** structures.

svn path=/branches/ros-csrss/; revision=58753

31 files changed:
dll/cpl/console/console.c
dll/cpl/console/layout.c
dll/ntdll/csr/api.c
dll/ntdll/csr/capture.c
dll/ntdll/csr/connect.c
dll/win32/kernel32/client/console/console.c
dll/win32/kernel32/client/dllmain.c
dll/win32/kernel32/client/path.c
dll/win32/kernel32/client/proc.c
dll/win32/kernel32/client/vdm.c
include/reactos/subsys/csr/csrmsg.h
include/reactos/subsys/csr/csrsrv.h
include/reactos/subsys/win/base.h
include/reactos/subsys/win/basemsg.h
include/reactos/subsys/win/conmsg.h
include/reactos/subsys/win/console.h
include/reactos/subsys/win/winmsg.h
subsystems/win/basesrv/init.c
subsystems/win32/csrsrv/procsup.c
subsystems/win32/csrsrv/server.c
win32ss/user/consrv/coninput.c
win32ss/user/consrv/conoutput.c
win32ss/user/consrv/console.c
win32ss/user/consrv/frontends/gui/guiterm.c
win32ss/user/user32/misc/exit.c
win32ss/user/user32/misc/misc.c
win32ss/user/winsrv/CMakeLists.txt
win32ss/user/winsrv/harderror.c
win32ss/user/winsrv/init.c
win32ss/user/winsrv/register.c
win32ss/user/winsrv/shutdown.c

index d570085..c1bccba 100644 (file)
@@ -196,7 +196,6 @@ ApplyConsoleInfo(HWND hwndDlg,
         }
     }
 
-    // if (res == IDC_RADIO_APPLY_ALL || res == IDC_RADIO_APPLY_CURRENT)
     if (SetParams)
     {
         HANDLE hSection;
@@ -290,10 +289,6 @@ InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
         return 0;
     }
 
-    // if (IsBadReadPtr((PVOID)pSharedInfo, sizeof(CONSOLE_PROPS)))
-    // {
-    // }
-
     /* Find the console window and whether we must use default parameters */
     pConInfo->hConsoleWindow    = pSharedInfo->hConsoleWindow;
     pConInfo->ShowDefaultParams = pSharedInfo->ShowDefaultParams;
index 11c1318..8375581 100644 (file)
 
 const TCHAR szPreviewText[] =
     _T("C:\\ReactOS> dir                       \n") \
-    _T("SYSTEM       <DIR>      03-03-13  5:00a\n") \
-    _T("SYSTEM32     <DIR>      03-03-13  5:00a\n") \
-    _T("readme   txt       1739 03-03-13  5:00a\n") \
-    _T("explorer exe    3329536 03-03-13  5:00a\n") \
-    _T("vgafonts cab      18736 03-03-13  5:00a\n") \
-    _T("setuplog txt        313 03-03-13  5:00a\n") \
-    _T("win      ini       7005 03-03-13  5:00a\n");
+    _T("SYSTEM       <DIR>      03-04-15  5:00a\n") \
+    _T("SYSTEM32     <DIR>      03-04-15  5:00a\n") \
+    _T("readme   txt       1739 03-04-15  5:00a\n") \
+    _T("explorer exe    3329536 03-04-15  5:00a\n") \
+    _T("vgafonts cab      18736 03-04-15  5:00a\n") \
+    _T("setuplog txt        313 03-04-15  5:00a\n") \
+    _T("win      ini       7005 03-04-15  5:00a\n");
 
 
 VOID
index 37a7b66..4e3556c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
- * FILE:            lib/ntdll/csr/api.c
+ * FILE:            dll/ntdll/csr/api.c
  * PURPOSE:         CSR APIs exported through NTDLL
  * PROGRAMMER:      Alex Ionescu (alex@relsoft.net)
  */
index 637786f..1ab781d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
- * FILE:            lib/ntdll/csr/capture.c
+ * FILE:            dll/ntdll/csr/capture.c
  * PURPOSE:         Routines for probing and capturing CSR API Messages
  * PROGRAMMER:      Alex Ionescu (alex@relsoft.net)
  */
@@ -94,7 +94,8 @@ CsrAllocateCaptureBuffer(IN ULONG ArgumentCount,
     if (BufferSize >= MAXLONG) return NULL;
 
     /* Add the size of the header and for each offset to the pointers */
-    BufferSize += FIELD_OFFSET(CSR_CAPTURE_BUFFER, PointerOffsetsArray) + (ArgumentCount * sizeof(ULONG_PTR));
+    BufferSize += FIELD_OFFSET(CSR_CAPTURE_BUFFER, PointerOffsetsArray) +
+                    (ArgumentCount * sizeof(ULONG_PTR));
 
     /* Align it to a 4-byte boundary */
     BufferSize = (BufferSize + 3) & ~3;
index ffe2a42..41ce526 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
- * FILE:            lib/ntdll/csr/connect.c
+ * FILE:            dll/ntdll/csr/connect.c
  * PURPOSE:         Routines for connecting and calling CSR
  * PROGRAMMER:      Alex Ionescu (alex@relsoft.net)
  */
@@ -54,14 +54,14 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage,
     ULONG PointerCount;
     PULONG_PTR OffsetPointer;
 
-    /* Fill out the Port Message Header. */
+    /* Fill out the Port Message Header */
     ApiMessage->Header.u2.ZeroInit = 0;
     ApiMessage->Header.u1.s1.TotalLength =
         FIELD_OFFSET(CSR_API_MESSAGE, Data) + DataLength;
     ApiMessage->Header.u1.s1.DataLength =
         ApiMessage->Header.u1.s1.TotalLength - sizeof(PORT_MESSAGE);
 
-    /* Fill out the CSR Header. */
+    /* Fill out the CSR Header */
     ApiMessage->ApiNumber = ApiNumber;
     ApiMessage->CsrCaptureData = NULL;
 
@@ -70,10 +70,10 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage,
            ApiMessage->Header.u1.s1.DataLength,
            ApiMessage->Header.u1.s1.TotalLength);
                 
-    /* Check if we are already inside a CSR Server. */
+    /* Check if we are already inside a CSR Server */
     if (!InsideCsrProcess)
     {
-        /* Check if we got a Capture Buffer. */
+        /* Check if we got a Capture Buffer */
         if (CaptureBuffer)
         {
             /*
@@ -104,12 +104,12 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage,
             }
         }
 
-        /* Send the LPC Message. */
+        /* Send the LPC Message */
         Status = NtRequestWaitReplyPort(CsrApiPort,
                                         &ApiMessage->Header,
                                         &ApiMessage->Header);
 
-        /* Check if we got a Capture Buffer. */
+        /* Check if we got a Capture Buffer */
         if (CaptureBuffer)
         {
             /*
@@ -137,7 +137,7 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage,
             }
         }
 
-        /* Check for success. */
+        /* Check for success */
         if (!NT_SUCCESS(Status))
         {
             /* We failed. Overwrite the return value with the failure. */
@@ -150,13 +150,13 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage,
         /* This is a server-to-server call. Save our CID and do a direct call. */
         DPRINT1("Next gen server-to-server call\n");
 
-        /* We check this equality inside CsrValidateMessageBuffer. */
+        /* We check this equality inside CsrValidateMessageBuffer */
         ApiMessage->Header.ClientId = NtCurrentTeb()->ClientId;
 
         Status = CsrServerApiRoutine(&ApiMessage->Header,
                                      &ApiMessage->Header);
 
-        /* Check for success. */
+        /* Check for success */
         if (!NT_SUCCESS(Status))
         {
             /* We failed. Overwrite the return value with the failure. */
@@ -164,7 +164,7 @@ CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage,
         }
     }
 
-    /* Return the CSR Result. */
+    /* Return the CSR Result */
     DPRINT("Got back: 0x%lx\n", ApiMessage->Status);
     return ApiMessage->Status;
 }
@@ -404,7 +404,8 @@ CsrClientConnectToServer(IN PWSTR ObjectDirectory,
         if (!CsrApiPort)
         {
             /* No, set it up now */
-            if (!NT_SUCCESS(Status = CsrpConnectToServer(ObjectDirectory)))
+            Status = CsrpConnectToServer(ObjectDirectory);
+            if (!NT_SUCCESS(Status))
             {
                 /* Failed */
                 DPRINT1("Failure to connect to CSR\n");
index aed82b1..a064f94 100644 (file)
@@ -2227,8 +2227,8 @@ SetConsoleInputExeNameA(LPCSTR lpInputExeName)
  * \name GetConsoleInputExeNameW
  * \brief Retrieves the console input file name as unicode string.
  * \param nBufferLength Length of the buffer in WCHARs.
- *        Specify 0 to recieve the needed buffer length.
- * \param lpBuffer Pointer to a buffer that recieves the string.
+ *        Specify 0 to receive the needed buffer length.
+ * \param lpBuffer Pointer to a buffer that receives the string.
  * \return Needed buffer size if \p nBufferLength is 0.
  *         Otherwise 1 if successful, 2 if buffer is too small.
  * \remarks Sets last error value to ERROR_BUFFER_OVERFLOW if the buffer
@@ -2274,10 +2274,10 @@ GetConsoleInputExeNameW(DWORD nBufferLength, LPWSTR lpBuffer)
  * \name GetConsoleInputExeNameA
  * \brief Retrieves the console input file name as ansi string.
  * \param nBufferLength Length of the buffer in CHARs.
- * \param lpBuffer Pointer to a buffer that recieves the string.
+ * \param lpBuffer Pointer to a buffer that receives the string.
  * \return 1 if successful, 2 if buffer is too small.
  * \remarks Sets last error value to ERROR_BUFFER_OVERFLOW if the buffer
- *          is not big enough. The buffer recieves as much characters as fit.
+ *          is not big enough. The buffer receives as much characters as fit.
  */
 DWORD
 WINAPI
index a8573ca..0434ce7 100644 (file)
@@ -134,7 +134,6 @@ DllMain(HANDLE hDll,
             }
 
             /* Connect to the base server */
-            DPRINT("Connecting to CSR in DllMain...\n");
             Status = CsrClientConnectToServer(SessionDir,
                                               BASESRV_SERVERDLL_INDEX,
                                               &Dummy,
@@ -146,7 +145,6 @@ DllMain(HANDLE hDll,
                 NtTerminateProcess(NtCurrentProcess(), Status);
                 return FALSE;
             }
-            DPRINT("kernel32 DllMain - OK, connection succeeded\n");
 
             /* Get the server data */
             ASSERT(Peb->ReadOnlyStaticServerData);
@@ -214,13 +212,11 @@ DllMain(HANDLE hDll,
 
             /* Insert more dll attach stuff here! */
             DllInitialized = TRUE;
-            DPRINT("Initialization complete\n");
             break;
         }
 
         case DLL_PROCESS_DETACH:
         {
-            DPRINT("DLL_PROCESS_DETACH\n");
             if (DllInitialized == TRUE)
             {
                 /* Insert more dll detach stuff here! */
index 39a1cb2..b7256b6 100644 (file)
@@ -1430,7 +1430,7 @@ SearchPathW(IN LPCWSTR lpPath,
     }
 
 Quickie:
-    /* Check if there was a dynamic path stirng to free */
+    /* Check if there was a dynamic path string to free */
     if ((PathString.Buffer != lpPath) && (PathString.Buffer))
     {
         /* And free it */
index 50f7c39..fe7e8a2 100644 (file)
@@ -581,7 +581,7 @@ BasepCreateFirstThread(HANDLE ProcessHandle,
 
     /*
      * For GUI applications we turn on the 2nd bit. This also allows
-     * us to know whether or not the application is a GUI or CUI app.
+     * us to know whether or not this is a GUI or a TUI application.
      */
     if (IMAGE_SUBSYSTEM_WINDOWS_GUI == SectionImageInfo->SubSystemType)
     {
@@ -1856,7 +1856,7 @@ FatalAppExitW(IN UINT uAction,
     ULONG Response;
     NTSTATUS Status;
 
-    /* Setup the stirng to print out */
+    /* Setup the string to print out */
     RtlInitUnicodeString(&UnicodeString, lpMessageText);
 
     /* Display the hard error no matter what */
index ea83cc6..e411729 100644 (file)
@@ -233,7 +233,7 @@ BaseGetVdmConfigInfo(IN LPCWSTR Reserved,
     }
     else
     {
-        /* Non-DOS, build the stirng for it without the task ID */
+        /* Non-DOS, build the string for it without the task ID */
         _snwprintf(CommandLine,
                    sizeof(CommandLine),
                    L"\"%s\\ntvdm.exe\"  %s%c",
index 20d7933..b750aff 100644 (file)
@@ -33,7 +33,7 @@ typedef enum _CSRSRV_API_NUMBER
 
 
 /*
-typedef union _CSR_API_NUMBER
+typedef struct _CSR_API_NUMBER
 {
     WORD Index;
     WORD Subsystem;
index fb4a946..19acf19 100644 (file)
 #ifndef _CSRSRV_H
 #define _CSRSRV_H
 
-// see http://code.google.com/p/ontl/source/browse/branches/x64/ntl/nt/csr.hxx?r=67
-
-/*
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning (disable:4201)
-#endif
-*/
-
 #include "csrmsg.h"
 
 
@@ -213,6 +204,7 @@ ULONG
     IN BOOLEAN FirstPhase
 );
 
+// See http://redplait.blogspot.fr/2011/07/csrserverdll.html
 typedef struct _CSR_SERVER_DLL
 {
     ULONG Length;
@@ -221,8 +213,8 @@ typedef struct _CSR_SERVER_DLL
     HANDLE ServerHandle;
     ULONG ServerId;
     ULONG Unknown;
-    ULONG ApiBase; // ApiNumberBase
-    ULONG HighestApiSupported; // MaxApiNumber
+    ULONG ApiBase;
+    ULONG HighestApiSupported;
     PCSR_API_ROUTINE *DispatchTable;
     PBOOLEAN ValidTable; // Table of booleans which describe whether or not a server function call is valid when it is called via CsrCallServerFromServer.
     PCHAR *NameTable;
@@ -230,7 +222,7 @@ typedef struct _CSR_SERVER_DLL
     PCSR_CONNECT_CALLBACK ConnectCallback;
     PCSR_DISCONNECT_CALLBACK DisconnectCallback;
     PCSR_HARDERROR_CALLBACK HardErrorCallback;
-    PVOID SharedSection; // SharedStaticServerData
+    PVOID SharedSection;
     PCSR_NEWPROCESS_CALLBACK NewProcessCallback;
     PCSR_SHUTDOWNPROCESS_CALLBACK ShutdownProcessCallback;
     ULONG Unknown2[3];
@@ -419,12 +411,6 @@ NTAPI
 CsrValidateMessageString(IN PCSR_API_MESSAGE ApiMessage,
                          IN LPWSTR *MessageString);
 
-/*
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-*/
-
 #endif // _CSRSRV_H
 
 /* EOF */
index b359234..478ea6e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS Client/Server Runtime SubSystem
+ * PROJECT:         ReactOS Base API Server DLL
  * FILE:            include/reactos/subsys/win/base.h
  * PURPOSE:         Public definitions for Base API Clients
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
index 97c0f6a..8875744 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS Client/Server Runtime SubSystem
+ * PROJECT:         ReactOS Base API Server DLL
  * FILE:            include/reactos/subsys/win/basemsg.h
  * PURPOSE:         Public definitions for communication
  *                  between Base API Clients and Servers
@@ -184,7 +184,7 @@ typedef struct _BASE_API_MESSAGE
 
     PCSR_CAPTURE_BUFFER CsrCaptureData;
     CSR_API_NUMBER ApiNumber;
-    NTSTATUS Status; // ReturnValue;
+    NTSTATUS Status;
     ULONG Reserved;
     union
     {
index 43884d1..2454ac1 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS Client/Server Runtime SubSystem
+ * PROJECT:         ReactOS Console Server DLL
  * FILE:            include/reactos/subsys/win/conmsg.h
  * PURPOSE:         Public definitions for communication
  *                  between Console API Clients and Servers
@@ -131,7 +131,7 @@ typedef struct _CONSOLE_CONNECTION_INFO
     /* Adapted from CONSOLE_ALLOCCONSOLE */
     CONSOLE_START_INFO ConsoleStartInfo;
 
-    HANDLE Console; // ConsoleHandle // In fact, it is a PCSRSS_CONSOLE <-- correct that !!
+    HANDLE Console; // ConsoleHandle // On ReactOS, it is a PCSRSS_CONSOLE
     HANDLE InputHandle;
     HANDLE OutputHandle;
     HANDLE ErrorHandle;
@@ -180,7 +180,7 @@ typedef struct
 {
     PCONSOLE_START_INFO ConsoleStartInfo;
 
-    HANDLE Console; // ConsoleHandle // In fact, it is a PCSRSS_CONSOLE <-- correct that !!
+    HANDLE Console; // ConsoleHandle // On ReactOS, it is a PCSRSS_CONSOLE
     HANDLE InputHandle;
     HANDLE OutputHandle;
     HANDLE ErrorHandle;
@@ -192,7 +192,7 @@ typedef struct
 typedef struct
 {
     DWORD ProcessId; // If ProcessId == ATTACH_PARENT_PROCESS == -1, then attach the current process to its parent process console.
-    HANDLE Console; // ConsoleHandle // In fact, it is a PCSRSS_CONSOLE <-- correct that !!
+    HANDLE Console; // ConsoleHandle // On ReactOS, it is a PCSRSS_CONSOLE
     HANDLE InputHandle;
     HANDLE OutputHandle;
     HANDLE ErrorHandle;
@@ -585,7 +585,7 @@ typedef struct _CONSOLE_API_MESSAGE
 
     PCSR_CAPTURE_BUFFER CsrCaptureData;
     CSR_API_NUMBER ApiNumber;
-    NTSTATUS Status; // ReturnValue;
+    NTSTATUS Status;
     ULONG Reserved;
     union
     {
index 1153ef9..4f77dc6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS Client/Server Runtime SubSystem
+ * PROJECT:         ReactOS Console Server DLL
  * FILE:            include/reactos/subsys/win/console.h
  * PURPOSE:         Public definitions for Console API Clients
  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
index f16e779..b238d1c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS Client/Server Runtime SubSystem
+ * PROJECT:         ReactOS User API Server DLL
  * FILE:            include/reactos/subsys/win/winmsg.h
  * PURPOSE:         Public definitions for communication
  *                  between User-Mode API Clients and Servers
@@ -40,18 +40,18 @@ typedef struct
 {
     UINT Flags;
     DWORD Reserved;
-} CSRSS_EXIT_REACTOS, *PCSRSS_EXIT_REACTOS;
+} USER_EXIT_REACTOS, *PUSER_EXIT_REACTOS;
 
 typedef struct
 {
     ULONG_PTR ProcessId;
-} CSRSS_REGISTER_SERVICES_PROCESS, *PCSRSS_REGISTER_SERVICES_PROCESS;
+} USER_REGISTER_SERVICES_PROCESS, *PUSER_REGISTER_SERVICES_PROCESS;
 
 typedef struct
 {
     ULONG_PTR ProcessId;
     BOOL Register;
-} CSRSS_REGISTER_LOGON_PROCESS, *PCSRSS_REGISTER_LOGON_PROCESS;
+} USER_REGISTER_LOGON_PROCESS, *PUSER_REGISTER_LOGON_PROCESS;
 
 
 typedef struct _USER_API_MESSAGE
@@ -60,13 +60,13 @@ typedef struct _USER_API_MESSAGE
 
     PCSR_CAPTURE_BUFFER CsrCaptureData;
     CSR_API_NUMBER ApiNumber;
-    NTSTATUS Status; // ReturnValue;
+    NTSTATUS Status;
     ULONG Reserved;
     union
     {
-        CSRSS_EXIT_REACTOS ExitReactosRequest;
-        CSRSS_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest;
-        CSRSS_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest;
+        USER_EXIT_REACTOS ExitReactosRequest;
+        USER_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest;
+        USER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest;
     } Data;
 } USER_API_MESSAGE, *PUSER_API_MESSAGE;
 
index 007b6bd..8edeefc 100644 (file)
@@ -138,16 +138,19 @@ CreateBaseAcls(OUT PACL* Dacl,
     SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};
     SID_IDENTIFIER_AUTHORITY WorldAuthority = {SECURITY_WORLD_SID_AUTHORITY};
     NTSTATUS Status;
-    // UCHAR KeyValueBuffer[0x40];
-    // PKEY_VALUE_PARTIAL_INFORMATION KeyValuePartialInfo;
-    // UNICODE_STRING KeyName;
-    // ULONG ProtectionMode = 0;
-    ULONG AclLength; // , ResultLength;
-    // HANDLE hKey;
-    // OBJECT_ATTRIBUTES ObjectAttributes;
+#if 0 // Unused code
+    UCHAR KeyValueBuffer[0x40];
+    PKEY_VALUE_PARTIAL_INFORMATION KeyValuePartialInfo;
+    UNICODE_STRING KeyName;
+    ULONG ProtectionMode = 0;
+#endif
+    ULONG AclLength;
+#if 0 // Unused code
+    ULONG ResultLength;
+    HANDLE hKey;
+    OBJECT_ATTRIBUTES ObjectAttributes;
 
     /* Open the Session Manager Key */
-    /*
     RtlInitUnicodeString(&KeyName, SM_REG_KEY);
     InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
@@ -157,7 +160,7 @@ CreateBaseAcls(OUT PACL* Dacl,
     Status = NtOpenKey(&hKey, KEY_READ, &ObjectAttributes);
     if (NT_SUCCESS(Status))
     {
-        /\* Read the key value *\/
+        /* Read the key value */
         RtlInitUnicodeString(&KeyName, L"ProtectionMode");
         Status = NtQueryValueKey(hKey,
                                  &KeyName,
@@ -166,19 +169,19 @@ CreateBaseAcls(OUT PACL* Dacl,
                                  sizeof(KeyValueBuffer),
                                  &ResultLength);
 
-        /\* Make sure it's what we expect it to be *\/
+        /* Make sure it's what we expect it to be */
         KeyValuePartialInfo = (PKEY_VALUE_PARTIAL_INFORMATION)KeyValueBuffer;
         if ((NT_SUCCESS(Status)) && (KeyValuePartialInfo->Type == REG_DWORD) &&
             (*(PULONG)KeyValuePartialInfo->Data))
         {
-            /\* Save the Protection Mode *\/
-            // ProtectionMode = *(PULONG)KeyValuePartialInfo->Data;
+            /* Save the Protection Mode */
+            ProtectionMode = *(PULONG)KeyValuePartialInfo->Data;
         }
 
-        /\* Close the handle *\/
+        /* Close the handle */
         NtClose(hKey);
     }
-    */
+#endif
 
     /* Allocate the System SID */
     Status = RtlAllocateAndInitializeSid(&NtAuthority,
@@ -520,8 +523,8 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
 CSR_SERVER_DLL_INIT(ServerDllInitialization)
 {
     /* Setup the DLL Object */
-    LoadedServerDll->ApiBase = BASESRV_FIRST_API_NUMBER; // ApiNumberBase
-    LoadedServerDll->HighestApiSupported = BasepMaxApiNumber; // MaxApiNumber
+    LoadedServerDll->ApiBase = BASESRV_FIRST_API_NUMBER;
+    LoadedServerDll->HighestApiSupported = BasepMaxApiNumber;
     LoadedServerDll->DispatchTable = BaseServerApiDispatchTable;
     LoadedServerDll->ValidTable = BaseServerApiServerValidTable;
     LoadedServerDll->NameTable = BaseServerApiNameTable;
index 75adf20..d3ca5de 100644 (file)
@@ -1365,7 +1365,7 @@ Quickie:
     return Status;
 }
 
-/* FIXME: Temporary hack. This is really "CsrShutdownProcess", mostly. Used by winsrv */
+/* HACK: Temporary hack. This is really "CsrShutdownProcesses", mostly. Used by winsrv */
 #if 0
 NTSTATUS
 WINAPI
index 380c999..15d2e59 100644 (file)
@@ -603,6 +603,8 @@ CsrUnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
     ULONG_PTR ErrorParameters[4];
     ULONG Response;
 
+    DPRINT1("CsrUnhandledExceptionFilter called\n");
+
     /* Check if a debugger is installed */
     Status = NtQuerySystemInformation(SystemKernelDebuggerInformation,
                                       &DebuggerInfo,
index 48bc9b3..1cc8a5b 100644 (file)
@@ -367,7 +367,7 @@ ReadInputBufferThread(IN PLIST_ENTRY WaitList,
 
     PVOID InputHandle = WaitArgument2;
 
-    DPRINT1("ReadInputBufferThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
+    DPRINT("ReadInputBufferThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
 
     /*
      * If we are notified of the process termination via a call
@@ -500,7 +500,7 @@ ReadCharsThread(IN PLIST_ENTRY WaitList,
 
     PVOID InputHandle = WaitArgument2;
 
-    DPRINT1("ReadCharsThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
+    DPRINT("ReadCharsThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
 
     /*
      * If we are notified of the process termination via a call
index 7bd6794..9b6fc62 100644 (file)
 #define NDEBUG
 #include <debug.h>
 
+/*
+// Define wmemset(...)
+#include <wchar.h>
+#define HAVE_WMEMSET
+*/
+
 
 /* GLOBALS ********************************************************************/
 
@@ -598,7 +604,7 @@ WriteConsoleThread(IN PLIST_ENTRY WaitList,
 {
     NTSTATUS Status;
 
-    DPRINT1("WriteConsoleThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
+    DPRINT("WriteConsoleThread - WaitContext = 0x%p, WaitArgument1 = 0x%p, WaitArgument2 = 0x%p, WaitFlags = %lu\n", WaitContext, WaitArgument1, WaitArgument2, WaitFlags);
 
     /*
      * If we are notified of the process termination via a call
index c112751..90c604a 100644 (file)
@@ -639,7 +639,7 @@ ConSrvInitConsole(OUT PCONSOLE* NewConsole,
 
     if (!GuiMode)
     {
-        DPRINT1("CONSRV: Opening text-mode terminal emulator\n");
+        DPRINT("CONSRV: Opening text-mode terminal emulator\n");
         Status = TuiInitConsole(Console,
                                 ConsoleStartInfo,
                                 &ConsoleInfo,
@@ -663,7 +663,7 @@ ConSrvInitConsole(OUT PCONSOLE* NewConsole,
      */
     if (GuiMode)
     {
-        DPRINT1("CONSRV: Opening GUI-mode terminal emulator\n");
+        DPRINT("CONSRV: Opening GUI-mode terminal emulator\n");
         Status = GuiInitConsole(Console,
                                 ConsoleStartInfo,
                                 &ConsoleInfo,
index 7bbd681..6e25b3b 100644 (file)
 #define NDEBUG
 #include <debug.h>
 
-/*
-// Define wmemset(...)
-#include <wchar.h>
-#define HAVE_WMEMSET
-*/
-
 /* GUI Console Window Class name */
 #define GUI_CONSOLE_WINDOW_CLASS L"ConsoleWindowClass"
 
index a76d278..fcc2f9e 100644 (file)
@@ -76,7 +76,7 @@ ExitWindowsEx(UINT uFlags,
     Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
                                  NULL,
                                  CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpExitWindowsEx),
-                                 sizeof(CSRSS_EXIT_REACTOS));
+                                 sizeof(USER_EXIT_REACTOS));
     if (!NT_SUCCESS(Status))
     {
         SetLastError(RtlNtStatusToDosError(Status));
@@ -101,7 +101,7 @@ RegisterServicesProcess(DWORD ServicesProcessId)
     Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
                                  NULL,
                                  CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterServicesProcess),
-                                 sizeof(CSRSS_REGISTER_SERVICES_PROCESS));
+                                 sizeof(USER_REGISTER_SERVICES_PROCESS));
     if (!NT_SUCCESS(Status))
     {
         SetLastError(RtlNtStatusToDosError(Status));
index af571a0..1549863 100644 (file)
@@ -55,7 +55,7 @@ RegisterLogonProcess(DWORD dwProcessId, BOOL bRegister)
         Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
                                      NULL,
                                      CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterLogonProcess),
-                                     sizeof(CSRSS_REGISTER_LOGON_PROCESS));
+                                     sizeof(USER_REGISTER_LOGON_PROCESS));
         if (!NT_SUCCESS(Status))
         {
             ERR("Failed to register logon process with CSRSS\n");
index d81b1f0..e5d8659 100644 (file)
@@ -19,7 +19,6 @@ target_link_libraries(winsrv win32ksys ${PSEH_LIB}) # win32ksys because of NtUse
 
 set_module_type(winsrv win32dll UNICODE)
 
-# add_importlibs(winsrv psapi msvcrt kernel32 ntdll csrsrv)
 add_importlibs(winsrv msvcrt kernel32 ntdll csrsrv)
 add_delay_importlibs(winsrv user32 gdi32 advapi32)
 
index e77867a..708321e 100644 (file)
@@ -23,7 +23,7 @@
 
 static
 NTSTATUS
-CsrpGetClientFileName(
+UserpGetClientFileName(
     OUT PUNICODE_STRING ClientFileNameU,
     HANDLE hProcess)
 {
@@ -110,7 +110,7 @@ CsrpGetClientFileName(
 
 static
 VOID
-CsrpFreeStringParameters(
+UserpFreeStringParameters(
     IN OUT PULONG_PTR Parameters,
     IN PHARDERROR_MSG HardErrorMessage)
 {
@@ -130,7 +130,7 @@ CsrpFreeStringParameters(
 
 static
 NTSTATUS
-CsrpCaptureStringParameters(
+UserpCaptureStringParameters(
     OUT PULONG_PTR Parameters,
     OUT PULONG SizeOfAllUnicodeStrings,
     IN PHARDERROR_MSG HardErrorMessage,
@@ -226,7 +226,7 @@ CsrpCaptureStringParameters(
 
     if (!NT_SUCCESS(Status))
     {
-        CsrpFreeStringParameters(Parameters, HardErrorMessage);
+        UserpFreeStringParameters(Parameters, HardErrorMessage);
         return Status;
     }
 
@@ -238,7 +238,7 @@ CsrpCaptureStringParameters(
 
 static
 NTSTATUS
-CsrpFormatMessages(
+UserpFormatMessages(
     OUT PUNICODE_STRING TextStringU,
     OUT PUNICODE_STRING CaptionStringU,
     IN  PULONG_PTR Parameters,
@@ -254,7 +254,7 @@ CsrpFormatMessages(
     ULONG Size, ExceptionCode;
 
     /* Get the file name of the client process */
-    CsrpGetClientFileName(&FileNameU, hProcess);
+    UserpGetClientFileName(&FileNameU, hProcess);
 
     /* Check if we have a file name */
     if (!FileNameU.Buffer)
@@ -440,7 +440,7 @@ CsrpFormatMessages(
 
 static
 ULONG
-CsrpMessageBox(
+UserpMessageBox(
     PWSTR Text,
     PWSTR Caption,
     ULONG ValidResponseOptions,
@@ -547,7 +547,7 @@ UserServerHardError(
     }
 
     /* Capture all string parameters from the process memory */
-    Status = CsrpCaptureStringParameters(Parameters, &Size, Message, hProcess);
+    Status = UserpCaptureStringParameters(Parameters, &Size, Message, hProcess);
     if (!NT_SUCCESS(Status))
     {
         NtClose(hProcess);
@@ -555,15 +555,15 @@ UserServerHardError(
     }
 
     /* Format the caption and message box text */
-    Status = CsrpFormatMessages(&TextU,
-                                &CaptionU,
-                                Parameters,
-                                Size,
-                                Message,
-                                hProcess);
+    Status = UserpFormatMessages(&TextU,
+                                 &CaptionU,
+                                 Parameters,
+                                 Size,
+                                 Message,
+                                 hProcess);
 
     /* Cleanup */
-    CsrpFreeStringParameters(Parameters, Message);
+    UserpFreeStringParameters(Parameters, Message);
     NtClose(hProcess);
 
     if (!NT_SUCCESS(Status))
@@ -572,10 +572,10 @@ UserServerHardError(
     }
 
     /* Display the message box */
-    Message->Response = CsrpMessageBox(TextU.Buffer,
-                                       CaptionU.Buffer,
-                                       Message->ValidResponseOptions,
-                                       (ULONG)Message->Status >> 30);
+    Message->Response = UserpMessageBox(TextU.Buffer,
+                                        CaptionU.Buffer,
+                                        Message->ValidResponseOptions,
+                                        (ULONG)Message->Status >> 30);
 
     RtlFreeUnicodeString(&TextU);
     RtlFreeUnicodeString(&CaptionU);
index 52328e4..c9585cd 100644 (file)
@@ -191,13 +191,13 @@ InitializeVideoAddressSpace(VOID)
 }
 
 /**********************************************************************
- * CsrpInitVideo/3
+ * UserpInitVideo
  *
  * TODO: we need a virtual device for sessions other than
  * TODO: the console one
  */
 NTSTATUS
-CsrpInitVideo(VOID)
+UserpInitVideo(VOID)
 {
     OBJECT_ATTRIBUTES ObjectAttributes;
     UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\??\\DISPLAY1");
@@ -270,7 +270,7 @@ CSR_SERVER_DLL_INIT(UserServerDllInitialization)
     UserServerHeap = RtlGetProcessHeap();
 
     /* Initialize the video */
-    CsrpInitVideo();
+    UserpInitVideo();
     NtUserInitialize(0, NULL, NULL);
     PrivateCsrssManualGuiCheck(0);
 
index 6d8ab90..f571d38 100644 (file)
@@ -25,7 +25,7 @@ ULONG_PTR LogonProcessId = 0;
 
 CSR_API(SrvRegisterLogonProcess)
 {
-    PCSRSS_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.RegisterLogonProcessRequest;
+    PUSER_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.RegisterLogonProcessRequest;
 
     if (RegisterLogonProcessRequest->Register)
     {
@@ -51,7 +51,7 @@ CSR_API(SrvRegisterLogonProcess)
 
 CSR_API(SrvRegisterServicesProcess)
 {
-    PCSRSS_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.RegisterServicesProcessRequest;
+    PUSER_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.RegisterServicesProcessRequest;
 
     if (ServicesProcessIdValid == TRUE)
     {
index 0c9d8c8..fcb8bd9 100644 (file)
@@ -4,6 +4,8 @@
  * FILE:            win32ss/user/winsrv/shutdown.c
  * PURPOSE:         Logout/shutdown
  * PROGRAMMERS:
+ *
+ * NOTE: The shutdown code must be rewritten completely. (hbelusca)
  */
 
 /* INCLUDES *******************************************************************/
@@ -915,7 +917,7 @@ UserExitReactos(DWORD UserProcessId, UINT Flags)
 
 CSR_API(SrvExitWindowsEx)
 {
-    PCSRSS_EXIT_REACTOS ExitReactosRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.ExitReactosRequest;
+    PUSER_EXIT_REACTOS ExitReactosRequest = &((PUSER_API_MESSAGE)ApiMessage)->Data.ExitReactosRequest;
 
     if (0 == (ExitReactosRequest->Flags & EWX_INTERNAL_FLAG))
     {