home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / unixtool.zip / TOOLS / lib / perl / registry.pl < prev    next >
Text File  |  2000-04-21  |  4KB  |  126 lines

  1. #
  2. # these are constants for use in accessing the NT Registry database.
  3. #
  4.  
  5. #
  6. # standard access types
  7. #
  8.  
  9. $READ_CONTROL              =  0x00020000;
  10. $SYNCHRONIZE               =  0x00100000;
  11. $STANDARD_RIGHTS_REQUIRED  =  0x000F0000;
  12. $STANDARD_RIGHTS_READ      =  $READ_CONTROL;
  13. $STANDARD_RIGHTS_WRITE     =  $READ_CONTROL;
  14. $STANDARD_RIGHTS_EXECUTE   =  $READ_CONTROL;
  15. $STANDARD_RIGHTS_ALL       =  0x001F0000;
  16. $SPECIFIC_RIGHTS_ALL       =  0x0000FFFF;
  17.  
  18.  
  19. #
  20. # pre-defined registry keys
  21. #
  22.  
  23. $HKEY_CLASSES_ROOT     = 0x80000000;
  24. $HKEY_CURRENT_USER     = 0x80000001;
  25. $HKEY_LOCAL_MACHINE    = 0x80000002;
  26. $HKEY_USERS            = 0x80000003;
  27. $HKEY_PERFORMANCE_DATA = 0x80000004;
  28.  
  29. #
  30. # Open/Create Options
  31. #
  32.  
  33. $REG_OPTION_RESERVED     = 0x00000000;  # Parameter is reserved
  34. $REG_OPTION_NON_VOLATILE = 0x00000000;  # Key is preserved
  35.                                          # when system is rebooted
  36. $REG_OPTION_VOLATILE     = 0x00000001;  # Key is not preserved
  37.                                          # when system is rebooted
  38. $REG_OPTION_CREATE_LINK  = 0x00000002;  # Created key is a
  39.                                          # symbolic link
  40.  
  41. #
  42. # Key creation/open disposition
  43. #
  44.  
  45. $REG_CREATED_NEW_KEY      =  0x00000001;   # New Registry Key created
  46. $REG_OPENED_EXISTING_KEY  =  0x00000002;   # Existing Key opened
  47.  
  48. #
  49. # Key restore flags
  50. #
  51.  
  52. $REG_WHOLE_HIVE_VOLATILE   =  0x00000001;   # Restore whole hive volatile
  53. $REG_REFRESH_HIVE          =  0x00000002;   # Unwind changes to last flush
  54.  
  55.  
  56. #
  57. # Notify filter values
  58. #
  59.  
  60. $REG_NOTIFY_CHANGE_NAME        =  0x00000001; # Create or delete (child)
  61. $REG_NOTIFY_CHANGE_ATTRIBUTES  =  0x00000002;
  62. $REG_NOTIFY_CHANGE_LAST_SET    =  0x00000004; # time stamp
  63. $REG_NOTIFY_CHANGE_SECURITY    =  0x00000008;
  64.  
  65. $REG_LEGAL_CHANGE_FILTER = $REG_NOTIFY_CHANGE_NAME |
  66.     $REG_NOTIFY_CHANGE_ATTRIBUTES |
  67.     $REG_NOTIFY_CHANGE_LAST_SET |
  68.     $REG_NOTIFY_CHANGE_SECURITY;
  69.  
  70. #
  71. #
  72. # Predefined Value Types.
  73. #
  74.  
  75. $REG_NONE                    = 0; # No value type
  76. $REG_SZ                      = 1; # Unicode nul terminated string
  77. $REG_EXPAND_SZ               = 2; # Unicode nul terminated string
  78.                                   # (with environment variable references)
  79. $REG_BINARY                  = 3; # Free form binary
  80. $REG_DWORD                   = 4; # 32-bit number
  81. $REG_DWORD_LITTLE_ENDIAN     = 4; # 32-bit number (same as REG_DWORD)
  82. $REG_DWORD_BIG_ENDIAN        = 5; # 32-bit number
  83. $REG_LINK                    = 6; # Symbolic Link (unicode)
  84. $REG_MULTI_SZ                = 7; # Multiple Unicode strings
  85. $REG_RESOURCE_LIST           = 8; # Resource list in the resource map
  86. $REG_FULL_RESOURCE_DESCRIPTOR = 9;# Resource list in the hardware description
  87.  
  88.     
  89. #
  90. # Registry Specific Access Rights.
  91. #
  92.  
  93. $KEY_QUERY_VALUE         = 0x0001;
  94. $KEY_SET_VALUE           = 0x0002;
  95. $KEY_CREATE_SUB_KEY      = 0x0004;
  96. $KEY_ENUMERATE_SUB_KEYS  = 0x0008;
  97. $KEY_NOTIFY              = 0x0010;
  98. $KEY_CREATE_LINK         = 0x0020;
  99.  
  100. $KEY_READ                = ($STANDARD_RIGHTS_READ   |
  101.                             $KEY_QUERY_VALUE        |
  102.                             $KEY_ENUMERATE_SUB_KEYS |
  103.                             $KEY_NOTIFY)                 
  104.                              &                           
  105.                            ~$SYNCHRONIZE;
  106.  
  107.  
  108. $KEY_WRITE               = ($STANDARD_RIGHTS_WRITE   |
  109.                             $KEY_SET_VALUE           |
  110.                             $KEY_CREATE_SUB_KEY)
  111.                              &
  112.                             ~$SYNCHRONIZE;
  113.  
  114. $KEY_EXECUTE             = $KEY_READ & (~$SYNCHRONIZE);
  115.  
  116. $KEY_ALL_ACCESS          = ($STANDARD_RIGHTS_ALL    |
  117.                             $KEY_QUERY_VALUE        |
  118.                             $KEY_SET_VALUE          |
  119.                             $KEY_CREATE_SUB_KEY     |
  120.                             $KEY_ENUMERATE_SUB_KEYS |
  121.                             $KEY_NOTIFY             |
  122.                             $KEY_CREATE_LINK)
  123.                              &
  124.                            (~$SYNCHRONIZE);
  125. 1;
  126.