Author Topic: WinExtra bad constants, e.g. APPLICATION_ERROR_MASKorERROR_SEVERITY_ERRORor0x100  (Read 6612 times)

jj2007

  • Member
  • *****
  • Posts: 13932
  • Assembly is fun ;-)
    • MasmBasic
I'm pretty sure the topic was raised already, but I can't find the thread... so here it is again:
line 921, WinExtra.inc:
ERROR_EXPECTED_SECTION_NAME      equ APPLICATION_ERROR_MASKorERROR_SEVERITY_ERRORor0

There are 93 of them. For those who need these exotic constants, the attached proggie creates an extra include file, to be used e.g. as

Code: [Select]
include \Masm32\include\WinExtraOrX.txt
inkey str$(ERROR_AUTHENTICODE_TRUST_NOT_ESTABLISHED)

jj2007

  • Member
  • *****
  • Posts: 13932
  • Assembly is fun ;-)
    • MasmBasic
Windows.inc:
Code: [Select]
MCI_ANIM_WINDOW_PARMS STRUCT
  dwCallback    DWORD      ?
  hwnd          DWORD      ?
  nCmdShow      DWORD      ?
  lpstrText     DWORD      ?
MCI_ANIM_WINDOW_PARMS ENDS

MS VC MMSystem.h:
Code: [Select]
typedef struct tagMCI_ANIM_WINDOW_PARMS {
    DWORD   dwCallback;
    HWND    hWnd;
    WORD    wReserved1;
    WORD    nCmdShow;
    WORD    wReserved2;
    LPCSTR  lpstrText;
} MCI_ANIM_WINDOW_PARMS

The VC version looks awkward ::)

Another problem:
Windows.inc:
Code: [Select]
PSINJECTDATA STRUCT
  DataBytes       DWORD ?
  InjectionPoint  DWORD ?
  Flags           DWORD ?
  Reserved        DWORD ?
PSINJECTDATA ENDS

MS VC:
Code: [Select]
  typedef struct _PSINJECTDATA {
    DWORD DataBytes;
    WORD  InjectionPoint;
    WORD  PageNumber;
  } PSINJECTDATA, *PPSINJECTDATA;

Finally,
Windows.inc:
Code: [Select]
LOADED_IMAGE STRUCT
    ModuleName                      DWORD   ?
    hFile                           DWORD   ?
    MappedAddress                   DWORD   ?
    FileHeader                      DWORD   ?
    LastRvaSection                  DWORD   ?
    NumberOfSections                DWORD   ?
    Sections                        DWORD   ?
    Characteristics                 DWORD   ?
    fSystemImage                    BYTE    ?
    fDOSImage                       BYTE    ?
    Links                           DWORD   ?
    SizeOfImage                     DWORD   ?
LOADED_IMAGE ENDS

MS VC ImageHlp.h:
Code: [Select]
typedef struct _LOADED_IMAGE {
    PSTR                  ModuleName;
    HANDLE                hFile;
    PUCHAR                MappedAddress;
#ifdef _IMAGEHLP64
    PIMAGE_NT_HEADERS64   FileHeader;
#else
    PIMAGE_NT_HEADERS32   FileHeader;
#endif
    PIMAGE_SECTION_HEADER LastRvaSection;
    ULONG                 NumberOfSections;
    PIMAGE_SECTION_HEADER Sections;
    ULONG                 Characteristics;
    BOOLEAN               fSystemImage;
    BOOLEAN               fDOSImage;
    BOOLEAN               fReadOnly;
    UCHAR                 Version;
    LIST_ENTRY            Links;
    ULONG                 SizeOfImage;
} LOADED_IMAGE, *PLOADED_IMAGE;

LIST_ENTRY is two DWORDs.

TWell

  • Member
  • ****
  • Posts: 743
The VC version looks awkward ::)
WSDK 7.1 and WDDK 7600
Code: [Select]
typedef struct tagMCI_ANIM_WINDOW_PARMSA {
    DWORD_PTR   dwCallback;
    HWND        hWnd;
    UINT        nCmdShow;
    LPCSTR     lpstrText;
} MCI_ANIM_WINDOW_PARMSA, *PMCI_ANIM_WINDOW_PARMSA, * LPMCI_ANIM_WINDOW_PARMSA;
typedef struct tagMCI_ANIM_WINDOW_PARMSW {
    DWORD_PTR   dwCallback;
    HWND        hWnd;
    UINT        nCmdShow;
    LPCWSTR    lpstrText;
} MCI_ANIM_WINDOW_PARMSW, *PMCI_ANIM_WINDOW_PARMSW, * LPMCI_ANIM_WINDOW_PARMSW;
Code: [Select]
MCI_ANIM_WINDOW_PARMS 16 10h bytes
dwCallback +0h
hWnd       +4h
nCmdShow   +8h
lpstrText  +Ch