Help translating the header files .h

Started by ToutEnMasm, June 25, 2005, 06:55:28 AM

Previous topic - Next topic

ToutEnMasm

Hello,
I'm writing a translator for the header files .H.
I have made a list of the constants that must be translated


#define SP_SERIALCOMM    ((DWORD)0x00000001)
#define PIPE_ACCESS_INBOUND         0x00000001
#define GHND    (GMEM_MOVEABLE | GMEM_ZEROINIT) ; | = +
#define FS_CASE_IS_PRESERVED            FILE_CASE_PRESERVED_NAMES
#define RESTORE_LAST_ERROR_NAME   TEXT("RestoreLastError")   ;="RestoreLastError"
#define TBN_FIRST               (0U-700U) ;= 0 -700
#define REBARCLASSNAMEW         L"ReBarWindow32"     ;unicode
#define REBARCLASSNAMEA         "ReBarWindow32"         
#define RBN_AUTOBREAK       (RBN_FIRST - 22)


I have don't find the binary form like 01101b
If you see others types of constants,write it so i could translate it.

The translation have for goal,the constants,structures,unions,registry keys and interface.
If you see useful informations,write it
             
                                     ToutEnMasm




hutch--

There are some things I should not do at 2am but this is how I would convert the equates posted.


SP_SERIALCOMM       equ <00000001h>
PIPE_ACCESS_INBOUND equ <00000001h>
GHND                equ  <GMEM_MOVEABLE or GMEM_ZEROINIT>
FS_CASE_IS_PRESERVED equ <FILE_CASE_PRESERVED_NAMES>
RESTORE_LAST_ERROR_NAME equ <"RestoreLastError">
TBN_FIRST           equ <0-700>
REBARCLASSNAMEW     equ <"ReBarWindow32">
REBARCLASSNAMEA     equ <"ReBarWindow32">
RBN_AUTOBREAK       equ <RBN_FIRST - 22>


You will reduce the amount of grief with C++ header file with structures by using a C compiler with redirected output as it is a lot cleaner in the result and a lot easier to convert to MASM format.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

ToutEnMasm

Hello,
You aren't so tired.I test them,and it's work.That will be made
I forget to say that i have translated all of the conditionnal assembly,it's my recent post about the subject.
For structures , i have only the vctoolkit,but i think that I have identify all the possible forms.
Examples follow
                                      ToutEnMasm

typedef struct _COMSTAT {     
    DWORD fCtsHold : 1;
    DWORD fDsrHold : 1;
//////////////////////////// RECORD that will be named
    DWORD fReserved : 25;
    DWORD cbInQue;
    DWORD cbOutQue;
} COMSTAT, *LPCOMSTAT;

typedef struct _SYSTEMTIME {   // the name is at the end
   WORD wYear;
   WORD wMonth;
   WORD wDayOfWeek;
   WORD wDay;
   WORD wHour;
   WORD wMinute;
   WORD wSecond;
   WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;

struct PARAFORMAT2 : _paraformat  // the name is at the beginning
{
   LONG   dySpaceBefore;  // Vertical spacing before para
   LONG   dySpaceAfter;  // Vertical spacing after para
   LONG   dyLineSpacing; // Line spacing depending on Rule
/////////////////////////////////////////////////////////////////////////////////////
   WORD   wBorderWidth;// Pen widths (nbl/bdr in half pts)
   WORD   wBorders;   // Border styles (nibble/border)   
};      

and the sample
   typedef struct _SYSTEM_INFO {
      union {
      DWORD dwOemId;          // Obsolete field...do not use
      struct {
         WORD wProcessorArchitecture;
         WORD wReserved;
      };
      };
      DWORD dwPageSize;
      LPVOID lpMinimumApplicationAddress;
      LPVOID lpMaximumApplicationAddress;
      DWORD_PTR dwActiveProcessorMask;
      DWORD dwNumberOfProcessors;
      DWORD dwProcessorType;
      DWORD dwAllocationGranularity;
      WORD wProcessorLevel;
      WORD wProcessorRevision;
      } SYSTEM_INFO, *LPSYSTEM_INFO;
           Translating


    SYSTEM_INFO  STRUCT
      union
      dwOemId DWORD   ?  ;Obsolete field...do not use
      struct
      wProcessorArchitecture WORD ?
      wReserved WORD ?
      ENDS
      ENDS            
      dwPageSize  DWORD ?
                   lpMinimumApplicationAddress DWORD ?
      lpMaximumApplicationAddress DWORD ?
      dwActiveProcessorMask DWORD ?
      dwNumberOfProcessors DWORD ?
      dwProcessorType DWORD ?
      dwAllocationGranularity DWORD ?
      wProcessorLevel WORD ?
      wProcessorRevision WORD ?
    SYSTEM_INFO     ENDS