From 114dcb09bf65c5b829b8f86f43e29ab8a9189d94 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 26 Sep 2017 16:39:35 -0400 Subject: [PATCH] REG_DWORD did not work, it would not write anything to the Registry. Updated so that users enter an octet array and that octet array is assumed four characters. --- lib/registry.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/registry.js b/lib/registry.js index cf10632..1f51c4b 100644 --- a/lib/registry.js +++ b/lib/registry.js @@ -109,7 +109,8 @@ var api = { case windef.REG_VALUE_TYPE.REG_DWORD: case windef.REG_VALUE_TYPE.REG_DWORD_BIG_ENDIAN: case windef.REG_VALUE_TYPE.REG_DWORD_LITTLE_ENDIAN: - buffer = new Buffer(4, value); + buffer = Buffer.from(value); + byte = ref.alloc(types.LPDWORD, buffer); result = advApi.RegSetValueExA(key.handle.deref(), valueName, null, valueType, byte.deref(), buffer.length); break; default: