- NDK 0.98, now with versionned headers. Too many changes to list, see the TinyKRNL...
[reactos.git] / reactos / ntoskrnl / lpc / queue.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/lpc/queue.c
6 * PURPOSE: Communication mechanism
7 *
8 * PROGRAMMERS: David Welch (welch@cwcom.net)
9 */
10
11 /* INCLUDES *****************************************************************/
12
13 #include <ntoskrnl.h>
14 #define NDEBUG
15 #include <internal/debug.h>
16
17 /* FUNCTIONS *****************************************************************/
18
19 VOID STDCALL
20 EiEnqueueMessagePort (IN OUT PEPORT Port,
21 IN PQUEUEDMESSAGE Message)
22 {
23 InsertTailList (&Port->QueueListHead,
24 &Message->QueueListEntry);
25 Port->QueueLength++;
26 }
27
28 VOID STDCALL
29 EiEnqueueMessageAtHeadPort (IN OUT PEPORT Port,
30 IN PQUEUEDMESSAGE Message)
31 {
32 InsertTailList (&Port->QueueListHead,
33 &Message->QueueListEntry);
34 Port->QueueLength++;
35 }
36
37 PQUEUEDMESSAGE STDCALL
38 EiDequeueMessagePort (IN OUT PEPORT Port)
39 {
40 PQUEUEDMESSAGE Message;
41 PLIST_ENTRY entry;
42
43 if (IsListEmpty(&Port->QueueListHead))
44 {
45 return(NULL);
46 }
47 entry = RemoveHeadList (&Port->QueueListHead);
48 Message = CONTAINING_RECORD (entry, QUEUEDMESSAGE, QueueListEntry);
49 Port->QueueLength--;
50
51 return (Message);
52 }
53
54
55 VOID STDCALL
56 EiEnqueueConnectMessagePort (IN OUT PEPORT Port,
57 IN PQUEUEDMESSAGE Message)
58 {
59 InsertTailList (&Port->ConnectQueueListHead,
60 &Message->QueueListEntry);
61 Port->ConnectQueueLength++;
62 }
63
64
65 PQUEUEDMESSAGE STDCALL
66 EiDequeueConnectMessagePort (IN OUT PEPORT Port)
67 {
68 PQUEUEDMESSAGE Message;
69 PLIST_ENTRY entry;
70
71 if (IsListEmpty(&Port->ConnectQueueListHead))
72 {
73 return(NULL);
74 }
75 entry = RemoveHeadList (&Port->ConnectQueueListHead);
76 Message = CONTAINING_RECORD (entry, QUEUEDMESSAGE, QueueListEntry);
77 Port->ConnectQueueLength--;
78
79 return (Message);
80 }
81
82
83 /* EOF */