Fix to exceptions in ddtest
Chris Ahrendt
celticht32 at aol.com
Mon Oct 13 13:30:57 CDT 2008
>>> ---
>>> ok(rc==DDERR_INVALIDPARAMS,"CreateSurface returned: %x\n",rc);
>>> -
>>> + if (FAILED(rc)) {
>>> + skip("failed to create surface\n");
>>> + return;
>>> + }
>> here it is _expected_ that the surface creation fails. So this code is not
>> useful. ALso in other places.
>>
>> ciao, Marcus
> Ok that I can fix easy enough...
>
> chris
>
>
Ok I fixed the code to take this out... 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-devel/attachments/20081013/b9105ab3/attachment.txt
More information about the wine-devel
mailing list