Registry library with 64-bit (reflection) support

Share your advanced PureBasic knowledge/code with the community.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Registry library with 64-bit (reflection) support

Post by Mistrel »

When I say 64-bit support, I'm referring to registry reflection. I haven't actually attempted to compile this into a 64-bit application:

http://msdn.microsoft.com/en-us/library ... 85%29.aspx

This is an update to a collection of functions I accumulated from several years ago from the forum (thanks for doing the initial legwork for me):

http://www.purebasic.fr/english/viewtopic.php?t=17676
http://www.purebasic.fr/english/viewtopic.php?t=14091

I think this is mostly based on Kale's code. It's not a one-to-one update. I've changed parameters, return values, and function names, as I saw fit to clarify things.

Code: Select all

;/ Library constants
#KEY_WOW64_64KEY=256

;/ Library prototypes
Declare.s Reg_GetValueName(TopKey.l, KeyName.s, Index.l, *Count.Integer=0, DisableReflection.l=#False, ComputerName.s="")
Declare.s Reg_GetValueData(TopKey.l, KeyName.s, ValueName.s, DisableReflection.l=#False, ComputerName.s="")
Declare Reg_CreateKey(TopKey.l, KeyName.s, DisableReflection.l=#False, ComputerName.s="")
Declare Reg_DeleteKey(TopKey.l, KeyName.s, ComputerName.s="")
Declare Reg_KeyExists(TopKey.l, KeyName.s, DisableReflection.l=#False, ComputerName.s="")
Declare Reg_SetValue(TopKey.l, KeyName.s, ValueName.s, *ValueData, DataLength.l, Type, DisableReflection.l=#False, ComputerName.s="")
Declare Reg_DeleteValue(TopKey.l, KeyName.s, ValueName.s, DisableReflection.l=#False, ComputerName.s="")
Declare.s Reg_GetSubKeyName(TopKey.l, KeyName.s, Index.l, *Count.Integer=0, DisableReflection.l=#False, ComputerName.s="")

Code: Select all

Procedure.s Reg_GetValueName(TopKey.l, KeyName.s, Index.l, *Count.Integer=0, DisableReflection.l=#False, ComputerName.s="")
  Protected ValueCount.l
  Protected ValueNameMaxLen.l
  Protected ValueMaxLen.l
  Protected Access.l
  Protected LibID.i
  Protected Result.l
  Protected hKey.l
  Protected hRemoteRegistry.i
  Protected ValueNameLen
  Protected ValueName.s
  Protected ValueDataLen.l
  Protected ValueData.s
  Protected Type.l
  Static Ptr.i
  
  Access=#KEY_QUERY_VALUE
  
  If DisableReflection
    Access=Access|#KEY_WOW64_64KEY
  EndIf
  
  If Left(KeyName.s,1)="\"
    KeyName.s=Right(KeyName.s,Len(KeyName.s)-1)
  EndIf
  
  If Not Ptr
    ;/ Use the OS RegOpenKeyEx to ensure support for the #KEY_WOW64_64KEY flag
    LibID=OpenLibrary(#PB_Any,"advapi32.dll")
    
    CompilerIf #PB_Compiler_Unicode
      Ptr=GetFunction(LibID,"RegOpenKeyExW")
    CompilerElse
      Ptr=GetFunction(LibID,"RegOpenKeyExA")
    CompilerEndIf
  EndIf
  
  If Not Ptr
    ProcedureReturn ""
  EndIf
  
  If Not ComputerName
    If Not CallFunctionFast(Ptr,TopKey,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      ProcedureReturn ""
    EndIf
  Else
    If Not RegConnectRegistry_(@ComputerName.s,TopKey,@hRemoteRegistry)=#ERROR_SUCCESS
      ProcedureReturn ""
    EndIf
    
    If Not CallFunctionFast(Ptr,hRemoteRegistry,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      RegCloseKey_(hRemoteRegistry)
      ProcedureReturn ""
    EndIf
  EndIf
  
  If Not hKey
    If hRemoteRegistry
      RegCloseKey_(hRemoteRegistry)
    EndIf
    
    ProcedureReturn ""
  EndIf
  
  If Not RegQueryInfoKey_(hKey,0,0,0,0,0,0,@ValueCount,@ValueNameMaxLen,@ValueMaxLen,0,0)=#ERROR_SUCCESS
    If hRemoteRegistry
      RegCloseKey_(hRemoteRegistry)
    EndIf
    
    RegCloseKey_(hKey)
    ProcedureReturn ""
  EndIf
  
  If *Count
    *Count\i=ValueCount
  EndIf
  
  ValueNameLen=ValueNameMaxLen+1
  ValueName.s=Space(ValueNameLen)
  
  ValueDataLen=ValueMaxLen+1
  ValueData.s=Space(ValueDataLen)
  
  If Not RegEnumValue_(hKey,Index,@ValueName.s,@ValueNameLen,0,@Type,@ValueData.s,@ValueDataLen)=#ERROR_SUCCESS
    ValueName.s=""
  EndIf
  
  If hRemoteRegistry
    RegCloseKey_(hRemoteRegistry)
  EndIf
  
  RegCloseKey_(hKey)
  
  ProcedureReturn ValueName.s
EndProcedure

Procedure.s Reg_GetValueData(TopKey.l, KeyName.s, ValueName.s, DisableReflection.l=#False, ComputerName.s="")
  Protected ValueNameMaxLen.l
  Protected ValueMaxLen.l
  Protected Access.l
  Protected LibID.i
  Protected Result.l
  Protected hKey.l
  Protected hRemoteRegistry.i
  Protected ValueDataLen.l
  Protected ValueData.s
  Protected Type.l
  Static Ptr.i
  
  Access=#KEY_QUERY_VALUE
  
  If DisableReflection
    Access=Access|#KEY_WOW64_64KEY
  EndIf
  
  If DisableReflection
    Access=Access|#KEY_WOW64_64KEY
  EndIf
  
  If Left(KeyName.s,1)="\"
    KeyName.s=Right(KeyName.s,Len(KeyName.s)-1)
  EndIf
  
  If Not Ptr
    ;/ Use the OS RegOpenKeyEx to ensure support for the #KEY_WOW64_64KEY flag
    LibID=OpenLibrary(#PB_Any,"advapi32.dll")
    
    CompilerIf #PB_Compiler_Unicode
      Ptr=GetFunction(LibID,"RegOpenKeyExW")
    CompilerElse
      Ptr=GetFunction(LibID,"RegOpenKeyExA")
    CompilerEndIf
  EndIf
  
  If Not Ptr
    ProcedureReturn ""
  EndIf
  
  If Not ComputerName
    If Not CallFunctionFast(Ptr,TopKey,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      ProcedureReturn ""
    EndIf
  Else
    If Not RegConnectRegistry_(@ComputerName.s,TopKey,@hRemoteRegistry)=#ERROR_SUCCESS
      ProcedureReturn ""
    EndIf
    
    If Not CallFunctionFast(Ptr,hRemoteRegistry,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      RegCloseKey_(hRemoteRegistry)
      ProcedureReturn ""
    EndIf
  EndIf
  
  If Not hKey
    If hRemoteRegistry
      RegCloseKey_(hRemoteRegistry)
    EndIf
    
    ProcedureReturn ""
  EndIf
  
  If Not RegQueryInfoKey_(hKey,0,0,0,0,0,0,0,@ValueNameMaxLen,@ValueMaxLen,0,0)=#ERROR_SUCCESS
    If hRemoteRegistry
      RegCloseKey_(hRemoteRegistry)
    EndIf
    
    If hRemoteRegistry
      RegCloseKey_(hRemoteRegistry)
    EndIf
    
    RegCloseKey_(hKey)
    ProcedureReturn ""
  EndIf
  
  ValueDataLen=ValueMaxLen+1
  ValueData.s=Space(ValueDataLen)
  
  If Not RegQueryValueEx_(hKey,@ValueName.s,0,@Type,@ValueData.s,@ValueDataLen)=#ERROR_SUCCESS
    ValueData.s=""
  EndIf
  
  If hRemoteRegistry
    RegCloseKey_(hRemoteRegistry)
  EndIf
  
  RegCloseKey_(hKey)
  
  ProcedureReturn ValueData.s
EndProcedure

Procedure Reg_CreateKey(TopKey.l, KeyName.s, DisableReflection.l=#False, ComputerName.s="")
  Protected Security.SECURITY_ATTRIBUTES
  Protected hRemoteRegistry.i
  Protected hKey.i
  Protected Disposition.i
  Protected Access
  Protected LibID
  Static Ptr
  
  Access=#KEY_CREATE_SUB_KEY
  
  If DisableReflection
    Access=Access|#KEY_WOW64_64KEY
  EndIf
  
  If Left(KeyName.s,1)="\"
    KeyName.s=Right(KeyName.s,Len(KeyName.s)-1)
  EndIf
  
  If Not Ptr
    ;/ Use the OS RegOpenKeyEx to ensure support for the #KEY_WOW64_64KEY flag
    LibID=OpenLibrary(#PB_Any,"advapi32.dll")
    
    CompilerIf #PB_Compiler_Unicode
      Ptr=GetFunction(LibID,"RegCreateKeyExW")
    CompilerElse
      Ptr=GetFunction(LibID,"RegCreateKeyExA")
    CompilerEndIf
  EndIf
  
  If Not Ptr
    ProcedureReturn #False
  EndIf
  
  If Not ComputerName
    If Not CallFunctionFast(Ptr,TopKey,@KeyName.s,0,0,#REG_OPTION_NON_VOLATILE,Access,@Security,@hKey,@Disposition)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
  Else
    If Not RegConnectRegistry_(@ComputerName.s,TopKey,@hRemoteRegistry)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
    
    If Not CallFunctionFast(Ptr,hRemoteRegistry,@KeyName.s,0,0,#REG_OPTION_NON_VOLATILE,Access,@Security,@hKey,@Disposition)=#ERROR_SUCCESS
      RegCloseKey_(hRemoteRegistry)
      ProcedureReturn #False
    EndIf
  EndIf
 
  If Not hKey
    If hRemoteRegistry
      RegCloseKey_(hRemoteRegistry)
    EndIf
    
    ProcedureReturn #False
  EndIf
  
  If hRemoteRegistry
    RegCloseKey_(hRemoteRegistry)
  EndIf
  
  RegCloseKey_(hKey)
  
  ProcedureReturn #True
EndProcedure

Procedure Reg_DeleteKey(TopKey.l, KeyName.s, ComputerName.s="")
  Protected hRemoteRegistry.i
  
  If Left(KeyName.s,1)="\"
    KeyName.s=Right(KeyName.s,Len(KeyName.s)-1)
  EndIf
  
  If Not ComputerName
    If Not RegDeleteKey_(TopKey,@KeyName.s)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
  Else
    If Not RegConnectRegistry_(@ComputerName.s,TopKey,@hRemoteRegistry)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
    
    If Not RegDeleteKey_(hRemoteRegistry,@KeyName.s)=#ERROR_SUCCESS
      RegCloseKey_(hRemoteRegistry)
      ProcedureReturn #False
    EndIf
  EndIf
  
  If hRemoteRegistry
    RegCloseKey_(hRemoteRegistry)
  EndIf
  
  ProcedureReturn #True
EndProcedure

Procedure Reg_KeyExists(TopKey.l, KeyName.s, DisableReflection.l=#False, ComputerName.s="")
  Protected hRemoteRegistry.i
  Protected Access.l
  Protected hKey
  Protected LibID
  Static Ptr.i
  
  Access=#KEY_QUERY_VALUE
  
  If DisableReflection
    Access=Access|#KEY_WOW64_64KEY
  EndIf
  
  If Left(KeyName.s,1)="\"
    KeyName.s=Right(KeyName.s,Len(KeyName.s)-1)
  EndIf
  
  If Not Ptr
    ;/ Use the OS RegOpenKeyEx to ensure support for the #KEY_WOW64_64KEY flag
    LibID=OpenLibrary(#PB_Any,"advapi32.dll")
    
    CompilerIf #PB_Compiler_Unicode
      Ptr=GetFunction(LibID,"RegOpenKeyExW")
    CompilerElse
      Ptr=GetFunction(LibID,"RegOpenKeyExA")
    CompilerEndIf
  EndIf
  
  If Not Ptr
    ProcedureReturn #False
  EndIf
  
  If Not ComputerName
    If Not CallFunctionFast(Ptr,TopKey,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
  Else
    If Not RegConnectRegistry_(@ComputerName.s,TopKey,@hRemoteRegistry)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
    
    If Not CallFunctionFast(Ptr,hRemoteRegistry,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      RegCloseKey_(hRemoteRegistry)
      ProcedureReturn #False
    EndIf
  EndIf
 
  If Not hKey
    ProcedureReturn #False
  EndIf
  
  If hRemoteRegistry
    RegCloseKey_(hRemoteRegistry)
  EndIf
  
  RegCloseKey_(hKey)
  
  ProcedureReturn #True
EndProcedure

Procedure Reg_SetValue(TopKey.l, KeyName.s, ValueName.s, *ValueData, DataLength.l, Type, DisableReflection.l=#False, ComputerName.s="")
  Protected hRemoteRegistry.i
  Protected Access.l
  Protected hKey
  Protected LibID
  Static Ptr.i
  
  Access=#KEY_WRITE
  
  If DisableReflection
    Access=Access|#KEY_WOW64_64KEY
  EndIf
  
  If Left(KeyName.s,1)="\"
    KeyName.s=Right(KeyName.s,Len(KeyName.s)-1)
  EndIf
  
  If Not Ptr
    ;/ Use the OS RegOpenKeyEx to ensure support for the #KEY_WOW64_64KEY flag
    LibID=OpenLibrary(#PB_Any,"advapi32.dll")
    
    CompilerIf #PB_Compiler_Unicode
      Ptr=GetFunction(LibID,"RegOpenKeyExW")
    CompilerElse
      Ptr=GetFunction(LibID,"RegOpenKeyExA")
    CompilerEndIf
  EndIf
  
  If Not Ptr
    ProcedureReturn #False
  EndIf
  
  If Not ComputerName
    If Not CallFunctionFast(Ptr,TopKey,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
  Else
    If Not RegConnectRegistry_(@ComputerName.s,TopKey,@hRemoteRegistry)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
    
    If Not CallFunctionFast(Ptr,hRemoteRegistry,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      RegCloseKey_(hRemoteRegistry)
      ProcedureReturn #False
    EndIf
  EndIf
  
  If Not hKey
    ProcedureReturn #False
  EndIf
  
  If Not RegSetValueEx_(hKey,@ValueName.s,0,Type,*ValueData,DataLength)=#ERROR_SUCCESS
    If hRemoteRegistry
      RegCloseKey_(hRemoteRegistry)
    EndIf
    
    RegCloseKey_(hKey)
    
    ProcedureReturn #False
  EndIf
  
  If hRemoteRegistry
    RegCloseKey_(hRemoteRegistry)
  EndIf
  
  RegCloseKey_(hKey)
  
  ProcedureReturn #True
EndProcedure

Procedure Reg_DeleteValue(TopKey.l, KeyName.s, ValueName.s, DisableReflection.l=#False, ComputerName.s="")
  Protected hRemoteRegistry.i
  Protected Access.l
  Protected hKey
  Protected LibID
  Static Ptr.i
  
  Access=#KEY_ALL_ACCESS
  
  If DisableReflection
    Access=Access|#KEY_WOW64_64KEY
  EndIf
  
  If Left(KeyName.s,1)="\"
    KeyName.s=Right(KeyName.s,Len(KeyName.s)-1)
  EndIf
  
  If Not Ptr
    ;/ Use the OS RegOpenKeyEx to ensure support for the #KEY_WOW64_64KEY flag
    LibID=OpenLibrary(#PB_Any,"advapi32.dll")
    
    CompilerIf #PB_Compiler_Unicode
      Ptr=GetFunction(LibID,"RegOpenKeyExW")
    CompilerElse
      Ptr=GetFunction(LibID,"RegOpenKeyExA")
    CompilerEndIf
  EndIf
  
  If Not Ptr
    ProcedureReturn #False
  EndIf
  
  If Not ComputerName
    If Not CallFunctionFast(Ptr,TopKey,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
  Else
    If Not RegConnectRegistry_(@ComputerName.s,TopKey,@hRemoteRegistry)=#ERROR_SUCCESS
      ProcedureReturn #False
    EndIf
    
    If Not CallFunctionFast(Ptr,hRemoteRegistry,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      RegCloseKey_(hRemoteRegistry)
      ProcedureReturn #False
    EndIf
  EndIf
  
  If Not hKey
    ProcedureReturn #False
  EndIf
  
  If Not RegDeleteValue_(hKey,@ValueName.s)
    ProcedureReturn #False
  EndIf
  
  If hRemoteRegistry
    RegCloseKey_(hRemoteRegistry)
  EndIf
  
  RegCloseKey_(hKey)
  
  ProcedureReturn #True
EndProcedure

Procedure.s Reg_GetSubKeyName(TopKey.l, KeyName.s, Index.l, *Count.Integer=0, DisableReflection.l=#False, ComputerName.s="")
  Protected hRemoteRegistry.i
  Protected Access.l
  Protected hKey
  Protected KeyNameLen
  Protected LastWrite.FILETIME
  Protected SubKeysCount
  Protected SubKeyMaxLen
  Protected LibID
  Static Ptr.i
  
  Access=#KEY_QUERY_VALUE|#KEY_ENUMERATE_SUB_KEYS
  
  If DisableReflection
    Access=Access|#KEY_WOW64_64KEY
  EndIf
  
  If Left(KeyName.s,1)="\"
    KeyName.s=Right(KeyName.s,Len(KeyName.s)-1)
  EndIf
  
  If Not Ptr
    ;/ Use the OS RegOpenKeyEx to ensure support for the #KEY_WOW64_64KEY flag
    LibID=OpenLibrary(#PB_Any,"advapi32.dll")
    
    CompilerIf #PB_Compiler_Unicode
      Ptr=GetFunction(LibID,"RegOpenKeyExW")
    CompilerElse
      Ptr=GetFunction(LibID,"RegOpenKeyExA")
    CompilerEndIf
  EndIf
  
  If Not Ptr
    ProcedureReturn ""
  EndIf
  
  If Not ComputerName
    If Not CallFunctionFast(Ptr,TopKey,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      ProcedureReturn ""
    EndIf
  Else
    If Not RegConnectRegistry_(@ComputerName.s,TopKey,@hRemoteRegistry)=#ERROR_SUCCESS
      ProcedureReturn ""
    EndIf
    
    If Not CallFunctionFast(Ptr,hRemoteRegistry,@KeyName.s,0,Access,@hKey)=#ERROR_SUCCESS
      RegCloseKey_(hRemoteRegistry)
      ProcedureReturn ""
    EndIf
  EndIf
  
  If Not RegQueryInfoKey_(hKey,0,0,0,@SubKeysCount,@SubKeyMaxLen,0,0,0,0,0,0)=#ERROR_SUCCESS
    If hRemoteRegistry
      RegCloseKey_(hRemoteRegistry)
    EndIf
    
    RegCloseKey_(hKey)
    ProcedureReturn ""
  EndIf
  
  If *Count
    *Count\i=SubKeysCount
  EndIf
  
  KeyNameLen=SubKeyMaxLen+1
  KeyName.s=Space(KeyNameLen)
  
  If Not RegEnumKeyEx_(hKey,Index,@KeyName.s,@KeyNameLen,0,0,0,@LastWrite)=#ERROR_SUCCESS
    KeyName.s=""
  EndIf
  
  If Not hKey
    ProcedureReturn ""
  EndIf
  
  If hRemoteRegistry
    RegCloseKey_(hRemoteRegistry)
  EndIf
  
  RegCloseKey_(hKey)
  
  ProcedureReturn KeyName.s
EndProcedure
eJan
Enthusiast
Enthusiast
Posts: 366
Joined: Sun May 21, 2006 11:22 pm
Location: Sankt Veit am Flaum

Re: Registry library with 64-bit (reflection) support

Post by eJan »

Thanks Mistrel.
An example to get value data:

Code: Select all

Debug Reg_GetValueData(#HKEY_LOCAL_MACHINE, "Software\WinRAR", "exe32")
Debug: C:\Program Files\WinRAR\WinRAR.exe
Image
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: Registry library with 64-bit (reflection) support

Post by SFSxOI »

Thanks for the contribution. Don't know if you considered getting REG_QWORD values from the registry also, but heres something (a little un-refined but works) that does that (and DWORD also)

Code: Select all

Procedure Reg_ConvertRegKeyToTopKey(Key.s)
  
  topKey.s=StringField(Key,1,"\")
  topKey=UCase(topKey)
  
  Select topKey
    
    Case "HKEY_CLASSES_ROOT"
      retour=#HKEY_CLASSES_ROOT
      
    Case "HKEY_CURRENT_USER"
      retour=#HKEY_CURRENT_USER
      
    Case "HKEY_LOCAL_MACHINE"
      retour=#HKEY_LOCAL_MACHINE
      
    Case "HKEY_USERS"
      retour=#HKEY_USERS 
      
    Case "HKEY_CURRENT_CONFIG"
      retour=#HKEY_CURRENT_CONFIG 
      
  EndSelect
  
  ProcedureReturn retour
  
EndProcedure

Procedure.s Reg_ConvertRegKeyToKeyName(Key.s)
  PositionSlash=FindString(Key,"\",1)
  retour.s=Right(Key,(Len(Key)-PositionSlash))
  ProcedureReturn retour
EndProcedure

Procedure.s Reg_Get_DQValues(Key.s, ValueName.s)
  hKey.i
  lRegType.i
  lBuffSize.i
  qResult.q
  sTemp.s

topKey=Reg_ConvertRegKeyToTopKey(Key)
KeyName.s=Reg_ConvertRegKeyToKeyName(Key)

If Left(KeyName, 1) = "\" 
KeyName = Right(KeyName, Len(KeyName) - 1) 
EndIf

  If RegOpenKeyEx_(topKey, KeyName, #Null, #KEY_QUERY_VALUE, @hKey) <> #ERROR_SUCCESS
    sTemp = "No registry access"
  EndIf
  If RegQueryValueEx_(hKey, ValueName, 0, @lRegType, 0, @lBuffSize) <> #ERROR_SUCCESS
    sTemp = "Cannot obtain registry type or buffer size"
    RegCloseKey_(hKey)
  EndIf
  If RegQueryValueEx_(hKey, ValueName, 0, 0, @qResult, @lBuffSize) <> #ERROR_SUCCESS
    sTemp = "Cannot obtain value of " + ValueName
    RegCloseKey_(hKey)
  EndIf
  RegCloseKey_(hKey)

  Select lRegType
      
    Case #REG_DWORD
      If lBuffSize = 4
        sTemp = Str(qResult)
        ;RegCloseKey_(hKey)
      EndIf
     
    Case #REG_QWORD
      If lBuffSize = 8
        sTemp = Str(qResult)
        ;RegCloseKey_(hKey)
      EndIf

  EndSelect

RegCloseKey_(hKey)

ProcedureReturn sTemp

EndProcedure

; tested x86 Windows 7 - gets REG_QWORD and DWORD
Debug Reg_Get_DQValues("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winsat", "TimeLastFormalAssessment")
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Registry library with 64-bit (reflection) support

Post by Mistrel »

I didn't even know there was a REG_QWORD type. In that case, these functions would certainly fail to return an accurate value when compiled for x86 if the value is greater than a long.

The code is pretty easy to work with so adding this shouldn't be a problem, if you need it.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: Registry library with 64-bit (reflection) support

Post by SFSxOI »

Just offering it because a lot of people, like you, didn't know about the REG_QWORD type.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Post Reply