http://bugs.winehq.org/show_bug.cgi?id=14710
Summary: OleLoadPicturePath loads image in windows but not in wine, could cause access violation in some circumstances Product: Wine Version: unspecified Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: support@robertinventor.com
Created an attachment (id=15202) --> (http://bugs.winehq.org/attachment.cgi?id=15202) source code for program to duplicate the bug
This code works in Windows but not in Wine - running under KDE
WCHAR wpath[MAX_PATH]; MultiByteToWideChar(CP_ACP, 0, pszPath, -1, wpath, MAX_PATH); IPicture* pPic=NULL; CoInitialize(NULL);// NOT NEEDED IN WINDOWS // INCLUDED JUST IN CASE IT IS NEEDED FOR WINE but doesn't fix it. OleLoadPicturePath(wpath, NULL, NULL, NULL, IID_IPicture,(LPVOID*)&pPic); ...
In case where the file does exist, OleLoadPicturePath isn't initialising pPic.
If the app tests for file existence first, and doesn't initialise pPic, the result could be an access violation.
(I'm using the VMWare MultiBrowser Appliance as a way to run Linux on my Vista machine.)
Source code for app attached, obviously replace the example pictures with existing files on your machine.
Hope this helps. The reason my app calls OleLoadPicturePath(..) instead of LoadImage(..) is because it is an easy way to add the capability to load jpegs and gifs without need to add extra image libraries (which would add to the size of the installer).
Not that important for my program, just means the users would have to convert the skin images to bitmaps in order to use them. But maybe it might affect other programs too, and could cause an access violation if the programmer doesn't initilise the pPic.
Hope this helps, any questions?
Robert