Voici un dump de LoadParams
; Avant
;0x000000013FBE481A 00000000 ffffffff 00000000 00200000 00000004 000000ff 00000100 00000100 00000000 00010000 00480000 00000000 00000000 00000000 00000000
;0x000000013FBE4856 00000000 00000000 00000000 00000100 3f19999a 3f4ccccd 3f800000 3f800000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
;0x000000013FBE4892 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
;0x000000013FBE48CE 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
;0x000000013FBE490A 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
; Après
;0x000000013F18481A 00000001 ffffffff 00000000 02000000 00000004 000000ff 00000100 00000100 00000000 00010000 00480000 00000000 00000000 00000000 00000000
;0x000000013F184856 00000000 00000000 00000000 00000100 3f19999a 3f4ccccd 3f800000 3f800000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
;0x000000013F184892 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
;0x000000013F1848CE 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
;0x000000013F18490A 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
J'ai refait l'interface pour l'assembleur ML64.
Lorsque j'appelle LoadParams, je passe un buffer de 1024 octets tout à 0, pour éviter tout problème d'alignement de structure.
Voici mon code source
Code: Select all
mage_LoadFromFile PROC __lpszFileName:LPSTR,__lpImage:LPGFL_PICTURE
LOCAL _gflParams:GFL_LOAD_PARAMS
LOCAL _FileInfo:GFL_FILE_INFORMATION
LOCAL _gflBitmap:LPGFL_BITMAP
LOCAL _lpgflParams:LPGFL_LOAD_PARAMS
LOCAL _lpFileInfo:LPGFL_FILE_INFORMATION
mov __lpszFileName,rcx
mov __lpImage,rdx
sub rsp,32
lea rcx,T1 ;_gflParams
lea rdx,_FileInfo
mov _lpgflParams,rcx
mov _lpFileInfo,rdx
call gflGetDefaultLoadParams
mov rax,_lpgflParams
or (GFL_LOAD_PARAMS Ptr [rax]).Flags,GFL_LOAD_SKIP_ALPHA
mov (GFL_LOAD_PARAMS Ptr [rax]).Origin,GFL_TOP_LEFT
mov (GFL_LOAD_PARAMS Ptr [rax]).ColorModel,GFL_ARGB
mov (GFL_LOAD_PARAMS Ptr [rax]).DefaultAlpha,255
mov (GFL_LOAD_PARAMS Ptr [rax]).LinePadding,4
mov rcx,__lpszFileName
lea rdx,_gflBitmap
mov r8,_lpgflParams
mov r9,_lpFileInfo
call gflLoadBitmap
add rsp,32
ret
Image_LoadFromFile ENDP