-
Notifications
You must be signed in to change notification settings - Fork 1
/
data.h
95 lines (80 loc) · 3.21 KB
/
data.h
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
#pragma once
#define DEF_ROOT HKEY_CURRENT_USER
#define MAX_S 1024
/*___________________________________________________________________
| regChk:
| Checks if specified value exists in the app's registry key
|
| app_key: Registry key to set in relation to root key
| name: Name of the value to test
|
| Return value:
| Value exist -> true
| No value exist -> false
|____________________________________________________________________*/
bool regChk(LPCWSTR app_key, LPCWSTR name);
/*___________________________________________________________________
| regGet:
| Reads DWORD value from the Registry, first check with regChk!
|
| app_key: Registry key to set in relation to root key
| name: Name of the value to retrieve
|
| Return value:
| Value exist -> Data stored by the value
| No value exist -> 0
|____________________________________________________________________*/
DWORD regGet(LPCWSTR app_key, LPCWSTR name);
/*___________________________________________________________________
| regGet(sz):
| Reads SZ string value from registry.
|
| app_key: Registry key to set in relation to root key
| name: Name of the value to retrieve
| out: Ptr to buffer ptr to which memory will be allocated
| Must be freed after use via HeapFree()
|
| Return value:
| Number of bytes read
|____________________________________________________________________*/
DWORD regGet(LPCWSTR app_key, LPCWSTR name, LPWSTR *out);
/*___________________________________________________________________
| regSet:
| Sets empty value in the Registry
|
| app_key: Registry key to set in relation to root key
| name: Name of the value to set
|____________________________________________________________________*/
void regSet(LPCWSTR app_key, LPCWSTR name);
/*___________________________________________________________________
| regSet(dw):
| Sets DWORD value in the Registry
|
| app_key: Registry key to set in relation to root key
| name: Name of the value to set
| data: Data to associate with the value
|____________________________________________________________________*/
void regSet(LPCWSTR app_key, LPCWSTR name, DWORD data);
/*___________________________________________________________________
| regSet(sz):
| Sets SZ (null-terminated string) value in the Registry
|
| app_key: Registry key to set in relation to root key
| name: Name of the value to set
| data: Null terminated string to associate with the value
|____________________________________________________________________*/
void regSet(LPCWSTR app_key, LPCWSTR name, LPCWSTR data);
/*___________________________________________________________________
| regDel:
| Removes value from the Registry
|
| name: Name of the value to be removed
|____________________________________________________________________*/
void regDel(LPCWSTR app_key, LPCWSTR name);
/*___________________________________________________________________
| regSetRoot:
| Changes root registry key for application.
|
| app_root: New root registry key
|____________________________________________________________________*/
void regSetRoot(HKEY root);