1 /* $Id: smapi.c,v 1.8 2002/09/07 15:13:09 chorns Exp $
3 * Reactos Session Manager
14 /* GLOBAL VARIABLES *********************************************************/
16 static HANDLE SmApiPort
= INVALID_HANDLE_VALUE
;
18 /* FUNCTIONS ****************************************************************/
22 SmApiThread(HANDLE Port
)
26 PLPC_MESSAGE Reply
= NULL
;
30 DisplayString(L
"SmApiThread: running\n");
36 DisplayString(L
"SmApiThread: waiting for message\n");
39 Status
= NtReplyWaitReceivePort(Port
,
43 if (NT_SUCCESS(Status
))
46 DisplayString(L
"SmApiThread: message received\n");
49 if (Message
.MessageType
== LPC_CONNECTION_REQUEST
)
51 // SmHandleConnectionRequest (Port, &Message);
54 else if (Message
.MessageType
== LPC_DEBUG_EVENT
)
56 // DbgSsHandleKmApiMsg (&Message, 0);
59 else if (Message
.MessageType
== LPC_PORT_CLOSED
)
75 OBJECT_ATTRIBUTES ObjectAttributes
;
76 UNICODE_STRING UnicodeString
;
79 RtlInitUnicodeStringFromLiteral(&UnicodeString
,
81 InitializeObjectAttributes(&ObjectAttributes
,
87 Status
= NtCreatePort(&SmApiPort
,
92 if (!NT_SUCCESS(Status
))
97 /* Create two threads for "\SmApiPort" */
98 RtlCreateUserThread(NtCurrentProcess(),
104 (PTHREAD_START_ROUTINE
)SmApiThread
,
109 RtlCreateUserThread(NtCurrentProcess(),
115 (PTHREAD_START_ROUTINE
)SmApiThread
,