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.

81 lines
2.2 KiB

  1. /******************************************************************************
  2. *
  3. * Copyright (c) 1999 Microsoft Corporation
  4. *
  5. * Module Name:
  6. * Blob.h
  7. *
  8. * Abstract:
  9. * This file blob related definitions for ring0 / ring3
  10. *
  11. * Revision History:
  12. * Kanwaljit S Marok ( kmarok ) 05/17/99
  13. * created
  14. *
  15. *****************************************************************************/
  16. #ifndef _BLOB_H_
  17. #define _BLOB_H_
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #define BLOB_VERSION_NUM 3 // Version 3 for Whistler
  22. #define BLOB_MAGIC_NUM 12345 // Magic number
  23. enum BLOB_TYPE
  24. {
  25. BLOB_TYPE_CONFIG = 0, // Config blob may contain other blobs
  26. BLOB_TYPE_PATHTREE = 1, // Path tree blob
  27. BLOB_TYPE_HASHLIST = 2, // Hashed list blob
  28. BLOB_TYPE_CONTAINER= 3, // Container for other blobs
  29. };
  30. typedef struct _BLOB_HEADER
  31. {
  32. DWORD m_dwMaxSize ;
  33. DWORD m_dwVersion ;
  34. DWORD m_dwBlbType ;
  35. DWORD m_dwEntries ;
  36. DWORD m_dwMagicNum;
  37. } BlobHeader;
  38. #ifndef __FILELIST_STRUCTS__
  39. #define DEFINE_BLOB_HEADER() BlobHeader
  40. #else
  41. #define DEFINE_BLOB_HEADER() BlobHeader m_BlobHeader
  42. #endif
  43. //
  44. // Some convenience macros
  45. //
  46. #define INIT_BLOB_HEADER( pBlob, MaxSize, Version, BlbType, Entries ) \
  47. ((BlobHeader *)pBlob)->m_dwMaxSize = MaxSize; \
  48. ((BlobHeader *)pBlob)->m_dwVersion = Version; \
  49. ((BlobHeader *)pBlob)->m_dwBlbType = BlbType; \
  50. ((BlobHeader *)pBlob)->m_dwEntries = Entries; \
  51. ((BlobHeader *)pBlob)->m_dwMagicNum = BLOB_MAGIC_NUM;
  52. #define BLOB_HEADER(pBlob) ( ((BlobHeader *)pBlob) )
  53. #define BLOB_MAXSIZE(pBlob) ( ((BlobHeader *)pBlob)->m_dwMaxSize )
  54. #define BLOB_VERSION(pBlob) ( ((BlobHeader *)pBlob)->m_dwVersion )
  55. #define BLOB_BLBTYPE(pBlob) ( ((BlobHeader *)pBlob)->m_dwBlbType )
  56. #define BLOB_ENTRIES(pBlob) ( ((BlobHeader *)pBlob)->m_dwEntries )
  57. #define BLOB_MAGIC(pBlob) ( ((BlobHeader *)pBlob)->m_dwMagicNum )
  58. #define VERIFY_BLOB_VERSION(pBlob) (BLOB_VERSION(pBlob) == BLOB_VERSION_NUM)
  59. #define VERIFY_BLOB_MAGIC(pBlob) (BLOB_MAGIC(pBlob) == BLOB_MAGIC_NUM )
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif // _BLOB_H_