Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

KeInitializeQueue routine

The KeInitializeQueue routine initializes a queue object on which threads can wait for entries.

Syntax


VOID KeInitializeQueue(
  _Out_  PRKQUEUE Queue,
  _In_   ULONG Count
);

Parameters

Queue [out]

Pointer to a KQUEUE structure for which the caller must provide resident storage in nonpaged pool. This structure is defined as follows:


typedef struct _KQUEUE {
    DISPATCHER_HEADER Header;
    LIST_ENTRY EntryListHead;
    ULONG CurrentCount;
    ULONG MaximumCount;
    LIST_ENTRY ThreadListHead;
} KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE;

MemberMeaning

Header

Queue header.

EntryListHead

Pointer to the first entry in the queue.

CurrentCount

Current number of threads waiting on the queue.

MaximumCount

Maximum number of concurrent threads the queue can satisfy waits for.

ThreadListHead

Pointer to the first entry in the thread list.

 

Count [in]

The maximum number of threads for which the waits on the queue object can be satisfied concurrently. If this parameter is not supplied, the number of processors in the machine is used.

Return value

None

Remarks

Usually the caller of KeInitializeQueue also creates a set of dedicated threads to queue and dequeue its entries. Such a caller can specify an explicit Count to prevent too many of its dedicated threads from waiting concurrently on its queue object.

KeInitializeQueue sets the queue object's initial signal state to Not Signaled.

For more information about using driver-managed internal queues, see Driver-Managed Queues.

Requirements

Header

Ntifs.h (include Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= DISPATCH_LEVEL

See also

ExAllocatePoolWithTag
IoAllocateWorkItem
IoQueueWorkItem
KeInsertQueue
KeRemoveQueue
KeRundownQueue
PsCreateSystemThread

 

 

Send comments about this topic to Microsoft

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.