Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with large numbers in REG_DWORD and REG_QWORD #21

Closed
zariweyo opened this issue Mar 18, 2017 · 7 comments
Closed

Error with large numbers in REG_DWORD and REG_QWORD #21

zariweyo opened this issue Mar 18, 2017 · 7 comments
Assignees
Labels

Comments

@zariweyo
Copy link

To solve this, please, in file regUtil.vbs replace CInt to CLng. (lines 37 and 43).

Thanks

@kessler
Copy link
Owner

kessler commented Apr 15, 2017

@zariweyo could you please provide some code that will help me recreate the problem? thanks

@juanjo75es
Copy link

juanjo75es commented May 22, 2017

It still fails for me after making changes suggested by zariweyo

                                                      let valuesToPut = {};
                                                      valuesToPut[s3] = {
                                                        'FolderValueFlags': {
                                                          value: 0x28,
                                                          type: 'REG_DWORD'
                                                        },
                                                        'Attributes': {
                                                          value: 0xF080004D,  
                                                          type: 'REG_DWORD'
                                                        }
                                                      };

                                                      regedit.putValue(valuesToPut, function(err) {
                                                        if(typeof err !== "undefined")
                                                          console.log(err);
                                                        else{
                                                          
                                                        }
                                                      })

@kessler
Copy link
Owner

kessler commented May 22, 2017

@juanjo75es currently very busy... so it will take time to get to this. However, if you run into a solution in the meanwhile, please don't hesitate to send a PR

@nhz-io
Copy link
Contributor

nhz-io commented May 26, 2017

REG_DWORD

  • CLng overflows at 0x80000000.
  • Need to use CDbl for writing
  • Need to conver Long to ULong for reading

nhz-io added a commit to nhz-io/node-regedit that referenced this issue May 26, 2017
nhz-io added a commit to nhz-io/node-regedit that referenced this issue May 26, 2017
@nhz-io
Copy link
Contributor

nhz-io commented May 27, 2017

REG_QWORD

  • No conversion needed - SetQWORDValue accepts a String
  • writing is limited to values below 9007199254740993 Precision
  • reading is unaffected by precision limit

I dont see a way to overcome the precision limit on writing 😢

nhz-io added a commit to nhz-io/node-regedit that referenced this issue May 27, 2017
nhz-io added a commit to nhz-io/node-regedit that referenced this issue May 27, 2017
@nhz-io nhz-io closed this as completed May 29, 2017
@juanjo75es
Copy link

@kessler Well ... I solved my problem using:

var exec = require('child_process').exec;
exec( "reg add (...)" , function(error, stdout, stderr){});

But I guess it won't help you.

@kessler
Copy link
Owner

kessler commented May 31, 2017

@juanjo75es thanks for sharing the solution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants