2006-07-20 07:23:21 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
|
|
|
* PURPOSE: Native DirectDraw implementation
|
2015-11-10 17:41:55 +00:00
|
|
|
* FILE: win32ss/reactx/ntddraw/dd.c
|
2006-07-20 07:23:21 +00:00
|
|
|
* PROGRAMER: Magnus Olsen (greatlord@reactos.org)
|
|
|
|
* REVISION HISTORY:
|
2007-10-14 12:07:23 +00:00
|
|
|
* 19/1-2006 Magnus Olsen
|
2006-07-20 07:23:21 +00:00
|
|
|
*/
|
|
|
|
|
2010-04-26 13:58:46 +00:00
|
|
|
#include <win32k.h>
|
2023-11-15 20:07:27 +00:00
|
|
|
|
|
|
|
// #define NDEBUG
|
2006-07-20 07:23:21 +00:00
|
|
|
#include <debug.h>
|
2007-10-14 12:07:23 +00:00
|
|
|
|
2007-10-14 15:03:13 +00:00
|
|
|
/************************************************************************/
|
|
|
|
/* NtGdiDdCreateSurface */
|
|
|
|
/************************************************************************/
|
2007-10-14 12:07:23 +00:00
|
|
|
DWORD
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2007-10-14 15:03:13 +00:00
|
|
|
NtGdiDdCreateSurface(HANDLE hDirectDrawLocal,
|
|
|
|
HANDLE *hSurface,
|
|
|
|
DDSURFACEDESC *puSurfaceDescription,
|
|
|
|
DD_SURFACE_GLOBAL *puSurfaceGlobalData,
|
|
|
|
DD_SURFACE_LOCAL *puSurfaceLocalData,
|
|
|
|
DD_SURFACE_MORE *puSurfaceMoreData,
|
|
|
|
PDD_CREATESURFACEDATA puCreateSurfaceData,
|
|
|
|
HANDLE *puhSurface)
|
2007-10-14 12:07:23 +00:00
|
|
|
{
|
2008-04-17 22:25:38 +00:00
|
|
|
PGD_DDCREATESURFACE pfnDdCreateSurface = (PGD_DDCREATESURFACE)gpDxFuncs[DXG_INDEX_DxDdCreateSurface].pfn;
|
2023-11-15 20:07:27 +00:00
|
|
|
|
2007-10-14 15:03:13 +00:00
|
|
|
if (pfnDdCreateSurface == NULL)
|
2007-10-14 12:07:23 +00:00
|
|
|
{
|
2008-11-03 14:39:03 +00:00
|
|
|
DPRINT1("Warning: no pfnDdCreateSurface\n");
|
2007-10-14 12:07:23 +00:00
|
|
|
return DDHAL_DRIVER_NOTHANDLED;
|
|
|
|
}
|
|
|
|
|
2023-11-15 20:07:27 +00:00
|
|
|
DPRINT("Calling dxg.sys pfnDdCreateSurface\n");
|
2007-10-14 15:03:13 +00:00
|
|
|
return pfnDdCreateSurface(hDirectDrawLocal,hSurface,puSurfaceDescription,puSurfaceGlobalData,
|
|
|
|
puSurfaceLocalData,puSurfaceMoreData,puCreateSurfaceData,puhSurface);
|
2007-10-14 12:07:23 +00:00
|
|
|
}
|
|
|
|
|
2006-07-20 07:23:21 +00:00
|
|
|
/************************************************************************/
|
2007-10-14 15:03:13 +00:00
|
|
|
/* NtGdiDdWaitForVerticalBlank */
|
2006-07-20 07:23:21 +00:00
|
|
|
/************************************************************************/
|
2007-10-14 15:03:13 +00:00
|
|
|
DWORD
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2007-10-14 15:03:13 +00:00
|
|
|
NtGdiDdWaitForVerticalBlank(HANDLE hDirectDraw,
|
|
|
|
PDD_WAITFORVERTICALBLANKDATA puWaitForVerticalBlankData)
|
2006-07-20 07:23:21 +00:00
|
|
|
{
|
2008-04-17 22:25:38 +00:00
|
|
|
PGD_DXDDWAITFORVERTICALBLANK pfnDdWaitForVerticalBlank = (PGD_DXDDWAITFORVERTICALBLANK)gpDxFuncs[DXG_INDEX_DxDdWaitForVerticalBlank].pfn;
|
2023-11-15 20:07:27 +00:00
|
|
|
|
2007-10-14 15:03:13 +00:00
|
|
|
if (pfnDdWaitForVerticalBlank == NULL)
|
2007-03-17 15:15:27 +00:00
|
|
|
{
|
2008-11-03 14:39:03 +00:00
|
|
|
DPRINT1("Warning: no pfnDdWaitForVerticalBlank\n");
|
2007-10-14 15:03:13 +00:00
|
|
|
return DDHAL_DRIVER_NOTHANDLED;
|
2007-03-16 15:28:48 +00:00
|
|
|
}
|
|
|
|
|
2023-11-15 20:07:27 +00:00
|
|
|
DPRINT("Calling dxg.sys pfnDdWaitForVerticalBlank\n");
|
2007-10-14 15:03:13 +00:00
|
|
|
return pfnDdWaitForVerticalBlank(hDirectDraw, puWaitForVerticalBlankData);
|
2006-07-20 07:23:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/************************************************************************/
|
2007-10-14 15:03:13 +00:00
|
|
|
/* NtGdiDdCanCreateSurface */
|
2006-07-20 07:23:21 +00:00
|
|
|
/************************************************************************/
|
2007-10-14 15:03:13 +00:00
|
|
|
DWORD
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2007-10-14 15:03:13 +00:00
|
|
|
NtGdiDdCanCreateSurface(HANDLE hDirectDrawLocal,
|
|
|
|
PDD_CANCREATESURFACEDATA puCanCreateSurfaceData)
|
2006-07-20 07:23:21 +00:00
|
|
|
{
|
2008-04-17 22:25:38 +00:00
|
|
|
PGD_DDCANCREATESURFACE pfnDdCanCreateSurface = (PGD_DDCANCREATESURFACE)gpDxFuncs[DXG_INDEX_DxDdCanCreateSurface].pfn;
|
2023-11-15 20:07:27 +00:00
|
|
|
|
2007-10-14 15:03:13 +00:00
|
|
|
if (pfnDdCanCreateSurface == NULL)
|
|
|
|
{
|
2008-11-03 14:39:03 +00:00
|
|
|
DPRINT1("Warning: no pfnDdCanCreateSurface\n");
|
2007-10-14 15:03:13 +00:00
|
|
|
return DDHAL_DRIVER_NOTHANDLED;
|
2007-03-11 16:28:22 +00:00
|
|
|
}
|
2007-03-11 15:47:49 +00:00
|
|
|
|
2023-11-15 20:07:27 +00:00
|
|
|
DPRINT("Calling dxg.sys pfnDdCanCreateSurface\n");
|
2008-04-26 09:29:10 +00:00
|
|
|
|
|
|
|
return pfnDdCanCreateSurface(hDirectDrawLocal,puCanCreateSurfaceData);
|
2007-10-14 15:03:13 +00:00
|
|
|
}
|
2006-07-20 07:23:21 +00:00
|
|
|
|
|
|
|
/************************************************************************/
|
2007-10-14 15:03:13 +00:00
|
|
|
/* NtGdiDdGetScanLine */
|
2006-07-20 07:23:21 +00:00
|
|
|
/************************************************************************/
|
2007-10-14 15:03:13 +00:00
|
|
|
DWORD
|
2023-11-15 20:07:27 +00:00
|
|
|
APIENTRY
|
2007-10-14 15:03:13 +00:00
|
|
|
NtGdiDdGetScanLine(HANDLE hDirectDrawLocal,
|
|
|
|
PDD_GETSCANLINEDATA puGetScanLineData)
|
2006-07-20 07:23:21 +00:00
|
|
|
{
|
2008-04-17 22:25:38 +00:00
|
|
|
PGD_DXDDGETSCANLINE pfnDdGetScanLine = (PGD_DXDDGETSCANLINE)gpDxFuncs[DXG_INDEX_DxDdGetScanLine].pfn;
|
2023-11-15 20:07:27 +00:00
|
|
|
|
2007-10-14 15:03:13 +00:00
|
|
|
if (pfnDdGetScanLine == NULL)
|
2007-03-11 15:47:49 +00:00
|
|
|
{
|
2008-11-03 14:39:03 +00:00
|
|
|
DPRINT1("Warning: no pfnDdGetScanLine\n");
|
2007-10-14 15:03:13 +00:00
|
|
|
return DDHAL_DRIVER_NOTHANDLED;
|
2007-03-11 15:47:49 +00:00
|
|
|
}
|
2006-07-20 07:23:21 +00:00
|
|
|
|
2023-11-15 20:07:27 +00:00
|
|
|
DPRINT("Calling dxg.sys pfnDdGetScanLine\n");
|
2008-04-26 09:29:10 +00:00
|
|
|
|
BugFix : EDD_DIRECTDRAW_GLOBAL put ddCallbacks in right position.
that mean driver api DestroyDriver, CreateSurface, SetColorKey, SetMode, WaitForVerticalBlank, CanCreateSurface, CreatePalette, GetScanLine, MapMemory works inside ms dxg.sys now
test of that is NtGdiDdCreateSurface, NtGdiDdSetColorKey, NtGdiDdWaitForVerticalBlank, NtGdiDdCanCreateSurface, NtGdiDdCreatePalette, NtGdiDdGetScanLine
works and show prof it being call to the drv. that mean we got the graphic card api working now. It still exists bugs. Long live our ReactX that showing frist life sign with ms dxg.sys inside vmware and thuse api working. But it is not egunt getting a dx apps working yet.
svn path=/trunk/; revision=33156
2008-04-26 20:18:42 +00:00
|
|
|
return pfnDdGetScanLine(hDirectDrawLocal,puGetScanLineData);
|
2006-07-20 07:23:21 +00:00
|
|
|
}
|
2007-10-14 15:03:13 +00:00
|
|
|
|
|
|
|
|
2007-10-14 19:45:13 +00:00
|
|
|
/************************************************************************/
|
2011-11-29 14:55:58 +00:00
|
|
|
/* This is not part of the ddsurface interface but it */
|
|
|
|
/* deals with the surface */
|
2007-10-14 19:45:13 +00:00
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
/* NtGdiDdCreateSurfaceEx */
|
|
|
|
/************************************************************************/
|
|
|
|
DWORD
|
2008-11-29 22:48:58 +00:00
|
|
|
APIENTRY
|
2007-10-14 19:45:13 +00:00
|
|
|
NtGdiDdCreateSurfaceEx(HANDLE hDirectDraw,
|
|
|
|
HANDLE hSurface,
|
|
|
|
DWORD dwSurfaceHandle)
|
|
|
|
{
|
2008-04-17 22:25:38 +00:00
|
|
|
PGD_DXDDCREATESURFACEEX pfnDdCreateSurfaceEx = (PGD_DXDDCREATESURFACEEX)gpDxFuncs[DXG_INDEX_DxDdCreateSurfaceEx].pfn;
|
2023-11-15 20:07:27 +00:00
|
|
|
|
2007-10-14 19:45:13 +00:00
|
|
|
if (pfnDdCreateSurfaceEx == NULL)
|
|
|
|
{
|
2008-11-03 14:39:03 +00:00
|
|
|
DPRINT1("Warning: no pfnDdCreateSurfaceEx\n");
|
2007-10-14 19:45:13 +00:00
|
|
|
return DDHAL_DRIVER_NOTHANDLED;
|
|
|
|
}
|
|
|
|
|
2023-11-15 20:07:27 +00:00
|
|
|
DPRINT("Calling dxg.sys pfnDdCreateSurfaceEx\n");
|
2007-10-15 19:04:50 +00:00
|
|
|
return pfnDdCreateSurfaceEx(hDirectDraw,hSurface,dwSurfaceHandle);
|
2007-10-14 19:45:13 +00:00
|
|
|
}
|