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
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* DEPENDENCIES ***************************************************************/
|
2012-02-06 19:37:19 +00:00
|
|
|
#ifndef _SM_
|
|
|
|
#define _SM_
|
2012-01-30 02:10:39 +00:00
|
|
|
|
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/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/lpcfuncs.h>
|
|
|
|
#include <ndk/setypes.h>
|
|
|
|
#include <ndk/umfuncs.h>
|
|
|
|
#include <ndk/kefuncs.h>
|
2012-01-30 02:10:39 +00:00
|
|
|
|
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;
|
|
|
|
extern ULONG SmpNextSessionIdScanMode;
|
|
|
|
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;
|
|
|
|
extern LIST_ENTRY SmpSubSystemsToLoad;
|
|
|
|
extern LIST_ENTRY SmpExecuteList;
|
|
|
|
extern LIST_ENTRY SmpSubSystemList;
|
|
|
|
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 ******************************************************************/
|
|
|
|
|
2012-01-30 10:22:21 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpTerminate(
|
|
|
|
IN PULONG_PTR Parameters,
|
|
|
|
IN ULONG ParameterMask,
|
|
|
|
IN ULONG ParameterCount
|
|
|
|
);
|
|
|
|
|
2012-01-30 05:32:34 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpCreateSecurityDescriptors(
|
|
|
|
IN BOOLEAN InitialCall
|
|
|
|
);
|
|
|
|
|
2012-01-30 02:10:39 +00:00
|
|
|
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
|
|
|
|
);
|
2012-01-30 03:44:27 +00:00
|
|
|
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
SmpApiLoop(
|
|
|
|
IN PVOID Parameter
|
|
|
|
);
|
2012-01-30 05:32:34 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpExecuteCommand(
|
|
|
|
IN PUNICODE_STRING CommandLine,
|
|
|
|
IN ULONG MuSessionId,
|
2012-01-31 02:38:42 +00:00
|
|
|
OUT PHANDLE ProcessId,
|
2012-01-30 05:32:34 +00:00
|
|
|
IN ULONG Flags
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpLoadSubSystemsForMuSession(
|
|
|
|
IN PULONG MuSessionId,
|
|
|
|
OUT PHANDLE ProcessId,
|
|
|
|
IN PUNICODE_STRING InitialCommand
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
SmpPagingFileInitialize(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpCreatePagingFileDescriptor(
|
|
|
|
IN PUNICODE_STRING PageFileToken
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpCreatePagingFiles(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2012-01-30 19:29:30 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpParseCommandLine(
|
|
|
|
IN PUNICODE_STRING CommandLine,
|
|
|
|
OUT PULONG Flags,
|
|
|
|
OUT PUNICODE_STRING FileName,
|
|
|
|
OUT PUNICODE_STRING Directory,
|
|
|
|
OUT PUNICODE_STRING Arguments
|
|
|
|
);
|
2012-01-31 02:38:42 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpLoadSubSystem(
|
|
|
|
IN PUNICODE_STRING FileName,
|
|
|
|
IN PUNICODE_STRING Directory,
|
|
|
|
IN PUNICODE_STRING CommandLine,
|
|
|
|
IN ULONG MuSessionId,
|
2012-02-08 23:49:19 +00:00
|
|
|
OUT PHANDLE ProcessId,
|
|
|
|
IN ULONG Flags
|
2012-01-31 02:38:42 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SmpSetProcessMuSessionId(
|
|
|
|
IN HANDLE ProcessHandle,
|
|
|
|
IN ULONG SessionId
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
SmpQueryRegistrySosOption(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
SmpSaveAndClearBootStatusData(
|
|
|
|
OUT PBOOLEAN BootOkay,
|
|
|
|
OUT PBOOLEAN ShutdownOkay
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
SmpRestoreBootStatusData(
|
|
|
|
IN BOOLEAN BootOkay,
|
|
|
|
IN BOOLEAN ShutdownOkay
|
|
|
|
);
|
|
|
|
|
2012-02-03 23:11:28 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
SmpCheckForCrashDump(
|
|
|
|
IN PUNICODE_STRING FileName
|
|
|
|
);
|
|
|
|
|
2012-02-06 18:57:18 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
SmpTranslateSystemPartitionInformation(
|
|
|
|
VOID
|
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
|
|
|
|
SmpGetProcessMuSessionId(
|
|
|
|
IN HANDLE ProcessHandle,
|
|
|
|
OUT PULONG SessionId
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
SmpDereferenceSubsystem(
|
|
|
|
IN PSMP_SUBSYSTEM SubSystem
|
|
|
|
);
|
|
|
|
|
2012-02-08 23:49:19 +00:00
|
|
|
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
|
|
|
|
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
|
|
|
|
);
|
|
|
|
|
2014-01-13 13:16:07 +00:00
|
|
|
#endif /* _SM_ */
|