http://bugs.winehq.org/show_bug.cgi?id=33384
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Component|-unknown |windowscodecs Summary|Basic WPF application fails |Basic WPF applications |to handle images |using .NET 3.5 WPF fails to | |handle images | |(windowscodecs | |{7543696a-bc8d-46b0-5f81-8d | |95728972be} = | |IMILBitmapSource | |unsupported) Ever Confirmed|0 |1
--- Comment #5 from Anastasius Focht focht@gmx.net 2013-04-14 14:23:12 CDT --- Hello,
confirming.
It seems that .NET Framework WPF 3.x queries an internal interface that Wine builtin windowscodecs doesn't support.
--- snip --- $ WINEDEBUG=+tid,+seh,+loaddll,+process,+msvcrt,+snoop,+wincodecs wine ./WineTest.exe ... 002b:CALL wpfgfx_v0300.MilResource_SendCommand(0032dd70,00000018,0019a108) ret=046790e0 002b:RET wpfgfx_v0300.MilResource_SendCommand() retval=00000000 ret=046790e0 002b:CALL wpfgfx_v0300.MilCompositionEngine_EnterCompositionEngineLock() ret=042f08c3 002b:RET wpfgfx_v0300.MilCompositionEngine_EnterCompositionEngineLock() retval=00000000 ret=042f08c3 002b:CALL wpfgfx_v0300.MilResource_CreateOrAddRefOnChannel(0019a108,00000031,0032dd3c) ret=042f0a20 002b:RET wpfgfx_v0300.MilResource_CreateOrAddRefOnChannel() retval=00000000 ret=042f0a20 002b:CALL wpfgfx_v0300.MilCompositionEngine_EnterCompositionEngineLock() ret=042f08c3 002b:RET wpfgfx_v0300.MilCompositionEngine_EnterCompositionEngineLock() retval=00000000 ret=042f08c3 002b:CALL wpfgfx_v0300.MilResource_CreateOrAddRefOnChannel(0019a108,00000062,0032dcf8) ret=042f0a20 002b:RET wpfgfx_v0300.MilResource_CreateOrAddRefOnChannel() retval=00000000 ret=042f0a20 002b:trace:wincodecs:BitmapImpl_CopyPixels (0x1b6d30,0x32dc44,4,4,0x84ce6c) 002b:CALL wpfgfx_v0300.MILQueryInterface(001b6d30,0032dc34,0032dc9c) ret=042f123d 002b:trace:wincodecs:BitmapImpl_QueryInterface (0x1b6d30,{7543696a-bc8d-46b0-5f81-8d95728972be},0x32dc9c) 002b:RET wpfgfx_v0300.MILQueryInterface() retval=80004002 ret=042f123d ... 002b:trace:seh:raise_exception code=e0434f4d flags=1 addr=0x7b83aabb ip=7b83aabb tid=002b 002b:trace:seh:raise_exception info[0]=80004002 002b:trace:seh:raise_exception eax=7b826891 ebx=7b8b96b0 ecx=80004002 edx=0032da94 esi=0032db18 edi=00132d10 002b:trace:seh:raise_exception ebp=0032dad8 esp=0032da74 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00000283 002b:trace:seh:call_stack_handlers calling handler at 0x79f908a2 code=e0434f4d flags=1 002b:trace:seh:_except_handler4_common exception e0434f4d flags=1 at 0x7b83aabb handler=0x79f908a2 0x32d710 0x32d5dc cookie=a6e038fa scope table=0x79eda938 cookies=-2/0,-72/0 002b:trace:seh:_except_handler4_common level 0 prev -2 filter 0x79eda969 002b:trace:seh:_except_handler4_common filter returned CONTINUE_SEARCH 002b:trace:seh:_except_handler4_common reached -2, returning ExceptionContinueSearch 002b:trace:seh:call_stack_handlers handler at 0x79f908a2 returned 1 002b:trace:seh:call_stack_handlers calling handler at 0x79fb4869 code=e0434f4d flags=1 ... --- snip ---
Managed backtrace:
--- snip --- System.InvalidCastException: Specified cast is not valid. at System.Windows.Media.Imaging.BitmapSource.get_DUCECompatibleMILPtr() at System.Windows.Media.Imaging.BitmapSource.UpdateBitmapSourceResource(Channel channel, Boolean skipOnChannelCheck) at System.Windows.Media.Imaging.BitmapSource.UpdateResource(Channel channel, Boolean skipOnChannelCheck) at System.Windows.Media.Imaging.BitmapSource.AddRefOnChannelCore(Channel channel) at System.Windows.Media.Imaging.BitmapSource.System.Windows.Media.Composition.DUCE.IResource.AddRefOnChannel(Channel channel) at System.Windows.Media.RenderData.System.Windows.Media.Composition.DUCE.IResource.AddRefOnChannel(Channel channel) at System.Windows.UIElement.RenderContent(RenderContext ctx, Boolean isOnChannel) at System.Windows.Media.Visual.UpdateContent(RenderContext ctx, VisualProxyFlags flags, Boolean isOnChannel) at System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at System.Windows.Media.Visual.UpdateChildren(RenderContext ctx, ResourceHandle handle) ... at System.Windows.Media.Visual.RenderRecursive(RenderContext ctx) at System.Windows.Media.Visual.Render(RenderContext ctx, UInt32 childIndex) at System.Windows.Media.CompositionTarget.Compile(Channel channel) at System.Windows.Media.CompositionTarget.System.Windows.Media.ICompositionTarget.Render(Boolean inResize, Channel channel) at System.Windows.Media.MediaContext.Render(ICompositionTarget resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget) at System.Windows.Interop.HwndTarget.OnResize() --- snip ---
Google suggests that "7543696A-BC8D-46b0-5F81-8D95728972BE" is "IMILBitmapSource".
It's also mentioned in United States Patent 7511718 "Media integration layer": http://www.freepatentsonline.com/7511718.html
The interface has the same members/signatures as IWICBitmapSource except for CopyPalette() -> GetPalette().
You can work around installing native 'windowscodecs' using 'winetricks windowscodecs' recipe. Be aware the installer seems very unstable = needs several tries, most likely regressed over long time.
With native windowscodecs override your application properly loads and displays the picture on my system.
--- quote --- Is there any difference between handling .NET 3.5 and 4.0 by Wine? Is there chance that the same application works when targeting .NET 4.0? --- quote ---
Not by Wine (as long it's not an underlying win32 API insufficiency) but there are of course major WPF versions (3.0, 3.5, 3.5sp1, 4.0, 4.5) that have whole rendering engines underneath rewritten, interfaces obsoleted/added and the like. This is outside of Wine's scope, I suggest to read on MSDN.
Regarding .NET Framework 4.0 (containing WPF 4.0) ... you can try by rebuilding/deploying your app. Be sure to set the application target framework to ".NET Framework 4 Client Profile" in build settings. For testing I suggest a separate WINEPREFIX, created with 'winetricks -q dotnet40'.
Regards