Correct LPC implementation
[reactos.git] / reactos / subsys / smss / smapi.c
1 /* $Id: smapi.c,v 1.4 2000/04/03 21:54:42 dwelch Exp $
2 *
3 * Reactos Session Manager
4 *
5 *
6 */
7
8 #include <ddk/ntddk.h>
9 #include <napi/lpc.h>
10
11 #include "smss.h"
12
13 //#define NDEBUG
14
15
16 VOID STDCALL
17 SmApiThread (HANDLE Port)
18 {
19 NTSTATUS Status;
20 ULONG Unknown;
21 PLPC_MESSAGE Reply = NULL;
22 LPC_MESSAGE Message;
23
24 #ifndef NDEBUG
25 DisplayString (L"SmApiThread: running\n");
26 #endif
27
28 for (;;)
29 {
30 #ifndef NDEBUG
31 DisplayString (L"SmApiThread: waiting for message\n");
32 #endif
33
34 Status = NtReplyWaitReceivePort (Port,
35 &Unknown,
36 Reply,
37 &Message);
38 if (NT_SUCCESS(Status))
39 {
40 #ifndef NDEBUG
41 DisplayString (L"SmApiThread: message received\n");
42 #endif
43
44 if (Message.MessageType == LPC_CONNECTION_REQUEST)
45 {
46 // SmHandleConnectionRequest (Port, &Message);
47 Reply = NULL;
48 }
49 else if (Message.MessageType == LPC_DEBUG_EVENT)
50 {
51 // DbgSsHandleKmApiMsg (&Message, 0);
52 Reply = NULL;
53 }
54 else if (Message.MessageType == LPC_PORT_CLOSED)
55 {
56 Reply = NULL;
57 }
58 else
59 {
60
61 // Reply = &Message;
62 }
63 }
64 }
65 }
66
67 /* EOF */