sm namespace macros
[reactos.git] / reactos / subsys / csrss / win32mu / init.c
1 /* $Id: $
2 *
3 * WIN32MU.DLL - init.c - Initialize the server DLL
4 *
5 * ReactOS Operating System
6 *
7 * --------------------------------------------------------------------
8 *
9 * This software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This software is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this software; see the file COPYING.LIB. If not, write
21 * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
22 * MA 02139, USA.
23 *
24 * --------------------------------------------------------------------
25 */
26 #define NTOS_MODE_USER
27 #include <ntos.h>
28
29 #define NDEBUG
30 #include <debug.h>
31
32 #include "w32mu.h"
33
34 static NTSTATUS STDCALL
35 W32muLoadRemoteTerminalProxy (VOID)
36 {
37 SYSTEM_LOAD_AND_CALL_IMAGE ImageInfo;
38 NTSTATUS Status = STATUS_SUCCESS;
39
40 DPRINT("W32MU: loading remote terminal device\n");
41
42 /* Load kernel mode module */
43 RtlInitUnicodeString (& ImageInfo.ModuleName,
44 L"\\SystemRoot\\system32\\w32mut.sys");
45
46 Status = NtSetSystemInformation (SystemLoadAndCallImage,
47 & ImageInfo,
48 sizeof (SYSTEM_LOAD_AND_CALL_IMAGE));
49
50 DPRINT("W32MU: w32mut.sys loaded\n", Status);
51 if (!NT_SUCCESS(Status))
52 {
53 DPRINT("W32MU: loading w32mut.sys failed (Status=0x%08lx)\n", Status);
54 return Status;
55 }
56 return Status;
57 }
58
59 /* Public entry point for CSRSS.EXE to load us */
60
61 NTSTATUS STDCALL
62 ServerDllInitialization (int a0, int a1, int a2, int a3, int a4)
63 {
64 NTSTATUS Status = STATUS_SUCCESS;
65
66 /* TODO:
67 * 1) load a kernel mode module to make Kmode happy
68 * (it will provide keyoard, display and pointer
69 * devices for window stations not attached to
70 * the console);
71 */
72 Status = W32muLoadRemoteTerminalProxy ();
73 /*
74 * 2) pick up from the registry the list of session
75 * access providers (SAP: Local, RFB, RDP, ICA, ...);
76 * 3) initialize each SAP;
77 * 4) on SAP events, provide:
78 * 4.1) create session (SESSION->new);
79 * 4.2) suspend session (SESSION->state_change);
80 * 4.3) destroy session (SESSION->delete).
81 */
82 return Status;
83 }
84
85 /* EOF */