VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/switcher/d3d8_main.c@ 40587

Last change on this file since 40587 was 40587, checked in by vboxsync, 13 years ago

wined3d/xpdm: gracefully handle missing msd3d dll

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1/* $Id: d3d8_main.c 40587 2012-03-23 09:08:44Z vboxsync $ */
2
3/** @file
4 * VBox D3D8 dll switcher
5 */
6
7/*
8 * Copyright (C) 2009 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#include "d3d8.h"
20#include "switcher.h"
21
22typedef HRESULT (WINAPI *D3D8GetSWInfoProc)(void);
23typedef void (WINAPI *DebugSetMuteProc)(void);
24typedef IDirect3D8* (WINAPI *Direct3DCreate8Proc)(UINT SDKVersion);
25typedef HRESULT (WINAPI *ValidatePixelShaderProc)(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto);
26typedef HRESULT (WINAPI *ValidateVertexShaderProc)(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto);
27
28static HRESULT WINAPI vboxD3D8GetSWInfoStub(void)
29{
30 return E_FAIL;
31}
32
33static void WINAPI vboxDebugSetMuteStub(void)
34{
35
36}
37
38static IDirect3D8* WINAPI vboxDirect3DCreate8Stub(UINT SDKVersion)
39{
40 return NULL;
41}
42
43static HRESULT WINAPI vboxValidatePixelShaderStub(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto)
44{
45 return E_FAIL;
46}
47
48static HRESULT WINAPI vboxValidateVertexShaderStub(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto)
49{
50 return E_FAIL;
51}
52
53typedef struct _D3D8ExTag
54{
55 int initialized;
56 const char *vboxName;
57 const char *msName;
58 D3D8GetSWInfoProc pD3D8GetSWInfo;
59 DebugSetMuteProc pDebugSetMute;
60 Direct3DCreate8Proc pDirect3DCreate8;
61 ValidatePixelShaderProc pValidatePixelShader;
62 ValidateVertexShaderProc pValidateVertexShader;
63} D3D8Export;
64
65static D3D8Export g_swd3d8 = {0, "VBoxD3D8.dll", "MSD3D8.dll",};
66
67void FillD3DExports(HANDLE hDLL)
68{
69 SW_FILLPROC(g_swd3d8, hDLL, D3D8GetSWInfo);
70 SW_FILLPROC(g_swd3d8, hDLL, DebugSetMute);
71 SW_FILLPROC(g_swd3d8, hDLL, Direct3DCreate8);
72 SW_FILLPROC(g_swd3d8, hDLL, ValidatePixelShader);
73 SW_FILLPROC(g_swd3d8, hDLL, ValidateVertexShader);
74}
75
76HRESULT WINAPI D3D8GetSWInfo(void)
77{
78 SW_CHECKRET(g_swd3d8, D3D8GetSWInfo, E_FAIL);
79 return g_swd3d8.pD3D8GetSWInfo();
80}
81
82void WINAPI DebugSetMute(void)
83{
84 SW_CHECKCALL(g_swd3d8, DebugSetMute);
85 g_swd3d8.pDebugSetMute();
86}
87
88IDirect3D8* WINAPI Direct3DCreate8(UINT SDKVersion)
89{
90 SW_CHECKRET(g_swd3d8, Direct3DCreate8, NULL);
91 return g_swd3d8.pDirect3DCreate8(SDKVersion);
92}
93
94HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto)
95{
96 SW_CHECKRET(g_swd3d8, ValidatePixelShader, E_FAIL);
97 return g_swd3d8.pValidatePixelShader(pixelshader, reserved1, bool, toto);
98}
99
100HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto)
101{
102 SW_CHECKRET(g_swd3d8, ValidateVertexShader, E_FAIL)
103 return g_swd3d8.pValidateVertexShader(vertexshader, reserved1, reserved2, bool, toto);
104}
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