forked from CatalystCode/windows-registry-node
-
Notifications
You must be signed in to change notification settings - Fork 1
/
windef.js
88 lines (86 loc) · 2.35 KB
/
windef.js
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
var ref = require('ref-napi');
var types = require('./types'),
struct = require('ref-struct-napi'),
uniontype = require('ref-union-di')(ref);
// yes, this is the name in the official MSDN doc
var DUMMYUNIONNAME = uniontype({
hIcon: types.HANDLE,
hMonitor: types.HANDLE
});
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724878(v=vs.85).aspx
module.exports = {
KEY_ACCESS: {
KEY_ALL_ACCESS: 0xF003F,
KEY_CREATE_LINK: 0x0020,
KEY_CREATE_SUB_KEY: 0x0004,
KEY_ENUMERATE_SUB_KEYS: 0x0008,
KEY_EXECUTE: 0x20019,
KEY_NOTIFY: 0x0010,
KEY_QUERY_VALUE: 0x0001,
KEY_READ: 0x20019,
KEY_SET_VALUE: 0x0002,
KEY_WOW64_32KEY: 0x0200,
KEY_WOW64_64KEY: 0x0100,
KEY_WRITE: 0x20006
},
HKEY: {
HKEY_CLASSES_ROOT: 0x80000000,
HKEY_CURRENT_USER: 0x80000001,
HKEY_LOCAL_MACHINE: 0x80000002,
HKEY_USERS: 0x80000003,
HKEY_PERFORMANCE_DATA: 0x80000004,
HKEY_CURRENT_CONFIG: 0x80000005,
HKEY_DYN_DATA: 0X80000006
},
REG_VALUE_TYPE: {
REG_SZ: 1,
REG_EXPAND_SZ: 2,
REG_BINARY: 3,
REG_DWORD: 4,
REG_DWORD_BIG_ENDIAN: 5,
REG_DWORD_LITTLE_ENDIAN: 4,
REG_LINK: 6,
REG_MULTI_SZ: 7,
REG_RESOURCE_LIST: 8
},
REG_OPTION_NON_VOLATILE: 0,
/*
typedef struct _SHELLEXECUTEINFO {
DWORD cbSize;
ULONG fMask;
HWND hwnd;
LPCTSTR lpVerb;
LPCTSTR lpFile;
LPCTSTR lpParameters;
LPCTSTR lpDirectory;
int nShow;
HINSTANCE hInstApp;
LPVOID lpIDList;
LPCTSTR lpClass;
HKEY hkeyClass;
DWORD dwHotKey;
union {
HANDLE hIcon;
HANDLE hMonitor;
} DUMMYUNIONNAME;
HANDLE hProcess;
} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;
*/
SHELLEXECUTEINFO: struct({
cbSize: types.DWORD,
fMask: types.ULONG,
hwnd: types.HWND,
lpVerb: types.LPCWSTR,
lpFile: types.LPCWSTR,
lpParameters: types.LPCWSTR,
lpDirectory: types.LPCWSTR,
nShow: types.INT,
hInstApp: types.HINSTANCE,
lpIDList: types.LPVOID,
lpClass: types.LPCWSTR,
hkeyClass: types.HKEY,
dwHotKey: types.DWORD,
DUMMYUNIONNAME: DUMMYUNIONNAME,
hProcess: types.HANDLE
})
};