http://bugs.winehq.org/show_bug.cgi?id=1660
--- Comment #26 from Markus mst@collogia.de 2009-09-10 09:24:41 --- Upps, the last post was into the wrong direction. Better this time...
1. The application calls an DDRAW:GetSurfaceDesc and wants dwBackBufferCount. 2. If this is 1 it calls an DDRAW:GetAttachedSurface with dwCaps = 4. 3. Afterwards a call to DDRAW:CreatePalette is made. 4. Finally the application works on the surface pointers of step 2.
The exception occurs in my opinion because the app does not check the result of step 2. So in step 4 it fails and it looks as if the CreatePalette is the cause. Implementing some debug messages seems to solve the riddle.
... fixme:ddraw_thunk:IDirectDrawImpl_CreatePalette function called fixme:ddraw_thunk:IDirectDrawSurface3Impl_GetSurfaceDesc surface 1285364 has 1 backbuffers fixme:ddraw_thunk:IDirectDrawSurface3Impl_GetAttachedSurface 1285364 wants surface with dwCaps 4 fixme:ddraw_thunk:IDirectDrawSurface3Impl_GetAttachedSurface got surface 1285936 fixme:ddraw_thunk:IDirectDrawImpl_CreatePalette function called fixme:ddraw_thunk:IDirectDrawSurface3Impl_GetSurfaceDesc surface 1285940 has 1 backbuffers fixme:ddraw_thunk:IDirectDrawSurface3Impl_GetAttachedSurface 1285940 wants surface with dwCaps 4 fixme:ddraw_thunk:IDirectDrawSurface3Impl_GetAttachedSurface ERROR! CALL FAILED! FASTEN SEATBELTS! *ppAttached=NULL fixme:ddraw_thunk:IDirectDrawImpl_CreatePalette function called wine: Unhandled page fault on read access to 0x00000000 at address 0x401c3a ...
Maybe some expert can dig further into the deeps of GetAttachedSurface.