本文整理汇总了C++中VBoxCommonFromDeviceExt函数的典型用法代码示例。如果您正苦于以下问题:C++ VBoxCommonFromDeviceExt函数的具体用法?C++ VBoxCommonFromDeviceExt怎么用?C++ VBoxCommonFromDeviceExt使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VBoxCommonFromDeviceExt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VBoxWddmUpdateVideoModesInfoByMask
PVBOXWDDM_VIDEOMODES_INFO VBoxWddmUpdateVideoModesInfoByMask(PVBOXMP_DEVEXT pExt, uint8_t *pScreenIdMask)
{
for (int i = 0; i < VBoxCommonFromDeviceExt(pExt)->cDisplays; ++i)
{
if (ASMBitTest(pScreenIdMask, i))
VBoxWddmInvalidateVideoModesInfo(pExt, i);
}
/* ensure we have all the rest populated */
VBoxWddmGetAllVideoModesInfos(pExt);
return g_aVBoxVideoModeInfos;
}
示例2: vboxVBVAInformHost
static int vboxVBVAInformHost (PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO * pVbva, BOOL bEnable)
{
int rc = VERR_NO_MEMORY;
void *p = VBoxHGSMIBufferAlloc (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx,
sizeof (VBVAENABLE_EX),
HGSMI_CH_VBVA,
VBVA_ENABLE);
Assert(p);
if (!p)
{
LOGREL(("HGSMIHeapAlloc failed"));
rc = VERR_NO_MEMORY;
}
else
{
VBVAENABLE_EX *pEnableEx = (VBVAENABLE_EX *)p;
pEnableEx->u32ScreenId = pVbva->srcId;
VBVAENABLE *pEnable = &pEnableEx->Base;
pEnable->u32Flags = bEnable? VBVA_F_ENABLE: VBVA_F_DISABLE;
pEnable->u32Flags |= VBVA_F_EXTENDED | VBVA_F_ABSOFFSET;
pEnable->u32Offset = (uint32_t)pVbva->offVBVA;
pEnable->i32Result = VERR_NOT_SUPPORTED;
VBoxHGSMIBufferSubmit (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p);
if (bEnable)
{
rc = pEnable->i32Result;
AssertRC(rc);
}
else
rc = VINF_SUCCESS;
VBoxHGSMIBufferFree (&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, p);
}
return rc;
}
示例3: VBoxMPHgsmiHandlerEnable
/* Called for IOCTL_VIDEO_HGSMI_HANDLER_ENABLE.
* Enables HGSMI miniport channel.
*/
BOOLEAN VBoxMPHgsmiHandlerEnable(PVBOXMP_DEVEXT pExt, HGSMIHANDLERENABLE *pChannel, PSTATUS_BLOCK pStatus)
{
BOOLEAN bRC = TRUE;
LOGF_ENTER();
if (VBoxCommonFromDeviceExt(pExt)->bHGSMI)
{
int rc = VBoxVbvaChannelDisplayEnable(VBoxCommonFromDeviceExt(pExt), pExt->iDevice, pChannel->u8Channel);
if (RT_FAILURE(rc))
{
pStatus->Status = ERROR_INVALID_NAME;
bRC=FALSE;
}
}
else
{
pStatus->Status = ERROR_INVALID_FUNCTION;
bRC=FALSE;
}
LOGF_LEAVE();
return bRC;
}
示例4: VBoxMPHGSMIQueryCallbacks
/* Called for IOCTL_VIDEO_HGSMI_QUERY_CALLBACKS.
* Returns HGSMI related callbacks.
*/
BOOLEAN VBoxMPHGSMIQueryCallbacks(PVBOXMP_DEVEXT pExt, HGSMIQUERYCALLBACKS *pCallbacks, PSTATUS_BLOCK pStatus)
{
BOOLEAN bRC = TRUE;
LOGF_ENTER();
if (VBoxCommonFromDeviceExt(pExt)->bHGSMI)
{
pCallbacks->hContext = VBoxCommonFromDeviceExt(pExt);
pCallbacks->pfnCompletionHandler = VBoxMPHGSMIHostCmdCompleteCB;
pCallbacks->pfnRequestCommandsHandler = VBoxMPHGSMIHostCmdRequestCB;
pStatus->Information = sizeof(HGSMIQUERYCALLBACKS);
}
else
{
pStatus->Status = ERROR_INVALID_FUNCTION;
bRC=FALSE;
}
LOGF_LEAVE();
return bRC;
}
示例5: vboxVhwaHlpGetSurfInfo
int vboxVhwaHlpGetSurfInfo(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pSurf)
{
for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
{
PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i];
if (pSource->Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED)
{
int rc = vboxVhwaHlpGetSurfInfoForSource(pDevExt, pSurf, i);
AssertRC(rc);
return rc;
}
}
AssertBreakpoint();
return VERR_NOT_SUPPORTED;
}
示例6: VBoxWddmAdjustMode
void VBoxWddmAdjustMode(PVBOXMP_DEVEXT pExt, PVBOXWDDM_ADJUSTVIDEOMODE pMode)
{
pMode->fFlags = 0;
if (pMode->Mode.Id >= (UINT)VBoxCommonFromDeviceExt(pExt)->cDisplays)
{
WARN(("invalid screen id (%d)", pMode->Mode.Id));
pMode->fFlags = VBOXWDDM_ADJUSTVIDEOMODE_F_INVALISCREENID;
return;
}
PVBOXWDDM_TARGET pTarget = &pExt->aTargets[pMode->Mode.Id];
/* @todo: this info should go from the target actually */
PVBOXWDDM_SOURCE pSource = &pExt->aSources[pMode->Mode.Id];
UINT newWidth = pMode->Mode.Width;
UINT newHeight = pMode->Mode.Height;
UINT newBpp = pMode->Mode.BitsPerPixel;
if (!VBoxMPValidateVideoModeParams(pExt, pMode->Mode.Id, newWidth, newHeight, newBpp))
{
PVBOXWDDM_SOURCE pSource = &pExt->aSources[pMode->Mode.Id];
pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_UNSUPPORTED;
}
if (pMode->Mode.Width != newWidth
|| pMode->Mode.Height != newHeight
|| pMode->Mode.BitsPerPixel != newBpp)
{
pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_ADJUSTED;
pMode->Mode.Width = newWidth;
pMode->Mode.Height = newHeight;
pMode->Mode.BitsPerPixel = newBpp;
}
if (pTarget->HeightVisible /* <- active */
&& pSource->AllocData.SurfDesc.width == pMode->Mode.Width
&& pSource->AllocData.SurfDesc.height == pMode->Mode.Height
&& pSource->AllocData.SurfDesc.bpp == pMode->Mode.BitsPerPixel)
{
pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_CURRENT;
if (pMode->fFlags & VBOXWDDM_ADJUSTVIDEOMODE_F_UNSUPPORTED)
{
WARN(("current mode is reported as unsupported"));
}
}
}
示例7: VBoxMPCmnMapAdapterMemory
int VBoxMPCmnMapAdapterMemory(PVBOXMP_COMMON pCommon, void **ppv, uint32_t ulOffset, uint32_t ulSize)
{
PVBOXMP_DEVEXT pPEXT = VBoxCommonToPrimaryExt(pCommon);
LOGF(("0x%08X[0x%X]", ulOffset, ulSize));
if (!ulSize)
{
WARN(("Illegal length 0!"));
return ERROR_INVALID_PARAMETER;
}
PHYSICAL_ADDRESS FrameBuffer;
FrameBuffer.QuadPart = VBoxCommonFromDeviceExt(pPEXT)->phVRAM.QuadPart + ulOffset;
PVOID VideoRamBase = NULL;
ULONG VideoRamLength = ulSize;
VP_STATUS Status;
#ifndef VBOX_WITH_WDDM
ULONG inIoSpace = 0;
Status = VideoPortMapMemory(pPEXT, FrameBuffer, &VideoRamLength, &inIoSpace, &VideoRamBase);
#else
NTSTATUS ntStatus = pPEXT->u.primary.DxgkInterface.DxgkCbMapMemory(pPEXT->u.primary.DxgkInterface.DeviceHandle,
FrameBuffer,
VideoRamLength,
FALSE, /* IN BOOLEAN InIoSpace */
FALSE, /* IN BOOLEAN MapToUserMode */
MmNonCached, /* IN MEMORY_CACHING_TYPE CacheType */
&VideoRamBase /*OUT PVOID *VirtualAddress*/
);
Assert(ntStatus == STATUS_SUCCESS);
/* this is what VideoPortMapMemory returns according to the docs */
Status = ntStatus == STATUS_SUCCESS ? NO_ERROR : ERROR_INVALID_PARAMETER;
#endif
if (Status == NO_ERROR)
{
*ppv = VideoRamBase;
}
LOGF(("rc = %d", Status));
return (Status==NO_ERROR) ? VINF_SUCCESS:VERR_INVALID_PARAMETER;
}
示例8: vboxVhwaCommandSubmitAsynch
/* do not wait for completion */
void vboxVhwaCommandSubmitAsynch(PVBOXMP_DEVEXT pDevExt, VBOXVHWACMD* pCmd, PFNVBOXVHWACMDCOMPLETION pfnCompletion, void * pContext)
{
pCmd->GuestVBVAReserved1 = (uintptr_t)pfnCompletion;
pCmd->GuestVBVAReserved2 = (uintptr_t)pContext;
vbvaVhwaCommandRetain(pDevExt, pCmd);
VBoxHGSMIBufferSubmit(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx, pCmd);
if(!(pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH)
|| ((pCmd->Flags & VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION)
&& (pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED)))
{
/* the command is completed */
pfnCompletion(pDevExt, pCmd, pContext);
}
vbvaVhwaCommandRelease(pDevExt, pCmd);
}
示例9: VBoxMPSetPointerAttr
/* Called for IOCTL_VIDEO_SET_POINTER_ATTR.
* Sets pointer attributes.
*/
BOOLEAN VBoxMPSetPointerAttr(PVBOXMP_DEVEXT pExt, PVIDEO_POINTER_ATTRIBUTES pPointerAttrs, uint32_t cbLen, PSTATUS_BLOCK pStatus)
{
BOOLEAN bRC;
LOGF_ENTER();
if (VBoxQueryHostWantsAbsolute())
{
bRC = VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pExt), pPointerAttrs, cbLen);
}
else
{
LOG(("Fallback to sw pointer."));
pStatus->Status = ERROR_INVALID_FUNCTION;
bRC = FALSE;
}
LOGF_LEAVE();
return bRC;
}
示例10: VBoxCmdVbvaCreate
int VBoxCmdVbvaCreate(PVBOXMP_DEVEXT pDevExt, VBOXCMDVBVA *pVbva, ULONG offBuffer, ULONG cbBuffer)
{
memset(pVbva, 0, sizeof (*pVbva));
int rc = VBoxMPCmnMapAdapterMemory(VBoxCommonFromDeviceExt(pDevExt),
(void**)&pVbva->Vbva.pVBVA,
offBuffer,
cbBuffer);
if (RT_SUCCESS(rc))
{
Assert(pVbva->Vbva.pVBVA);
VBoxVBVAExSetupBufferContext(&pVbva->Vbva, offBuffer, cbBuffer, voxCmdVbvaFlushCb, pDevExt);
}
else
{
WARN(("VBoxMPCmnMapAdapterMemory failed rc %d", rc));
}
return rc;
}
示例11: VBoxMPVhwaQueryInfo
/* Called for IOCTL_VIDEO_VHWA_QUERY_INFO.
* Returns framebuffer offset.
*/
BOOLEAN VBoxMPVhwaQueryInfo(PVBOXMP_DEVEXT pExt, VHWAQUERYINFO *pInfo, PSTATUS_BLOCK pStatus)
{
BOOLEAN bRC = TRUE;
LOGF_ENTER();
if (VBoxCommonFromDeviceExt(pExt)->bHGSMI)
{
pInfo->offVramBase = (ULONG_PTR)pExt->ulFrameBufferOffset;
pStatus->Information = sizeof (VHWAQUERYINFO);
}
else
{
pStatus->Status = ERROR_INVALID_FUNCTION;
bRC=FALSE;
}
LOGF_LEAVE();
return bRC;
}
示例12: VBoxMPShareVideoMemory
/* Called for IOCTL_VIDEO_SHARE_VIDEO_MEMORY.
* Maps FrameBuffer as a linear frame buffer to a caller's virtual adress space. (obsolete).
*/
BOOLEAN VBoxMPShareVideoMemory(PVBOXMP_DEVEXT pExt, PVIDEO_SHARE_MEMORY pShareMem,
PVIDEO_SHARE_MEMORY_INFORMATION pShareMemInfo, PSTATUS_BLOCK pStatus)
{
PHYSICAL_ADDRESS shareAddress;
ULONG inIoSpace = 0;
ULONG offset, size;
PVOID virtualAddress;
ULONG ulMaxFBSize;
LOGF_ENTER();
ulMaxFBSize = pExt->pPrimary->u.primary.ulMaxFrameBufferSize;
offset = pShareMem->ViewOffset;
size = pShareMem->ViewSize;
virtualAddress = pShareMem->ProcessHandle;
VBOXMPIOCTL_HIDE(pShareMem);
if ((offset>ulMaxFBSize) || ((offset+size)>ulMaxFBSize))
{
WARN(("share failed offset:size(%#x:%#x) > %#x fb size.", offset, size, ulMaxFBSize));
pStatus->Status = ERROR_INVALID_PARAMETER;
return FALSE;
}
shareAddress.QuadPart = VBoxCommonFromDeviceExt(pExt)->phVRAM.QuadPart + pExt->ulFrameBufferOffset;
pStatus->Status = VideoPortMapMemory(pExt, shareAddress, &size, &inIoSpace, &virtualAddress);
if (NO_ERROR == pStatus->Status)
{
pShareMemInfo->SharedViewOffset = offset;
pShareMemInfo->SharedViewSize = size;
pShareMemInfo->VirtualAddress = virtualAddress;
pStatus->Information = sizeof(VIDEO_SHARE_MEMORY_INFORMATION);
}
VBOXMPIOCTL_UNHIDE();
LOGF_LEAVE();
return NO_ERROR == pStatus->Status;
}
示例13: VBoxMPHGSMIQueryPortProcs
/* Called for IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS.
* Returns video port api function pointers.
*/
BOOLEAN VBoxMPHGSMIQueryPortProcs(PVBOXMP_DEVEXT pExt, HGSMIQUERYCPORTPROCS *pProcs, PSTATUS_BLOCK pStatus)
{
BOOLEAN bRC = TRUE;
LOGF_ENTER();
if (VBoxCommonFromDeviceExt(pExt)->bHGSMI)
{
pProcs->pContext = pExt->pPrimary;
pProcs->VideoPortProcs = pExt->pPrimary->u.primary.VideoPortProcs;
pStatus->Information = sizeof(HGSMIQUERYCPORTPROCS);
}
else
{
pStatus->Status = ERROR_INVALID_FUNCTION;
bRC=FALSE;
}
LOGF_LEAVE();
return bRC;
}
示例14: vboxVbvaCreate
int vboxVbvaCreate(PVBOXMP_DEVEXT pDevExt, VBOXVBVAINFO *pVbva, ULONG offBuffer, ULONG cbBuffer, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
{
memset(pVbva, 0, sizeof(VBOXVBVAINFO));
KeInitializeSpinLock(&pVbva->Lock);
int rc = VBoxMPCmnMapAdapterMemory(VBoxCommonFromDeviceExt(pDevExt),
(void**)&pVbva->pVBVA,
offBuffer,
cbBuffer);
AssertRC(rc);
if (RT_SUCCESS(rc))
{
Assert(pVbva->pVBVA);
pVbva->offVBVA = offBuffer;
pVbva->cbVBVA = cbBuffer;
pVbva->srcId = srcId;
}
return rc;
}
示例15: VBoxMPEnablePointer
/* Called for IOCTL_VIDEO_ENABLE_POINTER/IOCTL_VIDEO_DISABLE_POINTER.
* Hides pointer or makes it visible depending on bEnable value passed.
*/
BOOLEAN VBoxMPEnablePointer(PVBOXMP_DEVEXT pExt, BOOLEAN bEnable, PSTATUS_BLOCK pStatus)
{
BOOLEAN bRC = TRUE;
LOGF_ENTER();
if (VBoxQueryHostWantsAbsolute())
{
/* Check if it's not shown already. */
if (bEnable == pExt->pPrimary->u.primary.fMouseHidden)
{
VIDEO_POINTER_ATTRIBUTES attrs;
/* Visible and No Shape means show the pointer, 0 means hide pointer.
* It's enough to init only this field.
*/
attrs.Enable = bEnable ? VBOX_MOUSE_POINTER_VISIBLE:0;
/* Pass info to the host. */
bRC = VBoxMPCmnUpdatePointerShape(VBoxCommonFromDeviceExt(pExt), &attrs, sizeof(attrs));
if (bRC)
{
/* Update device state. */
pExt->pPrimary->u.primary.fMouseHidden = !bEnable;
}
}
}
else
{
pStatus->Status = ERROR_INVALID_FUNCTION;
bRC = FALSE;
}
LOGF_LEAVE();
return bRC;
}