I really hope I don't get flamed for this since this is my second topic, and it is my second topic of asking for help without giving.

Here is a snippet of my code that isn't working, no errors, so once again a fundamental I'm probably missing.

bArray DB "c0,f5,b9,6b,b1,d6,e7,63,dc,f2,c2,bb,95,e7,ef,d1,49,a0,32,e6,26,dc,d9,e5,6d,5a,7d,b8,b4,34,5e,5b,00",0


.else
invoke RegSetValueEx,[hRegKey], OFFSET szValueName, 0, REG_BINARY, OFFSET bArray, sizeof bArray
.if (eax!=ERROR_SUCCESS)
invoke MessageBox,NULL,ADDR MsgBoxTextReg, ADDR MsgBoxCaption, MB_OK
.endif
invoke RegCloseKey, [hRegKey]
.endif
Posted on 2004-11-07 17:38:52 by Nilrem2
i have never actually used RegSetValueEx... but your problem might be result of using a string as REG_BINARY type. (db "c0,f5,b9,6b,b1 ..." instead of db 0c0h,0f5h,0b9h,06bh,0b1h...)
Posted on 2004-11-07 18:22:33 by arafel
Thankyou Arafel. 8-)
Posted on 2004-11-08 04:54:30 by Nilrem2
A new problem, how can I get past this? It says the statement is too complex:

fRegistrationTosaup DB 0d4h,0fdh,022h,0cbh,08fh,0ceh,0d1h,0fah,0dfh,085h,060h,0e2h,0e3h,0f5h,083h,0abh,0f7h,083h,054h,0bch,025h,06dh,04ah,0cfh,0e6h,0d3h,080h,0a5h,0feh,01dh,063h,0dch,099h,047h,0a5h,09bh,08ch,040h,086h,0c4h,0aeh,093h,0aeh,08eh,0d9h,0c0h,0ffh,086h,09fh,062h,0e0h,0c8h,0cdh,0e8h,0cch,0c2h,087h,0c0h,0dbh,0c4h,0c7h,0dah,036h,000h

It is for the use of RegSetValueEx.
Thankyou.
Posted on 2004-11-08 09:01:04 by Nilrem2
MASM limits number of operands that can be separated by commas to 48. So you'll need to split the data array to smaller parts.
Posted on 2004-11-08 09:31:25 by arafel


fRegistrationTosaup DB 0d4h, 0fdh, 022h, 0cbh, 08fh, 0ceh, 0d1h, 0fah
DB 0dfh, 085h, 060h, 0e2h, 0e3h, 0f5h, 083h, 0abh
DB 0f7h, 083h, 054h, 0bch, 025h, 06dh, 04ah, 0cfh
DB 0e6h, 0d3h, 080h, 0a5h, 0feh, 01dh, 063h, 0dch
DB 099h, 047h, 0a5h, 09bh, 08ch, 040h, 086h, 0c4h
DB 0aeh, 093h, 0aeh, 08eh, 0d9h, 0c0h, 0ffh, 086h
DB 09fh, 062h, 0e0h, 0c8h, 0cdh, 0e8h, 0cch, 0c2h
DB 087h, 0c0h, 0dbh, 0c4h, 0c7h, 0dah, 036h, 000h

The name is only a pointer to a part of the data. As you don't need to reference the middle of the data, you can not give it a name like this and MASM will still assemble it.

Mirno
Posted on 2004-11-08 09:49:02 by Mirno
Thankyou Mirno, that worked perfectly. 8-)
Posted on 2004-11-08 16:19:35 by Nilrem2
Ok, so it didn't work so perfectly. It only writes the first line of DB, not the rest of them. Why?
Posted on 2004-11-08 17:36:34 by Nilrem2
Because you are probably using 'sizeof fRegistrationTosaup' which gets size of the first line only.

fRegistrationTosaup DB 0d4h, 0fdh, 022h, 0cbh, 08fh, 0ceh, 0d1h, 0fah 

DB 0dfh, 085h, 060h, 0e2h, 0e3h, 0f5h, 083h, 0abh
DB 0f7h, 083h, 054h, 0bch, 025h, 06dh, 04ah, 0cfh
DB 0e6h, 0d3h, 080h, 0a5h, 0feh, 01dh, 063h, 0dch
DB 099h, 047h, 0a5h, 09bh, 08ch, 040h, 086h, 0c4h
DB 0aeh, 093h, 0aeh, 08eh, 0d9h, 0c0h, 0ffh, 086h
DB 09fh, 062h, 0e0h, 0c8h, 0cdh, 0e8h, 0cch, 0c2h
DB 087h, 0c0h, 0dbh, 0c4h, 0c7h, 0dah, 036h, 000h
regsize equ $-fRegistrationTosaup

should solve this.
Posted on 2004-11-08 18:31:13 by arafel
Thankyou.
Posted on 2004-11-09 04:48:59 by Nilrem2