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.

106 lines
3.0 KiB

  1. //*************************************************************
  2. //
  3. // Hash table for registry Rsop data
  4. //
  5. // Microsoft Confidential
  6. // Copyright (c) Microsoft Corporation 1999
  7. // All rights reserved
  8. //
  9. // History: 7-Jun-99 SitaramR Created
  10. //
  11. //*************************************************************
  12. #define HASH_TABLE_SIZE 97 // # buckets in hash table
  13. #define STARCOMMAND TEXT("**Command") // A special valuename created to keep the commands
  14. //
  15. // List of data values for key registry value in precedence order,
  16. // entries at the beginning of list have higher precedence.
  17. //
  18. typedef struct _REGDATAENTRY {
  19. BOOL bDeleted; // Is this a deleted value ?
  20. BOOL bAdmPolicy; // Is this generated by an Adm policy ?
  21. DWORD dwValueType;
  22. DWORD dwDataLen;
  23. BYTE * pData;
  24. WCHAR * pwszGPO; // Gpo that set this data
  25. WCHAR * pwszSOM; // SDOU that the above Gpo is linked to
  26. WCHAR * pwszCommand; // The actual command that caused the change in data value
  27. struct _REGDATAENTRY * pNext;
  28. } REGDATAENTRY, *LPREGDATAENTRY;
  29. //
  30. // List of registry value names under a common registry key
  31. //
  32. typedef struct _REGVALUEENTRY {
  33. WCHAR * pwszValueName; // Registry value name
  34. REGDATAENTRY * pDataList;
  35. struct _REGVALUEENTRY * pNext;
  36. } REGVALUEENTRY, *LPREGVALUEENTRY;
  37. //
  38. // List of registry keys that map to same hash bucket
  39. //
  40. typedef struct _REGKEYENTRY {
  41. WCHAR * pwszKeyName; // Registry key name
  42. REGVALUEENTRY * pValueList;
  43. struct _REGKEYENTRY * pNext;
  44. } REGKEYENTRY, *LPREGKEYENTRY;
  45. //
  46. // Hash table for looking up registry keys
  47. //
  48. typedef struct _REGHASHTABLE {
  49. REGKEYENTRY * aHashTable[HASH_TABLE_SIZE];
  50. HRESULT hrError;
  51. } REGHASHTABLE, *LPREGHASHTABLE;
  52. //
  53. // Registry operation types for deleting and
  54. // adding values.
  55. //
  56. typedef enum _REGOPERATION {
  57. REG_DELETEVALUE = 0,
  58. REG_DELETEALLVALUES,
  59. REG_DELETEKEY,
  60. REG_ADDVALUE,
  61. REG_SOFTADDVALUE,
  62. REG_INTERNAL_DELETESINGLEKEY
  63. } REGOPERATION;
  64. //
  65. // Public methods of hash table: alloc, free and addentry
  66. //
  67. #ifdef __cplusplus
  68. extern "C" {
  69. #endif
  70. REGHASHTABLE * AllocHashTable();
  71. void FreeHashTable( REGHASHTABLE *pHashTable );
  72. BOOL AddRegHashEntry( REGHASHTABLE *pHashTable,
  73. REGOPERATION opnType,
  74. WCHAR *pwszKeyName,
  75. WCHAR *pwszValueName,
  76. DWORD dwType,
  77. DWORD dwDataLen,
  78. BYTE *pData,
  79. WCHAR *pwszGPO,
  80. WCHAR *pwszSOM,
  81. WCHAR *szCommand,
  82. BOOL bCreateCommand);
  83. #ifdef __cplusplus
  84. }
  85. #endif