Small DDraw problem...

Lionel Ulmer lionel.ulmer at
Sun Oct 20 16:06:56 CDT 2002

Hi all,

I looked at this problem a long time and did not find what the problem is...
So I ask for the help of people here :-)

Some TRACE extracts :

trace:ddraw:DirectDrawCreate ((null),0x406a2b80,(nil))
trace:ddraw:DDRAW_Create Returning interface 0x403b48bc
                                                 | the DirectDraw interface
trace:ddraw:Main_DirectDraw_QueryInterface (0x403b48b0)->({9c59509a-39bd-11d1-8c4a-00c04fd930c5},0x406a2b84)
trace:ddraw:Main_DirectDraw_QueryInterface Returning interface 0x403b48b4
                                                                | the DirectDraw4 interface
trace:ddraw:IDirectDraw4Impl_CreateSurface thunking interface 0x403b48b4
trace:ddraw:Main_DirectDraw_CreateSurface (0x403b48b0)->(0x406a2ae0,0x415712dc,(nil))

So the surface is created using the DirectDraw4 interface and not the
DirectDraw one returned by DirectDrawCreate.

trace:ddraw:User_DirectDrawSurface_Construct (0x403b4c68,0x403b48b0,0x406a29d8)
                                                   | the DirectDrawSurface4 interface
trace:ddraw:Main_DirectDrawSurface_GetAttachedSurface (0x403b4c68)->Looking for caps: 4,400c97f1,40380000,403b4bc0 output: 0x415712e0

So we clearly see that the application is giving us a DDSCAPS structure and
NOT a DDSCAPS2 as it should be for a DirectDrawSurface4 interface (because
by 'hacking' the code by checking only dwCaps, the game goes further).

So :

  1) it is a bug in the game (and it works fine in Windows because,
     miraculously, the three others words of the 'fake' DDSCAPS2 structure
     are set to '0' or because Windows only checks with 'dwCaps' and not
     with all 'dwCaps' fields).

  2) somehow the docs are wrong and it should be a DirectDrawSurface that is
     returned by a CreateSurface even if the CreateSurface is called on a
     DirectDraw4 interface...

I would be glad for any help... Trying to go further with my hack in place :-)


		 Lionel Ulmer -

More information about the wine-devel mailing list