1 | /* $Id: vboxext.h 39648 2011-12-16 18:50:12Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | *
|
---|
4 | * VBox extension to Wine D3D
|
---|
5 | *
|
---|
6 | * Copyright (C) 2011 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | */
|
---|
16 | #ifndef ___VBOXEXT_H__
|
---|
17 | #define ___VBOXEXT_H__
|
---|
18 |
|
---|
19 | #ifdef VBOX_WINE_WITHOUT_LIBWINE
|
---|
20 | # include <windows.h>
|
---|
21 | #endif
|
---|
22 |
|
---|
23 | HRESULT VBoxExtCheckInit();
|
---|
24 | HRESULT VBoxExtCheckTerm();
|
---|
25 | #if defined(VBOX_WINE_WITH_SINGLE_CONTEXT) || defined(VBOX_WINE_WITH_SINGLE_SWAPCHAIN_CONTEXT)
|
---|
26 | # ifndef VBOX_WITH_WDDM
|
---|
27 | /* Windows destroys HDC created by a given thread when the thread is terminated
|
---|
28 | * this leads to a mess-up in Wine & Chromium code in some situations, e.g.
|
---|
29 | * D3D device is created in one thread, then the thread is terminated,
|
---|
30 | * then device is started to be used in another thread */
|
---|
31 | HDC VBoxExtGetDC(HWND hWnd);
|
---|
32 | int VBoxExtReleaseDC(HWND hWnd, HDC hDC);
|
---|
33 | # endif
|
---|
34 | /* We need to do a VBoxTlsRefRelease for the current thread context on thread exit to avoid memory leaking
|
---|
35 | * Calling VBoxTlsRefRelease may result in a call to context dtor callback, which is supposed to be run under wined3d lock.
|
---|
36 | * We can not acquire a wined3d lock in DllMain since this would result in a lock order violation, which may result in a deadlock.
|
---|
37 | * In other words, wined3d may internally call Win32 API functions which result in a DLL lock acquisition while holding wined3d lock.
|
---|
38 | * So lock order should always be "wined3d lock" -> "dll lock".
|
---|
39 | * To avoid possible deadlocks we make an asynchronous call to a worker thread to make a context release from there. */
|
---|
40 | void VBoxExtReleaseContextAsync(struct wined3d_context *context);
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | /* API for creating & destroying windows */
|
---|
44 | HRESULT VBoxExtWndDestroy(HWND hWnd, HDC hDC);
|
---|
45 | HRESULT VBoxExtWndCreate(DWORD width, DWORD height, HWND *phWnd, HDC *phDC);
|
---|
46 |
|
---|
47 | #endif /* #ifndef ___VBOXEXT_H__*/
|
---|