<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi Stefan,</span></div><div>> If the testing doesn't reveal anything, look out for IDirectDraw::GetCaps <br>> calls in the logs or IDirect3Dx::EnumZBufferFormats. IDirectDraw::GetCaps <br>> returns a DDCAPS structure which has dwZBufferBitDepths containing some flags <br>> for z buffer bit depths. EnumZBufferFormats calls a callback multiple times <br>> with available DDPIXELFORMAT structures. The application may not like some <br>> flags we set there.</div><div><br></div><div>You know, my gut says that this is the right place to look, particularly  IDirect3Dx::EnumZBufferFormats. <br></div><div>I see why you suggest this: what if none are returned to the application?</div><div> I will look into it. What The Sims is passing to CreateSurface just looks wrong.</div><div><br></div><div>In the meantime, I
 will generate a full ddraw trace and add it to the bug log as you suggest and then check it through.<br></div><div><br></div><div>Cheers, and thanks for the help. It is much appreciated.</div><div><br></div><div>Ralph<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Stefan D�singer <stefandoesinger@gmx.at><br> <b><span style="font-weight: bold;">To:</span></b> wine-devel@winehq.org; Ralph Little <littlesincanada@yahoo.co.uk> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, February 1, 2012 11:52:15 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: Profiing
 windows apps<br> </font> </div> <br>Hi,<br><br>Am Dienstag, 31. Januar 2012, 21:51:01 schrieb Ralph Little:<br>> IDirectDraw * pDD = NULL;<br>> IDirectDrawSurface * pDDSPrimary = NULL;<br>> DDSURFACEDESC ddsd;<br>Take a look at dlls/ddraw/tests/ddraw*.c<br><br>> ...<initialisation etc>...<br>Make sure you use the version of the interface the game uses. There are some <br>behavioral differences between them. E.g. with zbuffers <br>DDSURFACEDESC(IDirectDraw, IDirectDraw2) has dwZBufferBitDepth(and <br>DDSD_ZBUFFERBITDEPTH), while DDSURFACEDESC2(IDirectDraw4, IDirectDraw7) always <br>uses a pixel format.<br><br>As far as I can see from the bug report the game is using IDirectDraw4.<br><br>> memset(&ddsd, 0, sizeof(ddsd));<br>> ddsd.dwSize  = sizeof(ddsd);<br>> ddsd.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_HEIGHT | DDSD_WIDTH;<br>> ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER;<br>Is it really
 trying to create a system memory z buffer? (Ok, I just saw this <br>in the logs attached to the bug report - that's really odd).<br><br>> ddsd.dwHeight = 600;<br>> ddsd.dwWidth  = 800;<br>> ddsd.ddpfPixelFormat.dwSize  = sizeof(DDPIXELFORMAT);<br>Try to set ddsd.ddpfPixelFormat.dwZBufferBitDepth to e.g. 16 and <br>ddsd.ddpfPixelFormat.dwZBitMask to 0x0000ffff. Keep dwFlags set to 0. Als try <br>to keep dwSize at 0.<br><br>> I assume that if the caller specifies DDSCAPS_ZBUFFER, the you must also<br>> specify some PIXEL format information. DDSD_PIXELFORMAT is present, but<br>> there are no format flags.<br>Basically that, or dwZBufferBitDepth. See zbufferbitdepth_test in <br>dlls/ddraw/tests/dsurface.c for some tests on this. (Don't add any new tests <br>there btw - use tests/ddraw*.c).<br><br>> I have to admit that I am a bit of a novice when it comes to DirectX so any<br>> guidance here would be helpful. I see that the
 lpSurface is NULL, which I<br>> thought was an error. However, I see that this is optional if the caller<br>> wishes the system to manage the surface memory.<br>Correct.<br><br>> Any error returned by this function the Sims at this point to causes it to<br>> crash. Therefore, it seems to me that if it succeeds in Windows, it must<br>> have passed something different. If only we could see the source :D<br>If the testing doesn't reveal anything, look out for IDirectDraw::GetCaps <br>calls in the logs or IDirect3Dx::EnumZBufferFormats. IDirectDraw::GetCaps <br>returns a DDCAPS structure which has dwZBufferBitDepths containing some flags <br>for z buffer bit depths. EnumZBufferFormats calls a callback multiple times <br>with available DDPIXELFORMAT structures. The application may not like some <br>flags we set there.<br><br>Also please attach a full +ddraw log to the bug report. If it is too big <br>compress it. bzip2 should do a pretty
 decent job, if all fails try lrzip.<br><br><br> </div> </div> </blockquote></div>   </div></body></html>