On Wed, Nov 12, 2008 at 2:16 AM, Jeremy Drake wine@jdrake.com wrote:
I ran into a function that was not implemented when attempting to run a program I work on under wine.
This patch implements OleLoadPictureFile based on the MSDN docs (http://msdn.microsoft.com/en-us/library/ms221680.aspx) and what I saw when stepping through in windbg on XP.
A few notes: I'm not sure I got the spec file right. The first param is a VARIANT, not a VARIANT *, so I'm not sure ptr is the right thing.
I'm not sure the right way to do the TRACE call with the VARIANT param.
I did not implement OleLoadPictureFileEx. Technically, OleLoadPictureFile should call OleLoadPictureFileEx(varFilename, LP_DEFAULT, LP_DEFAULT, LP_DEFAULT, ppdispPicture) and OleLoadPictureEx should pass the sizeX, sizeY, and flags to OleLoadPictureEx.
When stepping through the function in windbg, I saw it call a function OLEAUT32!CreateFileStream which does not exist in wine anywhere. Instead of using that, I used the same mechanism as was used in OleLoadPicturePath (GlobalAlloc the size of the file, read the whole file in, and CreateStreamOnHGlobal).
Since this is my first wine patch, I hope you will forgive me these shortcomings. I'm not subscribed to any wine list, so please copy me on any replies.
Thanks, Jeremy
-- Personifiers Unite! You have nothing to lose but Mr. Dignity!
Can you add a testcase to show that this behavior is correct?