1 #ifndef __REGUTILS_H__ 2 #define __REGUTILS_H__ 3 4 #pragma once 5 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 //////////////////////////////////////////////////////////////////////////////// 11 typedef LRESULT 12 (*PQUERY_REGISTRY_KEYS_ROUTINE)(IN HKEY hRootKey, 13 IN LPCWSTR KeyName, 14 IN LPWSTR SubKeyName, 15 IN HKEY hOpenedSubKey, 16 IN PVOID Context, 17 IN PVOID EntryContext); 18 19 #define QUERY_REGISTRY_KEYS_ROUTINE(fnName) \ 20 LRESULT (fnName)(IN HKEY hRootKey, \ 21 IN LPCWSTR KeyName, \ 22 IN LPWSTR SubKeyName, \ 23 IN HKEY hOpenedSubKey, \ 24 IN PVOID Context, \ 25 IN PVOID EntryContext) 26 27 typedef struct __tagQUERY_REGISTRY_KEYS_TABLE 28 { 29 PQUERY_REGISTRY_KEYS_ROUTINE QueryRoutine; 30 PVOID EntryContext; 31 // Other fields ? 32 } QUERY_REGISTRY_KEYS_TABLE, *PQUERY_REGISTRY_KEYS_TABLE; 33 34 LRESULT 35 RegQueryRegistryKeys(IN HKEY hRootKey, 36 IN LPCWSTR KeyName, 37 IN PQUERY_REGISTRY_KEYS_TABLE QueryTable, 38 IN PVOID Context); 39 40 //////////////////////////////////////////////////////////////////////////////// 41 typedef LRESULT 42 (*PQUERY_REGISTRY_VALUES_ROUTINE)(IN HKEY hRootKey, 43 IN LPCWSTR KeyName, 44 IN LPWSTR ValueName, 45 IN DWORD ValueType, 46 IN LPBYTE ValueData, 47 IN DWORD ValueLength, 48 IN PVOID Context, 49 IN PVOID EntryContext); 50 51 #define QUERY_REGISTRY_VALUES_ROUTINE(fnName) \ 52 LRESULT (fnName)(IN HKEY hRootKey, \ 53 IN LPCWSTR KeyName, \ 54 IN LPWSTR ValueName, \ 55 IN DWORD ValueType, \ 56 IN LPBYTE ValueData, \ 57 IN DWORD ValueLength, \ 58 IN PVOID Context, \ 59 IN PVOID EntryContext) 60 61 typedef struct __tagQUERY_REGISTRY_VALUES_TABLE 62 { 63 PQUERY_REGISTRY_VALUES_ROUTINE QueryRoutine; 64 PVOID EntryContext; 65 // Other fields ? 66 } QUERY_REGISTRY_VALUES_TABLE, *PQUERY_REGISTRY_VALUES_TABLE; 67 68 LRESULT 69 RegQueryRegistryValues(IN HKEY hRootKey, 70 IN LPCWSTR KeyName, 71 IN PQUERY_REGISTRY_VALUES_TABLE QueryTable, 72 IN PVOID Context); 73 74 //////////////////////////////////////////////////////////////////////////////// 75 76 LONG 77 RegGetDWORDValue(IN HKEY hKey, 78 IN LPCWSTR lpSubKey OPTIONAL, 79 IN LPCWSTR lpValue OPTIONAL, 80 OUT LPDWORD lpData OPTIONAL); 81 82 LONG 83 RegSetDWORDValue(IN HKEY hKey, 84 IN LPCWSTR lpSubKey OPTIONAL, 85 IN LPCWSTR lpValue OPTIONAL, 86 IN BOOL bCreateKeyIfDoesntExist, 87 IN DWORD dwData); 88 89 #ifdef __cplusplus 90 } // extern "C" 91 #endif 92 93 #endif // __REGUTILS_H__ 94