[ros-diffs] [gbrunmar] 35498: Added some more parameter error checking to D3D9::CreateDevice()
gbrunmar at svn.reactos.org
gbrunmar at svn.reactos.org
Thu Aug 21 05:19:02 CEST 2008
Author: gbrunmar
Date: Wed Aug 20 22:19:02 2008
New Revision: 35498
URL: http://svn.reactos.org/svn/reactos?rev=35498&view=rev
Log:
Added some more parameter error checking to D3D9::CreateDevice()
Modified:
trunk/reactos/dll/directx/d3d9/d3d9_impl.c
Modified: trunk/reactos/dll/directx/d3d9/d3d9_impl.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_impl.c?rev=35498&r1=35497&r2=35498&view=diff
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_impl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_impl.c [iso-8859-1] Wed Aug 20 22:19:02 2008
@@ -923,7 +923,42 @@
if (hFocusWindow != NULL && FALSE == IsWindow(hFocusWindow))
{
- DPRINT1("Invalid hFocusWindow parameter specified");
+ DPRINT1("Invalid hFocusWindow parameter specified, expected NULL or a valid HWND");
+ UNLOCK_D3D9();
+ return D3DERR_INVALIDCALL;
+ }
+
+ if (NULL == pPresentationParameters)
+ {
+ DPRINT1("Invalid pPresentationParameters parameter specified");
+ UNLOCK_D3D9();
+ return D3DERR_INVALIDCALL;
+ }
+
+ if (pPresentationParameters->hDeviceWindow != NULL && FALSE == IsWindow(pPresentationParameters->hDeviceWindow))
+ {
+ DPRINT1("Invalid pPresentationParameters->hDeviceWindow parameter specified, expected NULL or a valid HWND");
+ UNLOCK_D3D9();
+ return D3DERR_INVALIDCALL;
+ }
+
+ if (FALSE == pPresentationParameters->Windowed && hFocusWindow == NULL)
+ {
+ DPRINT1("When pPresentationParameters->Windowed is not set, hFocusWindow must be a valid HWND");
+ UNLOCK_D3D9();
+ return D3DERR_INVALIDCALL;
+ }
+
+ if (NULL == hFocusWindow && NULL == pPresentationParameters->hDeviceWindow)
+ {
+ DPRINT1("Any of pPresentationParameters->Windowed and hFocusWindow must be set to a valid HWND");
+ UNLOCK_D3D9();
+ return D3DERR_INVALIDCALL;
+ }
+
+ if (Adapter > 0 && NULL == pPresentationParameters->hDeviceWindow)
+ {
+ DPRINT1("Invalid pPresentationParameters->hDeviceWindow, must be set to a valid unique HWND when Adapter is greater than 0");
UNLOCK_D3D9();
return D3DERR_INVALIDCALL;
}
More information about the Ros-diffs
mailing list