From 7ac1277f52a846e0978c77e0763135262b85e76e Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Fri, 15 Jun 2007 16:44:15 +0000 Subject: [PATCH] Fixing smaller bugs in startup.c it does not set windows handler or use windows handler hdc it create own hdc svn path=/trunk/; revision=27191 --- reactos/dll/directx/ddraw/startup.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/reactos/dll/directx/ddraw/startup.c b/reactos/dll/directx/ddraw/startup.c index 0db71394270..e3d6217fd97 100644 --- a/reactos/dll/directx/ddraw/startup.c +++ b/reactos/dll/directx/ddraw/startup.c @@ -172,8 +172,9 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable) } } } - - DX_STUB_str("here\n"); + /* Windows handler are by set of SetCooperLevel + * so do not set it + */ if (reenable == FALSE) { @@ -183,8 +184,8 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable) devicetypes= 1; /* Create HDC for default, hal and hel driver */ - This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow(); - This->lpLcl->hDC = (ULONG_PTR) GetDC((HWND)This->lpLcl->hWnd); + // This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow(); + This->lpLcl->hDC = (ULONG_PTR)CreateDCA("DISPLAY",NULL,NULL,NULL); /* cObsolete is undoc in msdn it being use in CreateDCA */ RtlCopyMemory(&ddgbl.cObsolete,&"DISPLAY",7); @@ -197,8 +198,8 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable) { devicetypes = 2; /* Create HDC for default, hal driver */ - This->lpLcl->hWnd =(ULONG_PTR) GetActiveWindow(); - This->lpLcl->hDC = (ULONG_PTR) GetDC((HWND)This->lpLcl->hWnd); + // This->lpLcl->hWnd =(ULONG_PTR) GetActiveWindow(); + This->lpLcl->hDC = (ULONG_PTR)CreateDCA("DISPLAY",NULL,NULL,NULL); /* cObsolete is undoc in msdn it being use in CreateDCA */ RtlCopyMemory(&ddgbl.cObsolete,&"DISPLAY",7); @@ -210,8 +211,8 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable) devicetypes = 3; /* Create HDC for default, hal and hel driver */ - This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow(); - This->lpLcl->hDC = (ULONG_PTR) GetDC((HWND)This->lpLcl->hWnd); + //This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow(); + This->lpLcl->hDC = (ULONG_PTR)CreateDCA("DISPLAY",NULL,NULL,NULL); /* cObsolete is undoc in msdn it being use in CreateDCA */ RtlCopyMemory(&ddgbl.cObsolete,&"DISPLAY",7); @@ -225,15 +226,17 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable) * the register. we do not support that yet */ devicetypes = 4; - This->lpLcl->hDC = (ULONG_PTR) NULL ; - This->lpLcl->hWnd = (ULONG_PTR) GetActiveWindow(); + //This->lpLcl->hDC = (ULONG_PTR) NULL ; + //This->lpLcl->hDC = (ULONG_PTR)CreateDCA("DISPLAY",NULL,NULL,NULL); } + /* if ( (HDC)This->lpLcl->hDC == NULL) { DX_STUB_str("DDERR_OUTOFMEMORY\n"); return DDERR_OUTOFMEMORY ; } + */ } This->lpLcl->lpDDCB = ddgbl.lpDDCBtmp; @@ -585,6 +588,11 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable) */ } + if (mHALInfo.dwFlags & DDHALINFO_GETDRIVERINFO2) + { + This->lpLcl->lpGbl->dwFlags = This->lpLcl->lpGbl->dwFlags | DDRAWI_DRIVERINFO2; + } + return DD_OK; }