windows-registry-node icon indicating copy to clipboard operation
windows-registry-node copied to clipboard

type error when call Key.setValue()

Open askdaddy opened this issue 9 years ago • 2 comments

   var ky = new Key(windef.HKEY.HKEY_CURRENT_USER, 'Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings', windef.KEY_ACCESS.KEY_WRITE);

        ky.setValue('ProxyEnable',windef.REG_VALUE_TYPE.REG_DWORD,1 );
        ky.close();

And I got a TypeError:

TypeError: Cannot read property 'deref' of undefined
    at Object.setValueForKeyObject (C:\Users\askda\git\proxy_mgr\node_modules\windows-registry\lib\registry.js:113:100)
    at Key.setValue (C:\Users\askda\git\proxy_mgr\node_modules\windows-registry\lib\key.js:44:24)
    at Object.setProxy (C:\Users\askda\git\proxy_mgr\index.js:10:12)
    at Object.<anonymous> (C:\Users\askda\git\proxy_mgr\test\test.js:14:5)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

askdaddy avatar Nov 08 '16 03:11 askdaddy

PS.

C:\Users\askda\git\proxy_mgr\node_modules\windows-registry\lib\registry.js:113 result = advApi.RegSetValueExA(key.handle.deref(), valueName, null, valueType, byte.deref(), buffer.length);

byte.deref() byte was undefined

askdaddy avatar Nov 08 '16 03:11 askdaddy

image Mmmmm.... I copied this line in \node_modules\windows-registry\lib\registry.js

da411d avatar Feb 20 '18 21:02 da411d