Hi, everybody! One problem:
;------------
regpath db 'SOFTWARE',0
key_cm dd 0
;------------
Invoke RegOpenKeyEx, HKEY_CURRENT_USER, addr regpath, \
null, KEY_ALL_ACCESS, addr key_cm
eax = 998: Invalid access to memory location.
;------------
Hope you help!
Posted on 2001-08-24 02:21:06 by Alexey
I think i have read somewhere that KEY_ALL_ACCESS does not work under NT
family. Try setting the Flags you need.

(I suppose your data are in .Data...)


betov.
Posted on 2001-08-24 04:12:57 by Betov
Sure in .data

i try KEY_READ - all the same!
Plz, example!
Posted on 2001-08-24 04:58:35 by Alexey
Does the Key exist?

betov
Posted on 2001-08-24 06:05:15 by Betov
I think i have read somewhere that KEY_ALL_ACCESS does not work under NT


oh !!
Is it true ???
can someone check ?
thanx

(s)
Posted on 2001-08-24 08:16:05 by (scalp)
It depends on your access rights. Administrator accounts can probably
do what they want, regular accounts can't. Depending on how the
system is set up.
Posted on 2001-08-24 08:31:13 by f0dder
I have found where i have read this, Scalp: This was a the time i was working
with Ron Thomas on the Screen Saver Demos. We have had a lot of problems
to make these Demos run under all Win versions. At that time i had no
test Computer with 2000 in the box, so, i didn't test by myself, but
here are some line relating a mail exchange between Iczelion and Ron:

"... I then realized that these two savers actually write to registry
keys and asked Iczelion if this could be the problem. The answer was yes,
Win2000 is paranoid about security and he changed the KEY_ALL_ACCESS to
KEY_READ or KEY_WRITE or KEY_QUERY_VALUE for the RegCreateKeyEx API...
It worked and I've now updated Balls in the same way.... ".


Betov.
Posted on 2001-08-24 10:05:26 by Betov
thanx
good to know !

(s)
Posted on 2001-08-24 10:13:53 by (scalp)
Test code:
regpath dw 'SOFTWARE\key',0
Invoke RegCreateKeyExW, HKEY_LOCAL_MACHINE, \
addr regpath, null, null, null, KEY_ALL_ACCESS, null, \
addr key_1, addr lc1
return error with "Invalid access to memory location" - 998

In the same program on the same machine:
regpathA db 'SOFTWARE\key',0
Invoke RegCreateKeyExA, HKEY_LOCAL_MACHINE, \
addr regpathA, null, null, null, KEY_ALL_ACCESS, null, \
addr key_1, addr lc1
return OK!
Posted on 2001-08-27 00:01:29 by Alexey
So does MASM really create Unicode with DW ?

If so, there's an ambiguity with

DW '12',0

To be compatible with previous assemblers, and be consistent with uses of 'xx' in machine instructions like

mov eax,'0123' ; load eax with 30313233h

then MASM must produce the equivalent of

DW 3132h,0000h

which is the same as

DB 32h, 31h, 00h, 00h

====

Unicode should produce code equivalent to:

DB 31h, 0, 32h, 0, 0, 0
Posted on 2001-08-27 14:38:28 by tank
Of course you right! My mistake!
In reality i use macro:
;------------------------------------------------
WSTRING macro name,_STRING_
Local k
k = 0
ifnb <name>
name label WORD
endif
_ESC_ = 0
forc _CHAR_,<_STRING_>
if _ESC_
_ESC_ = 0
if "&_CHAR_" eq "/"
WORD "/"
k = k+1
elseif "&_CHAR_" eq "n"
WORD 0Dh, 0Ah
k = k+2
elseif "&_CHAR_" eq "t"
WORD 09h
k = k+1
elseif "&_CHAR_" eq ":"
WORD "!"
k = k+1
elseif "&_CHAR_" eq "-"
WORD "'"
k = k+1
elseif "&_CHAR_" eq "="
WORD '"'
k = k+1
elseif "&_CHAR_" eq "|"
WORD "\"
k = k+1
elseif "&_CHAR_" eq "#"
WORD "%"
k = k+1
elseif "&_CHAR_" eq "+"
WORD "&"
k = k+1
elseif "&_CHAR_" eq "("
WORD "<"
k = k+1
elseif "&_CHAR_" eq ")"
WORD ">"
k = k+1
elseif "&_CHAR_" eq "0"
WORD 0
k = k+1
elseif "&_CHAR_" eq "1"
WORD 1
k = k+1
else
WORD "/", "&_CHAR_"
k = k+2
endif ;if "&_CHAR_"
else ;if _ESC_
if "&_CHAR_" eq "/"
_ESC_ = 1
else
_ESC_ = 0
if "&_CHAR_" ne "'"
if "&_CHAR_" ge 80h
WORD "&_CHAR_"+400h-176
else
WORD "&_CHAR_"
endif
k = k+1
endif
endif
endif ;if _ESC_
endm ;forc _CHAR_,<_STRING_>
ifnb <name>
sizeof_&name EQU 2*k
endif
endm
It generates unicode strings and in program i write:
WSTRING regpath,'SOFTWARE\KEY1/0'
--------------------------
All unicode Reg*ExW functions with second parameter
LPCTSTR subKey return error 998 if this par not null!
But functions Reg*ExA works fine!
Posted on 2001-08-28 10:05:04 by Alexey