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.

71 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. All rights reserved
  4. Module Name:
  5. jobid.h
  6. Abstract:
  7. Handles job id bitmap.
  8. Author:
  9. Albert Ting (AlbertT) 24-Oct-96
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. Ported from spooler.c code.
  14. --*/
  15. #ifndef _JOBID_H
  16. #define _JOBID_H
  17. typedef struct _JOB_ID_MAP {
  18. PDWORD pMap;
  19. DWORD dwMaxJobId;
  20. DWORD dwCurrentJobId;
  21. } JOB_ID_MAP, *PJOB_ID_MAP;
  22. #define pMapFromHandle( hJobIdMap ) (((PJOB_ID_MAP)hJobIdMap)->pMap)
  23. #define MaxJobId( hJobIdMap ) (((PJOB_ID_MAP)hJobIdMap)->dwMaxJobId)
  24. #define vMarkOn( hJobId, Id) \
  25. ((pMapFromHandle( hJobId ))[(Id) / 32] |= (1 << ((Id) % 32) ))
  26. #define vMarkOff( hJobId, Id) \
  27. ((pMapFromHandle( hJobId ))[(Id) / 32] &= ~(1 << ((Id) % 32) ))
  28. #define bBitOn( hJobId, Id) \
  29. ((pMapFromHandle( hJobId ))[Id / 32] & ( 1 << ((Id) % 32) ) )
  30. BOOL
  31. ReallocJobIdMap(
  32. HANDLE hJobIdMap,
  33. DWORD dwNewMinSize
  34. );
  35. DWORD
  36. GetNextId(
  37. HANDLE hJobIdMap
  38. );
  39. HANDLE
  40. hCreateJobIdMap(
  41. DWORD dwMinSize
  42. );
  43. VOID
  44. vDeleteJobIdMap(
  45. HANDLE hJobIdMap
  46. );
  47. #endif // ifdef _JOBID_H