Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.9 KiB

  1. //=====================================================
  2. // FILE: TSQ.h
  3. // Internal structures for the TS Queue implementation.
  4. //=====================================================
  5. #include "TSQPublic.h"
  6. // TS Queue flags
  7. #define TSQUEUE_BEING_DELETED 0x80 // Delete request has been received for this TS queue.
  8. // Maximum number of work items that can be held by the TS Queue.
  9. #define MAX_WORKITEMS 10
  10. // Data Structures
  11. typedef struct _TSQUEUE_WORK_ITEM {
  12. LIST_ENTRY Links;
  13. PTSQ_CALLBACK pCallBack; // Pointer to the callback function.
  14. PVOID pContext; // Context.
  15. } TSQUEUE_WORK_ITEM, *PTSQUEUE_WORK_ITEM;
  16. typedef struct _TSQUEUE {
  17. LIST_ENTRY WorkItemsHead; // Head of the work items.
  18. ULONG Flags; // Own Thread, Queue Priority, Being deleted
  19. ULONG MaxThreads; // Maximum number of threads that can be by this queue.
  20. ULONG ThreadsCount; // Number of Items being processed.
  21. KEVENT TerminateEvent; // Replace this type by pointer to event.
  22. KSPIN_LOCK TsqSpinLock; // Spin lock.
  23. PDEVICE_OBJECT pDeviceObject; // Device object.
  24. } TSQUEUE, *PTSQUEUE;
  25. typedef struct _TSQ_CONTEXT {
  26. PTSQUEUE pTsQueue; // TS queue
  27. PIO_WORKITEM pWorkItem; // Work item
  28. } TSQ_CONTEXT, *PTSQ_CONTEXT;
  29. // Function prototypes
  30. // TS Queue worker thread.
  31. void TSQueueWorker(PTSQUEUE pTsQueue);
  32. // TS Queue callback function.
  33. void TSQueueCallback(PDEVICE_OBJECT, PVOID);
  34. /*
  35. // Optimized version of TS Queue worker thread.
  36. typedef struct _TSQ_WORKER_INPUT {
  37. BOOL WorkItem; // Pointer to the work item or to the queue.
  38. union {
  39. PTSQUEUE_WORK_ITEM WorkItem;
  40. PQUEUE pQueue;
  41. }
  42. } TSQ_WORKER_INPUT, *PTSQ_WORKER_INPUT;
  43. NTSTATUS TSQueueworker(PTSQ_WORKER_INPUT pWorkerInput);
  44. */