mirror of
https://github.com/reactos/reactos.git
synced 2025-06-20 07:36:05 +00:00
finish implemented of DvpVideoport, misc, misc2, Color Control, NT callbacks not tested to 100% yet
stub up almost all callbacks that DdGetDriverInfo setup, mark out where DirectX DdBltAlphaBlend are ReactOS gdi32.dll was tested in windows xp and it seam working fine with dx1-7 at moment, even not everything are finish. svn path=/trunk/; revision=32539
This commit is contained in:
parent
797c6d5a2c
commit
676473212e
1 changed files with 452 additions and 87 deletions
|
@ -670,46 +670,198 @@ DvpUpdateVideoPort(LPDDHAL_UPDATEVPORTDATA pDvdUpdateVideoPort)
|
||||||
return NtGdiDvpUpdateVideoPort(pDvdUpdateVideoPort->lpVideoPort->hDDVideoPort,phSurfaceVideo,phSurfaceVbi, (PDD_UPDATEVPORTDATA)pDvdUpdateVideoPort);
|
return NtGdiDvpUpdateVideoPort(pDvdUpdateVideoPort->lpVideoPort->hDDVideoPort,phSurfaceVideo,phSurfaceVbi, (PDD_UPDATEVPORTDATA)pDvdUpdateVideoPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO */
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DvpWaitForVideoPortSync
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DvpGetVideoPortField(LPDDHAL_FLIPVPORTDATA pDvdGetVideoPortField)
|
||||||
|
{
|
||||||
|
return NtGdiDvpGetVideoPortField(pDvdGetVideoPortField->lpVideoPort->hDDVideoPort, (PDD_GETVPORTFIELDDATA)pDvdGetVideoPortField);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DvpWaitForVideoPortSync
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DvpGetVideoPortInputFormats(LPDDHAL_GETVPORTINPUTFORMATDATA pDvdGetVideoPortInputFormat)
|
||||||
|
{
|
||||||
|
return NtGdiDvpGetVideoPortInputFormats(pDvdGetVideoPortInputFormat->lpVideoPort->hDDVideoPort, (PDD_GETVPORTINPUTFORMATDATA) pDvdGetVideoPortInputFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DvpGetVideoPortLine
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DvpGetVideoPortLine(LPDDHAL_GETVPORTLINEDATA pDvdGetVideoPortLine)
|
||||||
|
{
|
||||||
|
return NtGdiDvpGetVideoPortLine(pDvdGetVideoPortLine->lpVideoPort->hDDVideoPort, (PDD_GETVPORTLINEDATA)pDvdGetVideoPortLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DvpGetVideoPortOutputFormats
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DvpGetVideoPortOutputFormats(LPDDHAL_GETVPORTLINEDATA pDvdGetVideoPortOutputFormat)
|
||||||
|
{
|
||||||
|
return NtGdiDvpGetVideoPortLine(pDvdGetVideoPortOutputFormat->lpVideoPort->hDDVideoPort, (PDD_GETVPORTLINEDATA)pDvdGetVideoPortOutputFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DvpGetVideoPortConnectInfo
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DvpGetVideoPortConnectInfo(LPDDHAL_GETVPORTCONNECTDATA pDvdGetVideoPortInfo)
|
||||||
|
{
|
||||||
|
return NtGdiDvpGetVideoPortConnectInfo( GetDdHandle( pDvdGetVideoPortInfo->lpDD->lpGbl->hDD) , (PDD_GETVPORTCONNECTDATA) pDvdGetVideoPortInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DdGetAvailDriverMemory
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DdGetAvailDriverMemory(LPDDHAL_GETAVAILDRIVERMEMORYDATA pDdGetAvailDriverMemory)
|
||||||
|
{
|
||||||
|
return NtGdiDdGetAvailDriverMemory(GetDdHandle( pDdGetAvailDriverMemory->lpDD->hDD), (PDD_GETAVAILDRIVERMEMORYDATA) pDdGetAvailDriverMemory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DdAlphaBlt
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DdAlphaBlt(LPDDHAL_BLTDATA pDdAlphaBlt)
|
||||||
|
{
|
||||||
|
HANDLE hDDSrcSurface = 0;
|
||||||
|
|
||||||
|
if (pDdAlphaBlt->lpDDSrcSurface != 0)
|
||||||
|
{
|
||||||
|
hDDSrcSurface = (HANDLE) pDdAlphaBlt->lpDDSrcSurface->hDDSurface;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NtGdiDdAlphaBlt((HANDLE)pDdAlphaBlt->lpDDDestSurface->hDDSurface, hDDSrcSurface, (PDD_BLTDATA)&pDdAlphaBlt);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DdCreateSurfaceEx
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DdCreateSurfaceEx(LPDDHAL_CREATESURFACEEXDATA pDdCreateSurfaceEx)
|
||||||
|
{
|
||||||
|
pDdCreateSurfaceEx->ddRVal = NtGdiDdCreateSurfaceEx( GetDdHandle(pDdCreateSurfaceEx->lpDDLcl->lpGbl->hDD),
|
||||||
|
(HANDLE)pDdCreateSurfaceEx->lpDDSLcl->hDDSurface,
|
||||||
|
pDdCreateSurfaceEx->lpDDSLcl->lpSurfMore->dwSurfaceHandle);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DdColorControl
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DdColorControl(LPDDHAL_COLORCONTROLDATA pDdColorControl)
|
||||||
|
{
|
||||||
|
return NtGdiDdColorControl( (HANDLE) pDdColorControl->lpDDSurface->hDDSurface, (PDD_COLORCONTROLDATA) &pDdColorControl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DdSetExclusiveMode
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA pDdSetExclusiveMode)
|
||||||
|
{
|
||||||
|
return NtGdiDdSetExclusiveMode( GetDdHandle(pDdSetExclusiveMode->lpDD->hDD), (PDD_SETEXCLUSIVEMODEDATA) &pDdSetExclusiveMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*
|
||||||
|
* DdFlipToGDISurface
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
WINAPI
|
||||||
|
DdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA pDdFlipToGDISurface)
|
||||||
|
{
|
||||||
|
return NtGdiDdFlipToGDISurface( GetDdHandle(pDdFlipToGDISurface->lpDD->hDD), (PDD_FLIPTOGDISURFACEDATA) &pDdFlipToGDISurface);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* TODO */
|
||||||
DWORD
|
DWORD
|
||||||
WINAPI
|
WINAPI
|
||||||
DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA pData)
|
DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA pData)
|
||||||
{
|
{
|
||||||
HANDLE hDD = GetDdHandle(pData->dwContext);
|
DDHAL_GETDRIVERINFODATA pDrvInfoData;
|
||||||
|
DWORD retValue = DDHAL_DRIVER_NOTHANDLED;
|
||||||
|
HANDLE hDD;
|
||||||
|
|
||||||
/* Get videoport callbacks */
|
/* FIXME add SEH around this functions */
|
||||||
|
|
||||||
|
RtlZeroMemory(&pDrvInfoData, sizeof (DDHAL_GETDRIVERINFODATA));
|
||||||
|
RtlCopyMemory(&pDrvInfoData.guidInfo, &pData->guidInfo, sizeof(GUID));
|
||||||
|
|
||||||
|
hDD = GetDdHandle(pData->dwContext);
|
||||||
|
|
||||||
|
pDrvInfoData.dwSize = sizeof (DDHAL_GETDRIVERINFODATA);
|
||||||
|
pDrvInfoData.ddRVal = DDERR_GENERIC;
|
||||||
|
pDrvInfoData.dwContext = (ULONG_PTR)hDD;
|
||||||
|
|
||||||
|
|
||||||
|
/* Videoport Callbacks check and setup for DirectX/ ReactX */
|
||||||
if (IsEqualGUID(&pData->guidInfo, &GUID_VideoPortCallbacks))
|
if (IsEqualGUID(&pData->guidInfo, &GUID_VideoPortCallbacks))
|
||||||
{
|
{
|
||||||
DDHAL_GETDRIVERINFODATA pDvdPortInfo;
|
|
||||||
DDHAL_DDVIDEOPORTCALLBACKS pDvdPort;
|
DDHAL_DDVIDEOPORTCALLBACKS pDvdPort;
|
||||||
DDHAL_DDVIDEOPORTCALLBACKS* pUserDvdPort = (DDHAL_DDVIDEOPORTCALLBACKS *)pData->lpvData;
|
DDHAL_DDVIDEOPORTCALLBACKS* pUserDvdPort = (DDHAL_DDVIDEOPORTCALLBACKS *)pData->lpvData;
|
||||||
DWORD retValue;
|
|
||||||
|
|
||||||
/* Clear user out buffer */
|
|
||||||
RtlZeroMemory(pUserDvdPort, DDVIDEOPORTCALLBACKSSIZE);
|
|
||||||
|
|
||||||
/* Clear internal out buffer and set it up*/
|
/* Clear internal out buffer and set it up*/
|
||||||
RtlZeroMemory(&pDvdPort, DDVIDEOPORTCALLBACKSSIZE);
|
RtlZeroMemory(&pDvdPort, DDVIDEOPORTCALLBACKSSIZE);
|
||||||
pDvdPort.dwSize = DDVIDEOPORTCALLBACKSSIZE;
|
pDvdPort.dwSize = DDVIDEOPORTCALLBACKSSIZE;
|
||||||
|
|
||||||
/* Clear internal in buffer and set it up*/
|
/* set up internal buffer */
|
||||||
RtlZeroMemory(&pDvdPortInfo, sizeof (DDHAL_GETDRIVERINFODATA));
|
pDrvInfoData.lpvData = (PVOID)&pDvdPort;
|
||||||
pDvdPortInfo.dwSize = sizeof (DDHAL_GETDRIVERINFODATA);
|
pDrvInfoData.dwExpectedSize = DDVIDEOPORTCALLBACKSSIZE ;
|
||||||
pDvdPortInfo.guidInfo = GUID_VideoPortCallbacks;
|
|
||||||
pDvdPortInfo.lpvData = (PVOID)&pDvdPort;
|
|
||||||
pDvdPortInfo.ddRVal = DDERR_GENERIC;
|
|
||||||
pDvdPortInfo.dwExpectedSize = DDVIDEOPORTCALLBACKSSIZE ;
|
|
||||||
pDvdPortInfo.dwContext = (ULONG_PTR) hDD;
|
|
||||||
|
|
||||||
/* Call win32k */
|
/* Call win32k */
|
||||||
retValue = NtGdiDdGetDriverInfo(hDD, (PDD_GETDRIVERINFODATA)&pDvdPortInfo);
|
retValue = NtGdiDdGetDriverInfo(hDD, (PDD_GETDRIVERINFODATA)&pDrvInfoData);
|
||||||
|
|
||||||
/* Setup user out buffer and convert kmode callbacks to user mode */
|
/* Setup user out buffer and convert kmode callbacks to user mode */
|
||||||
pUserDvdPort->dwSize = DDVIDEOPORTCALLBACKSSIZE;
|
pUserDvdPort->dwSize = DDVIDEOPORTCALLBACKSSIZE;
|
||||||
|
pUserDvdPort->dwFlags = pDrvInfoData.dwFlags = 0;
|
||||||
|
|
||||||
pUserDvdPort->dwFlags = (pDvdPortInfo.dwFlags & ~(DDHAL_VPORT32_CREATEVIDEOPORT | DDHAL_VPORT32_FLIP |
|
pUserDvdPort->dwFlags = (pDrvInfoData.dwFlags & ~(DDHAL_VPORT32_CREATEVIDEOPORT | DDHAL_VPORT32_FLIP |
|
||||||
DDHAL_VPORT32_DESTROY | DDHAL_VPORT32_UPDATE )) |
|
DDHAL_VPORT32_DESTROY | DDHAL_VPORT32_UPDATE | DDHAL_VPORT32_WAITFORSYNC)) |
|
||||||
(DDHAL_VPORT32_CREATEVIDEOPORT | DDHAL_VPORT32_FLIP |
|
(DDHAL_VPORT32_CREATEVIDEOPORT | DDHAL_VPORT32_FLIP |
|
||||||
DDHAL_VPORT32_DESTROY | DDHAL_VPORT32_UPDATE);
|
DDHAL_VPORT32_DESTROY | DDHAL_VPORT32_UPDATE);
|
||||||
|
|
||||||
|
@ -731,27 +883,27 @@ DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA pData)
|
||||||
|
|
||||||
if (pDvdPort.GetVideoPortInputFormats)
|
if (pDvdPort.GetVideoPortInputFormats)
|
||||||
{
|
{
|
||||||
pUserDvdPort->GetVideoPortInputFormats = (LPDDHALVPORTCB_GETINPUTFORMATS) NULL; // FIXME : DvpGetVideoPortInputFormats
|
pUserDvdPort->GetVideoPortInputFormats = (LPDDHALVPORTCB_GETINPUTFORMATS) DvpGetVideoPortInputFormats;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDvdPort.GetVideoPortOutputFormats)
|
if (pDvdPort.GetVideoPortOutputFormats)
|
||||||
{
|
{
|
||||||
pUserDvdPort->GetVideoPortOutputFormats = (LPDDHALVPORTCB_GETOUTPUTFORMATS) NULL; // FIXME : DvpGetVideoPortInputFormats
|
pUserDvdPort->GetVideoPortOutputFormats = (LPDDHALVPORTCB_GETOUTPUTFORMATS) DvpGetVideoPortOutputFormats;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDvdPort.GetVideoPortField)
|
if (pDvdPort.GetVideoPortField)
|
||||||
{
|
{
|
||||||
pUserDvdPort->GetVideoPortField = (LPDDHALVPORTCB_GETFIELD) NULL; // FIXME : DvpGetVideoPortField
|
pUserDvdPort->GetVideoPortField = (LPDDHALVPORTCB_GETFIELD) DvpGetVideoPortField;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDvdPort.GetVideoPortLine)
|
if (pDvdPort.GetVideoPortLine)
|
||||||
{
|
{
|
||||||
pUserDvdPort->GetVideoPortLine = (LPDDHALVPORTCB_GETLINE) NULL; // FIXME : DvpGetVideoPortLine
|
pUserDvdPort->GetVideoPortLine = (LPDDHALVPORTCB_GETLINE) DvpGetVideoPortLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDvdPort.GetVideoPortConnectInfo)
|
if (pDvdPort.GetVideoPortConnectInfo)
|
||||||
{
|
{
|
||||||
pUserDvdPort->GetVideoPortConnectInfo = (LPDDHALVPORTCB_GETVPORTCONNECT) NULL; // FIXME : DvpGetVideoPortConnectInfo
|
pUserDvdPort->GetVideoPortConnectInfo = (LPDDHALVPORTCB_GETVPORTCONNECT) DvpGetVideoPortConnectInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDvdPort.GetVideoPortFlipStatus)
|
if (pDvdPort.GetVideoPortFlipStatus)
|
||||||
|
@ -780,11 +932,223 @@ DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA pData)
|
||||||
* Windows XP
|
* Windows XP
|
||||||
*/
|
*/
|
||||||
pData->ddRVal = retValue;
|
pData->ddRVal = retValue;
|
||||||
return retValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME not supported yet */
|
/* Color Control Callbacks check and setup for DirectX/ ReactX */
|
||||||
return 0;
|
if (IsEqualGUID(&pData->guidInfo, &GUID_ColorControlCallbacks))
|
||||||
|
{
|
||||||
|
DDHAL_DDCOLORCONTROLCALLBACKS pColorControl;
|
||||||
|
DDHAL_DDCOLORCONTROLCALLBACKS* pUserColorControl = (DDHAL_DDCOLORCONTROLCALLBACKS *)pData->lpvData;
|
||||||
|
|
||||||
|
/* Clear internal out buffer and set it up*/
|
||||||
|
RtlZeroMemory(&pColorControl, DDCOLORCONTROLCALLBACKSSIZE);
|
||||||
|
pColorControl.dwSize = DDCOLORCONTROLCALLBACKSSIZE;
|
||||||
|
|
||||||
|
/* set up internal buffer */
|
||||||
|
pDrvInfoData.lpvData = (PVOID)&pColorControl;
|
||||||
|
pDrvInfoData.dwExpectedSize = DDCOLORCONTROLCALLBACKSSIZE ;
|
||||||
|
|
||||||
|
/* Call win32k */
|
||||||
|
retValue = NtGdiDdGetDriverInfo(hDD, (PDD_GETDRIVERINFODATA)&pDrvInfoData);
|
||||||
|
|
||||||
|
pData->dwActualSize = DDCOLORCONTROLCALLBACKSSIZE;
|
||||||
|
pData->dwFlags = pDrvInfoData.dwFlags;
|
||||||
|
|
||||||
|
pUserColorControl->dwSize = DDCOLORCONTROLCALLBACKSSIZE;
|
||||||
|
pUserColorControl->dwFlags = pUserColorControl->dwFlags;
|
||||||
|
|
||||||
|
if (pColorControl.ColorControl != NULL)
|
||||||
|
{
|
||||||
|
pUserColorControl->ColorControl = (LPDDHALCOLORCB_COLORCONTROL) DdColorControl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Windows XP never repot back the true return value,
|
||||||
|
* it only report back if we have a driver or not
|
||||||
|
* ReactOS keep this behoir to be compatible with
|
||||||
|
* Windows XP
|
||||||
|
*/
|
||||||
|
pData->ddRVal = retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Misc Callbacks check and setup for DirectX/ ReactX */
|
||||||
|
else if (IsEqualGUID(&pData->guidInfo, &GUID_MiscellaneousCallbacks))
|
||||||
|
{
|
||||||
|
DDHAL_DDMISCELLANEOUSCALLBACKS pMisc;
|
||||||
|
DDHAL_DDMISCELLANEOUSCALLBACKS* pUserMisc = (DDHAL_DDMISCELLANEOUSCALLBACKS *)pData->lpvData;
|
||||||
|
|
||||||
|
/* Clear internal out buffer and set it up*/
|
||||||
|
RtlZeroMemory(&pMisc, DDMISCELLANEOUSCALLBACKSSIZE);
|
||||||
|
pMisc.dwSize = DDMISCELLANEOUSCALLBACKSSIZE;
|
||||||
|
|
||||||
|
/* set up internal buffer */
|
||||||
|
pDrvInfoData.lpvData = (PVOID)&pMisc;
|
||||||
|
pDrvInfoData.dwExpectedSize = DDMISCELLANEOUSCALLBACKSSIZE ;
|
||||||
|
|
||||||
|
/* Call win32k */
|
||||||
|
retValue = NtGdiDdGetDriverInfo(hDD, (PDD_GETDRIVERINFODATA)&pDrvInfoData);
|
||||||
|
|
||||||
|
pData->dwActualSize = DDMISCELLANEOUSCALLBACKSSIZE;
|
||||||
|
|
||||||
|
/* Only one callbacks are supported */
|
||||||
|
pUserMisc->dwFlags = pMisc.dwFlags & DDHAL_MISCCB32_GETAVAILDRIVERMEMORY;
|
||||||
|
pUserMisc->GetAvailDriverMemory = (LPDDHAL_GETAVAILDRIVERMEMORY) DdGetAvailDriverMemory;
|
||||||
|
|
||||||
|
/* This callbacks are only for win9x and theirfor it is not longer use in NT or ReactOS
|
||||||
|
* pUserMisc->UpdateNonLocalHeap;
|
||||||
|
* pUserMisc->GetHeapAlignment;
|
||||||
|
* pUserMisc->GetSysmemBltStatus; */
|
||||||
|
|
||||||
|
/* Windows XP never repot back the true return value,
|
||||||
|
* it only report back if we have a driver or not
|
||||||
|
* ReactOS keep this behoir to be compatible with
|
||||||
|
* Windows XP
|
||||||
|
*/
|
||||||
|
pData->ddRVal = retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Misc 2 Callbacks check and setup for DirectX/ ReactX */
|
||||||
|
else if (IsEqualGUID(&pData->guidInfo, &GUID_Miscellaneous2Callbacks))
|
||||||
|
{
|
||||||
|
DDHAL_DDMISCELLANEOUS2CALLBACKS pMisc;
|
||||||
|
DDHAL_DDMISCELLANEOUS2CALLBACKS* pUserMisc = (DDHAL_DDMISCELLANEOUS2CALLBACKS *)pData->lpvData;
|
||||||
|
|
||||||
|
/* Clear internal out buffer and set it up*/
|
||||||
|
RtlZeroMemory(&pMisc, DDMISCELLANEOUS2CALLBACKSSIZE);
|
||||||
|
pMisc.dwSize = DDMISCELLANEOUS2CALLBACKSSIZE;
|
||||||
|
|
||||||
|
/* set up internal buffer */
|
||||||
|
pDrvInfoData.lpvData = (PVOID)&pMisc;
|
||||||
|
pDrvInfoData.dwExpectedSize = DDMISCELLANEOUS2CALLBACKSSIZE ;
|
||||||
|
|
||||||
|
/* Call win32k */
|
||||||
|
retValue = NtGdiDdGetDriverInfo(hDD, (PDD_GETDRIVERINFODATA)&pDrvInfoData);
|
||||||
|
|
||||||
|
pData->dwActualSize = DDMISCELLANEOUS2CALLBACKSSIZE;
|
||||||
|
|
||||||
|
pUserMisc->dwFlags = pMisc.dwFlags;
|
||||||
|
|
||||||
|
/* This functions are not documneted in MSDN for this struct, here is directx/reactx alpha blend */
|
||||||
|
if ( pMisc.Reserved )
|
||||||
|
{
|
||||||
|
pUserMisc->Reserved = (LPVOID) DdAlphaBlt;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( pMisc.CreateSurfaceEx )
|
||||||
|
{
|
||||||
|
pUserMisc->CreateSurfaceEx = (LPDDHAL_CREATESURFACEEX) DdCreateSurfaceEx;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( pMisc.GetDriverState )
|
||||||
|
{
|
||||||
|
pUserMisc->GetDriverState = (LPDDHAL_GETDRIVERSTATE) NtGdiDdGetDriverState;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* NOTE : pUserMisc->DestroyDDLocal is outdated and are not beign tuch */
|
||||||
|
|
||||||
|
/* Windows XP never repot back the true return value,
|
||||||
|
* it only report back if we have a driver or not
|
||||||
|
* ReactOS keep this behoir to be compatible with
|
||||||
|
* Windows XP
|
||||||
|
*/
|
||||||
|
pData->ddRVal = retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* NT Callbacks check and setup for DirectX/ ReactX */
|
||||||
|
else if (IsEqualGUID(&pData->guidInfo, &GUID_NTCallbacks))
|
||||||
|
{
|
||||||
|
/* MS does not have DHAL_* version of this callbacks
|
||||||
|
* so we are force using PDD_* callbacks here
|
||||||
|
*/
|
||||||
|
DD_NTCALLBACKS pNtKernel;
|
||||||
|
PDD_NTCALLBACKS pUserNtKernel = (PDD_NTCALLBACKS)pData->lpvData;
|
||||||
|
|
||||||
|
/* Clear internal out buffer and set it up*/
|
||||||
|
RtlZeroMemory(&pNtKernel, sizeof(DD_NTCALLBACKS));
|
||||||
|
pNtKernel.dwSize = sizeof(DD_NTCALLBACKS);
|
||||||
|
|
||||||
|
/* set up internal buffer */
|
||||||
|
pDrvInfoData.lpvData = (PVOID)&pNtKernel;
|
||||||
|
pDrvInfoData.dwExpectedSize = sizeof(DD_NTCALLBACKS) ;
|
||||||
|
|
||||||
|
/* Call win32k */
|
||||||
|
retValue = NtGdiDdGetDriverInfo(hDD, (PDD_GETDRIVERINFODATA)&pDrvInfoData);
|
||||||
|
|
||||||
|
pData->dwActualSize = sizeof(DD_NTCALLBACKS);
|
||||||
|
|
||||||
|
pUserNtKernel->dwSize = sizeof(DD_NTCALLBACKS);
|
||||||
|
pUserNtKernel->dwFlags = pNtKernel.dwFlags;
|
||||||
|
pUserNtKernel->FreeDriverMemory = 0;
|
||||||
|
|
||||||
|
if (pNtKernel.SetExclusiveMode)
|
||||||
|
{
|
||||||
|
pUserNtKernel->SetExclusiveMode = (PDD_SETEXCLUSIVEMODE) DdSetExclusiveMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pNtKernel.FlipToGDISurface)
|
||||||
|
{
|
||||||
|
pUserNtKernel->FlipToGDISurface = (PDD_FLIPTOGDISURFACE) DdFlipToGDISurface;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Windows XP never repot back the true return value,
|
||||||
|
* it only report back if we have a driver or not
|
||||||
|
* ReactOS keep this behoir to be compatible with
|
||||||
|
* Windows XP
|
||||||
|
*/
|
||||||
|
pData->ddRVal = retValue;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* D3D Callbacks version 2 check and setup for DirectX/ ReactX */
|
||||||
|
else if (IsEqualGUID(&pData->guidInfo, &GUID_D3DCallbacks2))
|
||||||
|
{
|
||||||
|
// FIXME GUID_D3DCallbacks2
|
||||||
|
}
|
||||||
|
|
||||||
|
/* D3D Callbacks version 3 check and setup for DirectX/ ReactX */
|
||||||
|
else if (IsEqualGUID(&pData->guidInfo, &GUID_D3DCallbacks3))
|
||||||
|
{
|
||||||
|
// FIXME GUID_D3DCallbacks3
|
||||||
|
}
|
||||||
|
|
||||||
|
/* D3DParseUnknownCommand Callbacks check and setup for DirectX/ ReactX */
|
||||||
|
else if (IsEqualGUID(&pData->guidInfo, &GUID_D3DParseUnknownCommandCallback))
|
||||||
|
{
|
||||||
|
// FIXME GUID_D3DParseUnknownCommandCallback
|
||||||
|
}
|
||||||
|
|
||||||
|
/* MotionComp Callbacks check and setup for DirectX/ ReactX */
|
||||||
|
else if (IsEqualGUID(&pData->guidInfo, &GUID_MotionCompCallbacks))
|
||||||
|
{
|
||||||
|
// FIXME GUID_MotionCompCallbacks
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME VPE2 Callbacks check and setup for DirectX/ ReactX */
|
||||||
|
//else if (IsEqualGUID(&pData->guidInfo, &GUID_VPE2Callbacks))
|
||||||
|
//{
|
||||||
|
// FIXME GUID_VPE2Callbacks
|
||||||
|
//}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* set up internal buffer */
|
||||||
|
pDrvInfoData.dwExpectedSize = pData->dwExpectedSize;
|
||||||
|
pDrvInfoData.lpvData = pData->lpvData;
|
||||||
|
|
||||||
|
/* We do not cover all callbacks for user mode, they are only cover by kmode */
|
||||||
|
retValue = NtGdiDdGetDriverInfo(hDD, (PDD_GETDRIVERINFODATA)&pDrvInfoData);
|
||||||
|
|
||||||
|
/* Setup return data */
|
||||||
|
pData->dwActualSize = pDrvInfoData.dwActualSize;
|
||||||
|
pData->lpvData = pDrvInfoData.lpvData;
|
||||||
|
/* Windows XP never repot back the true return value,
|
||||||
|
* it only report back if we have a driver or not
|
||||||
|
* ReactOS keep this behoir to be compatible with
|
||||||
|
* Windows XP
|
||||||
|
*/
|
||||||
|
pData->ddRVal = retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1594,3 +1958,4 @@ DdSetGammaRamp(LPDDRAWI_DIRECTDRAW_LCL pDDraw,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue