Sign in to follow this  
Followers 0
Tiger

REG_QWORD ?

5 posts in this topic

How can I create with RegWrite a REG_QWORD?


My UDFs:- _RegEnumKey

Share this post


Link to post
Share on other sites

How can I create with RegWrite a REG_QWORD?

As far as I know AutoIt's RegWrite() function doesn't support REG_QWORD.

As workaround you can call apropriate registry API functions directly with DllCall().

For inspiration look into AutoIt sources: autoit-v3.1.0-src.exe --> script_registry.cpp --> RegWrite

There are used these API functions: RegCreateKeyEx, RegSetValueEx, RegCloseKey

See MSDN for details or search for examples with these API functions

or maybe make post in Feature request forum for adding REG_QWORD support

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Looks like REG_QWORD was implemented in the recently released 3.2.11.0 Beta.

Cheers!

:P

Hmm... I'm missing something...

$iQWord = Binary("0xFEDCBA9876543210")
ConsoleWrite("Debug: $iQWord = " & $iQWord & @LF)
$RET = RegWrite("HKEY_CURRENT_USER\Software\AutoIt v3\Temp", "Test_QWord", "REG_QWORD", $iQWord)
ConsoleWrite("Debug: $RET = " & $RET & @LF)
$RET = RegRead("HKEY_CURRENT_USER\Software\AutoIt v3\Temp", "Test_QWord")
ConsoleWrite("Debug: $RET = " & $RET & @LF)

Outputs:

+>22:05:02 Starting AutoIt3Wrapper v.1.9.4
>Running AU3Check (1.54.12.0)  from:C:\Program Files\AutoIt3\beta
C:\Program Files\AutoIt3\Scripts\Test_1.au3(3,96) : ERROR: RegWrite() called with illegal argument 3: "REG_QWORD"
$RET = RegWrite("HKEY_CURRENT_USER\Software\AutoIt v3\Temp", "Test_QWord", "REG_QWORD", $iQWord)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Program Files\AutoIt3\Scripts\Test_1.au3 - 1 error(s), 0 warning(s)
!>22:05:02 AU3Check ended.rc:2
>Running:(3.2.11.0):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Program Files\AutoIt3\Scripts\Test_1.au3" 
Debug: $iQWord = 0xFEDCBA9876543210
Debug: $RET = 1
Debug: $RET = 
+>22:05:09 AutoIT3.exe ended.rc:0
+>22:05:10 AutoIt3Wrapper Finished
>Exit code: 0   Time: 9.282

The error is only because SciTE doesn't recognize the new key word.

The Value Test_QWord is written to my registry as "FE 00 00 00 00 00 00 00", and appears to RegRead as an empty string.

:D

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0