News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

struct with pre-initialized values crashes

Started by usingMasm, August 16, 2010, 02:34:42 PM

Previous topic - Next topic

usingMasm

Quote from: jj2007 on August 16, 2010, 06:57:06 PM
It works without the UNION. Apparently M$ had that problem earlier and didn't fix it properly:
FIX: A2138, A2036 or Hang, Init Nested Structure Array

We may have never noticed this bug because most members don't use initialised structures.

the fix has apparently not fixed it. I am using the latest masm. and the struct doesn't have any dup operator. it seems 13 is as many members as can be initialized.

usingMasm

it is worse than that. declaring "shellinfo SHELLEXECUTEINFO <>" in .data section and filling the members with code assembles but causes system crash. seems it is accessing some forbidden memory sections. only .data? section works.

jj2007

Quote from: usingMasm on August 16, 2010, 07:08:33 PM
Quote from: jj2007 on August 16, 2010, 06:57:06 PM
It works without the UNION. Apparently M$ had that problem earlier and didn't fix it properly:
FIX: A2138, A2036 or Hang, Init Nested Structure Array

We may have never noticed this bug because most members don't use initialised structures.

the fix has apparently not fixed it. I am using the latest masm. and the struct doesn't have any dup operator. it seems 13 is as many members as can be initialized.

It works perfectly with 15 members if you redefine the structure without the UNION. Tested with ml 6.15, 9.0 and JWasm.

usingMasm

Quote from: jj2007 on August 16, 2010, 07:45:45 PM
Quote from: usingMasm on August 16, 2010, 07:08:33 PM
Quote from: jj2007 on August 16, 2010, 06:57:06 PM
It works without the UNION. Apparently M$ had that problem earlier and didn't fix it properly:
FIX: A2138, A2036 or Hang, Init Nested Structure Array

We may have never noticed this bug because most members don't use initialised structures.

the fix has apparently not fixed it. I am using the latest masm. and the struct doesn't have any dup operator. it seems 13 is as many members as can be initialized.

It works perfectly with 15 members if you redefine the structure without the UNION. Tested with ml 6.15, 9.0 and JWasm.

it assembles but ShellExecuteEx returns access denied.

drizz

Quote from: jj2007 on August 16, 2010, 06:57:06 PMmost members don't use initialised structures.
Speak for yourself please  :snooty:

unions are initialized the same way as structures, see here (jj take notes  :wink):
http://www.masm32.com/board/index.php?topic=10272.msg75289#msg75289

shellinfo SHELLEXECUTEINFO <60,SEE_MASK_NOCLOSEPROCESS,0,0,firefox,url,0,SW_MAXIMIZE,0,0,0,0,0,<0>,0>

Quote from: usingMasm on August 16, 2010, 09:07:39 PMit assembles but ShellExecuteEx returns access denied.
And you tried running it as an Administrator?
The truth cannot be learned ... it can only be recognized.

usingMasm

Quote from: drizz on August 16, 2010, 09:52:55 PM
Quote from: jj2007 on August 16, 2010, 06:57:06 PMmost members don't use initialised structures.
Speak for yourself please  :snooty:

unions are initialized the same way as structures, see here (jj take notes  :wink):
http://www.masm32.com/board/index.php?topic=10272.msg75289#msg75289

shellinfo SHELLEXECUTEINFO <60,SEE_MASK_NOCLOSEPROCESS,0,0,firefox,url,0,SW_MAXIMIZE,0,0,0,0,0,<0>,0>

Quote from: usingMasm on August 16, 2010, 09:07:39 PMit assembles but ShellExecuteEx returns access denied.
And you tried running it as an Administrator?


Thanks a lot.
shellinfo SHELLEXECUTEINFO <60,SEE_MASK_NOCLOSEPROCESS,0,0,firefox,url,0,SW_MAXIMIZE,0,0,0,0,0,<0>,0>

works perfect.


dedndave

very cool Drizz - thanks for the help
i will take notes also   :P