News:

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

Main Menu

Important change for win64.inc

Started by hutch--, October 25, 2022, 03:12:01 PM

Previous topic - Next topic

hutch--

There was an error in Vasily's include file that I did not catch, the "message" member of the "MSG" struct was set to DWORD but it worked in most instances because of the structure alignment. The correct size is QWORD. Change this in your own copy of win64.inc. The next release will have it set correctly.

MSG STRUCT STRUCT_ALIGN
   hwnd  HWND ?
   message QWORD ?
   wParam  WPARAM ?
   lParam  LPARAM ?
   time  DWORD ?
   pt  POINT<>
MSG ENDS


Vortex

Hello,

Here is a patch file to update the win64.inc include file :

patch-win64-inc.sh

dos2unix win64.inc
patch win64.inc win64.inc.patch
unix2dos win64.inc


Applying the patch with busybox64 :

https://frippery.org/busybox/

https://frippery.org/files/busybox/busybox64.exe

G:\masm64\include64>busybox64.exe sh patch-win64-inc.sh
patching file win64.inc


Assuming that 0win64.inc is a copy of the original file win64.inc :

G:\masm64\include64>fc 0win64.inc win64.inc

***** 0win64.inc
   hwnd  HWND ?
   message DWORD ?
   wParam  WPARAM ?
***** WIN64.INC
   hwnd  HWND ?
   message QWORD ?
   wParam  WPARAM ?
*****


bluedevil

Thanks for the warning hutch, I have updated mine.

I hope you also consider my post here before releasing the new SDK.

Regards
..Dreams make the future
But the past never lies..
BlueDeviL // SCT
My Code Site:
BlueDeviL Github

jj2007

Another simple patcher (executable attached):

include \masm32\MasmBasic\MasmBasic.inc
  Init
  Let edi="\Masm64\include64\win64.inc"
  Let esi=FileRead$(edi)
  .if Instr_(esi, "MSG STRUCT")
.if Instr_(eax, "message DWORD") && edx<99
mov byte ptr [eax+8], "Q"
Rename edi, Replace$(edi, ".inc", ".old")
FileWrite edi, esi
MsgBox 0, "Successfully patched", "Hi", MB_OK
.endif
  .endif
EndOfCode


You can use fc to compare the files:
C:\Masm64\include64>fc win64.inc win64.old
Confronto in corso dei file win64.inc e WIN64.OLD
***** win64.inc
   hwnd  HWND ?
   message QWORD ?
   wParam  WPARAM ?
***** WIN64.OLD
   hwnd  HWND ?
   message DWORD ?
   wParam  WPARAM ?
*****

hutch--

 :biggrin:

If I was going to make a patch, I would do it in BASIC but as I am fundamentally lazy, I would just change the structure member to the correct size.  :tongue: