> Hi Al,
>
> Almost got it this time :)
> You should be checking that pParameters is not NULL, not &This->createParms.
> Note that if This is not-NULL, &This->creatParms will be not null as well
> since
> you are just getting the address of a struct. Also on failure, according to
> MSDN, you shoudl be returning D3DERR_INVALIDCALL not OUTOFVIDEOMEMORY.
>
> Probably the following would be most correct:
I've patchified Aric's corrections. That's what I get for not doing
any C/C++ for 5 years ...
I'll remember to check MSDN as well next time for the return code - I
just scanned the rest of the file and saw a lot of stuff returning
OUTOFVIDEOMEMORY.
-Al
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index b057a36..f1bfc01 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -6129,26 +6129,23 @@
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
/** FIXME: always true at the moment **/
if(bEnableDialogs == FALSE) {
FIXME("(%p) Dialogs cannot be disabled yet\n", This);
}
return D3D_OK;
}
-
HRESULT WINAPI IWineD3DDeviceImpl_GetCreationParameters(IWineD3DDevice *iface, D3DDEVICE_CREATION_PARAMETERS *pParameters) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
- FIXME("(%p) : stub\n", This);
- /* Setup some reasonable defaults */
- pParameters->AdapterOrdinal = 0; /* always for now */
- pParameters->DeviceType = D3DDEVTYPE_HAL; /* always for now */
- pParameters->hFocusWindow = 0;
- pParameters->BehaviorFlags =0;
+ if (This == NULL || pParameters == NULL)
+ return D3DERR_INVALIDCALL;
+
+ memcpy(pParameters, &This->createParms, sizeof(D3DDEVICE_CREATION_PARAMETERS));
return D3D_OK;
}
void WINAPI IWineD3DDeviceImpl_SetGammaRamp(IWineD3DDevice * iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) {
IWineD3DSwapChain *swapchain;
HRESULT hrc = D3D_OK;
TRACE("Relaying to swapchain\n");