Author: greatlrd
Date: Sun Oct 21 05:25:26 2007
New Revision: 29725
URL: http://svn.reactos.org/svn/reactos?rev=29725&view=rev
Log:
Add documentations : how NtGdiDdCreateD3DBuffer works, did nott add full docs, but egunt for people start using it if they read msdn as well
Optimize : NtGdiDdCreateD3DBuffer
Modified:
branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c
URL: http://svn.reactos.org/svn/reactos/branches/reactx/reactos/subsystems/win32…
==============================================================================
--- branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c (original)
+++ branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c Sun Oct 21 05:25:26 2007
@@ -48,6 +48,7 @@
* for the ddRVal will other wise be unchange if some error happen inside the driver.
* puCanCreateSurfaceData->lpDD is pointer to DDRAWI_DIRECTDRAW_GBL, MSDN say it is PDD_DIRECTDRAW_GLOBAL it is not.
* puCanCreateSurfaceData->lpDD->hDD need also be fill in with the handle we got from NtGdiDdCreateDirectDrawObject
+* puCreateSurfaceData->CanCreateSurface pointer to the real functions the HAL or HEL, that u need fill in
*
*--*/
@@ -195,9 +196,57 @@
return pfnD3dContextDestroyAll(pdcad);
}
-/************************************************************************/
-/* NtGdiDdCreateD3DBuffer */
-/************************************************************************/
+/*++
+* @name NtGdiDdCreateD3DBuffer
+* @implemented
+*
+* The function NtGdiDdCreateD3DBuffer create a
+* surface for DirectX. It is redirected to dxg.sys.
+*
+* @param HANDLE hDirectDraw
+* The handle we got from NtGdiDdCreateDirectDrawObject
+*
+* @param HANDLE *hSurface
+* <FILMEIN>
+*
+* @param DDSURFACEDESC puSurfaceDescription
+* surface desc what kind of surface it should be, example rgb, compress, deep, and more,
+* see DDSURFACEDESC for more infomations
+*
+* @param DD_SURFACE_GLOBAL *puSurfaceGlobalData
+* <FILMEIN>
+*
+* @param DD_SURFACE_LOCAL *puSurfaceLocalData
+* <FILMEIN>
+*
+* @param DD_SURFACE_MORE *puSurfaceMoreData
+* <FILMEIN>
+*
+* @param PDD_CREATESURFACEDATA puCreateSurfaceData
+* <FILMEIN>
+*
+* @param HANDLE *puhSurface
+* <FILMEIN>
+*
+* @return
+* Depending on if the driver supports this API or not, DDHAL_DRIVER_HANDLED
+* or DDHAL_DRIVER_NOTHANDLED is returned.
+* To check if the function has been successful, do a full check.
+* A full check is done by checking if the return value is DDHAL_DRIVER_HANDLED
+* and puCanCreateSurfaceData->ddRVal is set to DD_OK.
+*
+* @remarks.
+* dxg.sys NtGdiDdCreateD3DBuffer and NtGdiDdCreateSurface call are redirect to dxg.sys
+* inside the dxg.sys they ar redirect to same functions. examine the driver list functions
+* table, the memory address you will see they are pointed to same memory address.
+*
+* Before call to this api please set the puCreateSurfaceData->ddRVal to a error value example DDERR_NOTUSPORTED.
+* for the ddRVal will other wise be unchange if some error happen inside the driver.
+* puCreateSurfaceData->lpDD is pointer to DDRAWI_DIRECTDRAW_GBL, MSDN say it is PDD_DIRECTDRAW_GLOBAL it is not.
+* puCreateSurfaceData->lpDD->hDD need also be fill in with the handle we got from NtGdiDdCreateDirectDrawObject
+* puCreateSurfaceData->CreateSurface pointer to the real functions the HAL or HEL, that u need fill in
+*
+*--*/
DWORD
STDCALL
NtGdiDdCreateD3DBuffer(HANDLE hDirectDraw,
@@ -209,10 +258,7 @@
PDD_CREATESURFACEDATA puCreateSurfaceData,
HANDLE *puhSurface)
{
- PGD_DDCREATED3DBUFFER pfnDdCreateD3DBuffer = NULL;
- INT i;
-
- DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxDdCreateD3DBuffer, pfnDdCreateD3DBuffer);
+ PGD_DDCREATED3DBUFFER pfnDdCreateD3DBuffer = (PGD_D3DCONTEXTDESTROYALL)gpDxFuncs[DXG_INDEX_DxDdCreateD3DBuffer].pfn;
if (pfnDdCreateD3DBuffer == NULL)
{
Author: greatlrd
Date: Sun Oct 21 04:47:24 2007
New Revision: 29724
URL: http://svn.reactos.org/svn/reactos?rev=29724&view=rev
Log:
Add documentations : how NtGdiD3dContextDestroyAll works, MSDN docs is wrong
Optimize : NtGdiD3dContextDestroyAll
Modified:
branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c
URL: http://svn.reactos.org/svn/reactos/branches/reactx/reactos/subsystems/win32…
==============================================================================
--- branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c (original)
+++ branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c Sun Oct 21 04:47:24 2007
@@ -157,17 +157,33 @@
return pfnD3dContextDestroy(pContextDestroyData);
}
-/************************************************************************/
-/* NtGdiD3dContextDestroyAll */
-/************************************************************************/
+/*++
+* @name NtGdiD3dContextDestroyAll
+* @implemented
+*
+* The Function NtGdiD3dContextDestroyAll Destory the all context data we got in a process
+* The data have been alloc with NtGdiD3dContextCreate
+*
+* @param LPD3DNTHAL_CONTEXTDESTROYALLDATA pdcad
+* The context data we want to destory
+*
+* @remarks.
+* dxg.sys NtGdiD3dContextDestroyAll call are redirect to
+* same functions in the dxg.sys. So they are working exacly same. everthing else is lying if they
+* are diffent.
+*
+* Before call to this api please set the pdcad->ddRVal to a error value example DDERR_NOTUSPORTED.
+* for the ddRVal will other wise be unchange if some error happen inside the driver.
+* pdcad->dwPID need also be fill in with the Process ID we need destore the data for
+*
+* Waring MSDN is wrong about this api. it say it queare free memory and it does not accpect
+* any parama, last time checked in msdn 19/10-2007
+*--*/
DWORD
STDCALL
NtGdiD3dContextDestroyAll(LPD3DNTHAL_CONTEXTDESTROYALLDATA pdcad)
{
- PGD_D3DCONTEXTDESTROYALL pfnD3dContextDestroyAll = NULL;
- INT i;
-
- DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxD3dContextDestroyAll, pfnD3dContextDestroyAll);
+ PGD_D3DCONTEXTDESTROYALL pfnD3dContextDestroyAll = (PGD_D3DCONTEXTDESTROYALL)gpDxFuncs[DXG_INDEX_DxD3dContextDestroyAll].pfn;
if (pfnD3dContextDestroyAll == NULL)
{
Author: greatlrd
Date: Sat Oct 20 22:58:13 2007
New Revision: 29721
URL: http://svn.reactos.org/svn/reactos?rev=29721&view=rev
Log:
update some docs with info that is correct, this info can not be found in msdn, msdn is wrong in this part.
that why people can not check see if they can create a surface.
Modified:
branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c
URL: http://svn.reactos.org/svn/reactos/branches/reactx/reactos/subsystems/win32…
==============================================================================
--- branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c (original)
+++ branches/reactx/reactos/subsystems/win32/win32k/ntddraw/d3d.c Sat Oct 20 22:58:13 2007
@@ -46,6 +46,8 @@
*
* Before call to this api please set the puCanCreateSurfaceData->ddRVal to a error value example DDERR_NOTUSPORTED.
* for the ddRVal will other wise be unchange if some error happen inside the driver.
+* puCanCreateSurfaceData->lpDD is pointer to DDRAWI_DIRECTDRAW_GBL, MSDN say it is PDD_DIRECTDRAW_GLOBAL it is not.
+* puCanCreateSurfaceData->lpDD->hDD need also be fill in with the handle we got from NtGdiDdCreateDirectDrawObject
*
*--*/
@@ -54,7 +56,7 @@
NtGdiDdCanCreateD3DBuffer(HANDLE hDirectDraw,
PDD_CANCREATESURFACEDATA puCanCreateSurfaceData)
{
- PGD_DXDDDESTROYD3DBUFFER pfnDdCanCreateD3DBuffer = gpDxFuncs[DXG_INDEX_DxDdCanCreateD3DBuffer].pfn;
+ PGD_DDCANCREATED3DBUFFER pfnDdCanCreateD3DBuffer = (PGD_DDCANCREATED3DBUFFER)gpDxFuncs[DXG_INDEX_DxDdCanCreateD3DBuffer].pfn;
if (pfnDdCanCreateD3DBuffer == NULL)
{
@@ -92,12 +94,13 @@
*
*
* @remarks.
-* dxg.sys NtGdiD3dContextCreate and NtGdiD3dContextCreate call are redirect to
+* dxg.sys NtGdiD3dContextCreate call are redirect to
* same functions in the dxg.sys. So they are working exacly same. everthing else is lying if they
* are diffent.
*
* Before call to this api please set the hSurfZ->ddRVal to a error value example DDERR_NOTUSPORTED.
* for the ddRVal will other wise be unchange if some error happen inside the driver.
+* hSurfZ->dwhContext need also be fill in with the handle we got from NtGdiDdCreateDirectDrawObject
*
*--*/
BOOL
@@ -107,7 +110,7 @@
HANDLE hSurfZ,
D3DNTHAL_CONTEXTCREATEDATA* pdcci)
{
- PGD_DDCANCREATED3DBUFFER pfnD3dContextCreate = gpDxFuncs[DXG_INDEX_DxD3dContextCreate].pfn;
+ PGD_D3DCONTEXTCREATE pfnD3dContextCreate = (PGD_D3DCONTEXTCREATE)gpDxFuncs[DXG_INDEX_DxD3dContextCreate].pfn;
if (pfnD3dContextCreate == NULL)
{
@@ -119,17 +122,30 @@
return pfnD3dContextCreate(hDirectDrawLocal, hSurfColor, hSurfZ, pdcci);
}
-/************************************************************************/
-/* NtGdiD3dContextDestroy */
-/************************************************************************/
+/*++
+* @name NtGdiD3dContextDestroy
+* @implemented
+*
+* The Function NtGdiD3dContextDestroy Destory the context data we got from NtGdiD3dContextCreate
+*
+* @param LPD3DNTHAL_CONTEXTDESTROYDATA pContextDestroyData
+* The context data we want to destory
+*
+* @remarks.
+* dxg.sys NtGdiD3dContextDestroy call are redirect to
+* same functions in the dxg.sys. So they are working exacly same. everthing else is lying if they
+* are diffent.
+*
+* Before call to this api please set the pContextDestroyData->ddRVal to a error value example DDERR_NOTUSPORTED.
+* for the ddRVal will other wise be unchange if some error happen inside the driver.
+* pContextDestroyData->dwhContext need also be fill in with the handle we got from NtGdiDdCreateDirectDrawObject
+*
+*--*/
DWORD
STDCALL
NtGdiD3dContextDestroy(LPD3DNTHAL_CONTEXTDESTROYDATA pContextDestroyData)
{
- PGD_D3DCONTEXTDESTROY pfnD3dContextDestroy = NULL;
- INT i;
-
- DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxD3dContextDestroy, pfnD3dContextDestroy);
+ PGD_D3DCONTEXTDESTROY pfnD3dContextDestroy = (PGD_D3DCONTEXTDESTROY)gpDxFuncs[DXG_INDEX_DxD3dContextDestroy].pfn;
if ( pfnD3dContextDestroy == NULL)
{