SM: simplify and fix client (subsystem servers) management.
[reactos.git] / reactos / subsys / smss / smss.h
1 #ifndef _SMSS_H_INCLUDED_
2 #define _SMSS_H_INCLUDED_
3
4 #include <stdio.h>
5 #include <windows.h>
6 #define NTOS_MODE_USER
7 #include <ndk/ntndk.h>
8
9 #include <sm/api.h>
10 #include <sm/helper.h>
11
12 /* smss.c */
13 extern ULONG SmSsProcessId;
14
15 /* init.c */
16 NTSTATUS InitSessionManager(VOID);
17
18 /* initheap.c */
19 extern HANDLE SmpHeap;
20 NTSTATUS SmCreateHeap(VOID);
21
22 /* initenv.c */
23 extern PWSTR SmSystemEnvironment;
24 NTSTATUS SmCreateEnvironment(VOID);
25 NTSTATUS SmSetEnvironmentVariables(VOID);
26 NTSTATUS SmUpdateEnvironment(VOID);
27
28 /* initobdir.c */
29 NTSTATUS SmCreateObjectDirectories(VOID);
30
31 /* initdosdev.c */
32 NTSTATUS SmInitDosDevices(VOID);
33
34 /* initrun.c */
35 extern HANDLE Children[2];
36 NTSTATUS SmRunBootApplications(VOID);
37
38 /* initmv.c */
39 NTSTATUS SmProcessFileRenameList(VOID);
40
41 /* initwkdll.c */
42 NTSTATUS SmLoadKnownDlls(VOID);
43
44 /* initpage.c */
45 NTSTATUS SmCreatePagingFiles(VOID);
46
47 /* initreg.c */
48 NTSTATUS SmInitializeRegistry(VOID);
49
50 /* initss.c */
51 NTSTATUS STDCALL SmRegisterInternalSubsystem(LPWSTR,USHORT,PHANDLE);
52 NTSTATUS SmLoadSubsystems(VOID);
53
54 /* smapi.c */
55 #define SMAPI(n) \
56 NTSTATUS FASTCALL n (PSM_PORT_MESSAGE Request)
57 PSM_CONNECT_DATA FASTCALL SmpGetConnectData (PSM_PORT_MESSAGE);
58 NTSTATUS SmCreateApiPort(VOID);
59 VOID STDCALL SmpApiThread(PVOID);
60
61
62 /* smapiexec.c */
63 NTSTATUS STDCALL SmCreateUserProcess(LPWSTR ImagePath,
64 LPWSTR CommandLine,
65 BOOLEAN WaitForIt,
66 PLARGE_INTEGER Timeout OPTIONAL,
67 PRTL_USER_PROCESS_INFORMATION UserProcessInfo OPTIONAL);
68 NTSTATUS FASTCALL SmExecPgm(PSM_PORT_MESSAGE);
69
70 /* smapicomp.c */
71 NTSTATUS FASTCALL SmCompSes(PSM_PORT_MESSAGE);
72
73 /* smapiquery.c */
74 NTSTATUS FASTCALL SmQryInfo(PSM_PORT_MESSAGE);
75
76 /* client.c */
77 #define SM_CLIENT_FLAG_CANDIDATE 0x8000
78 #define SM_CLIENT_FLAG_INITIALIZED 0x0001
79 #define SM_CLIENT_FLAG_REQUIRED 0x0002
80 typedef struct _SM_CLIENT_DATA
81 {
82 RTL_CRITICAL_SECTION Lock;
83 WCHAR ProgramName [SM_SB_NAME_MAX_LENGTH];
84 USHORT SubsystemId;
85 WORD Flags;
86 WORD Unused;
87 ULONG ServerProcessId;
88 HANDLE ServerProcess;
89 HANDLE ApiPort;
90 HANDLE ApiPortThread;
91 HANDLE SbApiPort;
92 WCHAR SbApiPortName [SM_SB_NAME_MAX_LENGTH];
93
94 } SM_CLIENT_DATA, *PSM_CLIENT_DATA;
95 NTSTATUS SmInitializeClientManagement (VOID);
96 NTSTATUS STDCALL SmCreateClient (PRTL_USER_PROCESS_INFORMATION,PWSTR);
97 NTSTATUS STDCALL SmDestroyClient (ULONG);
98 NTSTATUS STDCALL SmBeginClientInitialization (PSM_PORT_MESSAGE,PSM_CLIENT_DATA*);
99 NTSTATUS STDCALL SmCompleteClientInitialization (ULONG);
100 NTSTATUS FASTCALL SmGetClientBasicInformation (PSM_BASIC_INFORMATION);
101 NTSTATUS FASTCALL SmGetSubSystemInformation (PSM_SUBSYSTEM_INFORMATION);
102
103 /* debug.c */
104 extern HANDLE DbgSsApiPort;
105 extern HANDLE DbgUiApiPort;
106 NTSTATUS SmInitializeDbgSs(VOID);
107
108 /* print.c */
109 VOID STDCALL DisplayString(LPCWSTR lpwString);
110 VOID STDCALL PrintString (char* fmt, ...);
111
112 #endif /* _SMSS_H_INCLUDED_ */
113
114 /* EOF */
115