2012-01-30 02:10:39 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Windows-Compatible Session Manager
|
|
|
|
* LICENSE: BSD 2-Clause License
|
|
|
|
* FILE: base/system/smss/smss.h
|
|
|
|
* PURPOSE: Main SMSS Header
|
|
|
|
* PROGRAMMERS: Alex Ionescu
|
|
|
|
*/
|
|
|
|
|
2012-02-06 19:37:19 +00:00
|
|
|
#ifndef _SM_
|
|
|
|
#define _SM_
|
2012-01-30 02:10:39 +00:00
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/* DEPENDENCIES ***************************************************************/
|
|
|
|
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <stdio.h>
|
2014-01-13 13:16:07 +00:00
|
|
|
|
|
|
|
/* Native Headers */
|
|
|
|
#define WIN32_NO_STATUS
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <winreg.h>
|
|
|
|
|
2012-01-23 16:49:52 +00:00
|
|
|
#define NTOS_MODE_USER
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <ndk/cmfuncs.h>
|
|
|
|
#include <ndk/exfuncs.h>
|
2022-11-12 00:57:56 +00:00
|
|
|
#include <ndk/iofuncs.h>
|
|
|
|
#include <ndk/kefuncs.h>
|
|
|
|
#include <ndk/lpcfuncs.h>
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <ndk/mmfuncs.h>
|
2022-11-12 00:57:56 +00:00
|
|
|
#include <ndk/obfuncs.h>
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <ndk/psfuncs.h>
|
2022-11-12 00:57:56 +00:00
|
|
|
#include <ndk/rtlfuncs.h>
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <ndk/setypes.h>
|
|
|
|
#include <ndk/umfuncs.h>
|
2012-01-30 02:10:39 +00:00
|
|
|
|
2020-04-30 16:42:16 +00:00
|
|
|
#include <ntstrsafe.h>
|
|
|
|
|
2014-01-13 13:16:07 +00:00
|
|
|
/* SM Protocol Header */
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <sm/smmsg.h>
|
2012-01-30 02:10:39 +00:00
|
|
|
|
|
|
|
/* DEFINES ********************************************************************/
|
|
|
|
|
2012-01-30 19:29:30 +00:00
|
|
|
#define SMP_DEBUG_FLAG 0x01
|
|
|
|
#define SMP_ASYNC_FLAG 0x02
|
|
|
|
#define SMP_AUTOCHK_FLAG 0x04
|
2012-01-31 02:38:42 +00:00
|
|
|
#define SMP_SUBSYSTEM_FLAG 0x08
|
2012-01-30 19:29:30 +00:00
|
|
|
#define SMP_INVALID_PATH 0x10
|
2012-01-31 02:38:42 +00:00
|
|
|
#define SMP_DEFERRED_FLAG 0x20
|
2012-02-08 23:49:19 +00:00
|
|
|
#define SMP_POSIX_FLAG 0x100
|
|
|
|
#define SMP_OS2_FLAG 0x200
|
2012-01-30 19:29:30 +00:00
|
|
|
|
2012-02-06 18:57:18 +00:00
|
|
|
/* STRUCTURES *****************************************************************/
|
|
|
|
|
|
|
|
typedef struct _SMP_REGISTRY_VALUE
|
|
|
|
{
|
|
|
|
LIST_ENTRY Entry;
|
|
|
|
UNICODE_STRING Name;
|
|
|
|
UNICODE_STRING Value;
|
|
|
|
PCHAR AnsiValue;
|
|
|
|
} SMP_REGISTRY_VALUE, *PSMP_REGISTRY_VALUE;
|
|
|
|
|
2012-02-07 07:13:42 +00:00
|
|
|
typedef struct _SMP_SUBSYSTEM
|
|
|
|
{
|
|
|
|
LIST_ENTRY Entry;
|
|
|
|
HANDLE Event;
|
|
|
|
HANDLE ProcessHandle;
|
|
|
|
ULONG ImageType;
|
|
|
|
HANDLE PortHandle;
|
|
|
|
HANDLE SbApiPort;
|
|
|
|
CLIENT_ID ClientId;
|
|
|
|
ULONG MuSessionId;
|
|
|
|
BOOLEAN Terminating;
|
|
|
|
ULONG ReferenceCount;
|
|
|
|
} SMP_SUBSYSTEM, *PSMP_SUBSYSTEM;
|
|
|
|
|
2012-01-30 03:44:27 +00:00
|
|
|
/* EXTERNALS ******************************************************************/
|
|
|
|
|
|
|
|
extern RTL_CRITICAL_SECTION SmpKnownSubSysLock;
|
|
|
|
extern LIST_ENTRY SmpKnownSubSysHead;
|
|
|
|
extern RTL_CRITICAL_SECTION SmpSessionListLock;
|
|
|
|
extern LIST_ENTRY SmpSessionListHead;
|
|
|
|
extern ULONG SmpNextSessionId;
|
2022-11-12 00:57:56 +00:00
|
|
|
extern BOOLEAN SmpNextSessionIdScanMode;
|
2012-01-30 03:44:27 +00:00
|
|
|
extern BOOLEAN SmpDbgSsLoaded;
|
|
|
|
extern HANDLE SmpWindowsSubSysProcess;
|
2012-01-30 05:32:34 +00:00
|
|
|
extern HANDLE SmpSessionsObjectDirectory;
|
|
|
|
extern HANDLE SmpWindowsSubSysProcessId;
|
[SMSS]: Co-exist with SMSS2 by using OBJ_OPENIF when creating object directories and sections, in case SMSS2 has already done so (which now it probably will).
[SMSS2]: Implement all the required registry configuration parsing functions. KnownDLLs, DosDevices, PageFiles, Subsystems, ExcludedKnownDLLs, PendingFileRenameOperations, ObjectDirectories, Environment keys are all processed and put into lists. Other than creating the object directories and setting the environment variables, though, no other work happens -- but we do DPRINT1 what should happen.
svn path=/trunk/; revision=55319
2012-01-30 08:02:17 +00:00
|
|
|
extern BOOLEAN RegPosixSingleInstance;
|
2012-01-30 19:29:30 +00:00
|
|
|
extern UNICODE_STRING SmpDebugKeyword, SmpASyncKeyword, SmpAutoChkKeyword;
|
|
|
|
extern PVOID SmpHeap;
|
|
|
|
extern ULONG SmBaseTag;
|
|
|
|
extern UNICODE_STRING SmpSystemRoot;
|
|
|
|
extern PWCHAR SmpDefaultEnvironment;
|
|
|
|
extern UNICODE_STRING SmpDefaultLibPath;
|
2012-02-06 18:57:18 +00:00
|
|
|
extern LIST_ENTRY SmpSetupExecuteList;
|
2022-10-26 15:35:03 +00:00
|
|
|
extern LIST_ENTRY SmpSubSystemList;
|
2012-02-06 18:57:18 +00:00
|
|
|
extern LIST_ENTRY SmpSubSystemsToLoad;
|
2022-10-26 15:35:03 +00:00
|
|
|
extern LIST_ENTRY SmpSubSystemsToDefer;
|
2012-02-06 18:57:18 +00:00
|
|
|
extern LIST_ENTRY SmpExecuteList;
|
|
|
|
extern ULONG AttachedSessionId;
|
2012-02-08 23:49:19 +00:00
|
|
|
extern BOOLEAN SmpDebug;
|
2012-01-30 05:32:34 +00:00
|
|
|
|
2012-01-30 02:10:39 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
/* crashdmp.c */
|
|
|
|
|
|
|
|
BOOLEAN
|
2012-01-30 10:22:21 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpCheckForCrashDump(
|
|
|
|
IN PUNICODE_STRING FileName
|
2012-01-30 10:22:21 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
/* pagefile.c */
|
|
|
|
|
|
|
|
VOID
|
2012-01-30 05:32:34 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpPagingFileInitialize(
|
|
|
|
VOID
|
2012-01-30 05:32:34 +00:00
|
|
|
);
|
|
|
|
|
2012-01-30 02:10:39 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpCreatePagingFileDescriptor(
|
|
|
|
IN PUNICODE_STRING PageFileToken
|
2012-01-30 02:10:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpCreatePagingFiles(
|
|
|
|
VOID
|
2012-01-30 02:10:39 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
/* sminit.c */
|
|
|
|
|
2012-01-30 02:10:39 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpTranslateSystemPartitionInformation(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpCreateSecurityDescriptors(
|
|
|
|
IN BOOLEAN InitialCall
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpInit(
|
|
|
|
IN PUNICODE_STRING InitialCommand,
|
|
|
|
OUT PHANDLE ProcessHandle
|
2012-01-30 02:10:39 +00:00
|
|
|
);
|
2012-01-30 03:44:27 +00:00
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
/* smloop.c */
|
|
|
|
|
2012-01-30 03:44:27 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
SmpApiLoop(
|
|
|
|
IN PVOID Parameter
|
|
|
|
);
|
2012-01-30 05:32:34 +00:00
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
/* smsbapi.c */
|
|
|
|
|
2012-01-30 05:32:34 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpSbCreateSession(
|
|
|
|
IN PVOID Reserved,
|
|
|
|
IN PSMP_SUBSYSTEM OtherSubsystem,
|
|
|
|
IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
|
2022-11-13 00:47:26 +00:00
|
|
|
IN ULONG DbgSessionId,
|
|
|
|
IN PCLIENT_ID DbgUiClientId
|
2012-01-30 05:32:34 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
/* smsessn.c */
|
|
|
|
|
|
|
|
BOOLEAN
|
2012-01-30 05:32:34 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpCheckDuplicateMuSessionId(
|
|
|
|
IN ULONG MuSessionId
|
2012-01-30 05:32:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpDeleteSession(
|
|
|
|
IN ULONG SessionId
|
2012-01-30 05:32:34 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
ULONG
|
2012-01-30 05:32:34 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpAllocateSessionId(
|
|
|
|
IN PSMP_SUBSYSTEM Subsystem,
|
|
|
|
IN PSMP_SUBSYSTEM OtherSubsystem
|
2012-01-30 05:32:34 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpGetProcessMuSessionId(
|
|
|
|
IN HANDLE ProcessHandle,
|
|
|
|
OUT PULONG SessionId
|
2012-01-30 05:32:34 +00:00
|
|
|
);
|
|
|
|
|
2012-01-30 19:29:30 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpSetProcessMuSessionId(
|
|
|
|
IN HANDLE ProcessHandle,
|
|
|
|
IN ULONG SessionId
|
2012-01-30 19:29:30 +00:00
|
|
|
);
|
2012-01-31 02:38:42 +00:00
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
/* smss.c */
|
|
|
|
|
2012-01-31 02:38:42 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpExecuteImage(
|
2012-01-31 02:38:42 +00:00
|
|
|
IN PUNICODE_STRING FileName,
|
|
|
|
IN PUNICODE_STRING Directory,
|
|
|
|
IN PUNICODE_STRING CommandLine,
|
|
|
|
IN ULONG MuSessionId,
|
2022-11-12 00:57:56 +00:00
|
|
|
IN ULONG Flags,
|
|
|
|
IN PRTL_USER_PROCESS_INFORMATION ProcessInformation
|
2012-01-31 02:38:42 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpExecuteCommand(
|
|
|
|
IN PUNICODE_STRING CommandLine,
|
|
|
|
IN ULONG MuSessionId,
|
|
|
|
OUT PHANDLE ProcessId,
|
|
|
|
IN ULONG Flags
|
2012-01-31 02:38:42 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
NTSTATUS
|
2012-01-31 02:38:42 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpExecuteInitialCommand(IN ULONG MuSessionId,
|
|
|
|
IN PUNICODE_STRING InitialCommand,
|
|
|
|
IN HANDLE InitialCommandProcess,
|
|
|
|
OUT PHANDLE ReturnPid);
|
2012-01-31 02:38:42 +00:00
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
NTSTATUS
|
2012-01-31 02:38:42 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpTerminate(
|
|
|
|
IN PULONG_PTR Parameters,
|
|
|
|
IN ULONG ParameterMask,
|
|
|
|
IN ULONG ParameterCount
|
2012-01-31 02:38:42 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
/* smsubsys.c */
|
2012-02-03 23:11:28 +00:00
|
|
|
|
2012-02-06 18:57:18 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpDereferenceSubsystem(
|
|
|
|
IN PSMP_SUBSYSTEM SubSystem
|
2012-02-06 19:37:19 +00:00
|
|
|
);
|
2012-02-07 07:13:42 +00:00
|
|
|
|
|
|
|
PSMP_SUBSYSTEM
|
|
|
|
NTAPI
|
|
|
|
SmpLocateKnownSubSysByCid(
|
|
|
|
IN PCLIENT_ID ClientId
|
|
|
|
);
|
|
|
|
|
|
|
|
PSMP_SUBSYSTEM
|
|
|
|
NTAPI
|
|
|
|
SmpLocateKnownSubSysByType(
|
|
|
|
IN ULONG MuSessionId,
|
|
|
|
IN ULONG ImageType
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpLoadSubSystem(
|
|
|
|
IN PUNICODE_STRING FileName,
|
|
|
|
IN PUNICODE_STRING Directory,
|
|
|
|
IN PUNICODE_STRING CommandLine,
|
|
|
|
IN ULONG MuSessionId,
|
|
|
|
OUT PHANDLE ProcessId,
|
|
|
|
IN ULONG Flags
|
2012-02-07 07:13:42 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
NTSTATUS
|
2012-02-07 07:13:42 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpLoadSubSystemsForMuSession(
|
|
|
|
IN PULONG MuSessionId,
|
|
|
|
OUT PHANDLE ProcessId,
|
|
|
|
IN PUNICODE_STRING InitialCommand
|
2012-02-07 07:13:42 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
/* smutil.c */
|
|
|
|
|
2012-02-08 23:49:19 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpAcquirePrivilege(
|
|
|
|
IN ULONG Privilege,
|
|
|
|
OUT PVOID *PrivilegeStat
|
2012-02-08 23:49:19 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
VOID
|
2012-02-08 23:49:19 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpReleasePrivilege(
|
|
|
|
IN PVOID State
|
2012-02-08 23:49:19 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
NTSTATUS
|
2012-02-08 23:49:19 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpParseCommandLine(
|
|
|
|
IN PUNICODE_STRING CommandLine,
|
|
|
|
OUT PULONG Flags,
|
|
|
|
OUT PUNICODE_STRING FileName,
|
|
|
|
OUT PUNICODE_STRING Directory,
|
|
|
|
OUT PUNICODE_STRING Arguments
|
2012-02-08 23:49:19 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpQueryRegistrySosOption(
|
|
|
|
VOID
|
2012-02-08 23:49:19 +00:00
|
|
|
);
|
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
BOOLEAN
|
2021-05-24 09:50:16 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpSaveAndClearBootStatusData(
|
|
|
|
OUT PBOOLEAN BootOkay,
|
|
|
|
OUT PBOOLEAN ShutdownOkay
|
|
|
|
);
|
2021-05-24 09:50:16 +00:00
|
|
|
|
2022-11-12 00:57:56 +00:00
|
|
|
VOID
|
2012-02-08 23:49:19 +00:00
|
|
|
NTAPI
|
2022-11-12 00:57:56 +00:00
|
|
|
SmpRestoreBootStatusData(
|
|
|
|
IN BOOLEAN BootOkay,
|
|
|
|
IN BOOLEAN ShutdownOkay
|
2012-02-08 23:49:19 +00:00
|
|
|
);
|
|
|
|
|
2014-01-13 13:16:07 +00:00
|
|
|
#endif /* _SM_ */
|