diff --git a/lib/registry.js b/lib/registry.js index 1cc4194..b1860fe 100644 --- a/lib/registry.js +++ b/lib/registry.js @@ -109,7 +109,11 @@ 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 = new Buffer(4); + // write the DWORD to the buffer to be added to the registry + buffer.writeUInt32LE(value, 0); + // create a pointer to it + byte = ref.alloc(types.LPBYTE, buffer); result = advApi.RegSetValueExA(key.handle.deref(), valueName, null, valueType, byte.deref(), buffer.length); break; default: @@ -152,4 +156,4 @@ var api = { } }; -module.exports = api; +module.exports = api; \ No newline at end of file