Author: greatlrd
Date: Wed Jul 19 06:14:26 2006
New Revision: 23168
URL: http://svn.reactos.org/svn/reactos?rev=23168&view=rev
Log:
hacking NtGdiDdResetVisrgn so it lest say clip have not change. for now
Modified:
trunk/reactos/subsystems/win32/win32k/ntddraw/stubs.c
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/stubs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/stubs.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/stubs.c Wed Jul 19 06:14:26 2006
@@ -338,9 +338,18 @@
HWND hwnd
)
{
- UNIMPLEMENTED
-
- return 0;
+ DPRINT1("UNIMPLEMENTED NtGdiDdResetVisrgn \n");
+ /* see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winu…
+ for more info, I pasted some part of it here
+ Clipping can change asynchronously from the point of view of user-mode threads.
+ The kernel-mode parts of DirectDraw and Microsoft Windows Graphics Device Interface (GDI)
+ maintain a counter that is incremented whenever the clipping list for the entire desktop
+ changes. A call to this function records this counter with every existing DirectDraw
+ primary surface on the system.
+
+ */
+
+ return TRUE;
}
Author: fireball
Date: Tue Jul 18 23:06:30 2006
New Revision: 23161
URL: http://svn.reactos.org/svn/reactos?rev=23161&view=rev
Log:
Add traceprints, and temporarily comment out NDEBUG
Modified:
trunk/reactos/drivers/test/kmtest/ntos_ex.c
Modified: trunk/reactos/drivers/test/kmtest/ntos_ex.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/test/kmtest/ntos_e…
==============================================================================
--- trunk/reactos/drivers/test/kmtest/ntos_ex.c (original)
+++ trunk/reactos/drivers/test/kmtest/ntos_ex.c Tue Jul 18 23:06:30 2006
@@ -71,6 +71,7 @@
ok(Status == STATUS_SUCCESS, "ZwOpenTimer failed with Status=0x%08lX", Status);
// Set the timer, to some rather high value so it doesn't expire
+ DPRINT("Set timer 1\n");
DueTime.LowPart = -10000;
DueTime.HighPart = -10;
PreviousState = TRUE;
@@ -85,6 +86,7 @@
ok(CurrentState == FALSE, "Incorrect CurrentState returned when canceling the timer");
// Set the timer to some small value, because we'll wait for it to expire
+ DPRINT("Set timer 2\n");
DueTime.LowPart = -100;
DueTime.HighPart = -1;
PreviousState = TRUE;
@@ -93,16 +95,19 @@
ok(PreviousState == FALSE, "Incorrect PreviousState returned when setting the timer");
// Wait until it expires
+ DPRINT("Wait till timer expires\n");
Status = ZwWaitForSingleObject(HandleOpened, FALSE, NULL);
ok(Status == STATUS_SUCCESS, "ZwWaitForSingleObject failed with Status=0x%08lX", Status);
// And cancel it
+ DPRINT("Cancel it\n");
CurrentState = FALSE;
Status = ZwCancelTimer(HandleOpened, &CurrentState);
ok(Status == STATUS_SUCCESS, "ZwCancelTimer failed with Status=0x%08lX", Status);
ok(CurrentState == TRUE, "Incorrect CurrentState returned when setting the timer");
// Test it with APC: Set, Cancel, check if APC has been called
+ DPRINT("Set timer with Apc (3)\n");
ApcCount = 0;
DueTime.LowPart = -10000;
DueTime.HighPart = -10;
@@ -114,6 +119,7 @@
ok(Status == STATUS_SUCCESS, "ZwSetTimer failed with Status=0x%08lX", Status);
ok(PreviousState == TRUE, "Incorrect PreviousState returned when setting the timer");
+ DPRINT("Cancel it\n");
CurrentState = TRUE;
Status = ZwCancelTimer(HandleOpened, &CurrentState);
ok(Status == STATUS_SUCCESS, "ZwCancelTimer failed with Status=0x%08lX", Status);
@@ -121,6 +127,7 @@
ok(ApcCount == 0, "Incorrect count of TimerApcRoutine calls: %ld, should be 0\n", ApcCount);
// Test setting the timer two times in a row, APC routine must not be called
+ DPRINT("Set timer with Apc (4)\n");
ApcCount = 0;
DueTime.LowPart = -10000;
DueTime.HighPart = -10;
@@ -132,6 +139,7 @@
ok(PreviousState == FALSE, "Incorrect PreviousState returned when setting the timer");
// Set small due time, since we have to wait for timer to finish
+ DPRINT("Set timer with Apc (5)\n");
DueTime.LowPart = -10;
DueTime.HighPart = -1;
PreviousState = TRUE;
@@ -142,6 +150,7 @@
ok(PreviousState == FALSE, "Incorrect PreviousState returned when setting the timer");
// Now wait till it's finished, and then check APC call
+ DPRINT("Wait for it\n");
Status = ZwWaitForSingleObject(HandleOpened, FALSE, NULL);
ok(Status == STATUS_SUCCESS, "ZwWaitForSingleObject failed with Status=0x%08lX", Status);
Author: greatlrd
Date: Tue Jul 18 23:04:41 2006
New Revision: 23160
URL: http://svn.reactos.org/svn/reactos?rev=23160&view=rev
Log:
rewrote NtGdiDdQueryDirectDrawObject for I must have been drunk when I wrote it frist time.
Now we manger getting gdientry2 working more or less here is a log how far I have come
I have not implement create surface for the drv yet. But it showing lest how far dxhaltest
comes. as u all can see it is not far before we getting dx hal working out of the box from
win32k and gdi32. I will thank all people that have been invlove in this, DrFred to helping debug betwin ddraw.dll gdi32.dll
with his sniffer apps, Alex for GdiEntry2, and some other help, W3seek, Filip, GvG help me to understand how our win32k how it works
and some other info. to make so far posible, it is now posible to load a graphic driver directx hal support in ros. But I do not known how well it works yet, after it is the frist public version that working so far.
ddraw.c:60) NtGdiDdCreateDirectDrawObject
ddraw.c:140) DirectDraw return handler 0x3b6001e4
ddraw.c:170) NtGdiDdQueryDirectDrawObject
ddraw.c:247) Found DirectDraw CallBack for 2D and 3D Hal
ddraw.c:170) NtGdiDdQueryDirectDrawObject
ddraw.c:247) Found DirectDraw CallBack for 2D and 3D Hal
ddraw.c:432) NtGdiDdCanCreateSurface
ddraw.c:348) NtGdiDdCreateSurface
Modified:
trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c Tue Jul 18 23:04:41 2006
@@ -30,9 +30,8 @@
DD_Cleanup(PVOID ObjectBody)
{
PDD_DIRECTDRAW pDirectDraw = (PDD_DIRECTDRAW) ObjectBody;
-#ifdef DX_DEBUG
+
DPRINT1("DD_Cleanup\n");
-#endif
if (!pDirectDraw)
return FALSE;
@@ -47,9 +46,8 @@
return TRUE;
}
-HANDLE STDCALL NtGdiDdCreateDirectDrawObject(
- HDC hdc
-)
+HANDLE STDCALL
+NtGdiDdCreateDirectDrawObject(HDC hdc)
{
DD_CALLBACKS callbacks;
DD_SURFACECALLBACKS surface_callbacks;
@@ -85,6 +83,11 @@
if (pDC->DriverFunctions.EnableDirectDraw == NULL)
{
/* Driver doesn't support DirectDraw */
+
+ /*
+ Warring ReactOS complain that pDC are not right owner
+ when DC_UnlockDc(pDC) hit, why ?
+ */
DC_UnlockDc(pDC);
return NULL;
}
@@ -134,17 +137,14 @@
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
DC_UnlockDc(pDC);
- DPRINT1("DirectDraw return handler\n");
+ DPRINT1("DirectDraw return handler 0x%x\n",hDirectDraw);
return hDirectDraw;
}
-BOOL STDCALL NtGdiDdDeleteDirectDrawObject(
- HANDLE hDirectDrawLocal
-)
-{
-#ifdef DX_DEBUG
+BOOL STDCALL
+NtGdiDdDeleteDirectDrawObject( HANDLE hDirectDrawLocal)
+{
DPRINT1("NtGdiDdDeleteDirectDrawObject\n");
-#endif
return GDIOBJ_FreeObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW);
}
@@ -162,59 +162,42 @@
DWORD *puFourCC
)
{
-#ifdef DX_DEBUG
+ DD_HALINFO HalInfo;
PDD_DIRECTDRAW pDirectDraw;
BOOL success;
+
+
DPRINT1("NtGdiDdQueryDirectDrawObject\n");
-#endif
/* Check for NULL pointer to prevent any one doing a mistake */
-
if (hDirectDrawLocal == NULL)
{
-#ifdef DX_DEBUG
- DPRINT1("warning hDirectDraw handler is NULL, the handler is DDRAWI_DIRECTDRAW_GBL.hDD\n");
- DPRINT1("and it is NtGdiDdCreateDirectDrawObject return value\n");
-#endif
return FALSE;
}
-
if (pHalInfo == NULL)
- {
-#ifdef DX_DEBUG
- DPRINT1("warning pHalInfo buffer is NULL \n");
-#endif
+ {
return FALSE;
}
if ( pCallBackFlags == NULL)
{
-#ifdef DX_DEBUG
- DPRINT1("warning pCallBackFlags s NULL, the size must be 3*DWORD in follow order \n");
- DPRINT1("pCallBackFlags[0] = flags in DD_CALLBACKS\n");
- DPRINT1("pCallBackFlags[1] = flags in DD_SURFACECALLBACKS\n");
- DPRINT1("pCallBackFlags[2] = flags in DD_PALETTECALLBACKS\n");
-#endif
return FALSE;
}
-
-
+
pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW);
-
-
+
if (!pDirectDraw)
{
/* Fail to Lock DirectDraw handle */
-#ifdef DX_DEBUG
- DPRINT1(" Fail to Lock DirectDraw handle \n");
-#endif
return FALSE;
}
+ pHalInfo->dwSize = 0;
+
success = pDirectDraw->DrvGetDirectDrawInfo(
pDirectDraw->Global.dhpdev,
- pHalInfo,
+ &HalInfo,
puNumHeaps,
puvmList,
puNumFourCC,
@@ -222,136 +205,77 @@
if (!success)
{
-#ifdef DX_DEBUG
- DPRINT1(" Fail to get DirectDraw driver info \n");
-#endif
+ DPRINT1("Driver does not fill the Fail to get DirectDraw driver info \n");
+
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
return FALSE;
}
-
-
+
+ if (HalInfo.dwSize == 0)
+ {
+ DPRINT1(" Fail for driver does not fill the DD_HALINFO struct \n");
+ GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+ return FALSE;
+ }
+
+ if (HalInfo.dwSize != sizeof(DD_HALINFO))
+ {
+ if (HalInfo.dwSize == sizeof(DD_HALINFO_V4))
+ {
+ /* NT4 Compatible */
+ DPRINT1("Got DD_HALINFO_V4 sturct we convert it to DD_HALINFO \n");
+ HalInfo.dwSize = sizeof(DD_HALINFO);
+ HalInfo.lpD3DGlobalDriverData = NULL;
+ HalInfo.lpD3DHALCallbacks = NULL;
+ HalInfo.lpD3DBufCallbacks = NULL;
+ }
+ else
+ {
+ DPRINT1(" Fail : did not get DD_HALINFO size \n");
+ GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
+ return FALSE;
+ }
+ }
+
+ RtlMoveMemory(pHalInfo, &HalInfo, sizeof(DD_HALINFO));
+
/* rest the flag so we do not need do it later */
- pCallBackFlags[0]=0;
- pCallBackFlags[1]=0;
- pCallBackFlags[2]=0;
-
- if (pHalInfo)
- {
-
- {
- DDHALINFO* pHalInfo2 = ((DDHALINFO*) pHalInfo);
-#ifdef DX_DEBUG
- DPRINT1("Found DirectDraw CallBack for 2D and 3D Hal\n");
-#endif
- RtlMoveMemory(&pDirectDraw->Hal, pHalInfo2, sizeof(DDHALINFO));
-
- if (pHalInfo2->lpDDExeBufCallbacks)
- {
-#ifdef DX_DEBUG
- DPRINT1("Found DirectDraw CallBack for 3D Hal Bufffer \n");
-#endif
- /* msdn DDHAL_D3DBUFCALLBACKS = DD_D3DBUFCALLBACKS */
- RtlMoveMemory(puD3dBufferCallbacks, pHalInfo2->lpDDExeBufCallbacks, sizeof(DD_D3DBUFCALLBACKS));
- }
-
-#ifdef DX_DEBUG
- DPRINT1("Do not support CallBack for 3D Hal\n");
-#endif
- /* FIXME we need D3DHAL be include
-
- if (pHalInfo2->lpD3DHALCallbacks )
- {
-#ifdef DX_DEBUG
- DPRINT1("Found DirectDraw CallBack for 3D Hal\n");
-#endif
- RtlMoveMemory(puD3dCallbacks, (ULONG *)pHalInfo2->lpD3DHALCallbacks, sizeof( D3DHAL_CALLBACKS ));
- }
- */
-
-
- /* msdn say D3DHAL_GLOBALDRIVERDATA and D3DNTHAL_GLOBALDRIVERDATA are not same
- but if u compare these in msdn it is exacly same */
-
- if (pHalInfo->lpD3DGlobalDriverData)
- {
-#ifdef DX_DEBUG
- DPRINT1("Found DirectDraw CallBack for 3D Hal Private \n");
-#endif
- RtlMoveMemory(puD3dDriverData, (ULONG *)pHalInfo2->lpD3DGlobalDriverData, sizeof(D3DNTHAL_GLOBALDRIVERDATA));
- }
-
- /* build the flag */
-
- if (pHalInfo2->lpDDCallbacks!=NULL)
- {
-#ifdef DX_DEBUG
- DPRINT1("Dectect DirectDraw lpDDCallbacks for 2D Hal flag = %d\n",pHalInfo2->lpDDCallbacks->dwFlags);
-#endif
- pCallBackFlags[0] = pHalInfo2->lpDDCallbacks->dwFlags;
- }
-
- if (pHalInfo2->lpDDCallbacks!=NULL)
- {
-#ifdef DX_DEBUG
- DPRINT1("Dectect DirectDraw lpDDSurfaceCallbacks for 2D Hal flag = %d\n",pHalInfo2->lpDDSurfaceCallbacks->dwFlags);
-#endif
- pCallBackFlags[1] = pHalInfo2->lpDDSurfaceCallbacks->dwFlags;
- }
-
- if (pHalInfo2->lpDDCallbacks!=NULL)
- {
-#ifdef DX_DEBUG
- DPRINT1("Dectect DirectDraw lpDDCallbacks for 2D Hal flag = %d\n",pHalInfo2->lpDDPaletteCallbacks->dwFlags);
-#endif
- pCallBackFlags[2] = pHalInfo2->lpDDPaletteCallbacks->dwFlags;
- }
-
- }
-
-#ifdef DX_DEBUG
- DPRINT1("Found DirectDraw CallBack for 3D Hal\n");
-#endif
- RtlMoveMemory(&pDirectDraw->Hal, pHalInfo, sizeof(DD_HALINFO));
-
- if (pHalInfo->lpD3DBufCallbacks)
- {
-#ifdef DX_DEBUG
- DPRINT1("Found DirectDraw CallBack for 3D Hal Bufffer \n");
-#endif
- RtlMoveMemory(puD3dBufferCallbacks, pHalInfo->lpD3DBufCallbacks, sizeof(DD_D3DBUFCALLBACKS));
- }
-
- if (pHalInfo->lpD3DHALCallbacks)
- {
-#ifdef DX_DEBUG
- DPRINT1("Found DirectDraw CallBack for 3D Hal\n");
-#endif
- RtlMoveMemory(puD3dCallbacks, pHalInfo->lpD3DHALCallbacks, sizeof(D3DNTHAL_CALLBACKS));
- }
-
- if (pHalInfo->lpD3DGlobalDriverData)
- {
-#ifdef DX_DEBUG
- DPRINT1("Found DirectDraw CallBack for 3D Hal Private \n");
-#endif
- RtlMoveMemory(puD3dDriverData, pHalInfo->lpD3DGlobalDriverData, sizeof(D3DNTHAL_GLOBALDRIVERDATA));
- }
-
-#ifdef DX_DEBUG
- DPRINT1("Unkown DirectX driver interface\n");
-#endif
-
- }
-
-#ifdef DX_DEBUG
- else
- {
- DPRINT1("No DirectDraw Hal info have been found, it did not fail, it did gather some other info \n");
+ pCallBackFlags[0]=pDirectDraw->DD.dwFlags;
+ pCallBackFlags[1]=pDirectDraw->Surf.dwFlags;
+ pCallBackFlags[2]=pDirectDraw->Pal.dwFlags;
+
+ DPRINT1("Found DirectDraw CallBack for 2D and 3D Hal\n");
+
+ RtlMoveMemory(&pDirectDraw->Hal, pHalInfo, sizeof(DD_HALINFO));
+
+ if (pHalInfo->lpD3DGlobalDriverData)
+ {
+ /*
+ msdn say D3DHAL_GLOBALDRIVERDATA and D3DNTHAL_GLOBALDRIVERDATA are not same
+ but if u compare these in msdn it is exacly same
+ */
+ DPRINT1("Found DirectDraw Global DriverData \n");
+ RtlMoveMemory(puD3dDriverData, pHalInfo->lpD3DGlobalDriverData, sizeof(D3DNTHAL_GLOBALDRIVERDATA));
}
-#endif
-
+ /* FIXME
+ * we missing D3DHAL_CALLBACKS in the headers
+ *
+
+ if (pHalInfo->lpD3DHALCallbacks )
+ {
+ DPRINT1("Found DirectDraw CallBack for 3D Hal\n");
+ RtlMoveMemory(puD3dCallbacks, (ULONG *)pHalInfo->lpD3DHALCallbacks, sizeof( D3DHAL_CALLBACKS ));
+ }
+
+ */
+ if (pHalInfo->lpD3DBufCallbacks)
+ {
+ DPRINT1("Found DirectDraw CallBack for 3D Hal Bufffer \n");
+ /* msdn DDHAL_D3DBUFCALLBACKS = DD_D3DBUFCALLBACKS */
+ RtlMoveMemory(puD3dBufferCallbacks, pHalInfo->lpD3DBufCallbacks, sizeof(DD_D3DBUFCALLBACKS));
+ }
+
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
-
return TRUE;
}