VirtualBox

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

Last change on this file since 49180 was 48070, checked in by vboxsync, 12 years ago

wddm,vboxtray: forward-port autoresize, multimon, and seamless fixes from 4.2 r87071, r87353, r87356, r87528, r87568, r87581, r87584, r87608, r87673, r87678, r87708, r87629, r87529; additional fixes

  • 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 48070 2013-08-26 18:13:22Z 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 */
32#define VBOXMP_MAX_VIDEO_MODES 128
33void VBoxMPCmnInitCustomVideoModes(PVBOXMP_DEVEXT pExt);
34VIDEO_MODE_INFORMATION* VBoxMPCmnGetCustomVideoModeInfo(ULONG ulIndex);
35
36#ifdef VBOX_XPDM_MINIPORT
37VIDEO_MODE_INFORMATION* VBoxMPCmnGetVideoModeInfo(ULONG ulIndex);
38VIDEO_MODE_INFORMATION* VBoxMPXpdmCurrentVideoMode(PVBOXMP_DEVEXT pExt);
39ULONG VBoxMPXpdmGetVideoModesCount();
40void VBoxMPXpdmBuildVideoModesTable(PVBOXMP_DEVEXT pExt);
41#endif
42
43#ifdef VBOX_WDDM_MINIPORT
44PVBOXWDDM_VIDEOMODES_INFO VBoxWddmUpdateVideoModesInfoByMask(PVBOXMP_DEVEXT pExt, uint8_t *pScreenIdMask);
45void VBoxWddmInitVideoModes(PVBOXMP_DEVEXT pExt);
46NTSTATUS VBoxWddmGetModesForResolution(VIDEO_MODE_INFORMATION *pAllModes, uint32_t cAllModes, int iSearchPreferredMode,
47 const D3DKMDT_2DREGION *pResolution, VIDEO_MODE_INFORMATION * pModes,
48 uint32_t cModes, uint32_t *pcModes, int32_t *piPreferrableMode);
49PVBOXWDDM_VIDEOMODES_INFO VBoxWddmGetAllVideoModesInfos(PVBOXMP_DEVEXT pExt);
50PVBOXWDDM_VIDEOMODES_INFO VBoxWddmGetVideoModesInfo(PVBOXMP_DEVEXT pExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId);
51bool VBoxWddmFillMode(VIDEO_MODE_INFORMATION *pInfo, D3DDDIFORMAT enmFormat, ULONG w, ULONG h);
52bool VBoxWddmFillMode(VIDEO_MODE_INFORMATION *pInfo, D3DDDIFORMAT enmFormat, ULONG w, ULONG h);
53void VBoxWddmAdjustMode(PVBOXMP_DEVEXT pExt, PVBOXWDDM_ADJUSTVIDEOMODE pMode);
54void VBoxWddmAdjustModes(PVBOXMP_DEVEXT pExt, uint32_t cModes, PVBOXWDDM_ADJUSTVIDEOMODE aModes);
55#endif
56
57/* Registry access */
58#ifdef VBOX_XPDM_MINIPORT
59typedef PVBOXMP_DEVEXT VBOXMPCMNREGISTRY;
60#else
61typedef HANDLE VBOXMPCMNREGISTRY;
62#endif
63
64VP_STATUS VBoxMPCmnRegInit(IN PVBOXMP_DEVEXT pExt, OUT VBOXMPCMNREGISTRY *pReg);
65VP_STATUS VBoxMPCmnRegFini(IN VBOXMPCMNREGISTRY Reg);
66VP_STATUS VBoxMPCmnRegSetDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t Val);
67VP_STATUS VBoxMPCmnRegQueryDword(IN VBOXMPCMNREGISTRY Reg, PWSTR pName, uint32_t *pVal);
68
69/* Pointer related */
70inline bool VBoxMPCmnUpdatePointerShape(PVBOXMP_COMMON pCommon, PVIDEO_POINTER_ATTRIBUTES pAttrs, uint32_t cbLength)
71{
72 return 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}
79
80RT_C_DECLS_END
81
82#endif /*VBOXMPCOMMON_H*/
Note: See TracBrowser for help on using the repository browser.

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