Microsoft 64 bit MASM > MASM64 SDK

Important change for win64.inc

(1/1)

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 :


--- Code: ---patch-win64-inc.sh
--- End code ---


--- Code: ---dos2unix win64.inc
patch win64.inc win64.inc.patch
unix2dos win64.inc

--- End code ---

Applying the patch with busybox64 :

https://frippery.org/busybox/

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


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

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


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

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

bluedevil:
Thanks for the warning hutch, I have updated mine.

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

Regards

jj2007:
Another simple patcher (executable attached):


--- Code: ---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
--- End code ---

You can use fc to compare the files:

--- Code: ---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 ?
*****
--- End code ---

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:

Navigation

[0] Message Index

Go to full version