source: Include/api_reg.sbp@ 17

Last change on this file since 17 was 1, checked in by (none), 18 years ago
File size: 4.7 KB
Line 
1' api_reg.sbp
2' Registry Operation
3
4
5#ifndef _INC_REG
6#define _INC_REG
7
8
9Const READ_CONTROL = &H00020000
10Const STANDARD_RIGHTS_ALL = &H001F0000
11
12Const ERROR_SUCCESS = 0
13
14
15' Security Mask
16Const KEY_QUERY_VALUE = &H0001
17Const KEY_SET_VALUE = &H0002
18Const KEY_CREATE_SUB_KEY = &H0004
19Const KEY_ENUMERATE_SUB_KEYS = &H0008
20Const KEY_NOTIFY = &H0010
21Const KEY_CREATE_LINK = &H0020
22Const KEY_READ = (READ_CONTROL Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE)
23Const KEY_WRITE = (READ_CONTROL Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE)
24Const KEY_EXECUTE = KEY_READ
25Const 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
29Const REG_OPTION_NON_VOLATILE = &H00000000
30Const REG_OPTION_VOLATILE = &H00000001
31Const REG_OPTION_BACKUP_RESTORE = &H00000004
32
33
34' Reserved Key Handles
35Const HKEY_CLASSES_ROOT = &H80000000
36Const HKEY_CURRENT_USER = &H80000001
37Const HKEY_LOCAL_MACHINE = &H80000002
38Const HKEY_USERS = &H80000003
39Const HKEY_PERFORMANCE_DATA = &H80000004
40Const HKEY_CURRENT_CONFIG = &H80000005
41Const HKEY_DYN_DATA = &H80000006
42
43
44' Key Create/Open Disposition
45Const REG_CREATED_NEW_KEY = &H00000001
46Const REG_OPENED_EXISTING_KEY = &H00000002
47
48
49' Data Type
50Const REG_NONE = 0
51Const REG_SZ = 1
52Const REG_EXPAND_SZ = 2
53Const REG_BINARY = 3
54Const REG_DWORD = 4
55Const REG_DWORD_LITTLE_ENDIAN = 4
56Const REG_DWORD_BIG_ENDIAN = 5
57Const REG_LINK = 6
58Const REG_MULTI_SZ = 7
59Const REG_RESOURCE_LIST = 8
60
61
62'------------------------
63' Registry API Functions
64
65Declare Function RegCloseKey Lib "advapi32" (hKey As HKEY) As Long
66Declare Function RegConnectRegistry Lib "advapi32" Alias "RegConnectRegistryA" (pMachineName As PCSTR, hKey As HKEY, ByRef hkResult As HKEY) As Long
67Declare 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
68Declare Function RegDeleteKey Lib "advapi32" Alias "RegDeleteKeyA" (hKey As HKEY, lpSubKey As PCSTR) As Long
69Declare Function RegDeleteValue Lib "advapi32" Alias "RegDeleteValueA" (hKey As HKEY, lpValueName As PCSTR) As Long
70Declare 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
71Declare 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
72Declare Function RegFlushKey Lib "advapi32"(hKey As HKEY) As Long
73Declare Function RegLoadKey Lib "advapi32" Alias "RegLoadKeyA" (hKey As HKEY, pSubKey As PCSTR, pFile As PCSTR) As Long
74Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (hKey As HKEY, lpSubKey As PCSTR, ulOptions As DWord, samDesired As Long, ByRef phkResult As HKEY) As Long
75Declare 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
76Declare 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
77Declare 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
78Declare Function RegSaveKey Lib "advapi32" Alias "RegSaveKeyA" (hKey As HKEY, pFile As PCSTR, pSecurityAttributes As *SECURITY_ATTRIBUTES) As Long
79Declare 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
80Declare Function RegUnLoadKey Lib "advapi32" Alias "RegUnLoadKeyA" (hKey As HKEY, pSubKey As PCSTR) As Long
81
82Type VALENT
83 ve_valuename As PSTR
84 ve_valuelen As DWord
85 ve_valueptr As ULONG_PTR
86 ve_type As DWord
87End Type
88#endif '_INC_REG
Note: See TracBrowser for help on using the repository browser.