mirror of
https://github.com/reactos/reactos.git
synced 2025-04-04 04:26:32 +00:00
[SMSS] Improve comments/code/some DPRINTs. Reorganize smss.h header.
This commit is contained in:
parent
06a0451415
commit
f43ce46566
8 changed files with 227 additions and 213 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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/mmfuncs.h>
|
||||
#include <ndk/psfuncs.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/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,62 +103,15 @@ 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
|
||||
NTAPI
|
||||
SmpCreateSecurityDescriptors(
|
||||
IN BOOLEAN InitialCall
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpInit(
|
||||
IN PUNICODE_STRING InitialCommand,
|
||||
OUT PHANDLE ProcessHandle
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpAcquirePrivilege(
|
||||
IN ULONG Privilege,
|
||||
OUT PVOID *PrivilegeStat
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
SmpReleasePrivilege(
|
||||
IN PVOID State
|
||||
);
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
SmpApiLoop(
|
||||
IN PVOID Parameter
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpExecuteCommand(
|
||||
IN PUNICODE_STRING CommandLine,
|
||||
IN ULONG MuSessionId,
|
||||
OUT PHANDLE ProcessId,
|
||||
IN ULONG Flags
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpLoadSubSystemsForMuSession(
|
||||
IN PULONG MuSessionId,
|
||||
OUT PHANDLE ProcessId,
|
||||
IN PUNICODE_STRING InitialCommand
|
||||
);
|
||||
/* pagefile.c */
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
|
@ -175,14 +131,138 @@ SmpCreatePagingFiles(
|
|||
VOID
|
||||
);
|
||||
|
||||
/* sminit.c */
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
SmpTranslateSystemPartitionInformation(
|
||||
VOID
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpParseCommandLine(
|
||||
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
|
||||
SmpSbCreateSession(
|
||||
IN PVOID Reserved,
|
||||
IN PSMP_SUBSYSTEM OtherSubsystem,
|
||||
IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
|
||||
IN ULONG MuSessionId,
|
||||
IN PCLIENT_ID DbgClientId
|
||||
);
|
||||
|
||||
/* smsessn.c */
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
SmpCheckDuplicateMuSessionId(
|
||||
IN ULONG MuSessionId
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
SmpDeleteSession(
|
||||
IN ULONG SessionId
|
||||
);
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
SmpAllocateSessionId(
|
||||
IN PSMP_SUBSYSTEM Subsystem,
|
||||
IN PSMP_SUBSYSTEM OtherSubsystem
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpGetProcessMuSessionId(
|
||||
IN HANDLE ProcessHandle,
|
||||
OUT PULONG SessionId
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpSetProcessMuSessionId(
|
||||
IN HANDLE ProcessHandle,
|
||||
IN ULONG SessionId
|
||||
);
|
||||
|
||||
/* smss.c */
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpExecuteImage(
|
||||
IN PUNICODE_STRING FileName,
|
||||
IN PUNICODE_STRING Directory,
|
||||
IN PUNICODE_STRING CommandLine,
|
||||
OUT PULONG Flags,
|
||||
OUT PUNICODE_STRING FileName,
|
||||
OUT PUNICODE_STRING Directory,
|
||||
OUT PUNICODE_STRING Arguments
|
||||
IN ULONG MuSessionId,
|
||||
IN ULONG Flags,
|
||||
IN PRTL_USER_PROCESS_INFORMATION ProcessInformation
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpExecuteCommand(
|
||||
IN PUNICODE_STRING CommandLine,
|
||||
IN ULONG MuSessionId,
|
||||
OUT PHANDLE ProcessId,
|
||||
IN ULONG Flags
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpExecuteInitialCommand(IN ULONG MuSessionId,
|
||||
IN PUNICODE_STRING InitialCommand,
|
||||
IN HANDLE InitialCommandProcess,
|
||||
OUT PHANDLE ReturnPid);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpTerminate(
|
||||
IN PULONG_PTR Parameters,
|
||||
IN ULONG ParameterMask,
|
||||
IN ULONG ParameterCount
|
||||
);
|
||||
|
||||
/* smsubsys.c */
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
SmpDereferenceSubsystem(
|
||||
IN PSMP_SUBSYSTEM SubSystem
|
||||
);
|
||||
|
||||
PSMP_SUBSYSTEM
|
||||
NTAPI
|
||||
SmpLocateKnownSubSysByCid(
|
||||
IN PCLIENT_ID ClientId
|
||||
);
|
||||
|
||||
PSMP_SUBSYSTEM
|
||||
NTAPI
|
||||
SmpLocateKnownSubSysByType(
|
||||
IN ULONG MuSessionId,
|
||||
IN ULONG ImageType
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
|
@ -198,9 +278,35 @@ SmpLoadSubSystem(
|
|||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpSetProcessMuSessionId(
|
||||
IN HANDLE ProcessHandle,
|
||||
IN ULONG SessionId
|
||||
SmpLoadSubSystemsForMuSession(
|
||||
IN PULONG MuSessionId,
|
||||
OUT PHANDLE ProcessId,
|
||||
IN PUNICODE_STRING InitialCommand
|
||||
);
|
||||
|
||||
/* smutil.c */
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpAcquirePrivilege(
|
||||
IN ULONG Privilege,
|
||||
OUT PVOID *PrivilegeStat
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
SmpReleasePrivilege(
|
||||
IN PVOID State
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpParseCommandLine(
|
||||
IN PUNICODE_STRING CommandLine,
|
||||
OUT PULONG Flags,
|
||||
OUT PUNICODE_STRING FileName,
|
||||
OUT PUNICODE_STRING Directory,
|
||||
OUT PUNICODE_STRING Arguments
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
|
@ -223,89 +329,4 @@ SmpRestoreBootStatusData(
|
|||
IN BOOLEAN ShutdownOkay
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
SmpCheckForCrashDump(
|
||||
IN PUNICODE_STRING FileName
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
SmpTranslateSystemPartitionInformation(
|
||||
VOID
|
||||
);
|
||||
|
||||
PSMP_SUBSYSTEM
|
||||
NTAPI
|
||||
SmpLocateKnownSubSysByCid(
|
||||
IN PCLIENT_ID ClientId
|
||||
);
|
||||
|
||||
PSMP_SUBSYSTEM
|
||||
NTAPI
|
||||
SmpLocateKnownSubSysByType(
|
||||
IN ULONG MuSessionId,
|
||||
IN ULONG ImageType
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpGetProcessMuSessionId(
|
||||
IN HANDLE ProcessHandle,
|
||||
OUT PULONG SessionId
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
SmpDereferenceSubsystem(
|
||||
IN PSMP_SUBSYSTEM SubSystem
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpSbCreateSession(
|
||||
IN PVOID Reserved,
|
||||
IN PSMP_SUBSYSTEM OtherSubsystem,
|
||||
IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
|
||||
IN ULONG MuSessionId,
|
||||
IN PCLIENT_ID DbgClientId
|
||||
);
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
SmpAllocateSessionId(
|
||||
IN PSMP_SUBSYSTEM Subsystem,
|
||||
IN PSMP_SUBSYSTEM OtherSubsystem
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
SmpDeleteSession(
|
||||
IN ULONG SessionId
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
SmpCheckDuplicateMuSessionId(
|
||||
IN ULONG MuSessionId
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
SmpExecuteInitialCommand(IN ULONG MuSessionId,
|
||||
IN PUNICODE_STRING InitialCommand,
|
||||
IN HANDLE InitialCommandProcess,
|
||||
OUT PHANDLE ReturnPid);
|
||||
|
||||
NTSTATUS
|
||||
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
|
||||
);
|
||||
|
||||
#endif /* _SM_ */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue