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.

109 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. chkreg.h
  5. Abstract:
  6. This module contains the private (internal) header file for the
  7. chkreg utility.
  8. Author:
  9. Dragos C. Sambotin (dragoss) 30-Dec-98
  10. Revision History:
  11. --*/
  12. #ifndef __CHKREG_H__
  13. #define __CHKREG_H__
  14. #include <nt.h>
  15. #include <ntrtl.h>
  16. #include <nturtl.h>
  17. #include <windows.h>
  18. #include <stdio.h>
  19. #include <stdlib.h>
  20. #include <string.h>
  21. #include <assert.h>
  22. #include "cmdata.h"
  23. // constants for implementing (kind of) hash table
  24. // these may not be the best values (to be determined)
  25. #define FRAGMENTATION 0x00008000
  26. #define SUBLISTS 0x000000F0
  27. #define CM_VIEW_SIZE 16L*1024L //16K
  28. // type definitions
  29. typedef struct _REG_USAGE {
  30. ULONG Size;
  31. ULONG DataSize;
  32. ULONG KeyNodeCount;
  33. ULONG KeyValueCount;
  34. ULONG KeyIndexCount;
  35. ULONG ValueIndexCount;
  36. ULONG DataCount;
  37. } REG_USAGE, *PREG_USAGE;
  38. typedef struct _UnknownCell {
  39. HCELL_INDEX Cell;
  40. struct _UnknownCell *Next;
  41. } UNKNOWN_CELL, *PUNKNOWN_CELL;
  42. // the unknown list is a matrix/hash table combination
  43. // it uses a lot of heap space, but is faster than a linked list
  44. typedef struct _UnknownList {
  45. ULONG Count;
  46. PUNKNOWN_CELL List[SUBLISTS];
  47. } UNKNOWN_LIST, *PUNKNOWN_LIST;
  48. // routines for cell manipulation
  49. BOOLEAN IsCellAllocated( HCELL_INDEX Cell );
  50. LONG GetCellSize( HCELL_INDEX Cell );
  51. PCELL_DATA GetCell( HCELL_INDEX Cell );
  52. VOID
  53. FreeCell(
  54. HCELL_INDEX Cell);
  55. VOID
  56. AllocateCell(
  57. HCELL_INDEX Cell );
  58. // routines for list manipulation
  59. VOID AddCellToUnknownList(HCELL_INDEX cellindex);
  60. VOID RemoveCellFromUnknownList(HCELL_INDEX cellindex);
  61. VOID FreeUnknownList();
  62. VOID DumpUnknownList();
  63. // phisycal hive check
  64. BOOLEAN ChkPhysicalHive();
  65. BOOLEAN ChkBaseBlock(PHBASE_BLOCK BaseBlock,DWORD dwFileSize);
  66. BOOLEAN
  67. ChkSecurityDescriptors( );
  68. // logical hive check
  69. BOOLEAN DumpChkRegistry(
  70. ULONG Level,
  71. USHORT ParentLength,
  72. HCELL_INDEX Cell,
  73. HCELL_INDEX ParentCell,
  74. PREG_USAGE PUsage);
  75. // hive compacting
  76. VOID DoCompactHive();
  77. #endif //__CHKREG_H__