mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
- Comments, debug prints translation into readable english.
svn path=/trunk/; revision=29389
This commit is contained in:
parent
a030c28a82
commit
e82583fbe8
1 changed files with 39 additions and 37 deletions
|
@ -5,7 +5,7 @@
|
||||||
* FILE: subsys/win32k/ntddraw/dd.c
|
* FILE: subsys/win32k/ntddraw/dd.c
|
||||||
* PROGRAMER: Magnus Olsen (greatlord@reactos.org)
|
* PROGRAMER: Magnus Olsen (greatlord@reactos.org)
|
||||||
* REVISION HISTORY:
|
* REVISION HISTORY:
|
||||||
* 19/7-2006 Magnus Olsen
|
* 19/7-2006 Magnus Olsen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <w32k.h>
|
#include <w32k.h>
|
||||||
|
@ -16,17 +16,16 @@
|
||||||
#define DdHandleTable GdiHandleTable
|
#define DdHandleTable GdiHandleTable
|
||||||
|
|
||||||
/*
|
/*
|
||||||
DdMapMemory, DdDestroyDriver are not exported as NtGdi Call
|
DdMapMemory, DdDestroyDriver are not exported as NtGdi calls
|
||||||
This file is compelete for DD_CALLBACKS setup
|
This file is complete for DD_CALLBACKS setup
|
||||||
|
|
||||||
ToDO fix the NtGdiDdCreateSurface, shall we fix it
|
TODO: Fix the NtGdiDdCreateSurface (something is missing in
|
||||||
from GdiEntry or gdientry callbacks for DdCreateSurface
|
either GdiEntry or GdiEntry's callback for DdCreateSurface)
|
||||||
have we miss some thing there
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* NtGdiDdCreateSurface */
|
/* NtGdiDdCreateSurface */
|
||||||
/* status : Bugs out */
|
/* Status : Bugs out */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
DWORD STDCALL NtGdiDdCreateSurface(
|
DWORD STDCALL NtGdiDdCreateSurface(
|
||||||
|
@ -52,12 +51,11 @@ DWORD STDCALL NtGdiDdCreateSurface(
|
||||||
|
|
||||||
DD_CREATESURFACEDATA CreateSurfaceData;
|
DD_CREATESURFACEDATA CreateSurfaceData;
|
||||||
|
|
||||||
/* FIXME alloc so mayne we need */
|
/* FIXME: Alloc as much as needed */
|
||||||
PHANDLE *myhSurface;
|
PHANDLE *myhSurface;
|
||||||
|
|
||||||
/* GCC4 warnns on value are unisitaed,
|
/* GCC4 gives warnings about uninitialized
|
||||||
but they are initated in seh
|
values, but they are initialized in SEH */
|
||||||
*/
|
|
||||||
|
|
||||||
DPRINT1("NtGdiDdCreateSurface\n");
|
DPRINT1("NtGdiDdCreateSurface\n");
|
||||||
|
|
||||||
|
@ -79,11 +77,12 @@ DWORD STDCALL NtGdiDdCreateSurface(
|
||||||
return ddRVal;
|
return ddRVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME we only support one surface at moment
|
/* FIXME: There is only support for one surface at the moment.
|
||||||
this is a hack to prevent more that one surface being create
|
This is a hack to prevent more than one surface creation */
|
||||||
*/
|
|
||||||
if (CreateSurfaceData.dwSCnt > 1)
|
if (CreateSurfaceData.dwSCnt > 1)
|
||||||
{
|
{
|
||||||
|
DPRINT1("HACK: Limiting quantity of created surfaces from %d to 1!\n",
|
||||||
|
CreateSurfaceData.dwSCnt);
|
||||||
CreateSurfaceData.dwSCnt = 1;
|
CreateSurfaceData.dwSCnt = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,8 +109,7 @@ DWORD STDCALL NtGdiDdCreateSurface(
|
||||||
return ddRVal;
|
return ddRVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* see if a surface have been create or not */
|
/* Check if a surface has been created */
|
||||||
|
|
||||||
for (i=0;i<CreateSurfaceData.dwSCnt;i++)
|
for (i=0;i<CreateSurfaceData.dwSCnt;i++)
|
||||||
{
|
{
|
||||||
if (!myhSurface[i])
|
if (!myhSurface[i])
|
||||||
|
@ -119,21 +117,21 @@ DWORD STDCALL NtGdiDdCreateSurface(
|
||||||
myhSurface[i] = GDIOBJ_AllocObj(DdHandleTable, GDI_OBJECT_TYPE_DD_SURFACE);
|
myhSurface[i] = GDIOBJ_AllocObj(DdHandleTable, GDI_OBJECT_TYPE_DD_SURFACE);
|
||||||
if (!myhSurface[i])
|
if (!myhSurface[i])
|
||||||
{
|
{
|
||||||
/* FIXME lock myhSurface*/
|
/* FIXME: lock myhSurface*/
|
||||||
/* FIXME free myhSurface, and the contain */
|
/* FIXME: free myhSurface, and the contain */
|
||||||
/* add to attach list */
|
/* FIXME: add to attach list */
|
||||||
return ddRVal;
|
return ddRVal;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* FIXME lock myhSurface*/
|
/* FIXME: lock myhSurface*/
|
||||||
/* FIXME add to attach list */
|
/* FIXME: add to attach list */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME we need continue fix more that one createsurface */
|
/* FIXME: more than one surface is not supported here, once again */
|
||||||
/* FIXME we need release myhSurface before any exits*/
|
/* FIXME: we need release myhSurface before any exits */
|
||||||
|
|
||||||
phsurface = GDIOBJ_LockObj(DdHandleTable, myhSurface[0], GDI_OBJECT_TYPE_DD_SURFACE);
|
phsurface = GDIOBJ_LockObj(DdHandleTable, myhSurface[0], GDI_OBJECT_TYPE_DD_SURFACE);
|
||||||
if (!phsurface)
|
if (!phsurface)
|
||||||
|
@ -247,10 +245,13 @@ DWORD STDCALL NtGdiDdCreateSurface(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* FIXME unlock phsurface free phsurface at fail*/
|
/* FIXME: unlock phsurface, free phsurface at failure */
|
||||||
/* FIXME unlock hsurface free phsurface at fail*/
|
/* FIXME: unlock hsurface, free phsurface at failure */
|
||||||
/* FIXME add support for more that one surface create */
|
/* FIXME: add support for more than one surface create, once more */
|
||||||
/* FIXME alloc memory if it more that one surface */
|
/* FIXME: alloc memory if it's more than one surface (5th mention
|
||||||
|
that this long function doesn't support more than one
|
||||||
|
surface creation. I guess it was easier to support it
|
||||||
|
than to write such comments 10 times). */
|
||||||
|
|
||||||
pLocal = &phsurface->Local;
|
pLocal = &phsurface->Local;
|
||||||
pMore = &phsurface->More;
|
pMore = &phsurface->More;
|
||||||
|
@ -267,18 +268,18 @@ DWORD STDCALL NtGdiDdCreateSurface(
|
||||||
pLocal->lpAttachListFrom;
|
pLocal->lpAttachListFrom;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* FIXME a countup to next pLocal, pMore, pGlobal */
|
/* FIXME: a countup to next pLocal, pMore, pGlobal */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setup DD_CREATESURFACEDATA CreateSurfaceData for the driver */
|
/* Setup DD_CREATESURFACEDATA CreateSurfaceData for the driver */
|
||||||
CreateSurfaceData.lplpSList = (PDD_SURFACE_LOCAL *) &phsurface->lcllist;
|
CreateSurfaceData.lplpSList = (PDD_SURFACE_LOCAL *) &phsurface->lcllist;
|
||||||
CreateSurfaceData.lpDDSurfaceDesc = &phsurface->desc;
|
CreateSurfaceData.lpDDSurfaceDesc = &phsurface->desc;
|
||||||
CreateSurfaceData.CreateSurface = NULL;
|
CreateSurfaceData.CreateSurface = NULL;
|
||||||
CreateSurfaceData.ddRVal = DDERR_GENERIC;
|
CreateSurfaceData.ddRVal = DDERR_GENERIC;
|
||||||
CreateSurfaceData.lpDD = &pDirectDraw->Global;
|
CreateSurfaceData.lpDD = &pDirectDraw->Global;
|
||||||
|
|
||||||
/* the CreateSurface crash with lcl convering */
|
/* CreateSurface must crash with lcl converting */
|
||||||
if ((pDirectDraw->DD.dwFlags & DDHAL_CB32_CREATESURFACE))
|
if ((pDirectDraw->DD.dwFlags & DDHAL_CB32_CREATESURFACE))
|
||||||
{
|
{
|
||||||
DPRINT1("0x%04x",pDirectDraw->DD.CreateSurface);
|
DPRINT1("0x%04x",pDirectDraw->DD.CreateSurface);
|
||||||
|
@ -288,7 +289,7 @@ DWORD STDCALL NtGdiDdCreateSurface(
|
||||||
|
|
||||||
DPRINT1("Retun value is %04x and driver return code is %04x\n",ddRVal,CreateSurfaceData.ddRVal);
|
DPRINT1("Retun value is %04x and driver return code is %04x\n",ddRVal,CreateSurfaceData.ddRVal);
|
||||||
|
|
||||||
/* FIXME support for more that one surface */
|
/* FIXME: support for more that one surface (once more!!!!) */
|
||||||
_SEH_TRY
|
_SEH_TRY
|
||||||
{
|
{
|
||||||
ProbeForWrite(puSurfaceDescription, sizeof(DDSURFACEDESC), 1);
|
ProbeForWrite(puSurfaceDescription, sizeof(DDSURFACEDESC), 1);
|
||||||
|
@ -364,17 +365,18 @@ DWORD STDCALL NtGdiDdCreateSurface(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* FIXME fillin the return handler */
|
/* FIXME: Fil the return handler */
|
||||||
DPRINT1("GDIOBJ_UnlockObjByPtr\n");
|
DPRINT1("GDIOBJ_UnlockObjByPtr\n");
|
||||||
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
|
||||||
|
|
||||||
DPRINT1("Retun value is %04x and driver return code is %04x\n",ddRVal,CreateSurfaceData.ddRVal);
|
DPRINT1("Return value is %04x and driver return code is %04x\n",
|
||||||
|
ddRVal, CreateSurfaceData.ddRVal);
|
||||||
return ddRVal;
|
return ddRVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* NtGdiDdWaitForVerticalBlank */
|
/* NtGdiDdWaitForVerticalBlank */
|
||||||
/* status : OK working as it should */
|
/* status : Works as intended */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
@ -440,7 +442,7 @@ DWORD STDCALL NtGdiDdWaitForVerticalBlank(
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* CanCreateSurface */
|
/* CanCreateSurface */
|
||||||
/* status : OK working as it should */
|
/* status : Works as intended */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
DWORD STDCALL NtGdiDdCanCreateSurface(
|
DWORD STDCALL NtGdiDdCanCreateSurface(
|
||||||
|
@ -523,8 +525,8 @@ DWORD STDCALL NtGdiDdCanCreateSurface(
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* GetScanLine */
|
/* GetScanLine */
|
||||||
/* status : is now documented in MSDN and I checked the code it works */
|
/* status : This func is now documented in MSDN, and now it's compatible*/
|
||||||
/* like windows 2000 */
|
/* with Windows 2000 implementation */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
DWORD STDCALL
|
DWORD STDCALL
|
||||||
NtGdiDdGetScanLine( HANDLE hDirectDrawLocal, PDD_GETSCANLINEDATA puGetScanLineData)
|
NtGdiDdGetScanLine( HANDLE hDirectDrawLocal, PDD_GETSCANLINEDATA puGetScanLineData)
|
||||||
|
|
Loading…
Reference in a new issue