-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathadv_api.js
More file actions
85 lines (81 loc) · 2.6 KB
/
adv_api.js
File metadata and controls
85 lines (81 loc) · 2.6 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
// Minimal wrappers for Advapi32.dll to support basic registry manipulations
'use strict';
var ffi = require('ffi'),
types = require('../types');
// Javascript bindings for native Win32 registry APIs
var advApi = ffi.Library('Advapi32', {
/*
LONG WINAPI RegOpenCurrentUser(
_In_ REGSAM samDesired,
_Out_ PHKEY phkResult
);
*/
RegOpenCurrentUser: ['long', [types.REGSAM, types.PHKEY]],
/*
LONG WINAPI RegQueryValueEx(
_In_ HKEY hKey,
_In_opt_ LPCTSTR lpValueName,
_Reserved_ LPDWORD lpReserved,
_Out_opt_ LPDWORD lpType,
_Out_opt_ LPBYTE lpData,
_Inout_opt_ LPDWORD lpcbData
);
*/
RegQueryValueExW: ['long', [types.HKEY, types.LPCWSTR, 'pointer', types.LPDWORD, types.LPBYTE, types.LPDWORD]],
/*
LONG WINAPI RegOpenKeyEx(
_In_ HKEY hKey,
_In_opt_ LPCTSTR lpSubKey,
_In_ DWORD ulOptions,
_In_ REGSAM samDesired,
_Out_ PHKEY phkResult
);
*/
RegOpenKeyExW: ['long', ['longlong', types.LPCWSTR, types.DWORD, types.REGSAM, types.PHKEY]],
/*
LONG WINAPI RegSetValueEx(
_In_ HKEY hKey,
_In_opt_ LPCTSTR lpValueName,
_Reserved_ DWORD Reserved,
_In_ DWORD dwType,
_In_ const BYTE *lpData,
_In_ DWORD cbData
);
*/
RegSetValueExW: ['long', [types.HKEY, types.LPCWSTR, 'pointer', types.DWORD, types.LPBYTE, types.DWORD]],
/**
* LONG WINAPI RegCreateKeyEx(
_In_ HKEY hKey,
_In_ LPCTSTR lpSubKey,
_Reserved_ DWORD Reserved,
_In_opt_ LPTSTR lpClass,
_In_ DWORD dwOptions,
_In_ REGSAM samDesired,
_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
_Out_ PHKEY phkResult,
_Out_opt_ LPDWORD lpdwDisposition
);
*/
RegCreateKeyExW: ['long', [types.HKEY, types.LPCWSTR, 'pointer', 'pointer', types.DWORD, types.REGSAM, 'pointer', types.PHKEY, 'pointer']],
/*
LONG WINAPI RegDeleteTree(
_In_ HKEY hKey,
_In_opt_ LPCTSTR lpSubKey
);
*/
RegDeleteTreeW: ['long', [types.HKEY, types.LPCWSTR]],
/*
LONG WINAPI RegDeleteValue(
_In_ HKEY hKey,
_In_opt_ LPCTSTR lpValueName
);
*/
RegDeleteValueW: ['long', [types.HKEY, types.LPCWSTR]],
/*
LONG WINAPI RegCloseKey(
_In_ HKEY hKey
);
*/
RegCloseKey: ['long', [types.HKEY]]
});
module.exports = advApi;