News:

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

WINDOWS.INC version 1.4 release.

Started by hutch--, July 28, 2007, 01:27:09 AM

Previous topic - Next topic

Adamanteus

I have a small remark about the union in structure in :

D:\MASM\INCLUDE\winextra.inc(3312) : error A2008:syntax error : tab

hutch--

Give me the name of the structure as the original file has been modified since the version you are using was released.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Adamanteus

 Here's :

NOTIFICATION STRUCT
    ...
    union info
        ...
        tab TABLE_NOTIFICATION <>

hutch--

The problem is that "tab" is not a reserve word in MASM 6.14. Are you using a later version ? I just tested it with ML.EXE version 8.0 and its still not a problem.

Here is the test piece.


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    .data?
      value dd ?

    .data
      tab dd 0

    .code

start:
   
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    call main

    exit

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

main proc

    mov eax, OFFSET tab
    ret

main endp

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

end start


This is the structure in the windows.inc extra file.


NOTIFICATION STRUCT
    ulEventType dd ?
    ulAlignPad dd ?
    union info
        err ERROR_NOTIFICATION <>
        newmail NEWMAIL_NOTIFICATION <>
        obj OBJECT_NOTIFICATION <>
        tab TABLE_NOTIFICATION <>
        ext EXTENDED_NOTIFICATION <>
        statobj STATUS_OBJECT_NOTIFICATION <>
    ends
NOTIFICATION ENDS
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Adamanteus

#19
It is equate :

ht            equ           09H ; ^I
tab           equ           09h ; ^I tabulation
lf            equ           0AH ; ^J

hutch--

It is not an equate in any win32 system and that equate is not in the windows.inc or extra file.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Adamanteus

This equate could be in any program, because to often used name, when that's overlading by one field in union of system include file it's nou useful.

MichaelW

The names match the names from the Microsoft structure definitions in MAPIDefS.h and WabDefs.h:

typedef struct _NOTIFICATION
{
  ULONG ulEventType;    /* notification type, i.e. fnevSomething */
  ULONG ulAlignPad;     /* Force to 8-byte boundary */
  union
  {
    ERROR_NOTIFICATION          err;
    NEWMAIL_NOTIFICATION        newmail;
    OBJECT_NOTIFICATION         obj;
    TABLE_NOTIFICATION          tab;
    EXTENDED_NOTIFICATION       ext;
    STATUS_OBJECT_NOTIFICATION  statobj;
  } info;
} NOTIFICATION, FAR * LPNOTIFICATION;

eschew obfuscation

hutch--

Keeping include files as close to documented naming conventions is simply more important than private equates in a single application. Reporting this as an error is simply mistaken, the error is in your own application for duplicating the name with an equate instead of using a naming scheme that is compatible with the documented structure scheme names.

It has managed to waste a reasonable amount of time debugging your application when I have a workload with this project that rivals writing Encyclopaedia Brittanica so please keep error reporting to documented problems allowing that MASM deviated in some reserve word names.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Adamanteus

Is it not mistake in assembler that equate intersect with union fields. Especially if to use h2inc versions of include files iI think, t's need to discard.- EQU it's not TEXTEQU and nowhow link to fields.

MichaelW

The DLGTEMPLATE structure in windows.inc is incorrectly declared:

DLGTEMPLATE STRUCT DWORD
  style             DWORD     ?
  dwExtendedStyle   DWORD     ?
  cdit              WORD      ?
  x                 WORD      ?
  y                 WORD      ?
  lx                WORD      ?
  ly                WORD      ?
DLGTEMPLATE ENDS


The DWORD alignment is forcing the length to 20 bytes by adding two zero bytes at the end, to meet the requirement that the size be a multiple of the alignment. The length should be 18, as verified with this code:

#include <windows.h>
int main(void)
{
    printf("%d\n",sizeof(DLGTEMPLATE));
    getch();
    return 0;
}

eschew obfuscation

hutch--

Gratsie,

Its fixed in the reference build version and will be available with the next beta or release.

I think it was one of Iczelion's leftovers, I have never DWORD aligned a win32 structure.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php