Skip to content

Access Violation on getValue? #64

@tomysshadow

Description

@tomysshadow

This line of code in registry.js appears to be causing my NodeJS to abruptly terminate with an access violation.

        // QUERY FOR VALUE SIZE & TYPE
        var result = advApi.RegQueryValueExA(key.handle.deref(), valueName, null, pKeyType, null, pKeyDataLength);

This is my code...

			var WindowsRegistry = require("windows-registry");
			var internetSettingsKey = new WindowsRegistry.Key(WindowsRegistry.windef.HKEY.HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", WindowsRegistry.windef.KEY_ACCESS.KEY_QUERY_VALUE | WindowsRegistry.windef.KEY_ACCESS.KEY_SET_VALUE);
			local.internetSettings.proxyServer = internetSettingsKey.getValue("ProxyServer");
			local.internetSettings.proxyEnable = internetSettingsKey.getValue("ProxyEnable");

In debug output, I can see it attempting to invoke the function...

  ref allocating Buffer for type with "size" 4 +1ms
  ref setting value on allocated buffer <Buffer@0x00000206B0DC16A0 00 00 00 00 00 00 00 00> +0ms
  ref set(): (offset: 0) <Buffer@0x00000206B0DC16B0 00 00 00 00 00 00 00 00> <Buffer@0x00000206B0DC16A0 00 00 00 00 00 00 00 00> +1ms
  ref writing pointer to buffer <Buffer@0x00000206B0DC16B0 00 00 00 00 00 00 00 00> 0 <Buffer@0x00000206B0DC16A0 00 00 00 00 00 00 00 00> +0ms
  ref allocating Buffer for type with "size" 4 +0ms
  ref setting value on allocated buffer <Buffer@0x00000206B0DC15B0 00 00 00 00 00 00 00 00> +0ms
  ref set(): (offset: 0) <Buffer@0x00000206B0DC13D0 00 00 00 00 00 00 00 00> <Buffer@0x00000206B0DC15B0 00 00 00 00 00 00 00 00> +0ms
  ref writing pointer to buffer <Buffer@0x00000206B0DC13D0 00 00 00 00 00 00 00 00> 0 <Buffer@0x00000206B0DC15B0 00 00 00 00 00 00 00 00> +0ms
  ref dereferencing buffer <Buffer@0x00000206B0DC1710 10 04 00 00 00 00 00 00> +0ms
  ref get(): (offset: 0) <Buffer@0x00000206B0DC1710 10 04 00 00 00 00 00 00> +1ms
  ffi:_ForeignFunction invoking proxy function +8ms
  ref allocating Buffer for type with "size" 0 +0ms

Am I using this wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions