Which number cast is a registry Dword in vb based on its minimum and max values?
I am trying to build an editor that can read and edit registry dumps
Which number cast is a registry Dword in vb based on its minimum and max values?
I am trying to build an editor that can read and edit registry dumps
This is actually fairly easy to find out:
Dim value As Object = Registry.GetValue("HKEY_CURRENT_USER\Console", "FontSize", -1)
Console.WriteLine(value.GetType().FullName)
In the case of a REG_DWORD value this will print "System.Int32", which would be an Integer
in VB.NET.
For VB.Net, you should use the Integer
data type. See this handy list for details on the available datatypes. In older Visual Basic, you would have used the long
data type.
This has the proper number of bits (32; an x86 DWORD
is a "double word", where a word is understood to be 16-bit), but I think there's a slight problem with VB not supporting "unsigned" values. This limitation might make presentation/editing a bit more complicated.