From 57d6853ca4467d4da7eaaf2aa9e1eb27dffa03c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 14 Apr 2013 12:14:00 +0000 Subject: [PATCH] [CONSOLE.CPL-KERNEL32-USER32-NTDLL-CSRSRV-CONSRV-BASESRV-WINSRV] - Fix some comments. - Remove unuseful DPRINTs and just shut-up some DPRINT1s. - Rename remaining CSRSS_*** structures. svn path=/branches/ros-csrss/; revision=58753 --- dll/cpl/console/console.c | 5 --- dll/cpl/console/layout.c | 14 ++++---- dll/ntdll/csr/api.c | 2 +- dll/ntdll/csr/capture.c | 5 +-- dll/ntdll/csr/connect.c | 25 +++++++------- dll/win32/kernel32/client/console/console.c | 8 ++--- dll/win32/kernel32/client/dllmain.c | 4 --- dll/win32/kernel32/client/path.c | 2 +- dll/win32/kernel32/client/proc.c | 4 +-- dll/win32/kernel32/client/vdm.c | 2 +- include/reactos/subsys/csr/csrmsg.h | 2 +- include/reactos/subsys/csr/csrsrv.h | 22 +++--------- include/reactos/subsys/win/base.h | 2 +- include/reactos/subsys/win/basemsg.h | 4 +-- include/reactos/subsys/win/conmsg.h | 10 +++--- include/reactos/subsys/win/console.h | 2 +- include/reactos/subsys/win/winmsg.h | 16 ++++----- subsystems/win/basesrv/init.c | 35 ++++++++++--------- subsystems/win32/csrsrv/procsup.c | 2 +- subsystems/win32/csrsrv/server.c | 2 ++ win32ss/user/consrv/coninput.c | 4 +-- win32ss/user/consrv/conoutput.c | 8 ++++- win32ss/user/consrv/console.c | 4 +-- win32ss/user/consrv/frontends/gui/guiterm.c | 6 ---- win32ss/user/user32/misc/exit.c | 4 +-- win32ss/user/user32/misc/misc.c | 2 +- win32ss/user/winsrv/CMakeLists.txt | 1 - win32ss/user/winsrv/harderror.c | 38 ++++++++++----------- win32ss/user/winsrv/init.c | 6 ++-- win32ss/user/winsrv/register.c | 4 +-- win32ss/user/winsrv/shutdown.c | 4 ++- 31 files changed, 117 insertions(+), 132 deletions(-) diff --git a/dll/cpl/console/console.c b/dll/cpl/console/console.c index d570085e7ab..c1bccba1ea2 100644 --- a/dll/cpl/console/console.c +++ b/dll/cpl/console/console.c @@ -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; diff --git a/dll/cpl/console/layout.c b/dll/cpl/console/layout.c index 11c1318d929..83755814903 100644 --- a/dll/cpl/console/layout.c +++ b/dll/cpl/console/layout.c @@ -13,13 +13,13 @@ const TCHAR szPreviewText[] = _T("C:\\ReactOS> dir \n") \ - _T("SYSTEM 03-03-13 5:00a\n") \ - _T("SYSTEM32 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 03-04-15 5:00a\n") \ + _T("SYSTEM32 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 diff --git a/dll/ntdll/csr/api.c b/dll/ntdll/csr/api.c index 37a7b665c8b..4e3556c9071 100644 --- a/dll/ntdll/csr/api.c +++ b/dll/ntdll/csr/api.c @@ -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) */ diff --git a/dll/ntdll/csr/capture.c b/dll/ntdll/csr/capture.c index 637786fcf38..1ab781d8990 100644 --- a/dll/ntdll/csr/capture.c +++ b/dll/ntdll/csr/capture.c @@ -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; diff --git a/dll/ntdll/csr/connect.c b/dll/ntdll/csr/connect.c index ffe2a426ca9..41ce5264677 100644 --- a/dll/ntdll/csr/connect.c +++ b/dll/ntdll/csr/connect.c @@ -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"); diff --git a/dll/win32/kernel32/client/console/console.c b/dll/win32/kernel32/client/console/console.c index aed82b1a52f..a064f947806 100644 --- a/dll/win32/kernel32/client/console/console.c +++ b/dll/win32/kernel32/client/console/console.c @@ -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 diff --git a/dll/win32/kernel32/client/dllmain.c b/dll/win32/kernel32/client/dllmain.c index a8573ca28c6..0434ce75644 100644 --- a/dll/win32/kernel32/client/dllmain.c +++ b/dll/win32/kernel32/client/dllmain.c @@ -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! */ diff --git a/dll/win32/kernel32/client/path.c b/dll/win32/kernel32/client/path.c index 39a1cb2f0ea..b7256b60e6d 100644 --- a/dll/win32/kernel32/client/path.c +++ b/dll/win32/kernel32/client/path.c @@ -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 */ diff --git a/dll/win32/kernel32/client/proc.c b/dll/win32/kernel32/client/proc.c index 50f7c398c7a..fe7e8a2cf71 100644 --- a/dll/win32/kernel32/client/proc.c +++ b/dll/win32/kernel32/client/proc.c @@ -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 */ diff --git a/dll/win32/kernel32/client/vdm.c b/dll/win32/kernel32/client/vdm.c index ea83cc6a5cb..e41172982c9 100644 --- a/dll/win32/kernel32/client/vdm.c +++ b/dll/win32/kernel32/client/vdm.c @@ -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", diff --git a/include/reactos/subsys/csr/csrmsg.h b/include/reactos/subsys/csr/csrmsg.h index 20d7933a230..b750aff6d65 100644 --- a/include/reactos/subsys/csr/csrmsg.h +++ b/include/reactos/subsys/csr/csrmsg.h @@ -33,7 +33,7 @@ typedef enum _CSRSRV_API_NUMBER /* -typedef union _CSR_API_NUMBER +typedef struct _CSR_API_NUMBER { WORD Index; WORD Subsystem; diff --git a/include/reactos/subsys/csr/csrsrv.h b/include/reactos/subsys/csr/csrsrv.h index fb4a9467d05..19acf19d1ff 100644 --- a/include/reactos/subsys/csr/csrsrv.h +++ b/include/reactos/subsys/csr/csrsrv.h @@ -10,15 +10,6 @@ #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 */ diff --git a/include/reactos/subsys/win/base.h b/include/reactos/subsys/win/base.h index b3592349805..478ea6e76b5 100644 --- a/include/reactos/subsys/win/base.h +++ b/include/reactos/subsys/win/base.h @@ -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) diff --git a/include/reactos/subsys/win/basemsg.h b/include/reactos/subsys/win/basemsg.h index 97c0f6adf80..88757447489 100644 --- a/include/reactos/subsys/win/basemsg.h +++ b/include/reactos/subsys/win/basemsg.h @@ -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 { diff --git a/include/reactos/subsys/win/conmsg.h b/include/reactos/subsys/win/conmsg.h index 43884d11206..2454ac1ae08 100644 --- a/include/reactos/subsys/win/conmsg.h +++ b/include/reactos/subsys/win/conmsg.h @@ -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 { diff --git a/include/reactos/subsys/win/console.h b/include/reactos/subsys/win/console.h index 1153ef92be6..4f77dc6f6ca 100644 --- a/include/reactos/subsys/win/console.h +++ b/include/reactos/subsys/win/console.h @@ -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) diff --git a/include/reactos/subsys/win/winmsg.h b/include/reactos/subsys/win/winmsg.h index f16e7799f58..b238d1c8678 100644 --- a/include/reactos/subsys/win/winmsg.h +++ b/include/reactos/subsys/win/winmsg.h @@ -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; diff --git a/subsystems/win/basesrv/init.c b/subsystems/win/basesrv/init.c index 007b6bda796..8edeefc5b7c 100644 --- a/subsystems/win/basesrv/init.c +++ b/subsystems/win/basesrv/init.c @@ -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; diff --git a/subsystems/win32/csrsrv/procsup.c b/subsystems/win32/csrsrv/procsup.c index 75adf201608..d3ca5de1412 100644 --- a/subsystems/win32/csrsrv/procsup.c +++ b/subsystems/win32/csrsrv/procsup.c @@ -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 diff --git a/subsystems/win32/csrsrv/server.c b/subsystems/win32/csrsrv/server.c index 380c999c7a4..15d2e59c8a9 100644 --- a/subsystems/win32/csrsrv/server.c +++ b/subsystems/win32/csrsrv/server.c @@ -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, diff --git a/win32ss/user/consrv/coninput.c b/win32ss/user/consrv/coninput.c index 48bc9b3bc39..1cc8a5bb61d 100644 --- a/win32ss/user/consrv/coninput.c +++ b/win32ss/user/consrv/coninput.c @@ -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 diff --git a/win32ss/user/consrv/conoutput.c b/win32ss/user/consrv/conoutput.c index 7bd67946712..9b6fc62bdab 100644 --- a/win32ss/user/consrv/conoutput.c +++ b/win32ss/user/consrv/conoutput.c @@ -19,6 +19,12 @@ #define NDEBUG #include +/* +// Define wmemset(...) +#include +#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 diff --git a/win32ss/user/consrv/console.c b/win32ss/user/consrv/console.c index c112751ede4..90c604adc12 100644 --- a/win32ss/user/consrv/console.c +++ b/win32ss/user/consrv/console.c @@ -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, diff --git a/win32ss/user/consrv/frontends/gui/guiterm.c b/win32ss/user/consrv/frontends/gui/guiterm.c index 7bbd681a315..6e25b3b102d 100644 --- a/win32ss/user/consrv/frontends/gui/guiterm.c +++ b/win32ss/user/consrv/frontends/gui/guiterm.c @@ -24,12 +24,6 @@ #define NDEBUG #include -/* -// Define wmemset(...) -#include -#define HAVE_WMEMSET -*/ - /* GUI Console Window Class name */ #define GUI_CONSOLE_WINDOW_CLASS L"ConsoleWindowClass" diff --git a/win32ss/user/user32/misc/exit.c b/win32ss/user/user32/misc/exit.c index a76d2789753..fcc2f9ed6c6 100644 --- a/win32ss/user/user32/misc/exit.c +++ b/win32ss/user/user32/misc/exit.c @@ -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)); diff --git a/win32ss/user/user32/misc/misc.c b/win32ss/user/user32/misc/misc.c index af571a0cfa0..154986348c1 100644 --- a/win32ss/user/user32/misc/misc.c +++ b/win32ss/user/user32/misc/misc.c @@ -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"); diff --git a/win32ss/user/winsrv/CMakeLists.txt b/win32ss/user/winsrv/CMakeLists.txt index d81b1f01d8e..e5d865991f6 100644 --- a/win32ss/user/winsrv/CMakeLists.txt +++ b/win32ss/user/winsrv/CMakeLists.txt @@ -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) diff --git a/win32ss/user/winsrv/harderror.c b/win32ss/user/winsrv/harderror.c index e77867aa70b..708321e097b 100644 --- a/win32ss/user/winsrv/harderror.c +++ b/win32ss/user/winsrv/harderror.c @@ -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); diff --git a/win32ss/user/winsrv/init.c b/win32ss/user/winsrv/init.c index 52328e46be8..c9585cd93ba 100644 --- a/win32ss/user/winsrv/init.c +++ b/win32ss/user/winsrv/init.c @@ -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); diff --git a/win32ss/user/winsrv/register.c b/win32ss/user/winsrv/register.c index 6d8ab90d621..f571d3823ca 100644 --- a/win32ss/user/winsrv/register.c +++ b/win32ss/user/winsrv/register.c @@ -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) { diff --git a/win32ss/user/winsrv/shutdown.c b/win32ss/user/winsrv/shutdown.c index 0c9d8c81bff..fcb8bd9b766 100644 --- a/win32ss/user/winsrv/shutdown.c +++ b/win32ss/user/winsrv/shutdown.c @@ -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)) {