MACE
(Starting to like KiXtart)
2013-09-13 12:35 PM
Formula to convert Decimal Double to QWORD

Having determined a large decimal double I need to convert it into a QWORD to write into the registry and I keep getting a DWORD, anyone know the correct formula to break this up appropriately ?

NTDOCAdministrator
(KiX Master)
2013-09-17 07:47 AM
Re: Formula to convert Decimal Double to QWORD

I don't think KiXtart can handle that value period. There was some UDF or Script I thought I saw where someone does try to do something to trick KiX into it but not sure where that was, maybe someone else knows.

QWORD Value REG_QWORD
Data represented by a number that is a 64-bit integer. This data is displayed in Registry Editor as a Binary Value and was introduced in Windows 2000.

Not sure if these values are correct but they are listed on the Windows 7 forum.


REG_DWORD - 32-bit number

The range of integer values that can be stored in 32 bits is 0 through 4,294,967,295. Hence, a processor with 32-bit memory addresses can directly access 4 GB of byte-addressable memory.


REG_QWORD - 64-bit number

A 64-bit register can store 2^64 (2 to 64th power) = 18,446,744,073,709,551,616 different values.


MACE
(Starting to like KiXtart)
2013-09-17 11:02 AM
Re: Formula to convert Decimal Double to QWORD

I know when it gets to that level you get 0 returned if actually doing the maths so I was thinking as its already a double it may be possible to treat it somewhat like a string manipulation in that we want 8 bytes represented as hex, but the registry display in hex qword in not what I would have expected but is correct as dec. As Win 7 x64 regedit can flick between both values at will it makes the formula possible but difficult in x32.
FSO returns disk sizes in bytes which is great but I need to store them as QWords.
In a Reg file however "TotalSize"=hex(b):00,30,88,4c,af,02,00,00 = 2951926525952 which is represented as 8 distinct bytes.
This type of math is not my strength so I am reading whatever I can but its slow going.


JochenAdministrator
(KiX Supporter)
2013-09-18 07:31 AM
Re: Formula to convert Decimal Double to QWORD

Hopefully the current situation workwise will loosen a bit tense soon ...
If I dont find any replies on this then I'll try to come up with something.

in the end they are all 0s and 1s or states on a circuit or what ever you like to abstract those big numbers ;\)


LonkeroAdministrator
(KiX Master Guru)
2013-09-18 06:51 PM
Re: Formula to convert Decimal Double to QWORD

I guess this part never got implemented in kix.net yet :P

ok, you have the option of reg.exe.
it will involve files on reading or wshpipe() but this way you can get it working.