1 | ' api_reg.sbp
|
---|
2 | ' Registry Operation
|
---|
3 |
|
---|
4 |
|
---|
5 | #ifndef _INC_REG
|
---|
6 | #define _INC_REG
|
---|
7 |
|
---|
8 | #ifdef UNICODE
|
---|
9 | Const _FuncName_RegConnectRegistry = "RegConnectRegistryW"
|
---|
10 | Const _FuncName_RegCreateKeyEx = "RegCreateKeyExW"
|
---|
11 | Const _FuncName_RegDeleteKey = "RegDeleteKeyW"
|
---|
12 | Const _FuncName_RegDeleteValue = "RegDeleteValueW"
|
---|
13 | Const _FuncName_RegEnumKeyEx = "RegEnumKeyExW"
|
---|
14 | Const _FuncName_RegEnumValue = "RegEnumValueW"
|
---|
15 | Const _FuncName_RegLoadKey = "RegLoadKeyW"
|
---|
16 | Const _FuncName_RegOpenKeyEx = "RegOpenKeyExW"
|
---|
17 | Const _FuncName_RegQueryInfoKey = "RegQueryInfoKeyW"
|
---|
18 | Const _FuncName_RegQueryMultipleValues = "RegQueryMultipleValuesW"
|
---|
19 | Const _FuncName_RegQueryValueEx = "RegQueryValueExW"
|
---|
20 | Const _FuncName_RegReplaceKey = "RegReplaceKeyW"
|
---|
21 | Const _FuncName_RegSaveKey = "RegSaveKeyW"
|
---|
22 | Const _FuncName_RegSetValueEx = "RegSetValueExW"
|
---|
23 | Const _FuncName_RegUnLoadKey = "RegUnLoadKeyW"
|
---|
24 | #else
|
---|
25 | Const _FuncName_RegConnectRegistry = "RegConnectRegistryA"
|
---|
26 | Const _FuncName_RegCreateKeyEx = "RegCreateKeyExA"
|
---|
27 | Const _FuncName_RegDeleteKey = "RegDeleteKeyA"
|
---|
28 | Const _FuncName_RegDeleteValue = "RegDeleteValueA"
|
---|
29 | Const _FuncName_RegEnumKeyEx = "RegEnumKeyExA"
|
---|
30 | Const _FuncName_RegEnumValue = "RegEnumValueA"
|
---|
31 | Const _FuncName_RegLoadKey = "RegLoadKeyA"
|
---|
32 | Const _FuncName_RegOpenKeyEx = "RegOpenKeyExA"
|
---|
33 | Const _FuncName_RegQueryInfoKey = "RegQueryInfoKeyA"
|
---|
34 | Const _FuncName_RegQueryMultipleValues = "RegQueryMultipleValuesA"
|
---|
35 | Const _FuncName_RegQueryValueEx = "RegQueryValueExA"
|
---|
36 | Const _FuncName_RegReplaceKey = "RegReplaceKeyA"
|
---|
37 | Const _FuncName_RegSaveKey = "RegSaveKeyA"
|
---|
38 | Const _FuncName_RegSetValueEx = "RegSetValueExA"
|
---|
39 | Const _FuncName_RegUnLoadKey = "RegUnLoadKeyA"
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | ' Reserved Key Handles
|
---|
43 | Const HKEY_CLASSES_ROOT = ((&H80000000 As Long) As ULONG_PTR) As HKEY
|
---|
44 | Const HKEY_CURRENT_USER = ((&H80000001 As Long) As ULONG_PTR) As HKEY
|
---|
45 | Const HKEY_LOCAL_MACHINE = ((&H80000002 As Long) As ULONG_PTR) As HKEY
|
---|
46 | Const HKEY_USERS = ((&H80000003 As Long) As ULONG_PTR) As HKEY
|
---|
47 | Const HKEY_PERFORMANCE_DATA = ((&H80000004 As Long) As ULONG_PTR) As HKEY
|
---|
48 | Const HKEY_CURRENT_CONFIG = ((&H80000005 As Long) As ULONG_PTR) As HKEY
|
---|
49 | Const HKEY_DYN_DATA = ((&H80000006 As Long) As ULONG_PTR) As HKEY
|
---|
50 |
|
---|
51 | Type VALENTW
|
---|
52 | ve_valuename As PWSTR
|
---|
53 | ve_valuelen As DWord
|
---|
54 | ve_valueptr As ULONG_PTR
|
---|
55 | ve_type As DWord
|
---|
56 | End Type
|
---|
57 | Type VALENTA
|
---|
58 | ve_valuename As PSTR
|
---|
59 | ve_valuelen As DWord
|
---|
60 | ve_valueptr As ULONG_PTR
|
---|
61 | ve_type As DWord
|
---|
62 | End Type
|
---|
63 |
|
---|
64 | #ifdef UNICODE
|
---|
65 | TypeDef VALENT = VALENTW
|
---|
66 | #else
|
---|
67 | TypeDef VALENT = VALENTA
|
---|
68 | #endif
|
---|
69 |
|
---|
70 | '------------------------
|
---|
71 | ' Registry API Functions
|
---|
72 |
|
---|
73 | Declare Function RegCloseKey Lib "advapi32" (hKey As HKEY) As Long
|
---|
74 | Declare Function RegConnectRegistry Lib "advapi32" Alias _FuncName_RegConnectRegistry (pMachineName As PCTSTR, hKey As HKEY, ByRef hkResult As HKEY) As Long
|
---|
75 | Declare Function RegCreateKeyEx Lib "advapi32" Alias _FuncName_RegCreateKeyEx (hKey As HKEY, lpSubKey As PCTSTR, Reserved As DWord, lpClass As PTSTR, dwOptions As DWord, samDesired As Long, ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, ByRef phkResult As HKEY, lpdwDisposition As *DWord) As Long
|
---|
76 | Declare Function RegDeleteKey Lib "advapi32" Alias _FuncName_RegDeleteKey (hKey As HKEY, lpSubKey As PCTSTR) As Long
|
---|
77 | Declare Function RegDeleteValue Lib "advapi32" Alias _FuncName_RegDeleteValue (hKey As HKEY, lpValueName As PCTSTR) As Long
|
---|
78 | Declare Function RegEnumKeyEx Lib "advapi32" Alias _FuncName_RegEnumKeyEx (hKey As HKEY, dwIndex As DWord, pName As PTSTR, ByRef cName As DWord, pReserved As *DWord, pClass As PTSTR, ByRef cClass As DWord, pftLastWriteTime As *FILETIME) As Long
|
---|
79 | Declare Function RegEnumValue Lib "advapi32" Alias _FuncName_RegEnumValue (hKey As HKEY, dwIndex As DWord, pValueName As PTSTR, ByRef cValueName As DWord, pReserved As *DWord, pType As *DWord, pData As *Byte, pcbData As *DWord) As Long
|
---|
80 | Declare Function RegFlushKey Lib "advapi32"(hKey As HKEY) As Long
|
---|
81 | Declare Function RegLoadKey Lib "advapi32" Alias _FuncName_RegLoadKey (hKey As HKEY, pSubKey As PCTSTR, pFile As PCTSTR) As Long
|
---|
82 | Declare Function RegOpenKeyEx Lib "advapi32" Alias _FuncName_RegOpenKeyEx (hKey As HKEY, lpSubKey As PCTSTR, ulOptions As DWord, samDesired As Long, ByRef phkResult As HKEY) As Long
|
---|
83 | Declare Function RegQueryInfoKey Lib "advapi32" Alias _FuncName_RegQueryInfoKey (hKey As HKEY, pClass As PTSTR, 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
|
---|
84 | Declare Function RegQueryMultipleValues Lib "advapi32" Alias _FuncName_RegQueryMultipleValues (hKey As HKEY, val_list As *VALENT, num_vals As DWord, pValueBuf As PTSTR, ByRef dwTotsize As DWord) As Long
|
---|
85 | Declare Function RegQueryValueEx Lib "advapi32" Alias _FuncName_RegQueryValueEx (hKey As HKEY, lpValueName As PCTSTR, lpReserved As DWord, lpType As *DWord, lpData As VoidPtr, lpcbData As *DWord) As Long
|
---|
86 | Declare Function RegReplaceKey Lib "advapi32" Alias _FuncName_RegReplaceKey (hKey As HKEY, lpSubKey As LPCTSTR, lpNewFile As LPCTSTR, lpOldFile As LPCTSTR) As Long
|
---|
87 | Declare Function RegSaveKey Lib "advapi32" Alias _FuncName_RegSaveKey (hKey As HKEY, pFile As PCTSTR, pSecurityAttributes As *SECURITY_ATTRIBUTES) As Long
|
---|
88 | Declare Function RegSetValueEx Lib "advapi32" Alias _FuncName_RegSetValueEx (hKey As HKEY, lpValueName As PCTSTR, Reserved As DWord, dwType As DWord, lpData As VoidPtr, cbData As DWord) As Long
|
---|
89 | Declare Function RegUnLoadKey Lib "advapi32" Alias _FuncName_RegUnLoadKey (hKey As HKEY, lpSubKey As LPCTSTR) As Long
|
---|
90 |
|
---|
91 | #endif '_INC_REG
|
---|