mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[DXG] Initial implementation of DxDdLock and better stub for DxDdUnlock
svn path=/trunk/; revision=75182
This commit is contained in:
parent
355e52a599
commit
1f993d692c
5 changed files with 105 additions and 20 deletions
|
@ -24,8 +24,8 @@ typedef struct _EDD_DIRECTDRAW_LOCAL
|
|||
/* 0x2C */ FLONG fl;
|
||||
/* 0x30 */ struct _EDD_DIRECTDRAW_LOCAL *peDirectDrawLocal_prev; // verified to match Windows XP,
|
||||
// points to the old DDLocal when new handle is created.
|
||||
/* 0x34 */ ULONG unk_034;
|
||||
/* 0x38 */ ULONG unk_038;
|
||||
/* 0x34 */ FLATPTR fpProcess2; // surface memory address returned by graphic driver
|
||||
/* 0x38 */ ULONG isMemoryMapped; // surface memory mapped?
|
||||
/* 0x3C */ HANDLE UniqueProcess;
|
||||
/* 0x40 */ PEPROCESS Process;
|
||||
/* 0x44 */ VOID *unk_044;
|
||||
|
|
|
@ -7,6 +7,7 @@ list(APPEND SOURCE
|
|||
d3d.c
|
||||
dd.c
|
||||
ddraw.c
|
||||
ddsurf.c
|
||||
eng.c
|
||||
historic.c
|
||||
dxg_int.h)
|
||||
|
|
100
reactos/win32ss/reactx/dxg/ddsurf.c
Normal file
100
reactos/win32ss/reactx/dxg/ddsurf.c
Normal file
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* PURPOSE: Native driver for dxg implementation
|
||||
* FILE: win32ss/reactx/dxg/ddsurf.c
|
||||
* PROGRAMER: Sebastian Gasiorek (sebastian.gasiorek@reactos.org)
|
||||
*/
|
||||
|
||||
/*++
|
||||
* @name DxDdLock
|
||||
* @implemented
|
||||
*
|
||||
* The function DxDdLock locks the surface and calls
|
||||
* MapMemory driver function to assign surface memory.
|
||||
* Surface memory is returned in mapMemoryData.fpProcess variable
|
||||
*
|
||||
* @param HANDLE hSurface
|
||||
* Handle to DirectDraw surface
|
||||
*
|
||||
* @param PDD_LOCKDATA puLockData
|
||||
* Structure with lock details
|
||||
*
|
||||
* @param HDC hdcClip
|
||||
* Reserved
|
||||
*
|
||||
* @return
|
||||
* Returns DDHAL_DRIVER_HANDLED or DDHAL_DRIVER_NOTHANDLED.
|
||||
*
|
||||
* @remarks.
|
||||
* Missing lock data and error handling.
|
||||
*--*/
|
||||
DWORD
|
||||
NTAPI
|
||||
DxDdLock(HANDLE hSurface,
|
||||
PDD_LOCKDATA puLockData,
|
||||
HDC hdcClip)
|
||||
{
|
||||
PEDD_SURFACE pSurface;
|
||||
PEDD_DIRECTDRAW_LOCAL peDdL;
|
||||
PEDD_DIRECTDRAW_GLOBAL peDdGl;
|
||||
DD_MAPMEMORYDATA mapMemoryData;
|
||||
|
||||
pSurface = (PEDD_SURFACE)DdHmgLock(hSurface, ObjType_DDSURFACE_TYPE, TRUE);
|
||||
peDdL = pSurface->peDirectDrawLocal;
|
||||
peDdGl = peDdL->peDirectDrawGlobal2;
|
||||
|
||||
// Map memory if it's not already mapped and driver function is provided
|
||||
if (!peDdL->isMemoryMapped && (peDdGl->ddCallbacks.dwFlags & DDHAL_CB32_MAPMEMORY))
|
||||
{
|
||||
mapMemoryData.bMap = 1;
|
||||
mapMemoryData.hProcess = (HANDLE)-1;
|
||||
mapMemoryData.fpProcess = 0;
|
||||
mapMemoryData.lpDD = (PDD_DIRECTDRAW_GLOBAL)peDdGl;
|
||||
|
||||
peDdGl->ddCallbacks.MapMemory(&mapMemoryData);
|
||||
|
||||
if (!mapMemoryData.ddRVal)
|
||||
{
|
||||
peDdL->isMemoryMapped = 1;
|
||||
peDdL->fpProcess2 = mapMemoryData.fpProcess;
|
||||
}
|
||||
}
|
||||
|
||||
if (pSurface)
|
||||
{
|
||||
InterlockedExchangeAdd((LONG*)&pSurface->pobj.cExclusiveLock, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
puLockData->ddRVal = DD_OK;
|
||||
|
||||
return DDHAL_DRIVER_HANDLED;
|
||||
}
|
||||
|
||||
/*++
|
||||
* @name DxDdUnlock
|
||||
* @unimplemented
|
||||
*
|
||||
* The function DxDdUnlock releases the lock from specified surface
|
||||
*
|
||||
* @param HANDLE hSurface
|
||||
* Handle to DirectDraw surface
|
||||
*
|
||||
* @param PDD_UNLOCKDATA puUnlockData
|
||||
* Structure with lock details
|
||||
*
|
||||
* @return
|
||||
* Returns DDHAL_DRIVER_HANDLED or DDHAL_DRIVER_NOTHANDLED.
|
||||
*
|
||||
* @remarks.
|
||||
* Stub
|
||||
*--*/
|
||||
DWORD
|
||||
NTAPI
|
||||
DxDdUnlock(HANDLE hSurface,
|
||||
PDD_UNLOCKDATA puUnlockData)
|
||||
{
|
||||
puUnlockData->ddRVal = DD_OK;
|
||||
|
||||
return DDHAL_DRIVER_HANDLED;
|
||||
}
|
|
@ -343,15 +343,6 @@ DxDdGetScanLine(
|
|||
return 0;
|
||||
}
|
||||
|
||||
DWORD
|
||||
NTAPI
|
||||
DxDdLock(
|
||||
PVOID p1)
|
||||
{
|
||||
TRACE();
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD
|
||||
NTAPI
|
||||
DxDdLockD3D(
|
||||
|
@ -464,15 +455,6 @@ DxDdUnattachSurface(
|
|||
return 0;
|
||||
}
|
||||
|
||||
DWORD
|
||||
NTAPI
|
||||
DxDdUnlock(
|
||||
PVOID p1)
|
||||
{
|
||||
TRACE();
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD
|
||||
NTAPI
|
||||
DxDdUnlockD3D(
|
||||
|
|
|
@ -202,6 +202,8 @@ BOOL NTAPI DxDdQueryDirectDrawObject(HANDLE DdHandle, DD_HALINFO* pDdHalInfo, DW
|
|||
DWORD NTAPI DxDdReenableDirectDrawObject(HANDLE DdHandle, PVOID p2);
|
||||
DWORD NTAPI DxDdCanCreateSurface(HANDLE DdHandle, PDD_CANCREATESURFACEDATA SurfaceData);
|
||||
DWORD NTAPI DxDdCanCreateD3DBuffer(HANDLE DdHandle, PDD_CANCREATESURFACEDATA SurfaceData);
|
||||
DWORD NTAPI DxDdLock(HANDLE hSurface, PDD_LOCKDATA puLockData, HDC hdcClip);
|
||||
DWORD NTAPI DxDdUnlock(HANDLE hSurface, PDD_UNLOCKDATA puUnlockData);
|
||||
|
||||
|
||||
/* Internal functions */
|
||||
|
|
Loading…
Reference in a new issue