diff --git a/reactos/subsystems/win32/win32k/ntddraw/ddraw.c b/reactos/subsystems/win32/win32k/ntddraw/ddraw.c index dbc5d681162..675a5753526 100644 --- a/reactos/subsystems/win32/win32k/ntddraw/ddraw.c +++ b/reactos/subsystems/win32/win32k/ntddraw/ddraw.c @@ -462,7 +462,7 @@ NtGdiDdQueryDirectDrawObject( return Ret; } - /* + /* * Get puD3dBufferCallbacks */ if (puD3dBufferCallbacks != NULL) @@ -540,6 +540,58 @@ NtGdiDdQueryDirectDrawObject( return Ret; } +BOOL STDCALL NtGdiDdReenableDirectDrawObject( + HANDLE hDirectDrawLocal, + BOOL *pubNewMode +) +{ + BOOL Ret=FALSE; + NTSTATUS Status = FALSE; + PDD_DIRECTDRAW pDirectDraw; + + if (hDirectDrawLocal == NULL) + { + return Ret; + } + + pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, + GDI_OBJECT_TYPE_DIRECTDRAW); + + if (!pDirectDraw) + { + return Ret; + } + + /* + * FIXME detect mode change thic code maybe are not correct + * if we call on intEnableDriver it will cause some memory leak + * we need free the alloc memory before we call on it + */ + Ret = intEnableDriver(pDirectDraw); + + _SEH_TRY + { + ProbeForWrite(pubNewMode, sizeof(BOOL), 1); + *pubNewMode = Ret; + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + if(!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + return Ret; + } + + GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw); + + return Ret; + +} + + DWORD STDCALL NtGdiDdGetDriverInfo( HANDLE hDirectDrawLocal, diff --git a/reactos/subsystems/win32/win32k/ntddraw/stubs.c b/reactos/subsystems/win32/win32k/ntddraw/stubs.c index 37cc61283c5..bae83615e83 100644 --- a/reactos/subsystems/win32/win32k/ntddraw/stubs.c +++ b/reactos/subsystems/win32/win32k/ntddraw/stubs.c @@ -304,15 +304,6 @@ DWORD STDCALL NtGdiDdQueryMoCompStatus( return 0; } -BOOL STDCALL NtGdiDdReenableDirectDrawObject( - HANDLE hDirectDrawLocal, - BOOL *pubNewMode -) -{ - UNIMPLEMENTED - - return FALSE; -} BOOL STDCALL NtGdiDdReleaseDC( HANDLE hSurface