1 /* $Id: queue.c,v 1.5 2001/12/02 23:34:42 dwelch Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/lpc/queue.c
6 * PURPOSE: Communication mechanism
7 * PROGRAMMER: David Welch (welch@cwcom.net)
12 /* INCLUDES *****************************************************************/
14 #include <ddk/ntddk.h>
15 #include <internal/ob.h>
16 #include <internal/port.h>
17 #include <internal/dbg.h>
20 #include <internal/debug.h>
22 /* FUNCTIONS *****************************************************************/
25 EiEnqueueMessagePort (IN OUT PEPORT Port
,
26 IN PQUEUEDMESSAGE Message
)
28 InsertTailList (&Port
->QueueListHead
,
29 &Message
->QueueListEntry
);
34 EiEnqueueMessageAtHeadPort (IN OUT PEPORT Port
,
35 IN PQUEUEDMESSAGE Message
)
37 InsertTailList (&Port
->QueueListHead
,
38 &Message
->QueueListEntry
);
42 PQUEUEDMESSAGE STDCALL
43 EiDequeueMessagePort (IN OUT PEPORT Port
)
45 PQUEUEDMESSAGE Message
;
48 if (IsListEmpty(&Port
->QueueListHead
))
52 entry
= RemoveHeadList (&Port
->QueueListHead
);
53 Message
= CONTAINING_RECORD (entry
, QUEUEDMESSAGE
, QueueListEntry
);
61 EiEnqueueConnectMessagePort (IN OUT PEPORT Port
,
62 IN PQUEUEDMESSAGE Message
)
64 InsertTailList (&Port
->ConnectQueueListHead
,
65 &Message
->QueueListEntry
);
66 Port
->ConnectQueueLength
++;
70 PQUEUEDMESSAGE STDCALL
71 EiDequeueConnectMessagePort (IN OUT PEPORT Port
)
73 PQUEUEDMESSAGE Message
;
76 if (IsListEmpty(&Port
->ConnectQueueListHead
))
80 entry
= RemoveHeadList (&Port
->ConnectQueueListHead
);
81 Message
= CONTAINING_RECORD (entry
, QUEUEDMESSAGE
, QueueListEntry
);
82 Port
->ConnectQueueLength
--;