News:

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

[FIXED] MASM v9 problems

Started by Cobra, July 27, 2008, 02:46:13 PM

Previous topic - Next topic

Cobra

I have MASM v9.00.21022.08 and whenever I try to assemble any file that includes windows.inc, it pops up this error:

windows.inc(17583) : error A2138:invalid data initializer


ImportRec RECORD Reserved : 11,NameType : 3,Type2 : 2

IMPORT_OBJECT_HEADER STRUCT
    Sig1 dw     ?
    Sig2 dw     ?
    Version dw  ?
    Machine dw  ?
    TimeDateStamp dd ?
    SizeOfData dd   ?
    union
        Ordinal dw  ?
        Hint dw     ?
    ends
    rImport ImportRec <>          ; <--- this is the problem line
IMPORT_OBJECT_HEADER ENDS


It assembles fine with MASM 6.15.  Any clues?

Thanks!

Tedd

No snowflake in an avalanche feels responsible.

Cobra

Quote from: Tedd on July 27, 2008, 03:03:16 PM
Try:
rImport ImportRec {}


Same issue. <?> appears not to work as well. MASM v8 also has this problem.

hutch--

It appears that they have broken the RECORD notation again, I changed the format in recent windows.inc version so it was compatible withe version 8.0 but it appears something has changed again. It may be time to remove the RECORD satements from the complete file and keep them in another so its easier to fix.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Cobra

Ok, it's really something stupid that causes the error. It's a simple fix.

Here's the original:

ImportRec RECORD Reserved : 11,NameType : 3,Type2 : 2

IMPORT_OBJECT_HEADER STRUCT
    Sig1 dw     ?
    Sig2 dw     ?
    Version dw  ?
    Machine dw  ?
    TimeDateStamp dd ?
    SizeOfData dd   ?
    union
        Ordinal dw  ?
        Hint dw     ?
    ends
    rImport ImportRec <>         
IMPORT_OBJECT_HEADER ENDS


Here's the fixed version:

ImportRec RECORD Reserved:11,NameType:3,Type2:2

IMPORT_OBJECT_HEADER STRUCT
    Sig1 WORD     ?
    Sig2 WORD     ?
    Version WORD  ?
    Machine WORD  ?
    TimeDateStamp DWORD ?
    SizeOfData DWORD   ?
    union
        Ordinal WORD  ?
        Hint WORD     ?
    ends
    rImport ImportRec <>
IMPORT_OBJECT_HEADER ENDS


I find it strange that it's the exact same thing but v9.00.21022.08 treats it differently. It works with v7 and v8 also.

I hope this helps those like myself that didn't know this.  :thumbu