From 8dd1e30e97ce550e89a7cc8377de71495fcaed7c Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Thu, 27 Dec 2007 18:51:27 +0000 Subject: [PATCH] implement DxEngGetDeviceGammaRamp implement DxEngSetDeviceGammaRamp svn path=/trunk/; revision=31465 --- reactos/dll/directx/ddraw/Ddraw/ddraw_main.c | 11 +-- .../include/reactos/drivers/directx/dxeng.h | 6 +- .../win32/win32k/include/intddraw.h | 3 + .../subsystems/win32/win32k/ntddraw/dxeng.c | 72 ++++++++++++++----- 4 files changed, 65 insertions(+), 27 deletions(-) diff --git a/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c b/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c index 250d873076d..62d80de2042 100644 --- a/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c +++ b/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c @@ -441,7 +441,7 @@ Main_DirectDraw_CreateSurface (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC pDD DX_WINDBG_trace(); - // EnterCriticalSection(&ddcs); + EnterCriticalSection(&ddcs); *ppSurf = NULL; _SEH_TRY @@ -464,8 +464,8 @@ Main_DirectDraw_CreateSurface (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC pDD ret = DDERR_INVALIDPARAMS; } _SEH_END; - // LeaveCriticalSection(&ddcs); - return ret; + LeaveCriticalSection(&ddcs); + return ret; } @@ -476,7 +476,8 @@ Main_DirectDraw_CreateSurface4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC2 pD { HRESULT ret; DX_WINDBG_trace(); - // EnterCriticalSection(&ddcs); + + EnterCriticalSection(&ddcs); *ppSurf = NULL; _SEH_TRY @@ -489,7 +490,7 @@ Main_DirectDraw_CreateSurface4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC2 pD } _SEH_END; - // LeaveCriticalSection(&ddcs); + LeaveCriticalSection(&ddcs); return ret; } diff --git a/reactos/include/reactos/drivers/directx/dxeng.h b/reactos/include/reactos/drivers/directx/dxeng.h index 0488557573c..6f214ef0761 100644 --- a/reactos/include/reactos/drivers/directx/dxeng.h +++ b/reactos/include/reactos/drivers/directx/dxeng.h @@ -67,7 +67,7 @@ HDEV *DxEngEnumerateHdev(HDEV *hdev); /* Notes : same protypes NtGdiEngGetDeviceGammaRamp, diffent is we skipp the user mode checks and seh */ BOOL -DxEngGetDeviceGammaRamp(HDC hDC, LPVOID lpRamp); +DxEngGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp); /* Notes : Lock the hDC */ PDC DxEngLockDC(HDC hDC); @@ -75,7 +75,8 @@ PDC DxEngLockDC(HDC hDC); /* Notes : Unlock the hDC */ BOOL DxEngUnlockDC(PDC pDC); - +/* Notes : Set Gamma ramp */ +BOOL DxEngSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Unuse); /* prototypes are not done yet, I need gather all my notes * to make them correct @@ -89,7 +90,6 @@ DWORD DxEngUnlockHdev(DWORD x1); DWORD DxEngReferenceHdev(DWORD x1); DWORD DxEngIsHdevLockedByCurrentThread(DWORD x1); DWORD DxEngUnreferenceHdev(DWORD x1); -DWORD DxEngSetDeviceGammaRamp(DWORD x1, DWORD x2, DWORD x3); DWORD DxEngSpTearDownSprites(DWORD x1, DWORD x2, DWORD x3); DWORD DxEngSpUnTearDownSprites(DWORD x1, DWORD x2, DWORD x3); DWORD DxEngSpSpritesVisible(DWORD x1); diff --git a/reactos/subsystems/win32/win32k/include/intddraw.h b/reactos/subsystems/win32/win32k/include/intddraw.h index fd11d1e8162..c6954efc56f 100644 --- a/reactos/subsystems/win32/win32k/include/intddraw.h +++ b/reactos/subsystems/win32/win32k/include/intddraw.h @@ -121,5 +121,8 @@ typedef BOOL (NTAPI *PGD_ENGUNLOCKDIRECTDRAWSURFACE)(PDD_SURFACE_LOCAL); } \ } +/* Gammaramp internal prototype */ +BOOL FASTCALL IntGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp); +BOOL FASTCALL IntSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp); #endif /* _INT_W32k_DDRAW */ diff --git a/reactos/subsystems/win32/win32k/ntddraw/dxeng.c b/reactos/subsystems/win32/win32k/ntddraw/dxeng.c index 5d267539fe0..2c82222a2fb 100644 --- a/reactos/subsystems/win32/win32k/ntddraw/dxeng.c +++ b/reactos/subsystems/win32/win32k/ntddraw/dxeng.c @@ -123,16 +123,29 @@ DxEngEnumerateHdev(HDEV *hdev) return FALSE; } -/************************************************************************/ -/* DxEngGetDeviceGammaRamp */ -/************************************************************************/ -/* same protypes NtGdiEngGetDeviceGammaRamp, diffent is we skipp the user mode checks and seh */ +/*++ +* @name DxEngGetDeviceGammaRamp +* @implemented +* +* The function DxEngSetDeviceGammaRamp Set Gamma ramp from from dxg.sys + +* @param HDEV hPDev +* The hdev +* +* @param PGAMMARAMP Ramp +* to fill in our gama ramp +* +* @return +* This return FALSE or TRUE, FALSE for fail, TRUE for success +* +* @remarks. +* ReactOS does not loop it, only set the gamma once. +* +*--*/ BOOL -DxEngGetDeviceGammaRamp(HDC hDC, LPVOID lpRamp) +DxEngGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp) { - /* FIXME redirect it to NtGdiEngGetDeviceGammaRamp internal call */ - UNIMPLEMENTED; - return FALSE; + return IntGetDeviceGammaRamp(hPDev, Ramp); } @@ -140,12 +153,12 @@ DxEngGetDeviceGammaRamp(HDC hDC, LPVOID lpRamp) * @name DxEngLockDC * @implemented * -* The function DxEngLockDC lock a hdc from dxg.sys +* The function DxEngLockDC lock a hdc from dxg.sys * * @param HDC hDC * The handle we need want lock * -* @return +* @return * This api return PDC or NULL depns if it sussess lock the hdc or not * * @remarks. @@ -163,13 +176,13 @@ DxEngLockDC(HDC hDC) * @name DxEngUnlockDC * @implemented * -* The function DxEngUnlockDC Unlock a pDC (hdc) from dxg.sys +* The function DxEngUnlockDC Unlock a pDC (hdc) from dxg.sys * @param PDC pDC * The handle we need unlock * -* @return -* This api always return TRUE if it sussess or not +* @return +* This api always return TRUE if it sussess or not * * @remarks. * none @@ -265,13 +278,34 @@ DWORD DxEngUnreferenceHdev(DWORD x1) return FALSE; } -/************************************************************************/ -/* DxEngSetDeviceGammaRamp */ -/************************************************************************/ -DWORD DxEngSetDeviceGammaRamp(DWORD x1, DWORD x2, DWORD x3) + +/*++ +* @name DxEngSetDeviceGammaRamp +* @implemented +* +* The function DxEngSetDeviceGammaRamp Set Gamma ramp from from dxg.sys + +* @param HDEV hPDev +* The hdev +* +* @param PGAMMARAMP Ramp +* to set in our gama ramp +* +* @param BOOL Unuse +* Info on this are avail at request. at moment ReactOS does not +* does not use it. and problare never need it. +* +* @return +* This return FALSE or TRUE, FALSE for fail, TRUE for success +* +* @remarks. +* ReactOS does not loop it, only set the gamma once. +* +*--*/ +BOOL +DxEngSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Unuse) { - UNIMPLEMENTED; - return FALSE; + return IntSetDeviceGammaRamp(hPDev, Ramp); } /************************************************************************/