source: branch/egtra-stream-without-en_dec/api_reg.sbp@ 677

Last change on this file since 677 was 521, checked in by イグトランス (egtra), 16 years ago

表記揺れ、ミスなど修正

File size: 11.2 KB
Line 
1' api_reg.sbp
2' Registry Operation
3
4#ifdef UNICODE
5Const _FuncName_RegConnectRegistry = "RegConnectRegistryW"
6Const _FuncName_RegConnectRegistryEx = "RegConnectRegistryExW"
7Const _FuncName_RegCreateKeyEx = "RegCreateKeyExW"
8Const _FuncName_RegCreateKeyTransacted = "RegCreateKeyTransactedW"
9Const _FuncName_RegDeleteKey = "RegDeleteKeyW"
10Const _FuncName_RegDeleteKeyEx = "RegDeleteKeyExW"
11Const _FuncName_RegDeleteKeyTransacted = "RegDeleteKeyTransactedW"
12Const _FuncName_RegDeleteValue = "RegDeleteValueW"
13Const _FuncName_RegEnumKeyEx = "RegEnumKeyExW"
14Const _FuncName_RegEnumValue = "RegEnumValueW"
15Const _FuncName_RegLoadKey = "RegLoadKeyW"
16Const _FuncName_RegOpenKeyEx = "RegOpenKeyExW"
17Const _FuncName_RegOpenKeyTransacted = "RegOpenKeyTransactedW"
18Const _FuncName_RegQueryInfoKey = "RegQueryInfoKeyW"
19Const _FuncName_RegQueryMultipleValues = "RegQueryMultipleValuesW"
20Const _FuncName_RegQueryValueEx = "RegQueryValueExW"
21Const _FuncName_RegReplaceKey = "RegReplaceKeyW"
22Const _FuncName_RegRestoreKey = "RegRestoreKeyW"
23Const _FuncName_RegSaveKey = "RegSaveKeyW"
24Const _FuncName_RegSetValueEx = "RegSetValueExW"
25Const _FuncName_RegUnLoadKey = "RegUnLoadKeyW"
26Const _FuncName_RegDeleteKeyValue = "RegDeleteKeyValueW"
27Const _FuncName_RegSetKeyValue = "RegSetKeyValueW"
28Const _FuncName_RegDeleteTree = "RegDeleteTreeW"
29Const _FuncName_RegCopyTree = "RegCopyTreeW"
30Const _FuncName_RegGetValue = "RegGetValueW"
31Const _FuncName_RegLoadMUIString = "RegLoadMUIStringW"
32Const _FuncName_RegLoadAppKey = "RegLoadAppKeyW"
33Const _FuncName_RegSaveKeyEx = "RegSaveKeyExW"
34#else
35Const _FuncName_RegConnectRegistry = "RegConnectRegistryA"
36Const _FuncName_RegConnectRegistryEx = "RegConnectRegistryExA"
37Const _FuncName_RegCreateKeyEx = "RegCreateKeyExA"
38Const _FuncName_RegCreateKeyTransacted = "RegCreateKeyTransactedA"
39Const _FuncName_RegDeleteKey = "RegDeleteKeyA"
40Const _FuncName_RegDeleteKeyEx = "RegDeleteKeyExA"
41Const _FuncName_RegDeleteKeyTransacted = "RegDeleteKeyTransactedA"
42Const _FuncName_RegDeleteValue = "RegDeleteValueA"
43Const _FuncName_RegEnumKeyEx = "RegEnumKeyExA"
44Const _FuncName_RegEnumValue = "RegEnumValueA"
45Const _FuncName_RegLoadKey = "RegLoadKeyA"
46Const _FuncName_RegOpenKeyEx = "RegOpenKeyExA"
47Const _FuncName_RegOpenKeyTransacted = "RegOpenKeyTransactedA"
48Const _FuncName_RegQueryInfoKey = "RegQueryInfoKeyA"
49Const _FuncName_RegQueryMultipleValues = "RegQueryMultipleValuesA"
50Const _FuncName_RegQueryValueEx = "RegQueryValueExA"
51Const _FuncName_RegReplaceKey = "RegReplaceKeyA"
52Const _FuncName_RegRestoreKey = "RegRestoreKeyA"
53Const _FuncName_RegSaveKey = "RegSaveKeyA"
54Const _FuncName_RegSetValueEx = "RegSetValueExA"
55Const _FuncName_RegUnLoadKey = "RegUnLoadKeyA"
56Const _FuncName_RegDeleteKeyValue = "RegDeleteKeyValueA"
57Const _FuncName_RegSetKeyValue = "RegSetKeyValueA"
58Const _FuncName_RegDeleteTree = "RegDeleteTreeA"
59Const _FuncName_RegCopyTree = "RegCopyTreeA"
60Const _FuncName_RegGetValue = "RegGetValueA"
61Const _FuncName_RegLoadMUIString = "RegLoadMUIStringA"
62Const _FuncName_RegLoadAppKey = "RegLoadAppKeyA"
63Const _FuncName_RegSaveKeyEx = "RegSaveKeyExA"
64#endif
65
66TypeDef REGSAM = Long 'ACCESS_MASK
67
68' Reserved Key Handles
69Const HKEY_CLASSES_ROOT = ((&H80000000 As Long) As ULONG_PTR) As HKEY
70Const HKEY_CURRENT_USER = ((&H80000001 As Long) As ULONG_PTR) As HKEY
71Const HKEY_LOCAL_MACHINE = ((&H80000002 As Long) As ULONG_PTR) As HKEY
72Const HKEY_USERS = ((&H80000003 As Long) As ULONG_PTR) As HKEY
73Const HKEY_PERFORMANCE_DATA = ((&H80000004 As Long) As ULONG_PTR) As HKEY
74Const HKEY_CURRENT_CONFIG = ((&H80000005 As Long) As ULONG_PTR) As HKEY
75Const HKEY_DYN_DATA = ((&H80000006 As Long) As ULONG_PTR) As HKEY
76
77Const REG_SECURE_CONNECTION = 1
78
79Type VALENTW
80 ve_valuename As PWSTR
81 ve_valuelen As DWord
82 ve_valueptr As ULONG_PTR
83 ve_type As DWord
84End Type
85Type VALENTA
86 ve_valuename As PSTR
87 ve_valuelen As DWord
88 ve_valueptr As ULONG_PTR
89 ve_type As DWord
90End Type
91
92#ifdef UNICODE
93TypeDef VALENT = VALENTW
94#else
95TypeDef VALENT = VALENTA
96#endif
97'------------------------
98' Registry API Functions
99
100Declare Function RegCloseKey Lib "advapi32" (hKey As HKEY) As Long
101'#if WINVER >= 0x0500 'AB
102Declare Function RegOverridePredefKey Lib "advapi32" (hKey As HKEY, hNewKey As HKEY) As Long
103Declare Function RegOpenUserClassesRoot Lib "advapi32" (hToken As HANDLE, dwOptions As DWord, samDesired As REGSAM, ByRef hkResult As HKEY) As Long
104Declare Function RegOpenCurrentUser Lib "advapi32" (samDesired As REGSAM, ByRef hkResult As HKEY) As Long
105Declare Function RegDisablePredefinedCache Lib "advapi32" () As Long
106Declare Function RegDisablePredefinedCacheEx Lib "advapi32" () As Long
107'#endif
108Declare Function RegConnectRegistry Lib "advapi32" Alias _FuncName_RegConnectRegistry (pMachineName As PCTSTR, hKey As HKEY, ByRef hkResult As HKEY) As Long
109Declare Function RegConnectRegistryEx Lib "advapi32" Alias _FuncName_RegConnectRegistryEx (lpMachineName As LPCTSTR, hKey As HKEY, Flags As DWord, ByRef hkResult As HKEY) As Long
110Declare Function RegCreateKeyEx Lib "advapi32" Alias _FuncName_RegCreateKeyEx (hKey As HKEY, lpSubKey As PCTSTR, Reserved As DWord, lpClass As PTSTR, dwOptions As DWord, samDesired As REGSAM, lpSecurityAttributes As *SECURITY_ATTRIBUTES, ByRef phkResult As HKEY, lpdwDisposition As *DWord) As Long
111'#if WINVER >= 0x0600 'AB
112Declare Function RegCreateKeyTransacted Lib "advapi32" Alias _FuncName_RegCreateKeyTransacted (hKey As HKEY, lpSubKey As LPCTSTR, Reserved As DWord, lpClass As LPTSTR, dwOptions As DWord, samDesired As REGSAM, lpSecurityAttributes As *SECURITY_ATTRIBUTES, ByRef phkResult As HKEY, lpdwDisposition As *DWord, hTransaction As HANDLE, pExtendedParemeter As VoidPtr) As Long
113'#endif
114Declare Function RegDeleteKey Lib "advapi32" Alias _FuncName_RegDeleteKey (hKey As HKEY, lpSubKey As PCTSTR) As Long
115'#if WINVER >= 0x0520 'AB
116Declare Function RegDeleteKeyEx Lib "advapi32" Alias _FuncName_RegDeleteKeyEx (hKey As HKEY, lpSubKey As LPCTSTR, samDesired As REGSAM, Reserved As DWord) As Long
117'#endif
118'#if WINVER >= 0x0600 'AB
119Declare Function RegDeleteKeyTransacted Lib "advapi32" Alias _FuncName_RegDeleteKeyTransacted (hKey As HKEY, lpSubKey As LPCTSTR, samDesired As REGSAM, Reserved As DWord, hTransaction As HANDLE, pExtendedParameter As VoidPtr) As Long
120'#endif
121'#if WINVER >= 0x0520 'AB
122Declare Function RegDisableReflectionKey Lib "advapi32" (hBase As HKEY) As Long
123Declare Function RegEnableReflectionKey Lib "advapi32" (hBase As HKEY) As Long
124Declare Function RegQueryReflectionKey Lib "advapi32" (hBase As HKEY, ByRef bIsReflectionDisabled As BOOL) As Long
125'#endif
126Declare Function RegDeleteValue Lib "advapi32" Alias _FuncName_RegDeleteValue (hKey As HKEY, lpValueName As PCTSTR) As Long
127Declare 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
128Declare 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
129Declare Function RegFlushKey Lib "advapi32" (hKey As HKEY) As Long
130'#if _WIN32_WINNT >= &h0310 'AB
131Declare Function RegGetKeySecurity Lib "advapi32" (hKey As HKEY, SecurityInformation As SECURITY_INFORMATION, pSecurityDescriptor As *SECURITY_DESCRIPTOR, ByRef lpcbSecurityDescriptor As DWord) As Long
132'#endif
133Declare Function RegLoadKey Lib "advapi32" Alias _FuncName_RegLoadKey (hKey As HKEY, pSubKey As PCTSTR, pFile As PCTSTR) As Long
134Declare 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
135'#if WINVER >= 0x0600 'AB
136Declare Function RegOpenKeyTransacted Lib "advapi32" Alias _FuncName_RegOpenKeyTransacted (hKey As HKEY, lpSubKey As LPCTSTR, ulOptions As DWord, samDesired As REGSAM, ByRef phkResult As HKEY, hTransaction As HANDLE, pExtendedParemeter As VoidPtr) As Long
137'#endif
138Declare 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
139Declare 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
140Declare 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
141Declare Function RegReplaceKey Lib "advapi32" Alias _FuncName_RegReplaceKey (hKey As HKEY, lpSubKey As LPCTSTR, lpNewFile As LPCTSTR, lpOldFile As LPCTSTR) As Long
142'#if _WIN32_WINNT >= &h0310 'AB
143Declare Function RegRestoreKey Lib "advapi32" Alias _FuncName_RegRestoreKey (hKey As HKEY, lpFile As LPCTSTR, dwFlags As DWord) As Long
144'#endif
145Declare Function RegSaveKey Lib "advapi32" Alias _FuncName_RegSaveKey (hKey As HKEY, pFile As PCTSTR, pSecurityAttributes As *SECURITY_ATTRIBUTES) As Long
146'#if _WIN32_WINNT >= &h0310 'AB
147Declare Function RegSetKeySecurity Lib "advapi32" (hKey As HKEY, SecurityInformation As SECURITY_INFORMATION, pSecurityDescriptor As *SECURITY_DESCRIPTOR) AS Long
148'#endif
149Declare Function RegSetValueEx Lib "advapi32" Alias _FuncName_RegSetValueEx (hKey As HKEY, lpValueName As LPCTSTR, Reserved As DWord, dwType As DWord, lpData As VoidPtr, cbData As DWord) As Long
150Declare Function RegUnLoadKey Lib "advapi32" Alias _FuncName_RegUnLoadKey (hKey As HKEY, lpSubKey As LPCTSTR) As Long
151'#if _WIN32_WINNT >= &h0600
152Declare Function RegDeleteKeyValue Lib "advapi32" Alias _FuncName_RegDeleteKeyValue (hKey As HKEY, lpSubKey As LPCTSTR, lpValueName As LPCTSTR) As Long
153Declare Function RegSetKeyValue Lib "advapi32" Alias _FuncName_RegSetKeyValue (hKey As HKEY, lpSubKey As LPCTSTR, lpValueName As LPCTSTR, dwType As DWord, lpData As VoidPtr, cbData As DWord) As Long
154Declare Function RegDeleteTree Lib "advapi32" Alias _FuncName_RegDeleteTree (hKey As HKEY, lpSubKey As LPCTSTR) As Long
155Declare Function RegCopyTree Lib "advapi32" Alias _FuncName_RegCopyTree (hKeySrc As HKEY, lpSubKey As LPCTSTR, hKeyDest As HKEY) As Long
156Declare Function RegGetValue Lib "advapi32" Alias _FuncName_RegGetValue (hKey As HKEY, lpSubKey As LPCTSTR, lpValue As LPCTSTR, dwFlags As DWord, pdwType As *DWord, pvData As VoidPtr, pcbData As *DWord) As Long
157Declare Function RegLoadMUIString Lib "advapi32" Alias _FuncName_RegLoadMUIString (hKey As HKEY, pszValue As LPCTSTR, pszOutBuf As LPTSTR, cbOutBuf As DWord, pcbData As *DWord, Flags As DWord, pszDirectory As LPCTSTR) As Long
158Declare Function RegLoadAppKey Lib "advapi32" Alias _FuncName_RegLoadAppKey (lpFile As LPCTSTR, ByRef hkResult As HKEY, samDesired As REGSAM, dwOptions As DWord, Reserved As DWord) As Long
159'#endif
160'#if WINVER >= 0x0510 'AB
161Declare Function RegSaveKeyEx Lib "advapi32" Alias _FuncName_RegSaveKeyEx (hKey As HKEY, lpFile As LPCTSTR, lpSecurityAttributes As *SECURITY_ATTRIBUTES, Flags As DWord) As Long
162'#endif
Note: See TracBrowser for help on using the repository browser.