ddraw: Only ddraw checks wether one can give a null pointer to SetMaterial.

This commit is contained in:
David Adam 2008-08-21 18:54:27 +02:00 committed by Alexandre Julliard
parent f0a821a1ae
commit bb67a925d6
3 changed files with 10 additions and 2 deletions

View File

@ -5543,6 +5543,7 @@ IDirect3DDeviceImpl_7_SetMaterial(IDirect3DDevice7 *iface,
HRESULT hr;
TRACE("(%p)->(%p): Relay!\n", This, Mat);
if (!Mat) return DDERR_INVALIDPARAMS;
/* Note: D3DMATERIAL7 is compatible with WINED3DMATERIAL */
EnterCriticalSection(&ddraw_cs);
hr = IWineD3DDevice_SetMaterial(This->wineD3DDevice,

View File

@ -2735,6 +2735,14 @@ static void DeviceLoadTest()
}
}
static void SetMaterialTest(void)
{
HRESULT rc;
rc =IDirect3DDevice7_SetMaterial(lpD3DDevice, NULL);
ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
}
START_TEST(d3d)
{
init_function_pointers();
@ -2752,6 +2760,7 @@ START_TEST(d3d)
SceneTest();
LimitTest();
D3D7EnumTest();
SetMaterialTest();
CapsTest();
VertexBufferDescTest();
D3D7_OldRenderStateTest();

View File

@ -3144,8 +3144,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetClipStatus(IWineD3DDevice *iface,
static HRESULT WINAPI IWineD3DDeviceImpl_SetMaterial(IWineD3DDevice *iface, CONST WINED3DMATERIAL* pMaterial) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
if (!pMaterial) return WINED3DERR_INVALIDCALL;
This->updateStateBlock->changed.material = TRUE;
This->updateStateBlock->material = *pMaterial;