News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

May be Win32API project that improves windows.inc

Started by Rockphorr, January 09, 2024, 04:50:38 AM

Previous topic - Next topic

Rockphorr

Hi.
I think may be improve windows.inc
I put my idea in attach.
I separate constants and structures in includes according with dlls.
The project is at start point.
What do you think ?

Vortex

Hi Rockphorr,

Not to discourage you but maintaining such a project is a huge job. The original Windows SDK has a lot of complicated include files. Are working on a tool capable of converting the SDK header files?

Rockphorr

Quote from: Vortex on January 09, 2024, 05:20:32 AMHi Rockphorr,

Not to discourage you but maintaining such a project is a huge job. The original Windows SDK has a lot of complicated include files. Are working on a tool capable of converting the SDK header files?

Hi Vortex !!!
Now win32api is legacy. Actual is win64api. I add euqs and structs to my win32dll.incs as soon as i use them in my projects. It is just for a fun and a convenience.
Usually there are so many includes in source files. With win32dll.inc we have to add incs of used dlls only. It is just a idea.

jj2007

Quote from: Rockphorr on January 09, 2024, 06:44:40 AMNow win32api is legacy. Actual is win64api.

Yes and no: you can design include files so that they work for both 32- and 64-bit code.

; determine size of a pointer (handle, ...):
if arch eq w64
    SIZE_P equ QWORD
else
    SIZE_P equ DWORD
endif

SECURITY_DESCRIPTOR STRUCT
  Revision  BYTE      ?
  Sbz1      BYTE      ?
  Control   WORD      ?
  Owner     SIZE_P      ?
  lGroup    SIZE_P      ?
  Sacl      SIZE_P      ?
  Dacl      SIZE_P      ?
SECURITY_DESCRIPTOR ENDS

EXCEPTION_RECORD STRUCT
  ExceptionCode         DWORD      ?
  ExceptionFlags        DWORD      ?
  pExceptionRecord      SIZE_P      ?
  ExceptionAddress      SIZE_P      ?
  NumberParameters      DWORD      ?
  ExceptionInformation  SIZE_P EXCEPTION_MAXIMUM_PARAMETERS dup(?)
EXCEPTION_RECORD ENDS

EXCEPTION_DEBUG_INFO STRUCT
  pExceptionRecord  EXCEPTION_RECORD <?,?,?,?,?,EXCEPTION_MAXIMUM_PARAMETERS dup(?)>
  dwFirstChance     DWORD      ?
EXCEPTION_DEBUG_INFO ENDS

CREATE_THREAD_DEBUG_INFO STRUCT
  hThread               SIZE_P      ?
  lpThreadLocalBase     SIZE_P      ?
  lpStartAddress        SIZE_P      ?
CREATE_THREAD_DEBUG_INFO ENDS

CREATE_PROCESS_DEBUG_INFO STRUCT
  hFile                 SIZE_P      ?
  hProcess              SIZE_P      ?
  hThread               SIZE_P      ?
  lpBaseOfImage         SIZE_P      ?
  dwDebugInfoFileOffset DWORD      ?
  nDebugInfoSize        DWORD      ?
  lpThreadLocalBase     SIZE_P      ?
  lpStartAddress        SIZE_P      ?
  lpImageName           SIZE_P      ?
  fUnicode              WORD      ?
CREATE_PROCESS_DEBUG_INFO ENDS

Rockphorr

 Hi, jj2007 !!!
Quote from: jj2007 on January 09, 2024, 08:35:01 AM
Quote from: Rockphorr on January 09, 2024, 06:44:40 AMNow win32api is legacy. Actual is win64api.

Yes and no: you can design include files so that they work for both 32- and 64-bit code.

; determine size of a pointer (handle, ...):
if arch eq w64
    SIZE_P equ QWORD
else
    SIZE_P equ DWORD
endif

SECURITY_DESCRIPTOR STRUCT
  Revision  BYTE      ?
  Sbz1      BYTE      ?
  Control   WORD      ?
  Owner     SIZE_P      ?
  lGroup    SIZE_P      ?
  Sacl      SIZE_P      ?
  Dacl      SIZE_P      ?
SECURITY_DESCRIPTOR ENDS

EXCEPTION_RECORD STRUCT
  ExceptionCode         DWORD      ?
  ExceptionFlags        DWORD      ?
  pExceptionRecord      SIZE_P      ?
  ExceptionAddress      SIZE_P      ?
  NumberParameters      DWORD      ?
  ExceptionInformation  SIZE_P EXCEPTION_MAXIMUM_PARAMETERS dup(?)
EXCEPTION_RECORD ENDS

EXCEPTION_DEBUG_INFO STRUCT
  pExceptionRecord  EXCEPTION_RECORD <?,?,?,?,?,EXCEPTION_MAXIMUM_PARAMETERS dup(?)>
  dwFirstChance     DWORD      ?
EXCEPTION_DEBUG_INFO ENDS

CREATE_THREAD_DEBUG_INFO STRUCT
  hThread               SIZE_P      ?
  lpThreadLocalBase     SIZE_P      ?
  lpStartAddress        SIZE_P      ?
CREATE_THREAD_DEBUG_INFO ENDS

CREATE_PROCESS_DEBUG_INFO STRUCT
  hFile                 SIZE_P      ?
  hProcess              SIZE_P      ?
  hThread               SIZE_P      ?
  lpBaseOfImage         SIZE_P      ?
  dwDebugInfoFileOffset DWORD      ?
  nDebugInfoSize        DWORD      ?
  lpThreadLocalBase     SIZE_P      ?
  lpStartAddress        SIZE_P      ?
  lpImageName           SIZE_P      ?
  fUnicode              WORD      ?
CREATE_PROCESS_DEBUG_INFO ENDS


Yes, you are right - we can do so. But this is the particular project for this win32 paticular forum thread . :D