mirror of
https://github.com/reactos/reactos.git
synced 2024-08-02 17:40:58 +00:00
start implement of GetDeviceIdentifier we are filling one member right.
svn path=/trunk/; revision=27088
This commit is contained in:
parent
2e1e1e0140
commit
0dabf31e76
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
#include "rosdraw.h"
|
#include "rosdraw.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/* PSEH for SEH Support */
|
/* PSEH for SEH Support */
|
||||||
#include <pseh/pseh.h>
|
#include <pseh/pseh.h>
|
||||||
|
|
||||||
|
@ -451,16 +453,69 @@ HRESULT WINAPI
|
||||||
Main_DirectDraw_GetDeviceIdentifier7(LPDIRECTDRAW7 iface,
|
Main_DirectDraw_GetDeviceIdentifier7(LPDIRECTDRAW7 iface,
|
||||||
LPDDDEVICEIDENTIFIER2 pDDDI, DWORD dwFlags)
|
LPDDDEVICEIDENTIFIER2 pDDDI, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
// HRESULT retVal = DD_OK;
|
HRESULT retVal = DDERR_INVALIDPARAMS;
|
||||||
HRESULT retVal = DD_FALSE;
|
|
||||||
|
BOOL found = FALSE;
|
||||||
|
DWORD iDevNum = 0;
|
||||||
|
DISPLAY_DEVICEA DisplayDeviceA;
|
||||||
|
|
||||||
|
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT) iface;
|
||||||
|
|
||||||
DX_WINDBG_trace();
|
DX_WINDBG_trace();
|
||||||
|
|
||||||
_SEH_TRY
|
_SEH_TRY
|
||||||
{
|
{
|
||||||
if (IsBadWritePtr( pDDDI, sizeof(DDDEVICEIDENTIFIER2) ) )
|
if ( (IsBadWritePtr( pDDDI, sizeof(DDDEVICEIDENTIFIER2) ) ) ||
|
||||||
|
(dwFlags & ~DDGDI_GETHOSTIDENTIFIER))
|
||||||
{
|
{
|
||||||
retVal = DDERR_INVALIDPARAMS;
|
retVal = DDERR_INVALIDPARAMS;
|
||||||
|
_SEH_LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* now we can start getting the driver data */
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
ZeroMemory(&DisplayDeviceA,sizeof(DISPLAY_DEVICEA));
|
||||||
|
|
||||||
|
DisplayDeviceA.cb = sizeof(DISPLAY_DEVICEA);
|
||||||
|
|
||||||
|
if ( EnumDisplayDevicesA( NULL, iDevNum, &DisplayDeviceA, 0) == 0)
|
||||||
|
{
|
||||||
|
retVal = DDERR_INVALIDPARAMS;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_stricmp(DisplayDeviceA.DeviceName, This->lpLcl->lpGbl->cDriverName))
|
||||||
|
{
|
||||||
|
// if we got another device like hardware mpeg decoder or video card or another drv
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
else if (DisplayDeviceA.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
|
||||||
|
{
|
||||||
|
/* double check if it primary driver we just found */
|
||||||
|
if (!_stricmp( This->lpLcl->lpGbl->cDriverName, "DISPLAY"))
|
||||||
|
{
|
||||||
|
/* yeah we found it */
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (found == TRUE)
|
||||||
|
{
|
||||||
|
/* we found our driver now we start setup it */
|
||||||
|
strcpy( pDDDI->szDescription, DisplayDeviceA.DeviceString);
|
||||||
|
|
||||||
|
/* This api still under devloping now we can get desc of the
|
||||||
|
primary drv
|
||||||
|
*/
|
||||||
|
retVal = DD_OK;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
iDevNum++;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
_SEH_HANDLE
|
_SEH_HANDLE
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue