Menu

#219 Wrong Integer Type Returned

Unscheduled
wont-fix
nobody
registry (1)
Bug
5
2024-09-27
2023-09-08
Anonymous
No

Hello.

I have problem with reading dword registry values that are larger than int32. The code simply returns -1.

For example I have a dword value for FileSizeLimitInBytes as 0xffffffff (uint32 - 4294967295), however, TWAPI is treating the value as int32 and returns -1.

Discussion

  • Ashok P. Nadkarni

    Thanks for the report. It might a bit of time before I put out a new release though. Have you tried reading using Tcl's registry command? As a work around in the meanwhile perhaps you can do a

    format 0x%x $regdwordvalue

    when you read.

     
    • ibakhmoutski

      ibakhmoutski - 2023-09-13

      I appreciate your quick response.

      Unfortunately, Tcl's registry command returns -1 as well.

      However, the workaround you provided works fine with a minor modification. I needed a decimal number to calculate the max file size.

      format %u $regdwordvalue

      I didn't realize that the value of -1 can be converted, I thought it was just an error.

      Thank you for the help.

       
  • Anonymous

    Anonymous - 2024-09-27

    Finally revisiting this, I agree that the value should be unsigned. However, not just Tcl's registry command, but .Net as well (see https://github.com/dotnet/runtime/issues/24954) treat REG_DWORD as signed. So I am hesitant to change it to return unsigned values. Closing.

     
  • Ashok P. Nadkarni

    • status: open --> wont-fix
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →