synopse / mORMot

Synopse mORMot 1 ORM/SOA/MVC framework - Please upgrade to mORMot 2 !
https://synopse.info
785 stars 323 forks source link

Declaration of "ConvertToEmfPlus" is not 64 bit safe #433

Closed kalwados closed 1 year ago

kalwados commented 1 year ago

SysGdiPlus.pas; line 628ff:

fConvertToEmfPlus: function(graphics, image: THandle; var flag: BOOL; emftype: TEmfType; description: PWideChar; var out_metafile: integer): TGdipStatus; stdcall;

The out_metafile type must be THandle (or NativeUInt) to be 64 bit save. The current declaration leads to access violations in 64 bit applications. Also the declarion for "EmfPlusImg" in function TGDIPlusFull.ConvertToEmfPlus must be changed to THandle.

synopse commented 1 year ago

Thanks for the report. Should be fixed now.

Note that mORMot 2 unit was already correct. See https://github.com/synopse/mORMot2/blob/master/src/lib/mormot.lib.gdiplus.pas#L533 If you can, consider switching to mORMot 2 for a better code stability and support.