Source code of Windows XP (NT5)
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.

147 lines
6.0 KiB

  1. /*************************************************************************
  2. * *
  3. * GROUP.H *
  4. * *
  5. * Copyright (C) Microsoft Corporation 1990-1995 *
  6. * All Rights reserved. *
  7. * *
  8. **************************************************************************
  9. * *
  10. * Module Intent *
  11. * All typedefs and defines needed for group *
  12. * *
  13. **************************************************************************
  14. * *
  15. * Current Owner: GarrG *
  16. * *
  17. **************************************************************************
  18. * *
  19. * Released by Development: (date) *
  20. * *
  21. **************************************************************************
  22. * Requires:
  23. * mverror.h
  24. */
  25. #include <_mvutil.h>
  26. // Critical structures that gets messed up in /Zp8
  27. #pragma pack(1)
  28. #define FILE_HDR_SIZE 40
  29. /*************************************************************************
  30. * Basic defines.
  31. *************************************************************************/
  32. #if defined( __cplusplus )
  33. extern "C" {
  34. #endif
  35. /*
  36. * Various files stamps.
  37. * This is to distinguish one file's type from another
  38. */
  39. #define GROUP_STAMP 0x3333
  40. #define GROUPVER ((WORD)20)
  41. #define VALIDATE_GROUP(lpGroup) {\
  42. if (lpGroup == NULL || (lpGroup->version < 7 || lpGroup->version > GROUPVER) || lpGroup->FileStamp != GROUP_STAMP)\
  43. return E_FAIL;\
  44. return S_OK;\
  45. }
  46. #define GROUPISBITSET(lpGroup, dwBit) \
  47. (lpGroup->lpbGrpBitVect[((dwBit) / 8)] & (1 << ((dwBit) % 8)))
  48. /*************************************************************************
  49. *
  50. * Group Structure & Global Functions
  51. *
  52. *************************************************************************/
  53. #define GROUP_HDR_SIZE FILE_HDR_SIZE
  54. typedef DWORD LIBITGROUP;
  55. /* Information that goes into the group file */
  56. #define GROUP_HEADER \
  57. unsigned short FileStamp; /* Group stamp */ \
  58. WORD version; /* Version number */ \
  59. DWORD dwSize; /* Group size in bytes */ \
  60. DWORD maxItem; /* Largest item in group */ \
  61. DWORD minItem; /* Smallest item in group */ \
  62. DWORD lcItem; /* Item's count */ \
  63. DWORD maxItemAllGroup; /* Maximum item of all groups */ \
  64. WORD fFlag
  65. typedef struct GROUP_HDR {
  66. GROUP_HEADER;
  67. } GROUP_HDR;
  68. #define BITVECT_GROUP 0 // Normal bit vector group
  69. #define HILO_GROUP 1 // HiLo group : no associated bit vector, only hi
  70. // &lo values
  71. #define TRIMMED_GROUP 2 // Trimmed group : bit vector only contains bytes
  72. // between lo & hi
  73. #define DISKCOMP_GROUP 3 // Disk Compression used
  74. // Must be expanded upon readin, becomes BITVECT_GROUP
  75. #define DISKCOMP_TRIMMED_GROUP 4 // Disk Compression used
  76. // Must be expanded upon readin, becomes TRIMMED_GROUP
  77. /* Group structure */
  78. /* Regular bit vector group */
  79. typedef struct tagGroup {
  80. GROUP_HEADER;
  81. LPERRB lperr; // Pointer to error buffer
  82. LPBYTE lpbGrpBitVect; // Pointer to group bit vector
  83. HANDLE hGrpBitVect; // Handle to "lpbGrpBitVect".
  84. HANDLE hGroup; // Handle to this structure.
  85. LPSTR lszGroupName; // Group name
  86. DWORD dwIndex; // Group index
  87. struct tagGroup FAR * lpGrpNext; // Next group in the linked list
  88. DWORD dwCount; // for faster GroupFind
  89. UINT nCache; // for faster GroupFind = # of bytes for dwCount
  90. WORD wFlag;
  91. } _GROUP, // winsock2.h defines GROUP
  92. FAR *_LPGROUP;
  93. #define GROUP_EXPAND 1
  94. #define GROUP_BLOCK_SIZE 256
  95. #define LCBITGROUPMAX ((DWORD)0x10000000) // This is the number of bits
  96. // that can fit into 32 Meg
  97. // all of the functions provided by the Group.lib
  98. // in groupcom.c
  99. ERR FAR PASCAL GroupAddItem(LPVOID, DWORD);
  100. _LPGROUP FAR PASCAL GroupInitiate(DWORD, LPERRB);
  101. DWORD FAR PASCAL LrgbBitCount(LPBYTE, DWORD);
  102. PUBLIC DWORD FAR PASCAL LrgbBitFind(LPBYTE, DWORD, BYTE FAR *);
  103. _LPGROUP FAR PASCAL GroupCreate (DWORD, DWORD, LPERRB);
  104. VOID FAR PASCAL GroupFree(_LPGROUP lpGroup);
  105. PUBLIC int PASCAL FAR GroupFileBuild
  106. (HFPB hfpbSysFile, LPSTR lszGrpFilename, _LPGROUP lpGroup);
  107. ERR FAR PASCAL GroupRemoveItem(_LPGROUP lpGroup, DWORD dwGrpItem);
  108. int PASCAL FAR GroupTrimmed (_LPGROUP lpGroup);
  109. PUBLIC _LPGROUP FAR PASCAL GroupOr(_LPGROUP lpGroup1,_LPGROUP lpGroup2, LPERRB lperr);
  110. PUBLIC _LPGROUP FAR PASCAL GroupNot(_LPGROUP lpGroup,LPERRB lperr);
  111. PUBLIC _LPGROUP FAR PASCAL GroupAnd(_LPGROUP lpGroup1,_LPGROUP lpGroup2, LPERRB lperr);
  112. PUBLIC DWORD FAR PASCAL GroupFind(_LPGROUP lpGroup, DWORD dwCount, LPERRB lperrb);
  113. PUBLIC DWORD FAR PASCAL GroupFindOffset(_LPGROUP lpGroup, DWORD dwCount, LPERRB lperrb);
  114. PUBLIC _LPGROUP PASCAL FAR GroupDuplicate (_LPGROUP lpGroup,LPERRB lperr);
  115. PUBLIC ERR PASCAL FAR GroupCopy (_LPGROUP lpGroupDst, _LPGROUP lpGroupSrc);
  116. PUBLIC BOOL FAR PASCAL GroupIsBitSet (_LPGROUP lpGroup, DWORD dwTopicNum);
  117. _LPGROUP PASCAL FAR GroupMake (LPBYTE lpBits, DWORD dwSize, DWORD dwItems);
  118. _LPGROUP PASCAL FAR GroupBufferCreate (HANDLE h, LPERRB lperrb);
  119. #if defined( __cplusplus )
  120. }
  121. #endif
  122. // Critical structures that gets messed up in /Zp8
  123. #pragma pack()