1 /* $Id: smapi.c,v 1.9 2002/09/08 10:23:46 chorns Exp $
3 * Reactos Session Manager
16 /* GLOBAL VARIABLES *********************************************************/
18 static HANDLE SmApiPort
= INVALID_HANDLE_VALUE
;
20 /* FUNCTIONS ****************************************************************/
24 SmApiThread(HANDLE Port
)
28 PLPC_MESSAGE Reply
= NULL
;
32 DisplayString(L
"SmApiThread: running\n");
38 DisplayString(L
"SmApiThread: waiting for message\n");
41 Status
= NtReplyWaitReceivePort(Port
,
45 if (NT_SUCCESS(Status
))
48 DisplayString(L
"SmApiThread: message received\n");
51 if (Message
.MessageType
== LPC_CONNECTION_REQUEST
)
53 // SmHandleConnectionRequest (Port, &Message);
56 else if (Message
.MessageType
== LPC_DEBUG_EVENT
)
58 // DbgSsHandleKmApiMsg (&Message, 0);
61 else if (Message
.MessageType
== LPC_PORT_CLOSED
)
77 OBJECT_ATTRIBUTES ObjectAttributes
;
78 UNICODE_STRING UnicodeString
;
81 RtlInitUnicodeStringFromLiteral(&UnicodeString
,
83 InitializeObjectAttributes(&ObjectAttributes
,
89 Status
= NtCreatePort(&SmApiPort
,
94 if (!NT_SUCCESS(Status
))
99 /* Create two threads for "\SmApiPort" */
100 RtlCreateUserThread(NtCurrentProcess(),
106 (PTHREAD_START_ROUTINE
)SmApiThread
,
111 RtlCreateUserThread(NtCurrentProcess(),
117 (PTHREAD_START_ROUTINE
)SmApiThread
,