Author: greatlrd
Date: Sun Apr 22 22:15:31 2007
New Revision: 26467
URL:
http://svn.reactos.org/svn/reactos?rev=26467&view=rev
Log:
adpabte wine SetCooperativeLevel to reactis ddraw. allot test need be done, I also took
DDRAWI_DIRECTDRAW_LCL->dwObsolete1 as device windows.
memory leak can exists and some value I forget free as well.
Modified:
trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
trunk/reactos/dll/directx/ddraw/startup.c
Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddr…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Sun Apr 22 22:15:31 2007
@@ -3,7 +3,7 @@
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS
* FILE: lib/ddraw/main/ddraw.c
- * PURPOSE: IDirectDraw7 Implementation
+ * PURPOSE: IDirectDraw7 Implementation
* PROGRAMMER: Magnus Olsen, Maarten Bosma
*
*/
@@ -11,19 +11,19 @@
#include "../rosdraw.h"
-HRESULT
-WINAPI
-Main_DirectDraw_QueryInterface (LPDIRECTDRAW7 iface,
- REFIID id,
- LPVOID *obj)
-{
+HRESULT
+WINAPI
+Main_DirectDraw_QueryInterface (LPDIRECTDRAW7 iface,
+ REFIID id,
+ LPVOID *obj)
+{
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
-
- /* fixme
- the D3D object cab be optain from here
- Direct3D7
+
+ /* fixme
+ the D3D object cab be optain from here
+ Direct3D7
*/
if (IsEqualGUID(&IID_IDirectDraw7, id))
{
@@ -38,7 +38,7 @@
}
Main_DirectDraw_AddRef(iface);
- return S_OK;
+ return DD_OK;
}
/*
@@ -46,9 +46,9 @@
* Status ok
*/
ULONG
-WINAPI
-Main_DirectDraw_AddRef (LPDIRECTDRAW7 iface)
-{
+WINAPI
+Main_DirectDraw_AddRef (LPDIRECTDRAW7 iface)
+{
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
@@ -67,10 +67,10 @@
}
-ULONG
-WINAPI
-Main_DirectDraw_Release (LPDIRECTDRAW7 iface)
-{
+ULONG
+WINAPI
+Main_DirectDraw_Release (LPDIRECTDRAW7 iface)
+{
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
@@ -92,7 +92,7 @@
{
ChangeDisplaySettings(NULL, 0);
}*/
-
+
Cleanup(iface);
return 0;
}
@@ -104,9 +104,9 @@
* IMPLEMENT
* Status ok
*/
-HRESULT
-WINAPI
-Main_DirectDraw_Compact(LPDIRECTDRAW7 iface)
+HRESULT
+WINAPI
+Main_DirectDraw_Compact(LPDIRECTDRAW7 iface)
{
/* MSDN say not implement but my question what does it return then */
DX_WINDBG_trace();
@@ -117,16 +117,16 @@
* IMPLEMENT
* Status ok
*/
-HRESULT
-WINAPI
-Main_DirectDraw_CreateClipper(LPDIRECTDRAW7 iface,
- DWORD dwFlags,
- LPDIRECTDRAWCLIPPER *ppClipper,
+HRESULT
+WINAPI
+Main_DirectDraw_CreateClipper(LPDIRECTDRAW7 iface,
+ DWORD dwFlags,
+ LPDIRECTDRAWCLIPPER *ppClipper,
IUnknown *pUnkOuter)
{
DX_WINDBG_trace();
- DX_STUB;
+ DX_STUB;
}
HRESULT WINAPI Main_DirectDraw_CreatePalette(LPDIRECTDRAW7 iface, DWORD dwFlags,
@@ -143,13 +143,13 @@
* Status not done
*/
HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDESC2
pDDSD,
- LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown
*pUnkOuter)
-{
-
- DX_WINDBG_trace();
-
- DX_STUB;
-
+ LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown
*pUnkOuter)
+{
+
+ DX_WINDBG_trace();
+
+ DX_STUB;
+
}
@@ -158,10 +158,10 @@
* Status not done
*/
HRESULT WINAPI Main_DirectDraw_DuplicateSurface(LPDIRECTDRAW7 iface, LPDIRECTDRAWSURFACE7
src,
- LPDIRECTDRAWSURFACE7* dst)
-{
- DX_WINDBG_trace();
- DX_STUB;
+ LPDIRECTDRAWSURFACE7* dst)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
}
/*
@@ -169,72 +169,72 @@
* Status ok
*/
HRESULT WINAPI Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
- LPDDSURFACEDESC2 pDDSD, LPVOID context, LPDDENUMMODESCALLBACK2 callback)
+ LPDDSURFACEDESC2 pDDSD, LPVOID context, LPDDENUMMODESCALLBACK2
callback)
{
DX_WINDBG_trace();
- DX_STUB;
+ DX_STUB;
}
/*
* stub
* Status not done
*/
-HRESULT WINAPI
+HRESULT WINAPI
Main_DirectDraw_EnumSurfaces(LPDIRECTDRAW7 iface, DWORD dwFlags,
LPDDSURFACEDESC2 lpDDSD2, LPVOID context,
- LPDDENUMSURFACESCALLBACK7 callback)
-{
- DX_WINDBG_trace();
- DX_STUB;
-}
-
-/*
- * IMPLEMENT
- * Status ok
- */
-HRESULT WINAPI
-Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface)
-{
- DX_WINDBG_trace();
-
- DX_STUB;
-}
-
-/*
- * IMPLEMENT
- * Status ok
- */
-HRESULT WINAPI
+ LPDDENUMSURFACESCALLBACK7 callback)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+/*
+ * IMPLEMENT
+ * Status ok
+ */
+HRESULT WINAPI
+Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface)
+{
+ DX_WINDBG_trace();
+
+ DX_STUB;
+}
+
+/*
+ * IMPLEMENT
+ * Status ok
+ */
+HRESULT WINAPI
Main_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps,
- LPDDCAPS pHELCaps)
-{
-
- DX_WINDBG_trace();
-
- DX_STUB;
-}
-
-
-/*
- * IMPLEMENT
- * Status ok
- */
-HRESULT WINAPI Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2
pDDSD)
-{
+ LPDDCAPS pHELCaps)
+{
+
+ DX_WINDBG_trace();
+
+ DX_STUB;
+}
+
+
+/*
+ * IMPLEMENT
+ * Status ok
+ */
+HRESULT WINAPI Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2
pDDSD)
+{
//LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
- DX_STUB;
-}
-
-/*
- * Stub
- * Status todo
- */
-HRESULT WINAPI
+ DX_STUB;
+}
+
+/*
+ * Stub
+ * Status todo
+ */
+HRESULT WINAPI
Main_DirectDraw_GetFourCCCodes(LPDIRECTDRAW7 iface, LPDWORD pNumCodes, LPDWORD pCodes)
{
DX_WINDBG_trace();
@@ -245,8 +245,8 @@
* Stub
* Status todo
*/
-HRESULT WINAPI
-Main_DirectDraw_GetGDISurface(LPDIRECTDRAW7 iface,
+HRESULT WINAPI
+Main_DirectDraw_GetGDISurface(LPDIRECTDRAW7 iface,
LPDIRECTDRAWSURFACE7 *lplpGDIDDSSurface)
{
DX_WINDBG_trace();
@@ -257,31 +257,31 @@
* IMPLEMENT
* Status ok
*/
-HRESULT WINAPI
+HRESULT WINAPI
Main_DirectDraw_GetMonitorFrequency(LPDIRECTDRAW7 iface,LPDWORD freq)
-{
- DX_WINDBG_trace();
-
- DX_STUB;
-}
-
-/*
- * IMPLEMENT
- * Status ok
- */
-HRESULT WINAPI
+{
+ DX_WINDBG_trace();
+
+ DX_STUB;
+}
+
+/*
+ * IMPLEMENT
+ * Status ok
+ */
+HRESULT WINAPI
Main_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
-{
- DX_WINDBG_trace();
-
- DX_STUB;
-}
-
-/*
- * Stub
- * Status todo
- */
-HRESULT WINAPI
+{
+ DX_WINDBG_trace();
+
+ DX_STUB;
+}
+
+/*
+ * Stub
+ * Status todo
+ */
+HRESULT WINAPI
Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL lpbIsInVB)
{
DX_WINDBG_trace();
@@ -292,78 +292,233 @@
* IMPLEMENT
* Status ok
*/
-HRESULT
-WINAPI
+HRESULT
+WINAPI
Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID)
-{
- DX_WINDBG_trace();
-
- DX_STUB;
-}
-
-/*
- * IMPLEMENT
- * Status ok
- */
-HRESULT WINAPI
+{
+ DX_WINDBG_trace();
+
+ DX_STUB;
+}
+
+/*
+ * IMPLEMENT
+ * Status ok
+ */
+HRESULT WINAPI
Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface)
{
DX_WINDBG_trace();
- DX_STUB;
+ DX_STUB;
return DD_OK;
}
/*
- * IMPLEMENT
- * Status ok
- */
-HRESULT WINAPI
+ */
+HRESULT WINAPI
Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface, HWND hwnd, DWORD cooplevel)
{
DX_WINDBG_trace();
- DX_STUB;
-}
-
-/*
- * IMPLEMENT
- * Status ok
- */
-HRESULT WINAPI
-Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
+/*
+ * Code from wine, this functions have been cut and paste from wine 0.9.35
+ * and have been modify allot and are still in devloping so it match with
+ * msdn document struct and flags
+ */
+
+ HWND window;
+ LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
+
+
+ /* Get the old window */
+ window = (HWND) This->lpLcl->hWnd;
+ if(!window)
+ {
+ return DDERR_NOHWND;
+ }
+
+ /* Tests suggest that we need one of them: */
+ if(!(cooplevel & (DDSCL_SETFOCUSWINDOW |
+ DDSCL_NORMAL |
+ DDSCL_EXCLUSIVE )))
+ {
+ return DDERR_INVALIDPARAMS;
+ }
+
+ /* Handle those levels first which set various hwnds */
+ if(cooplevel & DDSCL_SETFOCUSWINDOW)
+ {
+ /* This isn't compatible with a lot of flags */
+ if(cooplevel & ( DDSCL_MULTITHREADED |
+ DDSCL_FPUSETUP |
+ DDSCL_FPUPRESERVE |
+ DDSCL_ALLOWREBOOT |
+ DDSCL_ALLOWMODEX |
+ DDSCL_SETDEVICEWINDOW |
+ DDSCL_NORMAL |
+ DDSCL_EXCLUSIVE |
+ DDSCL_FULLSCREEN ) )
+ {
+ return DDERR_INVALIDPARAMS;
+ }
+
+ else if(This->lpLcl->dwLocalFlags & DDRAWILCL_SETCOOPCALLED)
+ {
+ return DDERR_HWNDALREADYSET;
+ }
+ else if( (This->lpLcl->dwLocalFlags & DDRAWILCL_ISFULLSCREEN)
&& window)
+ {
+ return DDERR_HWNDALREADYSET;
+ }
+
+ This->lpLcl->hFocusWnd = (ULONG_PTR) hwnd;
+
+
+ /* Won't use the hwnd param for anything else */
+ hwnd = NULL;
+
+ /* Use the focus window for drawing too */
+ This->lpLcl->hWnd = This->lpLcl->hFocusWnd;
+
+ }
+
+ /* DDSCL_NORMAL or DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE */
+ if(cooplevel & DDSCL_NORMAL)
+ {
+ /* Can't coexist with fullscreen or exclusive */
+ if(cooplevel & (DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE) )
+ return DDERR_INVALIDPARAMS;
+
+
+ /* Switching from fullscreen? */
+ if(This->lpLcl->dwLocalFlags & DDRAWILCL_ISFULLSCREEN)
+ {
+ /* Restore the display mode */
+ Main_DirectDraw_RestoreDisplayMode(iface);
+
+ This->lpLcl->dwLocalFlags &= ~DDRAWILCL_ISFULLSCREEN;
+ This->lpLcl->dwLocalFlags &= ~DDRAWILCL_HASEXCLUSIVEMODE;
+ This->lpLcl->dwLocalFlags &= ~DDRAWILCL_ALLOWMODEX;
+ }
+
+ /* Don't override focus windows or private device windows */
+ if( hwnd &&
+ !(This->lpLcl->hFocusWnd) &&
+ !(This->lpLcl->dwObsolete1) &&
+ (hwnd != window) )
+ {
+ This->lpLcl->hWnd = (ULONG_PTR)hwnd;
+ }
+
+ /* FIXME GL
+ IWineD3DDevice_SetFullscreen(This->wineD3DDevice,
+ FALSE);
+ */
+ }
+ else if(cooplevel & DDSCL_FULLSCREEN)
+ {
+ /* Needs DDSCL_EXCLUSIVE */
+ if(!(cooplevel & DDSCL_EXCLUSIVE) )
+ return DDERR_INVALIDPARAMS;
+
+ /* Switch from normal to full screen mode? */
+ if (!(This->lpLcl->dwLocalFlags & DDRAWILCL_HASEXCLUSIVEMODE))
+ {
+ /* FIXME GL
+ IWineD3DDevice_SetFullscreen(This->wineD3DDevice,
+ TRUE);
+ */
+ }
+
+ /* Don't override focus windows or private device windows */
+ if( hwnd &&
+ !(This->lpLcl->hFocusWnd) &&
+ !(This->lpLcl->dwObsolete1) &&
+ (hwnd != window) )
+ {
+ This->lpLcl->hWnd = (ULONG_PTR) hwnd;
+ }
+ }
+ else if(cooplevel & DDSCL_EXCLUSIVE)
+ {
+ return DDERR_INVALIDPARAMS;
+ }
+
+ if(cooplevel & DDSCL_CREATEDEVICEWINDOW)
+ {
+ /* Don't create a device window if a focus window is set */
+ if( !This->lpLcl->hFocusWnd)
+ {
+ HWND devicewindow = CreateWindowExW(0, classname, L"DDraw device
window",
+ WS_POPUP, 0, 0,
+ GetSystemMetrics(SM_CXSCREEN),
+ GetSystemMetrics(SM_CYSCREEN),
+ NULL, NULL, GetModuleHandleW(0), NULL);
+
+ ShowWindow(devicewindow, SW_SHOW); /* Just to be sure */
+
+ This->lpLcl->dwObsolete1 = (DWORD)devicewindow;
+ }
+ }
+
+ if(cooplevel & DDSCL_MULTITHREADED && !(This->lpLcl->dwLocalFlags
& DDRAWILCL_MULTITHREADED))
+ {
+ /* FIXME GL
+ * IWineD3DDevice_SetMultithreaded(This->wineD3DDevice);
+ */
+ }
+
+
+
+ /* Store the cooperative_level */
+
+ /* FIXME GL
+ * This->cooperative_level |= cooplevel;
+ */
+
+ return DD_OK;
+
+}
+
+/*
+ * IMPLEMENT
+ * Status ok
+ */
+HRESULT WINAPI
+Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
DWORD dwBPP, DWORD
dwRefreshRate, DWORD dwFlags)
{
DX_WINDBG_trace();
- DX_STUB;
-}
-
-/*
- * IMPLEMENT
- * Status ok
- */
-HRESULT WINAPI
+ DX_STUB;
+}
+
+/*
+ * IMPLEMENT
+ * Status ok
+ */
+HRESULT WINAPI
Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
HANDLE h)
{
DX_WINDBG_trace();
- DX_STUB;
-}
-
-/*
- * IMPLEMENT
- * Status ok
- */
-HRESULT WINAPI
+ DX_STUB;
+}
+
+/*
+ * IMPLEMENT
+ * Status ok
+ */
+HRESULT WINAPI
Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
- LPDWORD total, LPDWORD free)
-{
- DX_WINDBG_trace();
-
- DX_STUB;
+ LPDWORD total, LPDWORD free)
+{
+ DX_WINDBG_trace();
+
+ DX_STUB;
}
/*
@@ -372,7 +527,7 @@
*/
HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7 iface, HDC hdc,
LPDIRECTDRAWSURFACE7 *lpDDS)
-{
+{
DX_WINDBG_trace();
DX_STUB;
}
@@ -391,7 +546,7 @@
* Stub
* Status todo
*/
-HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW7 iface)
+HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW7 iface)
{
DX_WINDBG_trace();
DX_STUB;
@@ -403,7 +558,7 @@
*/
HRESULT WINAPI Main_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW7 iface,
LPDDDEVICEIDENTIFIER2 pDDDI, DWORD dwFlags)
-{
+{
DX_WINDBG_trace();
DX_STUB;
}
@@ -424,7 +579,7 @@
* Status todo
*/
HRESULT WINAPI Main_DirectDraw_EvaluateMode(LPDIRECTDRAW7 iface,DWORD a,DWORD* b)
-{
+{
DX_WINDBG_trace();
DX_STUB;
}
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Sun Apr 22 22:15:31 2007
@@ -20,6 +20,8 @@
/* DirectDraw startup code only internal use */
extern DDRAWI_DIRECTDRAW_GBL ddgbl;
extern DDRAWI_DDRAWSURFACE_GBL ddSurfGbl;
+extern WCHAR classname[128];
+extern WNDCLASSW wnd_class;
HRESULT WINAPI StartDirectDraw(LPDIRECTDRAW* iface, LPGUID pGUID, BOOL reenable);
Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Sun Apr 22 22:15:31 2007
@@ -13,9 +13,11 @@
#include "d3dhal.h"
#include "ddrawgdi.h"
-#include "ddrawi.h"
DDRAWI_DIRECTDRAW_GBL ddgbl;
DDRAWI_DDRAWSURFACE_GBL ddSurfGbl;
+
+WCHAR classname[128];
+WNDCLASSW wnd_class;
@@ -74,7 +76,25 @@
if (Main_DirectDraw_QueryInterface((LPDIRECTDRAW7)This, id, (void**)&pIface))
{
if (StartDirectDraw((LPDIRECTDRAW*)This, pGUID, FALSE) == DD_OK);
+ {
+ RtlZeroMemory(&wnd_class, sizeof(wnd_class));
+ wnd_class.style = CS_HREDRAW | CS_VREDRAW;
+ wnd_class.lpfnWndProc = DefWindowProcW;
+ wnd_class.cbClsExtra = 0;
+ wnd_class.cbWndExtra = 0;
+ wnd_class.hInstance = GetModuleHandleW(0);
+ wnd_class.hIcon = 0;
+ wnd_class.hCursor = 0;
+ wnd_class.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
+ wnd_class.lpszMenuName = NULL;
+ wnd_class.lpszClassName = classname;
+ if(!RegisterClassW(&wnd_class))
+ {
+ return DDERR_GENERIC;
+ }
+
return DD_OK;
+ }
}
return DDERR_INVALIDPARAMS;
@@ -91,6 +111,7 @@
DWORD dwFlags = 0;
DX_WINDBG_trace();
+
/*
* ddgbl.dwPDevice is not longer in use in windows 2000 and higher
@@ -127,7 +148,8 @@
devicetypes= 1;
/* Create HDC for default, hal and hel driver */
- This->lpLcl->hDC = (ULONG_PTR) GetDC(GetActiveWindow());
+ This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow();
+ This->lpLcl->hDC = (ULONG_PTR) GetDC((HWND)This->lpLcl->hWnd);
/* cObsolete is undoc in msdn it being use in CreateDCA */
RtlCopyMemory(&ddgbl.cObsolete,&"DISPLAY",7);
@@ -138,7 +160,8 @@
{
devicetypes = 2;
/* Create HDC for default, hal driver */
- This->lpLcl->hDC = (ULONG_PTR) GetDC(GetActiveWindow());
+ This->lpLcl->hWnd =(ULONG_PTR) GetActiveWindow();
+ This->lpLcl->hDC = (ULONG_PTR) GetDC((HWND)This->lpLcl->hWnd);
/* cObsolete is undoc in msdn it being use in CreateDCA */
RtlCopyMemory(&ddgbl.cObsolete,&"DISPLAY",7);
@@ -150,7 +173,8 @@
devicetypes = 3;
/* Create HDC for default, hal and hel driver */
- This->lpLcl->hDC = (ULONG_PTR) GetDC(GetActiveWindow());
+ This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow();
+ This->lpLcl->hDC = (ULONG_PTR) GetDC((HWND)This->lpLcl->hWnd);
/* cObsolete is undoc in msdn it being use in CreateDCA */
RtlCopyMemory(&ddgbl.cObsolete,&"DISPLAY",7);
@@ -165,6 +189,7 @@
*/
devicetypes = 4;
This->lpLcl->hDC = (ULONG_PTR) NULL ;
+ This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow();
}
if ( (HDC)This->lpLcl->hDC == NULL)
@@ -222,6 +247,7 @@
This->lpLcl->lpDDCB = This->lpLcl->lpGbl->lpDDCBtmp;
This->lpLcl->hDD = This->lpLcl->lpGbl->hDD;
ddgbl.hDD = This->lpLcl->lpGbl->hDD;
+
return DD_OK;
}
@@ -318,12 +344,12 @@
DDHAL_DDEXEBUFCALLBACKS mD3dBufferCallbacks;
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
-
RtlZeroMemory(&mHALInfo, sizeof(DDHALINFO));
RtlZeroMemory(&mD3dCallbacks, sizeof(D3DHAL_CALLBACKS));
RtlZeroMemory(&mD3dDriverData, sizeof(D3DHAL_GLOBALDRIVERDATA));
RtlZeroMemory(&mD3dBufferCallbacks, sizeof(DDHAL_DDEXEBUFCALLBACKS));
+
if (reenable == FALSE)
{
ddgbl.lpDDCBtmp = DxHeapMemAlloc(sizeof(DDHAL_CALLBACKS));
@@ -345,6 +371,8 @@
DxHeapMemFree(ddgbl.lpDDCBtmp);
return DD_FALSE;
}
+
+
/* Some card disable the dx after it have been created so
* we are force reanble it