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.

83 lines
2.2 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // File: TSrvWork.h
  4. //
  5. // Contents: TSrvWork include file
  6. //
  7. // Copyright: (c) 1992 - 1997, Microsoft Corporation.
  8. // All Rights Reserved.
  9. // Information Contained Herein is Proprietary
  10. // and Confidential.
  11. //
  12. // History: 17-JUL-97 BrianTa Created.
  13. //
  14. //---------------------------------------------------------------------------
  15. #ifndef _TSRVWORK_H_
  16. #define _TSRVWORK_H_
  17. //
  18. // Typedefs
  19. //
  20. typedef void (*PFI_WI_CALLOUT)(PWORKITEM); // Work callout
  21. // Work item
  22. typedef struct _WORKITEM
  23. {
  24. #if DBG
  25. DWORD CheckMark; // TSRVWORKITEM_CHECKMARK
  26. #endif
  27. PTSRVINFO pTSrvInfo; // Ptr to TSrvInfo object
  28. PFI_WI_CALLOUT pfnCallout; // Callout
  29. ULONG ulParam; // Callout parameter
  30. struct _WORKITEM *pNext; // Ptr to next workitem
  31. } WORKITEM, *PWORKITEM;
  32. // Work queue
  33. typedef struct _WORKQUEUE
  34. {
  35. PWORKITEM pHead; // Ptr to head of the queue
  36. PWORKITEM pTail; // Ptr to tail of the queue
  37. HANDLE hWorkEvent; // Worker event
  38. CRITICAL_SECTION cs; // Crit section
  39. } WORKQUEUE, *PWORKQUEUE;
  40. //
  41. // Prototypes
  42. //
  43. EXTERN_C BOOL TSrvInitWorkQueue(IN PWORKQUEUE pWorkQueue);
  44. EXTERN_C void TSrvFreeWorkQueue(IN PWORKQUEUE pWorkQueue);
  45. EXTERN_C void TSrvWaitForWork(IN PWORKQUEUE pWorkQueue);
  46. EXTERN_C BOOL TSrvWorkToDo(IN PWORKQUEUE pWorkQueue);
  47. EXTERN_C BOOL TSrvDoWork(IN PWORKQUEUE pWorkQueue);
  48. EXTERN_C void TSrvFreeWorkItem(IN PWORKITEM pWorkItem);
  49. EXTERN_C PWORKITEM TSrvDequeueWorkItem(IN PWORKQUEUE pWorkQueue);
  50. EXTERN_C BOOL TSrvEnqueueWorkItem (IN PWORKQUEUE pWorkQueue, IN PWORKITEM pWorkItem,
  51. IN PFI_WI_CALLOUT pfnCallout, IN ULONG ulParam);
  52. #ifdef _TSRVINFO_H_
  53. EXTERN_C PWORKITEM TSrvAllocWorkItem(IN PTSRVINFO pTSrvInfo);
  54. #endif // _TSRVINFO_H_
  55. #endif // _TSRVWORK_H_