Here is the new patch.   I did some additional testing and couldn't
get the same app to fail on that function again.   It still works with
this new patch, so I'm assuming for now that it's correct.    Anyways,
thanks again.

-Al Tobey

On 1/16/06, Aric Cyr <[EMAIL PROTECTED]> wrote:
> On 1/16/06, H. Verbeet <[EMAIL PROTECTED]> wrote:
> > If the D3DDEVICE_CREATION_PARAMETERS struct got zeroed out before
> > being passed to GetCreationParameters, DeviceType would now be 0 while
> > it was 1 (D3DDEVTYPE_HAL) before. I don't know if that's enough to
> > make things work.
>
> Yes good point.  I forgot that his original patch also included the
> deletion of a few lines.  That is the only reason I could see for his
> changes to actually have any effect as the pointer-assignment clearly
> does nothing.
>
> > And of course checking if pParameters is a valid pointer in the first
> > place is probably a good idea as well.
>
> I agree, definitely a NULL check should be added for pParameters.
>
> --
> Aric Cyr <Aric.Cyr at gmail dot com>    (http://acyr.net)
>
>
>
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 161c8c6..f7f3a2d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -6274,22 +6274,20 @@
     }
     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->createParms == NULL)
+        return D3DERR_OUTOFVIDEOMEMORY;
+
+    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");


Reply via email to