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 |
|
---|
13 | ' Security Mask
|
---|
14 | Const KEY_QUERY_VALUE = &H0001
|
---|
15 | Const KEY_SET_VALUE = &H0002
|
---|
16 | Const KEY_CREATE_SUB_KEY = &H0004
|
---|
17 | Const KEY_ENUMERATE_SUB_KEYS = &H0008
|
---|
18 | Const KEY_NOTIFY = &H0010
|
---|
19 | Const KEY_CREATE_LINK = &H0020
|
---|
20 | Const KEY_READ = (READ_CONTROL Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE)
|
---|
21 | Const KEY_WRITE = (READ_CONTROL Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE)
|
---|
22 | Const KEY_EXECUTE = KEY_READ
|
---|
23 | 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)
|
---|
24 |
|
---|
25 |
|
---|
26 | ' Options
|
---|
27 | Const REG_OPTION_NON_VOLATILE = &H00000000
|
---|
28 | Const REG_OPTION_VOLATILE = &H00000001
|
---|
29 | Const REG_OPTION_BACKUP_RESTORE = &H00000004
|
---|
30 |
|
---|
31 |
|
---|
32 | ' Reserved Key Handles
|
---|
33 | Const HKEY_CLASSES_ROOT = &H80000000
|
---|
34 | Const HKEY_CURRENT_USER = &H80000001
|
---|
35 | Const HKEY_LOCAL_MACHINE = &H80000002
|
---|
36 | Const HKEY_USERS = &H80000003
|
---|
37 | Const HKEY_PERFORMANCE_DATA = &H80000004
|
---|
38 | Const HKEY_CURRENT_CONFIG = &H80000005
|
---|
39 | Const HKEY_DYN_DATA = &H80000006
|
---|
40 |
|
---|
41 |
|
---|
42 | ' Key Create/Open Disposition
|
---|
43 | Const REG_CREATED_NEW_KEY = &H00000001
|
---|
44 | Const REG_OPENED_EXISTING_KEY = &H00000002
|
---|
45 |
|
---|
46 |
|
---|
47 | ' Data Type
|
---|
48 | Const REG_NONE = 0
|
---|
49 | Const REG_SZ = 1
|
---|
50 | Const REG_EXPAND_SZ = 2
|
---|
51 | Const REG_BINARY = 3
|
---|
52 | Const REG_DWORD = 4
|
---|
53 | Const REG_DWORD_LITTLE_ENDIAN = 4
|
---|
54 | Const REG_DWORD_BIG_ENDIAN = 5
|
---|
55 | Const REG_LINK = 6
|
---|
56 | Const REG_MULTI_SZ = 7
|
---|
57 | Const REG_RESOURCE_LIST = 8
|
---|
58 |
|
---|
59 |
|
---|
60 | '------------------------
|
---|
61 | ' Registry API Functions
|
---|
62 |
|
---|
63 | Declare Function RegCloseKey Lib "advapi32" (hKey As HKEY) As Long
|
---|
64 | Declare Function RegConnectRegistry Lib "advapi32" Alias "RegConnectRegistryA" (pMachineName As PCSTR, hKey As HKEY, ByRef hkResult As HKEY) As Long
|
---|
65 | 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
|
---|
66 | Declare Function RegDeleteKey Lib "advapi32" Alias "RegDeleteKeyA" (hKey As HKEY, lpSubKey As PCSTR) As Long
|
---|
67 | Declare Function RegDeleteValue Lib "advapi32" Alias "RegDeleteValueA" (hKey As HKEY, lpValueName As PCSTR) As Long
|
---|
68 | 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
|
---|
69 | 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
|
---|
70 | Declare Function RegFlushKey Lib "advapi32"(hKey As HKEY) As Long
|
---|
71 | Declare Function RegLoadKey Lib "advapi32" Alias "RegLoadKeyA" (hKey As HKEY, pSubKey As PCSTR, pFile As PCSTR) As Long
|
---|
72 | 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
|
---|
73 | 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
|
---|
74 | 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
|
---|
75 | 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
|
---|
76 | Declare Function RegSaveKey Lib "advapi32" Alias "RegSaveKeyA" (hKey As HKEY, pFile As PCSTR, pSecurityAttributes As *SECURITY_ATTRIBUTES) As Long
|
---|
77 | 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
|
---|
78 | Declare Function RegUnLoadKey Lib "advapi32" Alias "RegUnLoadKeyA" (hKey As HKEY, pSubKey As PCSTR) As Long
|
---|
79 |
|
---|
80 | Type VALENT
|
---|
81 | ve_valuename As PSTR
|
---|
82 | ve_valuelen As DWord
|
---|
83 | ve_valueptr As ULONG_PTR
|
---|
84 | ve_type As DWord
|
---|
85 | End Type
|
---|
86 | #endif '_INC_REG
|
---|