VirtualBox

source: vbox/trunk/src/VBox/Additions/3D/win/VBoxWddmUmHlp/VBoxWddmUmHlp.h@ 76539

Last change on this file since 76539 was 76539, checked in by vboxsync, 6 years ago

Additions/3D: scm --fix-header-guards. bugref:9344

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/* $Id: VBoxWddmUmHlp.h 76539 2018-12-30 06:22:29Z vboxsync $ */
2/** @file
3 * VBox WDDM User Mode Driver Helpers
4 */
5
6/*
7 * Copyright (C) 2018 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 ___VBoxWddmUmHlp_h__
19#define ___VBoxWddmUmHlp_h__
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include <iprt/win/d3d9.h>
25#include <d3dumddi.h>
26#include <d3dkmthk.h>
27
28#include <iprt/asm.h>
29#include <iprt/cdefs.h>
30
31/* Do not require IPRT library. */
32#if defined(Assert)
33#undef Assert
34#endif
35#ifdef RT_STRICT
36#define Assert(_e) (void)( (!!(_e)) || (ASMBreakpoint(), 0) )
37#else
38#define Assert(_e) (void)( 0 )
39#endif
40
41/* Do not require ntstatus.h.
42 * D3DKMT functions return NTSTATUS, but the driver code uses it only as a success/failure indicator.
43 * Therefore define the success and a failure status here.
44 */
45#ifndef STATUS_SUCCESS
46#define STATUS_SUCCESS 0
47#endif
48#ifndef STATUS_NOT_SUPPORTED
49#define STATUS_NOT_SUPPORTED ((NTSTATUS)0xC00000BBL)
50#endif
51
52RT_C_DECLS_BEGIN
53
54typedef struct VBOXWDDMDLLPROC
55{
56 char const *pszName;
57 FARPROC *ppfn;
58} VBOXWDDMDLLPROC;
59
60typedef struct D3DKMTFUNCTIONS
61{
62 PFND3DKMT_OPENADAPTERFROMHDC pfnD3DKMTOpenAdapterFromHdc;
63 PFND3DKMT_OPENADAPTERFROMDEVICENAME pfnD3DKMTOpenAdapterFromDeviceName;
64 PFND3DKMT_CLOSEADAPTER pfnD3DKMTCloseAdapter;
65 PFND3DKMT_QUERYADAPTERINFO pfnD3DKMTQueryAdapterInfo;
66 PFND3DKMT_ESCAPE pfnD3DKMTEscape;
67 PFND3DKMT_CREATEDEVICE pfnD3DKMTCreateDevice;
68 PFND3DKMT_DESTROYDEVICE pfnD3DKMTDestroyDevice;
69 PFND3DKMT_CREATECONTEXT pfnD3DKMTCreateContext;
70 PFND3DKMT_DESTROYCONTEXT pfnD3DKMTDestroyContext;
71 PFND3DKMT_CREATEALLOCATION pfnD3DKMTCreateAllocation;
72 PFND3DKMT_DESTROYALLOCATION pfnD3DKMTDestroyAllocation;
73 PFND3DKMT_RENDER pfnD3DKMTRender;
74 PFND3DKMT_PRESENT pfnD3DKMTPresent;
75 PFND3DKMT_GETSHAREDPRIMARYHANDLE pfnD3DKMTGetSharedPrimaryHandle;
76 PFND3DKMT_QUERYRESOURCEINFO pfnD3DKMTQueryResourceInfo;
77 PFND3DKMT_OPENRESOURCE pfnD3DKMTOpenResource;
78
79 /* Win 8+ */
80 PFND3DKMT_ENUMADAPTERS pfnD3DKMTEnumAdapters;
81 PFND3DKMT_OPENADAPTERFROMLUID pfnD3DKMTOpenAdapterFromLuid;
82} D3DKMTFUNCTIONS;
83
84DECLCALLBACK(HMODULE) VBoxWddmLoadSystemDll(const char *pszName);
85DECLCALLBACK(void) VBoxWddmLoadAdresses(HMODULE hmod, VBOXWDDMDLLPROC *paProcs);
86
87DECLCALLBACK(int) D3DKMTLoad(void);
88DECLCALLBACK(D3DKMTFUNCTIONS const *) D3DKMTFunctions(void);
89
90DECLCALLBACK(void) VBoxDispMpLoggerLogF(const char *pszString, ...);
91DECLCALLBACK(void) VBoxWddmUmLog(const char *pszString);
92
93/** @todo Rename to VBoxWddm* */
94NTSTATUS vboxDispKmtOpenAdapter2(D3DKMT_HANDLE *phAdapter, LUID *pLuid);
95NTSTATUS vboxDispKmtOpenAdapter(D3DKMT_HANDLE *phAdapter);
96NTSTATUS vboxDispKmtCloseAdapter(D3DKMT_HANDLE hAdapter);
97
98RT_C_DECLS_END
99
100#endif
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