https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f43ce465663f188d1ae0b…
commit f43ce465663f188d1ae0b37ad7db9f8e7145a3d2
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sat Nov 12 01:57:56 2022 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Nov 14 00:10:35 2022 +0100
[SMSS] Improve comments/code/some DPRINTs. Reorganize smss.h header.
---
base/system/smss/sminit.c | 29 +++---
base/system/smss/smloop.c | 10 +-
base/system/smss/smsessn.c | 8 +-
base/system/smss/smss.c | 44 ++++-----
base/system/smss/smss.h | 235 ++++++++++++++++++++++++--------------------
base/system/smss/smsubsys.c | 8 +-
base/system/smss/smutil.c | 6 +-
sdk/lib/smlib/smclient.c | 6 +-
8 files changed, 180 insertions(+), 166 deletions(-)
diff --git a/base/system/smss/sminit.c b/base/system/smss/sminit.c
index 03743dda4b6..bba8faf7cbe 100644
--- a/base/system/smss/sminit.c
+++ b/base/system/smss/sminit.c
@@ -1282,14 +1282,14 @@ SmpInitializeDosDevices(VOID)
PSMP_REGISTRY_VALUE RegEntry;
SECURITY_DESCRIPTOR_CONTROL OldFlag = 0;
OBJECT_ATTRIBUTES ObjectAttributes;
- UNICODE_STRING DestinationString;
+ UNICODE_STRING GlobalName;
HANDLE DirHandle;
PLIST_ENTRY NextEntry, Head;
- /* Open the GLOBAL?? directory */
- RtlInitUnicodeString(&DestinationString, L"\\??");
+ /* Open the \GLOBAL?? directory */
+ RtlInitUnicodeString(&GlobalName, L"\\??");
InitializeObjectAttributes(&ObjectAttributes,
- &DestinationString,
+ &GlobalName,
OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_PERMANENT,
NULL,
NULL);
@@ -1299,7 +1299,7 @@ SmpInitializeDosDevices(VOID)
if (!NT_SUCCESS(Status))
{
DPRINT1("SMSS: Unable to open %wZ directory - Status == %lx\n",
- &DestinationString, Status);
+ &GlobalName, Status);
return Status;
}
@@ -1426,7 +1426,7 @@ SmpInitializeKnownDllsInternal(IN PUNICODE_STRING Directory,
IN PUNICODE_STRING Path)
{
HANDLE DirFileHandle, DirHandle, SectionHandle, FileHandle, LinkHandle;
- UNICODE_STRING NtPath, DestinationString;
+ UNICODE_STRING NtPath, SymLinkName;
OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status, Status1;
PLIST_ENTRY NextEntry;
@@ -1499,9 +1499,9 @@ SmpInitializeKnownDllsInternal(IN PUNICODE_STRING Directory,
}
/* Create a symbolic link to the directory in the object manager */
- RtlInitUnicodeString(&DestinationString, L"KnownDllPath");
+ RtlInitUnicodeString(&SymLinkName, L"KnownDllPath");
InitializeObjectAttributes(&ObjectAttributes,
- &DestinationString,
+ &SymLinkName,
OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_PERMANENT,
DirHandle,
SmpPrimarySecurityDescriptor);
@@ -1518,7 +1518,7 @@ SmpInitializeKnownDllsInternal(IN PUNICODE_STRING Directory,
{
/* It wasn't, so bail out since the OS needs it to exist */
DPRINT1("SMSS: Unable to create %wZ symbolic link - Status == %lx\n",
- &DestinationString, Status);
+ &SymLinkName, Status);
LinkHandle = NULL;
goto Quickie;
}
@@ -1653,12 +1653,12 @@ SmpInitializeKnownDlls(VOID)
{
NTSTATUS Status;
PSMP_REGISTRY_VALUE RegEntry;
- UNICODE_STRING DestinationString;
+ UNICODE_STRING KnownDllsName;
PLIST_ENTRY Head, NextEntry;
/* Call the internal function */
- RtlInitUnicodeString(&DestinationString, L"\\KnownDlls");
- Status = SmpInitializeKnownDllsInternal(&DestinationString,
&SmpKnownDllPath);
+ RtlInitUnicodeString(&KnownDllsName, L"\\KnownDlls");
+ Status = SmpInitializeKnownDllsInternal(&KnownDllsName, &SmpKnownDllPath);
/* Wipe out the list regardless of success */
Head = &SmpKnownDllsList;
@@ -2268,6 +2268,7 @@ SmpLoadDataFromRegistry(OUT PUNICODE_STRING InitialCommand)
InitializeListHead(&SmpSubSystemsToLoad);
InitializeListHead(&SmpSubSystemsToDefer);
InitializeListHead(&SmpExecuteList);
+
SmpPagingFileInitialize();
/* Initialize the SMSS environment */
@@ -2479,7 +2480,7 @@ SmpInit(IN PUNICODE_STRING InitialCommand,
/* Initialize session parameters */
SmpNextSessionId = 1;
- SmpNextSessionIdScanMode = 0;
+ SmpNextSessionIdScanMode = FALSE;
SmpDbgSsLoaded = FALSE;
/* Create the initial security descriptors */
@@ -2557,7 +2558,7 @@ SmpInit(IN PUNICODE_STRING InitialCommand,
{
/* Autochk should've run now. Set the event and save the CSRSS handle */
*ProcessHandle = SmpWindowsSubSysProcess;
- NtSetEvent(EventHandle, 0);
+ NtSetEvent(EventHandle, NULL);
NtClose(EventHandle);
}
diff --git a/base/system/smss/smloop.c b/base/system/smss/smloop.c
index ce5707bff73..8913c56477c 100644
--- a/base/system/smss/smloop.c
+++ b/base/system/smss/smloop.c
@@ -17,10 +17,10 @@
typedef struct _SMP_CLIENT_CONTEXT
{
- PVOID Subsystem;
+ PSMP_SUBSYSTEM Subsystem;
HANDLE ProcessHandle;
HANDLE PortHandle;
- ULONG dword10;
+ PVOID Reserved;
} SMP_CLIENT_CONTEXT, *PSMP_CLIENT_CONTEXT;
typedef
@@ -277,7 +277,7 @@ SmpHandleConnectionRequest(IN HANDLE SmApiPort,
HANDLE PortHandle, ProcessHandle;
ULONG SessionId;
UNICODE_STRING SubsystemPort;
- SMP_CLIENT_CONTEXT *ClientContext;
+ PSMP_CLIENT_CONTEXT ClientContext;
NTSTATUS Status;
OBJECT_ATTRIBUTES ObjectAttributes;
REMOTE_PORT_VIEW PortView;
@@ -343,13 +343,13 @@ SmpHandleConnectionRequest(IN HANDLE SmApiPort,
{
ClientContext->ProcessHandle = ProcessHandle;
ClientContext->Subsystem = CidSubsystem;
- ClientContext->dword10 = 0;
+ ClientContext->Reserved = NULL;
ClientContext->PortHandle = NULL;
}
else
{
/* Failed to allocate a client context, so reject the connection */
- DPRINT1("Rejecting connectiond due to lack of memory\n");
+ DPRINT1("Rejecting connection due to lack of memory\n");
Accept = FALSE;
}
}
diff --git a/base/system/smss/smsessn.c b/base/system/smss/smsessn.c
index 8b3aed81e78..b999c2aaaa9 100644
--- a/base/system/smss/smsessn.c
+++ b/base/system/smss/smsessn.c
@@ -26,7 +26,7 @@ typedef struct _SMP_SESSION
RTL_CRITICAL_SECTION SmpSessionListLock;
LIST_ENTRY SmpSessionListHead;
ULONG SmpNextSessionId;
-ULONG SmpNextSessionIdScanMode;
+BOOLEAN SmpNextSessionIdScanMode;
BOOLEAN SmpDbgSsLoaded;
HANDLE SmpSessionsObjectDirectory;
@@ -134,13 +134,13 @@ SmpAllocateSessionId(IN PSMP_SUBSYSTEM Subsystem,
if (SmpNextSessionIdScanMode)
{
/* Break if it happened */
- DbgPrint("SMSS: SessionId's Wrapped\n");
- DbgBreakPoint();
+ UNIMPLEMENTED_DBGBREAK("SMSS: SessionId's Wrapped\n");
}
else
{
/* Detect it for next time */
- if (!SmpNextSessionId) SmpNextSessionIdScanMode = 1;
+ if (!SmpNextSessionId)
+ SmpNextSessionIdScanMode = TRUE;
}
/* Allocate a session structure */
diff --git a/base/system/smss/smss.c b/base/system/smss/smss.c
index d568becc6dc..ddbe409eb04 100644
--- a/base/system/smss/smss.c
+++ b/base/system/smss/smss.c
@@ -65,7 +65,7 @@ SmpExecuteImage(IN PUNICODE_STRING FileName,
}
/* Set the size field as required */
- ProcessInfo->Size = sizeof(RTL_USER_PROCESS_INFORMATION);
+ ProcessInfo->Size = sizeof(*ProcessInfo);
/* Check if the debug flag was requested */
if (Flags & SMP_DEBUG_FLAG)
@@ -88,7 +88,7 @@ SmpExecuteImage(IN PUNICODE_STRING FileName,
/* And always force NX for anything that SMSS launches */
ProcessParameters->Flags |= RTL_USER_PROCESS_PARAMETERS_NX;
- /* Now create the process */
+ /* Now create the process in suspended state */
Status = RtlCreateUserProcess(FileName,
OBJ_CASE_INSENSITIVE,
ProcessParameters,
@@ -134,7 +134,7 @@ SmpExecuteImage(IN PUNICODE_STRING FileName,
/* This image is invalid, so kill it, close our handles, and fail */
Status = STATUS_INVALID_IMAGE_FORMAT;
NtTerminateProcess(ProcessInfo->ProcessHandle, Status);
- NtWaitForSingleObject(ProcessInfo->ThreadHandle, 0, 0);
+ NtWaitForSingleObject(ProcessInfo->ThreadHandle, FALSE, NULL);
NtClose(ProcessInfo->ThreadHandle);
NtClose(ProcessInfo->ProcessHandle);
DPRINT1("SMSS: Not an NT image - %wZ\n", FileName);
@@ -255,7 +255,7 @@ SmpExecuteCommand(IN PUNICODE_STRING CommandLine,
}
else
{
- /* An actual image name was present -- execute it */
+ /* An actual image name was present, execute it */
Status = SmpExecuteImage(&FileName,
&Directory,
CommandLine,
@@ -265,7 +265,7 @@ SmpExecuteCommand(IN PUNICODE_STRING CommandLine,
}
/* Free all the token parameters */
- if (FileName.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, FileName.Buffer);
+ if (FileName.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, FileName.Buffer);
if (Directory.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Directory.Buffer);
if (Arguments.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Arguments.Buffer);
@@ -287,7 +287,7 @@ SmpExecuteInitialCommand(IN ULONG MuSessionId,
{
NTSTATUS Status;
RTL_USER_PROCESS_INFORMATION ProcessInfo;
- UNICODE_STRING Arguments, ImageFileDirectory, ImageFileName;
+ UNICODE_STRING Arguments, Directory, FileName;
ULONG Flags = 0;
/* Check if we haven't yet connected to ourselves */
@@ -305,14 +305,14 @@ SmpExecuteInitialCommand(IN ULONG MuSessionId,
/* Parse the initial command line */
Status = SmpParseCommandLine(InitialCommand,
&Flags,
- &ImageFileName,
- &ImageFileDirectory,
+ &FileName,
+ &Directory,
&Arguments);
if (Flags & SMP_INVALID_PATH)
{
/* Fail if it doesn't exist */
- DPRINT1("SMSS: Initial command image (%wZ) not found\n",
&ImageFileName);
- if (ImageFileName.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0,
ImageFileName.Buffer);
+ DPRINT1("SMSS: Initial command image (%wZ) not found\n",
&FileName);
+ if (FileName.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, FileName.Buffer);
return STATUS_OBJECT_NAME_NOT_FOUND;
}
@@ -324,23 +324,17 @@ SmpExecuteInitialCommand(IN ULONG MuSessionId,
return Status;
}
- /* Execute the initial command -- but defer its full execution */
- Status = SmpExecuteImage(&ImageFileName,
- &ImageFileDirectory,
+ /* Execute the initial command, but defer its full execution */
+ Status = SmpExecuteImage(&FileName,
+ &Directory,
InitialCommand,
MuSessionId,
SMP_DEFERRED_FLAG,
&ProcessInfo);
- /* Free any buffers we had lying around */
- if (ImageFileName.Buffer)
- {
- RtlFreeHeap(RtlGetProcessHeap(), 0, ImageFileName.Buffer);
- }
- if (ImageFileDirectory.Buffer)
- {
- RtlFreeHeap(RtlGetProcessHeap(), 0, ImageFileDirectory.Buffer);
- }
+ /* Free all the token parameters */
+ if (FileName.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, FileName.Buffer);
+ if (Directory.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Directory.Buffer);
if (Arguments.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0, Arguments.Buffer);
/* Bail out if we couldn't execute the initial command */
@@ -409,7 +403,7 @@ LONG
SmpUnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
{
ULONG_PTR Parameters[4];
- UNICODE_STRING DestinationString;
+ UNICODE_STRING ErrorString;
/* Print and breakpoint into the debugger */
DbgPrint("SMSS: Unhandled exception - Status == %x IP == %p\n",
@@ -421,8 +415,8 @@ SmpUnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
DbgBreakPoint();
/* Build the hard error and terminate */
- RtlInitUnicodeString(&DestinationString, L"Unhandled Exception in Session
Manager");
- Parameters[0] = (ULONG_PTR)&DestinationString;
+ RtlInitUnicodeString(&ErrorString, L"Unhandled Exception in Session
Manager");
+ Parameters[0] = (ULONG_PTR)&ErrorString;
Parameters[1] = ExceptionInfo->ExceptionRecord->ExceptionCode;
Parameters[2] = (ULONG_PTR)ExceptionInfo->ExceptionRecord->ExceptionAddress;
Parameters[3] = (ULONG_PTR)ExceptionInfo->ContextRecord;
diff --git a/base/system/smss/smss.h b/base/system/smss/smss.h
index 46f8dd18f87..fb63117cea5 100644
--- a/base/system/smss/smss.h
+++ b/base/system/smss/smss.h
@@ -6,10 +6,13 @@
* PROGRAMMERS: Alex Ionescu
*/
-/* DEPENDENCIES ***************************************************************/
#ifndef _SM_
#define _SM_
+#pragma once
+
+/* DEPENDENCIES ***************************************************************/
+
#include <stdio.h>
/* Native Headers */
@@ -19,17 +22,17 @@
#include <winreg.h>
#define NTOS_MODE_USER
-#include <ndk/iofuncs.h>
-#include <ndk/obfuncs.h>
-#include <ndk/rtlfuncs.h>
#include <ndk/cmfuncs.h>
#include <ndk/exfuncs.h>
+#include <ndk/iofuncs.h>
+#include <ndk/kefuncs.h>
+#include <ndk/lpcfuncs.h>
#include <ndk/mmfuncs.h>
+#include <ndk/obfuncs.h>
#include <ndk/psfuncs.h>
-#include <ndk/lpcfuncs.h>
+#include <ndk/rtlfuncs.h>
#include <ndk/setypes.h>
#include <ndk/umfuncs.h>
-#include <ndk/kefuncs.h>
#include <ntstrsafe.h>
@@ -78,7 +81,7 @@ extern LIST_ENTRY SmpKnownSubSysHead;
extern RTL_CRITICAL_SECTION SmpSessionListLock;
extern LIST_ENTRY SmpSessionListHead;
extern ULONG SmpNextSessionId;
-extern ULONG SmpNextSessionIdScanMode;
+extern BOOLEAN SmpNextSessionIdScanMode;
extern BOOLEAN SmpDbgSsLoaded;
extern HANDLE SmpWindowsSubSysProcess;
extern HANDLE SmpSessionsObjectDirectory;
@@ -100,139 +103,153 @@ extern BOOLEAN SmpDebug;
/* FUNCTIONS ******************************************************************/
-NTSTATUS
+/* crashdmp.c */
+
+BOOLEAN
NTAPI
-SmpTerminate(
- IN PULONG_PTR Parameters,
- IN ULONG ParameterMask,
- IN ULONG ParameterCount
+SmpCheckForCrashDump(
+ IN PUNICODE_STRING FileName
);
-NTSTATUS
+/* pagefile.c */
+
+VOID
NTAPI
-SmpCreateSecurityDescriptors(
- IN BOOLEAN InitialCall
+SmpPagingFileInitialize(
+ VOID
);
NTSTATUS
NTAPI
-SmpInit(
- IN PUNICODE_STRING InitialCommand,
- OUT PHANDLE ProcessHandle
+SmpCreatePagingFileDescriptor(
+ IN PUNICODE_STRING PageFileToken
);
NTSTATUS
NTAPI
-SmpAcquirePrivilege(
- IN ULONG Privilege,
- OUT PVOID *PrivilegeStat
+SmpCreatePagingFiles(
+ VOID
);
+/* sminit.c */
+
VOID
NTAPI
-SmpReleasePrivilege(
- IN PVOID State
+SmpTranslateSystemPartitionInformation(
+ VOID
+);
+
+NTSTATUS
+NTAPI
+SmpCreateSecurityDescriptors(
+ IN BOOLEAN InitialCall
+);
+
+NTSTATUS
+NTAPI
+SmpInit(
+ IN PUNICODE_STRING InitialCommand,
+ OUT PHANDLE ProcessHandle
);
+/* smloop.c */
+
ULONG
NTAPI
SmpApiLoop(
IN PVOID Parameter
);
+/* smsbapi.c */
+
NTSTATUS
NTAPI
-SmpExecuteCommand(
- IN PUNICODE_STRING CommandLine,
+SmpSbCreateSession(
+ IN PVOID Reserved,
+ IN PSMP_SUBSYSTEM OtherSubsystem,
+ IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
IN ULONG MuSessionId,
- OUT PHANDLE ProcessId,
- IN ULONG Flags
+ IN PCLIENT_ID DbgClientId
);
-NTSTATUS
+/* smsessn.c */
+
+BOOLEAN
NTAPI
-SmpLoadSubSystemsForMuSession(
- IN PULONG MuSessionId,
- OUT PHANDLE ProcessId,
- IN PUNICODE_STRING InitialCommand
+SmpCheckDuplicateMuSessionId(
+ IN ULONG MuSessionId
);
VOID
NTAPI
-SmpPagingFileInitialize(
- VOID
+SmpDeleteSession(
+ IN ULONG SessionId
);
-NTSTATUS
+ULONG
NTAPI
-SmpCreatePagingFileDescriptor(
- IN PUNICODE_STRING PageFileToken
+SmpAllocateSessionId(
+ IN PSMP_SUBSYSTEM Subsystem,
+ IN PSMP_SUBSYSTEM OtherSubsystem
);
NTSTATUS
NTAPI
-SmpCreatePagingFiles(
- VOID
+SmpGetProcessMuSessionId(
+ IN HANDLE ProcessHandle,
+ OUT PULONG SessionId
);
NTSTATUS
NTAPI
-SmpParseCommandLine(
- IN PUNICODE_STRING CommandLine,
- OUT PULONG Flags,
- OUT PUNICODE_STRING FileName,
- OUT PUNICODE_STRING Directory,
- OUT PUNICODE_STRING Arguments
+SmpSetProcessMuSessionId(
+ IN HANDLE ProcessHandle,
+ IN ULONG SessionId
);
+/* smss.c */
+
NTSTATUS
NTAPI
-SmpLoadSubSystem(
+SmpExecuteImage(
IN PUNICODE_STRING FileName,
IN PUNICODE_STRING Directory,
IN PUNICODE_STRING CommandLine,
IN ULONG MuSessionId,
- OUT PHANDLE ProcessId,
- IN ULONG Flags
+ IN ULONG Flags,
+ IN PRTL_USER_PROCESS_INFORMATION ProcessInformation
);
NTSTATUS
NTAPI
-SmpSetProcessMuSessionId(
- IN HANDLE ProcessHandle,
- IN ULONG SessionId
-);
-
-BOOLEAN
-NTAPI
-SmpQueryRegistrySosOption(
- VOID
+SmpExecuteCommand(
+ IN PUNICODE_STRING CommandLine,
+ IN ULONG MuSessionId,
+ OUT PHANDLE ProcessId,
+ IN ULONG Flags
);
-BOOLEAN
+NTSTATUS
NTAPI
-SmpSaveAndClearBootStatusData(
- OUT PBOOLEAN BootOkay,
- OUT PBOOLEAN ShutdownOkay
-);
+SmpExecuteInitialCommand(IN ULONG MuSessionId,
+ IN PUNICODE_STRING InitialCommand,
+ IN HANDLE InitialCommandProcess,
+ OUT PHANDLE ReturnPid);
-VOID
+NTSTATUS
NTAPI
-SmpRestoreBootStatusData(
- IN BOOLEAN BootOkay,
- IN BOOLEAN ShutdownOkay
+SmpTerminate(
+ IN PULONG_PTR Parameters,
+ IN ULONG ParameterMask,
+ IN ULONG ParameterCount
);
-BOOLEAN
-NTAPI
-SmpCheckForCrashDump(
- IN PUNICODE_STRING FileName
-);
+/* smsubsys.c */
VOID
NTAPI
-SmpTranslateSystemPartitionInformation(
- VOID
+SmpDereferenceSubsystem(
+ IN PSMP_SUBSYSTEM SubSystem
);
PSMP_SUBSYSTEM
@@ -250,62 +267,66 @@ SmpLocateKnownSubSysByType(
NTSTATUS
NTAPI
-SmpGetProcessMuSessionId(
- IN HANDLE ProcessHandle,
- OUT PULONG SessionId
+SmpLoadSubSystem(
+ IN PUNICODE_STRING FileName,
+ IN PUNICODE_STRING Directory,
+ IN PUNICODE_STRING CommandLine,
+ IN ULONG MuSessionId,
+ OUT PHANDLE ProcessId,
+ IN ULONG Flags
);
-VOID
+NTSTATUS
NTAPI
-SmpDereferenceSubsystem(
- IN PSMP_SUBSYSTEM SubSystem
+SmpLoadSubSystemsForMuSession(
+ IN PULONG MuSessionId,
+ OUT PHANDLE ProcessId,
+ IN PUNICODE_STRING InitialCommand
);
+/* smutil.c */
+
NTSTATUS
NTAPI
-SmpSbCreateSession(
- IN PVOID Reserved,
- IN PSMP_SUBSYSTEM OtherSubsystem,
- IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
- IN ULONG MuSessionId,
- IN PCLIENT_ID DbgClientId
+SmpAcquirePrivilege(
+ IN ULONG Privilege,
+ OUT PVOID *PrivilegeStat
);
-ULONG
+VOID
NTAPI
-SmpAllocateSessionId(
- IN PSMP_SUBSYSTEM Subsystem,
- IN PSMP_SUBSYSTEM OtherSubsystem
+SmpReleasePrivilege(
+ IN PVOID State
);
-VOID
+NTSTATUS
NTAPI
-SmpDeleteSession(
- IN ULONG SessionId
+SmpParseCommandLine(
+ IN PUNICODE_STRING CommandLine,
+ OUT PULONG Flags,
+ OUT PUNICODE_STRING FileName,
+ OUT PUNICODE_STRING Directory,
+ OUT PUNICODE_STRING Arguments
);
BOOLEAN
NTAPI
-SmpCheckDuplicateMuSessionId(
- IN ULONG MuSessionId
+SmpQueryRegistrySosOption(
+ VOID
);
-NTSTATUS
+BOOLEAN
NTAPI
-SmpExecuteInitialCommand(IN ULONG MuSessionId,
- IN PUNICODE_STRING InitialCommand,
- IN HANDLE InitialCommandProcess,
- OUT PHANDLE ReturnPid);
+SmpSaveAndClearBootStatusData(
+ OUT PBOOLEAN BootOkay,
+ OUT PBOOLEAN ShutdownOkay
+);
-NTSTATUS
+VOID
NTAPI
-SmpExecuteImage(
- IN PUNICODE_STRING FileName,
- IN PUNICODE_STRING Directory,
- IN PUNICODE_STRING CommandLine,
- IN ULONG MuSessionId,
- IN ULONG Flags,
- IN PRTL_USER_PROCESS_INFORMATION ProcessInformation
+SmpRestoreBootStatusData(
+ IN BOOLEAN BootOkay,
+ IN BOOLEAN ShutdownOkay
);
#endif /* _SM_ */
diff --git a/base/system/smss/smsubsys.c b/base/system/smss/smsubsys.c
index ecae4cb1db0..1d6738c8237 100644
--- a/base/system/smss/smsubsys.c
+++ b/base/system/smss/smsubsys.c
@@ -87,7 +87,7 @@ SmpLocateKnownSubSysByCid(IN PCLIENT_ID ClientId)
break;
}
- /* Reset the current pointer and keep earching */
+ /* Reset the current pointer and keep searching */
Subsystem = NULL;
NextEntry = NextEntry->Flink;
}
@@ -123,7 +123,7 @@ SmpLocateKnownSubSysByType(IN ULONG MuSessionId,
break;
}
- /* Reset the current pointer and keep earching */
+ /* Reset the current pointer and keep searching */
Subsystem = NULL;
NextEntry = NextEntry->Flink;
}
@@ -499,7 +499,7 @@ Quickie2:
if (!NT_SUCCESS(Status))
{
RemoveEntryList(&NewSubsystem->Entry);
- NtSetEvent(NewSubsystem->Event, 0);
+ NtSetEvent(NewSubsystem->Event, NULL);
SmpDereferenceSubsystem(NewSubsystem);
}
@@ -619,7 +619,7 @@ SmpLoadSubSystemsForMuSession(IN PULONG MuSessionId,
}
if (!NT_SUCCESS(Status))
{
- DbgPrint("SMSS: Subsystem execute failed (%wZ)\n",
&RegEntry->Value);
+ DPRINT1("SMSS: Subsystem execute failed (%wZ)\n",
&RegEntry->Value);
return Status;
}
diff --git a/base/system/smss/smutil.c b/base/system/smss/smutil.c
index 8b61ab37813..7b1c7c9df1b 100644
--- a/base/system/smss/smutil.c
+++ b/base/system/smss/smutil.c
@@ -173,7 +173,7 @@ SmpParseToken(IN PUNICODE_STRING Input,
Length = 0;
while (Length < InputLength)
{
- if (*p > L' ' ) break;
+ if (*p > L' ') break;
++p;
Length += sizeof(WCHAR);
}
@@ -191,7 +191,7 @@ SmpParseToken(IN PUNICODE_STRING Input,
pp = p;
while (Length < InputLength)
{
- if (*pp <= L' ' ) break;
+ if (*pp <= L' ') break;
++pp;
Length += sizeof(WCHAR);
}
@@ -200,7 +200,7 @@ SmpParseToken(IN PUNICODE_STRING Input,
TokenLength = (ULONG_PTR)pp - (ULONG_PTR)p;
while (Length < InputLength)
{
- if (*pp > L' ' ) break;
+ if (*pp > L' ') break;
++pp;
Length += sizeof(WCHAR);
}
diff --git a/sdk/lib/smlib/smclient.c b/sdk/lib/smlib/smclient.c
index 440ff4fe2e0..ff765898639 100644
--- a/sdk/lib/smlib/smclient.c
+++ b/sdk/lib/smlib/smclient.c
@@ -280,9 +280,7 @@ SmExecPgm(
#endif
/* Set the message data */
- RtlCopyMemory(&ExecPgm->ProcessInformation,
- ProcessInformation,
- sizeof(ExecPgm->ProcessInformation));
+ ExecPgm->ProcessInformation = *ProcessInformation;
ExecPgm->DebugFlag = DebugFlag;
/* Send the message and wait for a reply */
@@ -420,7 +418,7 @@ SmStartCsr(
SmApiMsg.ApiNumber = SmpStartCsrApi;
Status = SmSendMsgToSm(SmApiPort, &SmApiMsg);
- /* Give back informations to caller */
+ /* Give back information to caller */
*pMuSessionId = StartCsr->MuSessionId;
*pWindowsSubSysProcessId = StartCsr->WindowsSubSysProcessId;
*pInitialCommandProcessId = StartCsr->SmpInitialCommandProcessId;