forked from somma/_MyLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegistryUtil.h
More file actions
103 lines (84 loc) · 1.97 KB
/
RegistryUtil.h
File metadata and controls
103 lines (84 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/**----------------------------------------------------------------------------
* RegistryUtil.h
*-----------------------------------------------------------------------------
*
*-----------------------------------------------------------------------------
* All rights reserved by somma (fixbrain@gmail.com, unsorted@msn.com)
*-----------------------------------------------------------------------------
* 11:11:2011 0:10 created
**---------------------------------------------------------------------------*/
#pragma once
#include <string>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#define MAX_KEY_LENGTH 255
#define MAX_VALUE_NAME 16383
HKEY
RUOpenKey(
HKEY RootKey,
const wchar_t* SubKey,
bool ReadOnly
);
bool
RUCloseKey(
HKEY Key
);
HKEY
RUCreateKey(
HKEY RootKey,
const wchar_t* SubKey,
bool ReadOnly
);
DWORD
RUReadDword(
HKEY RootKey,
const wchar_t* SubKey,
const wchar_t* ValueName,
DWORD DefaultValue
);
bool
RUWriteDword(
HKEY RootKey,
const wchar_t* SubKey,
const wchar_t* ValueName,
DWORD Value
);
bool
RUReadString(
IN HKEY RootKey,
IN const wchar_t* SubKey,
IN const wchar_t* ValueName,
OUT std::wstring& Value
);
bool
RUSetString(
HKEY RootKey,
const wchar_t* SubKey,
const wchar_t* ValueName,
const wchar_t* Value, // byte buffer
DWORD cbValue // count byte
);
bool
RUSetExpandString(
HKEY RootKey,
const wchar_t* SubKey,
const wchar_t* value_name,
const wchar_t* value, // byte buffer
DWORD cbValue // count byte
);
bool
RUDeleteValue(
_In_ HKEY RootKey,
_In_ const wchar_t* SubKey,
_In_ const wchar_t* ValueName
);
bool
RUDeleteKey(
_In_ HKEY RootKey,
_In_ const wchar_t* SubKey
);
bool
RUIsKeyExists(
HKEY RootKey,
const wchar_t* TargetKey
);