FsGetPreviewBitmap is not being called

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

User avatar
D1P
Senior Member
Senior Member
Posts: 233
Joined: 2005-02-28, 18:29 UTC
Location: Moscow
Contact:

Post by *D1P »

I did some experiments. When i change function definition in wfx from

Code: Select all

function FsGetPreviewBitmap(RemoteName:pchar;width,height:integer; var ReturnedBitmap:HBitmap):integer; stdcall;
to

Code: Select all

function FsGetPreviewBitmap(RemoteName:pchar;width,height:integer):integer; stdcall;
it was be founded and called sucessfuly.
Any idea?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Strange, I just checked my code. Here I find the definition:

tFsGetPreviewBitmap=function(FileToLoad:pchar;width,height:integer;var ReturnedBitmap:hbitmap):integer; stdcall;

var FsGetPreviewBitmap:tFsGetPreviewBitmap;

and it's loaded like this:

@FsGetPreviewBitmap:=GetProcAddress(DllHandle,'FsGetPreviewBitmap');

But the function should be found in both cases, it's just searched by name...
Author of Total Commander
https://www.ghisler.com
User avatar
D1P
Senior Member
Senior Member
Posts: 233
Joined: 2005-02-28, 18:29 UTC
Location: Moscow
Contact:

Post by *D1P »

Yes, it really very strange.
I check this code on other PC under WinXP SP2 and all work fine!
Same results reported on russian forum (http://forum.wincmd.ru/viewtopic.php?t=10355). On some computers it work, but on some it doesn't work.
-
But now (when i can implement needed function to my plugin), we will collect more information from plugin users.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Bug confirmed.
WinXPSP2 rus, TC7.02a. Checked with different thumbs sizes.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Maybe it's related to the WMF file bug in Windows? Are these Windows versions fully patched?
Author of Total Commander
https://www.ghisler.com
User avatar
D1P
Senior Member
Senior Member
Posts: 233
Joined: 2005-02-28, 18:29 UTC
Location: Moscow
Contact:

Post by *D1P »

Maybe it's related to the WMF file bug in Windows? Are these Windows versions fully patched?
Today i had to re-install Windows XP SP2 (EN PRO) (i had Windows 2003 before). There is no updates after SP2, and FsGetPreviewBitmap still not being called :(
On other computer, where all released patches installed, function called normally.

I can't download all updates for my home Windows installation, because i have very slow and expensive connection here. But if you give me download link to one update for this bug, then i can check you assumption.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

2D1P
1. WMF patch. Try to find KB912919 (this update noted in Total Commander help).
2. Bug occurs with other formats like bmp, jpg... I don't think it's related to wmf...
User avatar
D1P
Senior Member
Senior Member
Posts: 233
Joined: 2005-02-28, 18:29 UTC
Location: Moscow
Contact:

Post by *D1P »

WMF patch. Try to find KB912919 (this update noted in Total Commander help).
Ok, thanks, i got it.

And now everything seems to be ok! I can see thumbnails in filesystem panel, and can see how function called under debugger! Great!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for checking that! I remember that I turned off loading of images from file system plugins in this case because
- wmf files can have ANY extension and still cause the bug
- the file content is not available with plugins, so TC cannot check before requesting the image whether the content is potentially dangerous or not

This behaviour can be overridden by adding
WmfAllowed=3
to your wincmd.ini, which I can really NOT recommend. Better install the wmf patch!
Author of Total Commander
https://www.ghisler.com
Post Reply