1 | ' api_reg.sbp
|
---|
2 | ' Registry Operation
|
---|
3 |
|
---|
4 |
|
---|
5 | #ifndef _INC_REG
|
---|
6 | #define _INC_REG
|
---|
7 |
|
---|
8 |
|
---|
9 | Const READ_CONTROL = &H00020000
|
---|
10 | Const STANDARD_RIGHTS_ALL = &H001F0000
|
---|
11 |
|
---|
12 | Const ERROR_SUCCESS = 0
|
---|
13 |
|
---|
14 |
|
---|
15 | ' Security Mask
|
---|
16 | Const KEY_QUERY_VALUE = &H0001
|
---|
17 | Const KEY_SET_VALUE = &H0002
|
---|
18 | Const KEY_CREATE_SUB_KEY = &H0004
|
---|
19 | Const KEY_ENUMERATE_SUB_KEYS = &H0008
|
---|
20 | Const KEY_NOTIFY = &H0010
|
---|
21 | Const KEY_CREATE_LINK = &H0020
|
---|
22 | Const KEY_READ = (READ_CONTROL Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE)
|
---|
23 | Const KEY_WRITE = (READ_CONTROL Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE)
|
---|
24 | Const KEY_EXECUTE = KEY_READ
|
---|
25 | Const KEY_ALL_ACCESS = (STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE)
|
---|
26 |
|
---|
27 |
|
---|
28 | ' Options
|
---|
29 | Const REG_OPTION_NON_VOLATILE = &H00000000
|
---|
30 | Const REG_OPTION_VOLATILE = &H00000001
|
---|
31 | Const REG_OPTION_BACKUP_RESTORE = &H00000004
|
---|
32 |
|
---|
33 |
|
---|
34 | ' Reserved Key Handles
|
---|
35 | Const HKEY_CLASSES_ROOT = &H80000000
|
---|
36 | Const HKEY_CURRENT_USER = &H80000001
|
---|
37 | Const HKEY_LOCAL_MACHINE = &H80000002
|
---|
38 | Const HKEY_USERS = &H80000003
|
---|
39 | Const HKEY_PERFORMANCE_DATA = &H80000004
|
---|
40 | Const HKEY_CURRENT_CONFIG = &H80000005
|
---|
41 | Const HKEY_DYN_DATA = &H80000006
|
---|
42 |
|
---|
43 |
|
---|
44 | ' Key Create/Open Disposition
|
---|
45 | Const REG_CREATED_NEW_KEY = &H00000001
|
---|
46 | Const REG_OPENED_EXISTING_KEY = &H00000002
|
---|
47 |
|
---|
48 |
|
---|
49 | ' Data Type
|
---|
50 | Const REG_NONE = 0
|
---|
51 | Const REG_SZ = 1
|
---|
52 | Const REG_EXPAND_SZ = 2
|
---|
53 | Const REG_BINARY = 3
|
---|
54 | Const REG_DWORD = 4
|
---|
55 | Const REG_DWORD_LITTLE_ENDIAN = 4
|
---|
56 | Const REG_DWORD_BIG_ENDIAN = 5
|
---|
57 | Const REG_LINK = 6
|
---|
58 | Const REG_MULTI_SZ = 7
|
---|
59 | Const REG_RESOURCE_LIST = 8
|
---|
60 |
|
---|
61 |
|
---|
62 | '------------------------
|
---|
63 | ' Registry API Functions
|
---|
64 |
|
---|
65 | Declare Function RegCloseKey Lib "advapi32" (hKey As HKEY) As Long
|
---|
66 | Declare Function RegConnectRegistry Lib "advapi32" Alias "RegConnectRegistryA" (pMachineName As PCSTR, hKey As HKEY, ByRef hkResult As HKEY) As Long
|
---|
67 | Declare Function RegCreateKeyEx Lib "advapi32" Alias "RegCreateKeyExA" (hKey As HKEY, lpSubKey As PCSTR, Reserved As DWord, lpClass As PSTR, dwOptions As DWord, samDesired As Long, ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, ByRef phkResult As HKEY, lpdwDisposition As *DWord) As Long
|
---|
68 | Declare Function RegDeleteKey Lib "advapi32" Alias "RegDeleteKeyA" (hKey As HKEY, lpSubKey As PCSTR) As Long
|
---|
69 | Declare Function RegDeleteValue Lib "advapi32" Alias "RegDeleteValueA" (hKey As HKEY, lpValueName As PCSTR) As Long
|
---|
70 | Declare Function RegEnumKeyEx Lib "advapi32" Alias "RegEnumKeyExA" (hKey As HKEY, dwIndex As DWord, pName As PSTR, ByRef cName As DWord, pReserved As *DWord, pClass As PSTR, ByRef cClass As DWord, pftLastWriteTime As *FILETIME) As Long
|
---|
71 | Declare Function RegEnumValue Lib "advapi32" Alias "RegEnumValueA" (hKey As HKEY, dwIndex As DWord, pValueName As PSTR, ByRef cValueName As DWord, pReserved As *DWord, pType As *DWord, pData As *Byte, pcbData As *DWord) As Long
|
---|
72 | Declare Function RegFlushKey Lib "advapi32"(hKey As HKEY) As Long
|
---|
73 | Declare Function RegLoadKey Lib "advapi32" Alias "RegLoadKeyA" (hKey As HKEY, pSubKey As PCSTR, pFile As PCSTR) As Long
|
---|
74 | Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (hKey As HKEY, lpSubKey As PCSTR, ulOptions As DWord, samDesired As Long, ByRef phkResult As HKEY) As Long
|
---|
75 | Declare Function RegQueryInfoKey Lib "advapi32" Alias "RegQueryInfoKeyA" (hKey As HKEY, pClass As PSTR, pcClass As *DWord, pReserved As *DWord, pcSubKeys As *DWord, pcMaxSubKeyLen As *DWord, pcMaxClassLen As *DWord, pcValues As *DWord, pcMaxValueNameLen As *DWord, pcMaxValueLen As *DWord, pcbSecurityDescriptor As *DWord, pftLastWriteTime As *FILETIME) As Long
|
---|
76 | Declare Function RegQueryMultipleValues Lib "advapi32" Alias "RegQueryMultipleValuesA" (hKey As HKEY, val_list As *VALENT, num_vals As DWord, pValueBuf As PSTR, ByRef dwTotsize As DWord) As Long
|
---|
77 | Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (hKey As HKEY, lpValueName As PCSTR, lpReserved As DWord, lpType As *DWord, lpData As VoidPtr, lpcbData As *DWord) As Long
|
---|
78 | Declare Function RegSaveKey Lib "advapi32" Alias "RegSaveKeyA" (hKey As HKEY, pFile As PCSTR, pSecurityAttributes As *SECURITY_ATTRIBUTES) As Long
|
---|
79 | Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" (hKey As HKEY, lpValueName As PCSTR, Reserved As DWord, dwType As DWord, lpData As VoidPtr, cbData As DWord) As Long
|
---|
80 | Declare Function RegUnLoadKey Lib "advapi32" Alias "RegUnLoadKeyA" (hKey As HKEY, pSubKey As PCSTR) As Long
|
---|
81 |
|
---|
82 | Type VALENT
|
---|
83 | ve_valuename As PSTR
|
---|
84 | ve_valuelen As DWord
|
---|
85 | ve_valueptr As ULONG_PTR
|
---|
86 | ve_type As DWord
|
---|
87 | End Type
|
---|
88 | #endif '_INC_REG
|
---|