37#define FLG_ADDREG_BINVALUETYPE 0x00000001
38#define FLG_ADDREG_NOCLOBBER 0x00000002
39#define FLG_ADDREG_DELVAL 0x00000004
40#define FLG_ADDREG_APPEND 0x00000008
41#define FLG_ADDREG_KEYONLY 0x00000010
42#define FLG_ADDREG_OVERWRITEONLY 0x00000020
43#define FLG_ADDREG_KEYONLY_COMMON 0x00002000
44#define FLG_DELREG_KEYONLY_COMMON FLG_ADDREG_KEYONLY_COMMON
45#define FLG_ADDREG_DELREG_BIT 0x00008000
47#define FLG_ADDREG_TYPE_SZ 0x00000000
48#define FLG_ADDREG_TYPE_MULTI_SZ 0x00010000
49#define FLG_ADDREG_TYPE_EXPAND_SZ 0x00020000
50#define FLG_ADDREG_TYPE_BINARY (0x00000000 | FLG_ADDREG_BINVALUETYPE)
51#define FLG_ADDREG_TYPE_DWORD (0x00010000 | FLG_ADDREG_BINVALUETYPE)
52#define FLG_ADDREG_TYPE_NONE (0x00020000 | FLG_ADDREG_BINVALUETYPE)
53#define FLG_ADDREG_TYPE_MASK (0xFFFF0000 | FLG_ADDREG_BINVALUETYPE)
63static const WCHAR HKCRPath[] = {
'\\',
'R',
'e',
'g',
'i',
's',
't',
'r',
'y',
'\\',
'M',
'a',
'c',
'h',
'i',
'n',
'e',
'\\',
'S',
'O',
'F',
'T',
'W',
'A',
'R',
'E',
'\\',
'C',
'l',
'a',
's',
's',
'e',
's',
'\\',0};
64static const WCHAR HKCUPath[] = {
'\\',
'R',
'e',
'g',
'i',
's',
't',
'r',
'y',
'\\',
'U',
's',
'e',
'r',
'\\',
'.',
'D',
'E',
'F',
'A',
'U',
'L',
'T',
'\\',0};
65static const WCHAR HKLMPath[] = {
'\\',
'R',
'e',
'g',
'i',
's',
't',
'r',
'y',
'\\',
'M',
'a',
'c',
'h',
'i',
'n',
'e',
'\\',0};
66static const WCHAR HKUPath[] = {
'\\',
'R',
'e',
'g',
'i',
's',
't',
'r',
'y',
'\\',
'U',
's',
'e',
'r',
'\\',0};
67static const WCHAR BCDPath[] = {
'\\',
'R',
'e',
'g',
'i',
's',
't',
'r',
'y',
'\\',
'M',
'a',
'c',
'h',
'i',
'n',
'e',
'\\',0};
185 Total +
sizeof(
WCHAR));
505 DPRINT1(
"registry_callback() for DelReg failed\n");
512 DPRINT1(
"registry_callback() for AddReg failed\n");
BOOL Delete(LPCTSTR ServiceName)
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
static const WCHAR Strings[]
REFIID LPVOID DWORD_PTR dw
int InfHostOpenFile(PHINF InfHandle, const CHAR *FileName, LANGID LanguageId, ULONG *ErrorLine)
int InfHostFindNextLine(PINFCONTEXT ContextIn, PINFCONTEXT ContextOut)
int InfHostFindFirstLine(HINF InfHandle, const WCHAR *Section, const WCHAR *Key, PINFCONTEXT *Context)
int InfHostGetIntField(PINFCONTEXT Context, ULONG FieldIndex, INT *IntegerValue)
int InfHostGetMultiSzField(PINFCONTEXT Context, ULONG FieldIndex, WCHAR *ReturnBuffer, ULONG ReturnBufferSize, ULONG *RequiredSize)
int InfHostGetBinaryField(PINFCONTEXT Context, ULONG FieldIndex, UCHAR *ReturnBuffer, ULONG ReturnBufferSize, ULONG *RequiredSize)
int InfHostGetStringField(PINFCONTEXT Context, ULONG FieldIndex, WCHAR *ReturnBuffer, ULONG ReturnBufferSize, ULONG *RequiredSize)
LONG InfHostGetFieldCount(PINFCONTEXT Context)
void InfHostCloseFile(HINF InfHandle)
void InfHostFreeContext(PINFCONTEXT Context)
#define MAX_INF_STRING_LENGTH
#define memcpy(s1, s2, n)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define strtoulW(s1, s2, b)
static const WCHAR HKUPath[]
#define FLG_ADDREG_DELREG_BIT
#define FLG_ADDREG_OVERWRITEONLY
static BOOL do_reg_operation(IN HKEY KeyHandle, IN PCWSTR ValueName, IN PINFCONTEXT Context, IN ULONG Flags)
static BOOL registry_callback(HINF hInf, PCWSTR Section, BOOL Delete)
static const WCHAR HKLM[]
#define FLG_ADDREG_TYPE_MASK
BOOL ImportRegistryFile(PCHAR FileName)
#define FLG_ADDREG_TYPE_BINARY
static const WCHAR HKCR[]
#define FLG_ADDREG_TYPE_SZ
#define FLG_ADDREG_BINVALUETYPE
#define FLG_ADDREG_APPEND
#define FLG_ADDREG_TYPE_EXPAND_SZ
#define FLG_DELREG_KEYONLY_COMMON
#define FLG_ADDREG_DELVAL
static BOOL get_root_key(PWCHAR Name)
static VOID append_multi_sz_value(IN HKEY KeyHandle, IN PCWSTR ValueName, IN PCWSTR Strings, IN ULONG StringSize)
static const WCHAR HKLMPath[]
#define FLG_ADDREG_TYPE_MULTI_SZ
static const WCHAR HKCRPath[]
static const WCHAR HKCUPath[]
#define FLG_ADDREG_TYPE_NONE
#define FLG_ADDREG_KEYONLY
#define FLG_ADDREG_NOCLOBBER
#define FLG_ADDREG_TYPE_DWORD
static const WCHAR AddReg[]
#define FLG_ADDREG_KEYONLY_COMMON
static const WCHAR BCDPath[]
static const WCHAR DelReg[]
static const WCHAR HKCU[]
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ ULONG Flags