On Sun, Apr 18, 2010 at 3:58 PM, Octavian Voicu octavian.voicu@gmail.com wrote:
Hello,
I'm trying to get the Adobe Photoshop Elements 8.0 installer to work and noticed the license screen doesn't show up when running the installer using wine. A trace shows that a custom action (CA_EULA_ExtractEulaFiles) generates a page fault.
The cause of the crash is that MsiGetActiveDatabase is called on a remote handle that is actually a database handle (not a package handle as expected). A simple proof of concept would be to call this from a custom action handler in a dll:
MsiGetActiveDatabase(MsiGetActiveDatabase(hPackage));
MsiGetActiveDatabase will call msi_get_remote and cast the result to IWineMsiRemotePackage, then call IWineMsiRemotePackage_GetActiveDatabase. Because our handle is actually a database handle, instead of calling mrp_GetActiveDatabase, it will call mrd_GetPrimaryKeys. This leads to a crash (see attached log).
The correct behavior for MsiGetActiveDatabase is to return 0 when called with an invalid handle.
I made a patch for this (also attached). In order to check if the com object is actually an IWineMsiRemotePackage, I compare the IUnknown->lpVtbl pointer against msi_remote_package_vtbl. This looks a bit messy, but I found no other way to do it. I'm posting the patch here for review first.
Octavian
I'm not much of a COM expert, but from what it looks like in order to tell if an interface is really the interface you expect, the right way would be to QueryInterface it (idea from http://source.winehq.org/source/dlls/msxml3/domdoc.c#L1499 ).
Mike.