本文整理匯總了C++中EngDeviceIoControl函數的典型用法代碼示例。如果您正苦於以下問題:C++ EngDeviceIoControl函數的具體用法?C++ EngDeviceIoControl怎麽用?C++ EngDeviceIoControl使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EngDeviceIoControl函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: XenVesaMapVideoMemory
DWORD XenVesaMapVideoMemory(PPDEV pDev)
{
DWORD dwRet, dwRetBytes;
VIDEO_MEMORY videoMem;
VIDEO_MEMORY_INFORMATION videoMemInfo;
videoMem.RequestedVirtualAddress = 0;
dwRet = EngDeviceIoControl(pDev->hDriver,
IOCTL_VIDEO_MAP_VIDEO_MEMORY,
&videoMem, sizeof(VIDEO_MEMORY),
&videoMemInfo,
sizeof(VIDEO_MEMORY_INFORMATION), &dwRetBytes);
if (dwRet != 0 )
{
XenVesaDebugPrint(DEBUG_LEVEL_ERROR,
"Unable to map video memory! Error - %d\n",
dwRet);
pDev->pFrameBuffer = (PULONG) NULL;
return dwRet;
}
pDev->pFrameBuffer = (PULONG) videoMemInfo.FrameBufferBase;
return dwRet;
}
示例2: XenVesaGetNumModesFromMiniport
DWORD XenVesaGetNumModesFromMiniport(HANDLE hDrv, PDWORD pNumModes,
PDWORD pModeInfoSize)
{
DWORD dwRet, dwRetBytes;
VIDEO_NUM_MODES videoNumModes;
if ( pNumModes == NULL || pModeInfoSize == NULL )
{
XenVesaDebugPrint(DEBUG_LEVEL_ERROR,
"GetNumModesFromMiniport: Invalid input!\n");
return -1;
}
dwRet = EngDeviceIoControl(hDrv, IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES,
NULL, 0, &videoNumModes,
sizeof(VIDEO_NUM_MODES), &dwRetBytes);
if ( dwRet != 0 )
{
XenVesaDebugPrint(DEBUG_LEVEL_ERROR,
"Unable to query number of available modes. Error - %d\n",
dwRet);
return dwRet;
}
*pModeInfoSize = videoNumModes.ModeInformationLength;
*pNumModes = videoNumModes.NumModes;
return dwRet;
}
示例3: XenVesaGetModesFromMiniport
DWORD XenVesaGetModesFromMiniport(HANDLE hDrv,
PVIDEO_MODE_INFORMATION pModeInfo,
DWORD dwModeInfoSize, DWORD dwNumModes)
{
DWORD dwRet, dwRetBytes, dwTotalModeInfoSize;
if ( dwModeInfoSize == 0 || dwNumModes == 0 || pModeInfo == NULL )
{
XenVesaDebugPrint(DEBUG_LEVEL_ERROR,
"XenVesaGetModesFromMiniport: Invalid input!\n");
return -1;
}
dwTotalModeInfoSize = dwModeInfoSize * dwNumModes;
dwRet = EngDeviceIoControl(hDrv, IOCTL_VIDEO_QUERY_AVAIL_MODES,
NULL, 0, pModeInfo,
dwTotalModeInfoSize, &dwRetBytes);
if ( dwRet != 0 )
{
XenVesaDebugPrint(DEBUG_LEVEL_ERROR,
"Unable to query available modes! Error - %d\n",
dwRet);
return dwRet;
}
return dwRet;
}
示例4: bInitPointer
BOOL NTAPI bInitPointer(PPDEV ppdev, DEVINFO *pdevinfo)
{
DWORD returnedDataLength;
ppdev->pPointerAttributes = (PVIDEO_POINTER_ATTRIBUTES) NULL;
ppdev->cjPointerAttributes = 0; // initialized in screen.c
//
// Ask the miniport whether it provides pointer support.
//
if (EngDeviceIoControl(ppdev->hDriver,
IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES,
NULL,
0,
&ppdev->PointerCapabilities,
sizeof(ppdev->PointerCapabilities),
&returnedDataLength))
{
return(FALSE);
}
//
// If neither mono nor color hardware pointer is supported, there's no
// hardware pointer support and we're done.
//
if ((!(ppdev->PointerCapabilities.Flags & VIDEO_MODE_MONO_POINTER)) &&
(!(ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER)))
{
return(TRUE);
}
//
// Note: The buffer itself is allocated after we set the
// mode. At that time we know the pixel depth and we can
// allocate the correct size for the color pointer if supported.
//
//
// Set the asynchronous support status (async means miniport is capable of
// drawing the Pointer at any time, with no interference with any ongoing
// drawing operation)
//
if (ppdev->PointerCapabilities.Flags & VIDEO_MODE_ASYNC_POINTER)
{
pdevinfo->flGraphicsCaps |= GCAPS_ASYNCMOVE;
}
else
{
pdevinfo->flGraphicsCaps &= ~GCAPS_ASYNCMOVE;
}
return(TRUE);
}
示例5: VBoxDispMPDisablePointer
int VBoxDispMPDisablePointer(HANDLE hDriver)
{
DWORD dwrc;
ULONG cbReturned;
LOGF_ENTER();
dwrc = EngDeviceIoControl(hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0, NULL, 0, &cbReturned);
VBOX_CHECK_WINERR_RETRC(dwrc, VERR_DEV_IO_ERROR);
LOGF_LEAVE();
return VINF_SUCCESS;
}
示例6: VBoxDispMPResetDevice
int VBoxDispMPResetDevice(HANDLE hDriver)
{
DWORD dwrc;
ULONG cbReturned;
LOGF_ENTER();
dwrc = EngDeviceIoControl(hDriver, IOCTL_VIDEO_RESET_DEVICE, NULL, 0, NULL, 0, &cbReturned);
VBOX_CHECK_WINERR_RETRC(dwrc, VERR_DEV_IO_ERROR);
LOGF_LEAVE();
return VINF_SUCCESS;
}
示例7: VBoxDispMPSetColorRegisters
int VBoxDispMPSetColorRegisters(HANDLE hDriver, PVIDEO_CLUT pClut, DWORD cbClut)
{
DWORD dwrc;
ULONG cbReturned;
LOGF_ENTER();
dwrc = EngDeviceIoControl(hDriver, IOCTL_VIDEO_SET_COLOR_REGISTERS, pClut, cbClut, NULL, 0, &cbReturned);
VBOX_CHECK_WINERR_RETRC(dwrc, VERR_DEV_IO_ERROR);
LOGF_LEAVE();
return VINF_SUCCESS;
}
示例8: bInit256ColorPalette
BOOL bInit256ColorPalette(PPDEV ppdev)
{
BYTE ajClutSpace[MAX_CLUT_SIZE];
PVIDEO_CLUT pScreenClut;
ULONG ulReturnedDataLength;
ULONG cColors;
PVIDEO_CLUTDATA pScreenClutData;
if (ppdev->ulBitCount == 8)
{
//
// Fill in pScreenClut header info:
//
pScreenClut = (PVIDEO_CLUT) ajClutSpace;
pScreenClut->NumEntries = 256;
pScreenClut->FirstEntry = 0;
//
// Copy colours in:
//
cColors = 256;
pScreenClutData = (PVIDEO_CLUTDATA) (&(pScreenClut->LookupTable[0]));
while(cColors--)
{
pScreenClutData[cColors].Red = ppdev->pPal[cColors].peRed >>
ppdev->cPaletteShift;
pScreenClutData[cColors].Green = ppdev->pPal[cColors].peGreen >>
ppdev->cPaletteShift;
pScreenClutData[cColors].Blue = ppdev->pPal[cColors].peBlue >>
ppdev->cPaletteShift;
pScreenClutData[cColors].Unused = 0;
}
//
// Set palette registers:
//
if (EngDeviceIoControl(ppdev->hDriver,
IOCTL_VIDEO_SET_COLOR_REGISTERS,
pScreenClut,
MAX_CLUT_SIZE,
NULL,
0,
&ulReturnedDataLength))
{
DISPDBG((0, "Failed bEnablePalette"));
return(FALSE);
}
}
示例9: DrvSetPalette
BOOL DrvSetPalette (DHPDEV dhpdev,
PALOBJ *ppalo,
FLONG fl,
ULONG iStart,
ULONG cColors)
{
BYTE ajClutSpace[MAX_CLUT_SIZE];
PVIDEO_CLUT pScreenClut = (PVIDEO_CLUT) ajClutSpace;
PPALETTEENTRY pape;
ULONG ulTemp = 256;
UNREFERENCED_PARAMETER (fl);
DISPBLTDBG ((1, "TGA.DLL!DrvSetPalette - Entry\n"));
DISPBLTDBG ((2, "TGA.DLL!DrvSetPalette - ppalo [%x], fl [%x], iStart [%d], cColors [%d]\n", ppalo, fl, iStart, cColors));
// Fill in pScreenClut header info
pScreenClut->NumEntries = (USHORT)cColors;
pScreenClut->FirstEntry = (USHORT)iStart;
pape = (PPALETTEENTRY) (pScreenClut->LookupTable);
if (cColors != PALOBJ_cGetColors (ppalo, iStart, cColors, (PULONG) pape))
{
RIP ("DISP DrvSetPalette failed PALOBJ_cGetColors\n");
return FALSE;
}
// Set the high reserved byte in each palette entry to 0.
while (cColors--)
pape[cColors].peFlags = 0;
// Set palette registers
if (EngDeviceIoControl (((PPDEV)(dhpdev))->hDriver,
IOCTL_VIDEO_SET_COLOR_REGISTERS,
pScreenClut,
MAX_CLUT_SIZE,
NULL,
0,
&cColors))
{
RIP ("DISP DrvSetPalette failed EngDeviceIoControl\n");
return FALSE;
}
DISPBLTDBG ((1, "TGA.DLL!DrvSetPalette - Exit\n"));
return TRUE;
}
示例10: VBoxDispMPSetPointerPosition
int VBoxDispMPSetPointerPosition(HANDLE hDriver, PVIDEO_POINTER_POSITION pPos)
{
DWORD dwrc;
ULONG cbReturned;
LOGF_ENTER();
dwrc = EngDeviceIoControl(hDriver, IOCTL_VIDEO_SET_POINTER_POSITION, pPos, sizeof(VIDEO_POINTER_POSITION),
NULL, 0, &cbReturned);
VBOX_CHECK_WINERR_RETRC(dwrc, VERR_DEV_IO_ERROR);
LOGF_LEAVE();
return VINF_SUCCESS;
}
示例11: XenVesaResetDevice
DWORD XenVesaResetDevice(PPDEV pDev)
{
DWORD dwRet, dwRetBytes;
dwRet = EngDeviceIoControl(pDev->hDriver, IOCTL_VIDEO_RESET_DEVICE,
0, 0, 0, 0, &dwRetBytes);
if ( dwRet != 0)
XenVesaDebugPrint(DEBUG_LEVEL_ERROR,
"Reset device failed with error - %d\n",
dwRet);
return dwRet;
}
示例12: VBoxDispMPSetVisibleRegion
int VBoxDispMPSetVisibleRegion(HANDLE hDriver, PRTRECT pRects, DWORD cRects)
{
DWORD dwrc;
ULONG cbReturned;
LOGF_ENTER();
dwrc = EngDeviceIoControl(hDriver, IOCTL_VIDEO_VBOX_SETVISIBLEREGION, pRects, cRects*sizeof(RTRECT),
NULL, 0, &cbReturned);
VBOX_CHECK_WINERR_RETRC(dwrc, VERR_DEV_IO_ERROR);
LOGF_LEAVE();
return VINF_SUCCESS;
}
示例13: VBoxDispMPUnshareVideoMemory
int VBoxDispMPUnshareVideoMemory(HANDLE hDriver, PVIDEO_SHARE_MEMORY pSMem)
{
DWORD dwrc;
ULONG cbReturned;
LOGF_ENTER();
dwrc = EngDeviceIoControl(hDriver, IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY, pSMem, sizeof(VIDEO_SHARE_MEMORY),
NULL, 0, &cbReturned);
VBOX_CHECK_WINERR_RETRC(dwrc, VERR_DEV_IO_ERROR);
LOGF_LEAVE();
return VINF_SUCCESS;
}
示例14: VBoxDispMPSetCurrentMode
/* Set device mode */
int VBoxDispMPSetCurrentMode(HANDLE hDriver, ULONG ulMode)
{
DWORD dwrc;
ULONG cbReturned;
VIDEO_MODE mode;
LOGF_ENTER();
mode.RequestedMode = ulMode;
dwrc = EngDeviceIoControl(hDriver, IOCTL_VIDEO_SET_CURRENT_MODE, &mode, sizeof(VIDEO_MODE), NULL, 0, &cbReturned);
VBOX_CHECK_WINERR_RETRC(dwrc, VERR_DEV_IO_ERROR);
LOGF_LEAVE();
return VINF_SUCCESS;
}
示例15: VBoxDispMPShareVideoMemory
int VBoxDispMPShareVideoMemory(HANDLE hDriver, PVIDEO_SHARE_MEMORY pSMem, PVIDEO_SHARE_MEMORY_INFORMATION pSMemInfo)
{
DWORD dwrc;
ULONG cbReturned;
LOGF_ENTER();
dwrc = EngDeviceIoControl(hDriver, IOCTL_VIDEO_SHARE_VIDEO_MEMORY, pSMem, sizeof(VIDEO_SHARE_MEMORY),
pSMemInfo, sizeof(VIDEO_SHARE_MEMORY_INFORMATION), &cbReturned);
VBOX_CHECK_WINERR_RETRC(dwrc, VERR_DEV_IO_ERROR);
VBOX_WARN_IOCTLCB_RETRC("IOCTL_VIDEO_SHARE_VIDEO_MEMORY", cbReturned,
sizeof(VIDEO_SHARE_MEMORY_INFORMATION), VERR_DEV_IO_ERROR);
LOGF_LEAVE();
return VINF_SUCCESS;
}