VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPCommon.h@ 50940

Last change on this file since 50940 was 50900, checked in by vboxsync, 11 years ago

Additions/common/VBoxVideo: fix a return value.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1/* $Id: VBoxMPCommon.h 50900 2014-03-26 22:00:47Z vboxsync $ */
2/** @file
3 * VBox Miniport common functions used by XPDM/WDDM drivers
4 */
5
6/*
7 * Copyright (C) 2011-2012 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef VBOXMPCOMMON_H
19#define VBOXMPCOMMON_H
20
21#include "VBoxMPDevExt.h"
22
23RT_C_DECLS_BEGIN
24
25int VBoxMPCmnMapAdapterMemory(PVBOXMP_COMMON pCommon, void **ppv, uint32_t ulOffset, uint32_t ulSize);
26void VBoxMPCmnUnmapAdapterMemory(PVBOXMP_COMMON pCommon, void **ppv);
27
28typedef bool(*PFNVIDEOIRQSYNC)(void *);
29bool VBoxMPCmnSyncToVideoIRQ(PVBOXMP_COMMON pCommon, PFNVIDEOIRQSYNC pfnSync, void *pvUser);
30
31/* Video modes related */
32void VBoxMPCmnInitCustomVideoModes(PVBOXMP_DEVEXT pExt);
33VIDEO_MODE_INFORMATION* VBoxMPCmnGetCustomVideoModeInfo(ULONG ulIndex);
34
35#ifdef VBOX_XPDM_MINIPORT
36VIDEO_MODE_INFORMATION* VBoxMPCmnGetVideoModeInfo(PVBOXMP_DEVEXT pExt, ULONG ulIndex);
37VIDEO_MODE_INFORMATION* VBoxMPXpdmCurrentVideoMode(PVBOXMP_DEVEXT pExt);
38ULONG VBoxMPXpdmGetVideoModesCount(PVBOXMP_DEVEXT pExt);
39void VBoxMPXpdmBuildVideoModesTable(PVBOXMP_DEVEXT pExt);
40#endif
41
42#ifdef VBOX_WDDM_MINIPORT
43PVBOXWDDM_VIDEOMODES_INFO VBoxWddmUpdateVideoModesInfoByMask(PVBOXMP_DEVEXT pExt, uint8_t *pScreenIdMask);
44void VBoxWddmInitVideoModes(PVBOXMP_DEVEXT pExt);
45NTSTATUS VBoxWddmGetModesForResolution(VIDEO_MODE_INFORMATION *pAllModes, uint32_t cAllModes, int iSearchPreferredMode,
46 const D3DKMDT_2DREGION *pResolution, VIDEO_MODE_INFORMATION * pModes,
47 uint32_t cModes, uint32_t *pcModes, int32_t *piPreferrableMode);
48PVBOXWDDM_VIDEOMODES_INFO VBoxWddmGetAllVideoModesInfos(PVBOXMP_DEVEXT pExt);
49PVBOXWDDM_VIDEOMODES_INFO VBoxWddmGetVideoModesInfo(PVBOXMP_DEVEXT pExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId);
50bool VBoxWddmFillMode(VIDEO_MODE_INFORMATION *pInfo, D3DDDIFORMAT enmFormat, ULONG w, ULONG h);
51bool VBoxWddmFillMode(VIDEO_MODE_INFORMATION *pInfo, D3DDDIFORMAT enmFormat, ULONG w, ULONG h);
52void VBoxWddmAdjustMode(PVBOXMP_DEVEXT pExt, PVBOXWDDM_ADJUSTVIDEOMODE pMode);
53void VBoxWddmAdjustModes(PVBOXMP_DEVEXT pExt, uint32_t cModes, PVBOXWDDM_ADJUSTVIDEOMODE aModes);
54#endif
55
56/* Registry access */
57#ifdef VBOX_XPDM_MINIPORT
58typedef PVBOXMP_DEVEXT VBOXMPCMNREGISTRY;
59#else
60typedef HANDLE VBOXMPCMNREGISTRY;
61#endif
62
63VP_STATUS VBoxMPCmnRegInit(IN PVBOXMP_DEVEXT pExt, OUT VBOXMPCMNREGISTRY *pReg);
64VP_STATUS VBoxMPCmnRegFini(IN VBOXMPCMNREGISTRY Reg);
65VP_STATUS VBoxMPCmnRegSetDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t Val);
66VP_STATUS VBoxMPCmnRegQueryDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t *pVal);
67
68/* Pointer related */
69inline bool VBoxMPCmnUpdatePointerShape(PVBOXMP_COMMON pCommon, PVIDEO_POINTER_ATTRIBUTES pAttrs, uint32_t cbLength)
70{
71 int rc;
72 rc = VBoxHGSMIUpdatePointerShape(&pCommon->guestCtx,
73 pAttrs->Enable & 0x0000FFFF,
74 (pAttrs->Enable >> 16) & 0xFF,
75 (pAttrs->Enable >> 24) & 0xFF,
76 pAttrs->Width, pAttrs->Height, pAttrs->Pixels,
77 cbLength - sizeof(VIDEO_POINTER_ATTRIBUTES));
78 return RT_SUCCESS(rc);
79}
80
81RT_C_DECLS_END
82
83#endif /*VBOXMPCOMMON_H*/
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette