Author: greatlrd Date: Wed Jan 2 12:37:05 2008 New Revision: 31556
URL: http://svn.reactos.org/svn/reactos?rev=31556&view=rev Log: partly implement DxEngSetHdevData fixed DxEngGetHdevData protoype as well
Modified: trunk/reactos/drivers/directx/dxg/eng.c trunk/reactos/include/reactos/drivers/directx/dxeng.h trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
Modified: trunk/reactos/drivers/directx/dxg/eng.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/directx/dxg/eng.c?r... ============================================================================== --- trunk/reactos/drivers/directx/dxg/eng.c (original) +++ trunk/reactos/drivers/directx/dxg/eng.c Wed Jan 2 12:37:05 2008 @@ -45,6 +45,117 @@ return retVal; }
+HANDLE +STDCALL +DxDdCreateDirectDrawObject(HDC hdc) +{ + HANDLE hDirectDraw = NULL; + DHPDEV hPdev; // PGDIDEVICE + ULONG iDitherFormat; + + DC *pDC; = gpEngFuncs[DXENG_INDEX_DxEngLockDC](); + + if (pDC != NULL) + { + hPdev = gpEngFuncs[DXENG_INDEX_DxEngGetDCState](hdc, 3); + + if (hPdev != 0) + { + /* Get DC display flag */ + if (gpEngFuncs[DXENG_INDEX_DxEngGetHdevData](hPdev, 12)) + { + EDD_DEVLOCK(hdc, esi); + + if (!gpEngFuncs[DXENG_INDEX_DxEngGetHdevData](hPdev,19)) + { + CheckAgpHeaps( gpEngFuncs[DXENG_INDEX_DxEngGetHdevData](hPdev,7) ); + } + + iDitherFormat = gpEngFuncs[DXENG_INDEX_DxEngGetHdevData](hPdev,2); + + .text:00019FF1 cmp eax, 3 + .text:00019FF4 jb short loc_1A001 + + hDirectDraw = hDdCreateDirectDrawLocal(hPdev); + + loc_1A001: + if (hdc != NULL) + { + gpEngFuncs[DXENG_INDEX_DxEngUnlockHdev](hdc); + } + } + } + + gpEngFuncs[DXENG_INDEX_DxEngUnlockDC](pDC); + } + + return hDirectDraw; + +} + + +int __stdcall hDdCreateDirectDrawLocal(HDEV hDEV) +{ + int v1; // eax@1 + int v2; // edi@1 + int result; // eax@2 + int v4; // ebx@2 + struct HDD_OBJ__ *v5; // eax@5 + struct HDD_OBJ__ *v6; // esi@5 + int v7; // eax@1 + int v8; // eax@6 + int v9; // eax@6 + int v10; // eax@6 + int _EAX; // eax@6 + signed int _ECX; // ecx@6 + int v18; // [sp+8h] [bp-4h]@1 + + v18 = 0; + v7 = gpEngFuncs[DXENG_INDEX_DxEngGetHdevData](hPdev,7); + v2 = v7; + v1 = *(_DWORD *)(v7 + 0x30); + if ( v1 ) + { + result = EngAllocMem(1, 4 * v1, 1885627463); + v4 = result; + if ( !result ) + return result; + } + else + { + v4 = 0; + } + v5 = DdHmgAlloc(0x54u, 1u, 1u); + v6 = v5; + if ( v5 ) + { + *((_DWORD *)v5 + 12) = *(_DWORD *)(v2 + 1448); + *(_DWORD *)(v2 + 1448) = v5; + *((_DWORD *)v5 + 8) = (char *)v5 + 28; + *((_DWORD *)v5 + 7) = (char *)v5 + 28; + *((_DWORD *)v5 + 9) = v2; + *((_DWORD *)v5 + 4) = v2; + v8 = PsGetCurrentThread(); + *((_DWORD *)v6 + 15) = PsGetThreadProcessId(v8); + v9 = PsGetCurrentProcess(); + *((_DWORD *)v6 + 19) = 0; + *((_DWORD *)v6 + 16) = v9; + v10 = a1; + *((_DWORD *)v6 + 17) = v4; + (*(int (__cdecl **)(_DWORD))(gpEngFuncs + 108))(*(_DWORD *)v10); + v18 = *(_DWORD *)v6; + _EAX = (int)((char *)v6 + 8); + _ECX = -1; + __asm { lock xadd [eax], ecx } + MapAllAgpHeaps(v6); + } + else + { + if ( v4 ) + EngFreeMem(v4); + } + return v18; +}
Modified: trunk/reactos/include/reactos/drivers/directx/dxeng.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/dir... ============================================================================== --- trunk/reactos/include/reactos/drivers/directx/dxeng.h (original) +++ trunk/reactos/include/reactos/drivers/directx/dxeng.h Wed Jan 2 12:37:05 2008 @@ -81,6 +81,8 @@ BOOLEAN DxEngLockShareSem(); BOOLEAN DxEngUnlockShareSem(); BOOLEAN DxEngCleanDC(HDC hdc); +DWORD DxEngGetHdevData(HDEV hdev, DWORD Index); +BOOLEAN DxEngSetHdevData(HDEV hdev, DWORD Index, DWORD Save);
/* prototypes are not done yet, I need gather all my notes * to make them correct @@ -96,8 +98,7 @@ DWORD DxEngSpTearDownSprites(DWORD x1, DWORD x2, DWORD x3); DWORD DxEngSpUnTearDownSprites(DWORD x1, DWORD x2, DWORD x3); DWORD DxEngSpSpritesVisible(DWORD x1); -DWORD DxEngGetHdevData(PEDD_DIRECTDRAW_GLOBAL pEDDgpl, DWORD Index); -DWORD DxEngSetHdevData(DWORD x1, DWORD x2, DWORD x3); + DWORD DxEngGetDesktopDC(DWORD x1, DWORD x2, DWORD x3); DWORD DxEngDeleteDC(DWORD x1, DWORD x2); DWORD DxEngSetDCOwner(DWORD x1, DWORD x2);
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntd... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c Wed Jan 2 12:37:05 2008 @@ -374,20 +374,49 @@ /* DxEngGetHdevData */ /************************************************************************/ DWORD -DxEngGetHdevData(PEDD_DIRECTDRAW_GLOBAL pEDDgpl, +DxEngGetHdevData(HDEV hdev, DWORD Index) { UNIMPLEMENTED; return 0; }
-/************************************************************************/ -/* DxEngSetHdevData */ -/************************************************************************/ -DWORD DxEngSetHdevData(DWORD x1, DWORD x2, DWORD x3) -{ - UNIMPLEMENTED; - return FALSE; +/*++ +* @name DxEngSetHdevData +* @implemented +* +* The function DxEngSetHdevData sets a value in hdev + +* @param HDEV hPDev +* The hdev +* +* @param DWORD Index +* Support only Index 8 it is a internal counter how many time hdev been lock and unlock +* +* @param DWORD Save +* The value to be save to hdev internal counter +* +* @return +* Returns TRUE for success, FALSE for failure +* +* @remarks. +* ReactOS specfiy Not finish implement, I have not save the value into the hdev yet. +* +*--*/ +BOOLEAN +DxEngSetHdevData(HDEV hdev, + DWORD Index, + DWORD Save) +{ + BOOL retVal = FALSE; + if (Index == 8) + { + /* Counter how many time hdev been lock/unlock, we do not support it yet in ReactOS */ + DPRINT1("Warning not supproted yet\n"); + retVal = TRUE; + } + + return retVal; }
/************************************************************************/