Try #2 for fix to exception in ddraw test

Chris Ahrendt celticht32 at aol.com
Mon Oct 13 15:04:40 CDT 2008


Ok I fixed the code ... however : one section there is something I am 
not sure of so I left it in to prevent the exception from occuring.

here is my change that doesn't cause an exception:

     ZeroMemory(&desc, sizeof(desc));
     desc.dwSize = sizeof(desc);
     desc.dwFlags = DDSD_CAPS;
     desc.ddsCaps.dwCaps |= DDSCAPS_PRIMARYSURFACE;
     desc.dwHeight = 128; /* Keep them set to  check what happens */
     desc.dwWidth = 128; /* Keep them set to  check what happens */
     ret = IDirectDraw_CreateSurface(lpDD, &desc, &dsurface, NULL);
     ok(ret == DD_OK, "Creating a primary surface without width and 
height info returned %08x\n", ret);
 >> /* This should be handled but CreateSurface is not returning right */
 >>    if (FAILED(ret))
 >>    {
 >>        skip("Can't create cubemap surface\n");
 >>        return;
 >>    }
     if(dsurface)
     {
         ret = IDirectDrawSurface_GetSurfaceDesc(dsurface, &desc);
         ok(ret == DD_OK, "GetSurfaceDesc returned %x\n", ret);


If those lines are not there then when it gets to the
         ret = IDirectDrawSurface_GetSurfaceDesc(dsurface, &desc);
line it throws and exception because dsurface is null.. so
I am wondering if  the if should be if(&dsurface) instead of the above?

Chris
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Pared-Down-Test-For-ddraw-test.-fixes-error-with-IDi.txt
Url: http://www.winehq.org/pipermail/wine-patches/attachments/20081013/23014087/attachment.txt 


More information about the wine-patches mailing list