--- In [email protected], "entropyreduction"
<alancampbelllists+ya...@...> wrote:
>
> > For a list of the recent documents, I'm trying to get a registry value of
> > REG_BINARY type with Reg.Get_Binary(). File path may also contain multibyte
> > characters. so, Binary.Dump() not directly restore path string.
>
> I guess I better test binary block to make sure terminates in
> a wide-char string terminator (L'0'). Do your REG_BINARY blocks?
>
> Got example of REG_BINARY key that might contain a path that I can use for
> example?
>
;-------------------------------------
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\PowerPro]
"_sbcs_"=hex:43,00,3a,00,5c,00,54,00,65,00,6d,00,70,00,5c,00,73,00,62,00,63,00,\
73,00,5f,00,74,00,65,00,73,00,74,00,2e,00,74,00,78,00,74,00,00,00
"_mbcs_"=hex:43,00,3a,00,5c,00,54,00,65,00,6d,00,70,00,5c,00,00,ac,00,ac,5c,00,\
6d,00,62,00,63,00,73,00,5f,00,98,b0,98,b0,2e,00,74,00,78,00,74,00,00,00
;-------------------------------------
_sbcs_ is "C:\Temp\sbcs_test.txt".
_mbcs_ is containing multi-byte chars in both folder and file names.
unicode.encode(_mbcs_) returns
"QwA6AFwAVABlAG0AcABcAACsAKxcAG0AYgBjAHMAXwCYsJiwLgB0AHgAdAAAAA==" (without
quotation marks)
my test code alternatively using dll.call() is like below.
;-------------------------------------
Local Rg_Status, Dll_Status
Local str
Local bhs = Reg.Get_Binary(?"HKEY_CURRENT_USER\Software\PowerPro\_mbcs_")
Dll.Call("WideCharToMultiByte|ui ui x i s+ i ui ui", 0, 0, bhs, -1, "str", 272,
0, 0)
Win.Debug(str)
;-------------------------------------
It's working for me.
BTW, I'm using Binary plugin 0054h.
Unlike Help file, The default value of indexBase seems to be 1 not 0, and
there's a trivial error.
;-------------------------------------
local bhResult = binary.from_ascii("abcd")
Win.Debug(bhResult[2].dump) ;; 1-based
Win.Debug(bhResult[-2].dump) ;; error
; errors
Win.Debug(binary.index(bhResult, "bc"))
Win.Debug(bhResult.index("bc"))
;-------------------------------------
>
> I think I'll clear up COM first, then get back to this, unles you're in a
> hurry....
>
It's not important at this time. keep your priorities.
Thanks.