VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/vboxsharedrc.h@ 39648

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

wine: fix debug build

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/* $Id: vboxsharedrc.h 39648 2011-12-16 18:50:12Z vboxsync $ */
2/** @file
3 *
4 * VBox extension to Wine D3D - shared resource
5 *
6 * Copyright (C) 2010 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 ___vboxsharedrc_h___
17#define ___vboxsharedrc_h___
18
19#define VBOXSHRC_F_SHARED 0x00000001 /* shared rc */
20#define VBOXSHRC_F_SHARED_OPENED 0x00000002 /* if set shared rc is opened, otherwise it is created */
21#define VBOXSHRC_F_DONT_DELETE 0x00000004 /* don't delete gl resources on d3d resource deletion */
22
23#define VBOXSHRC_GET_SHAREFLAFS(_o) ((_o)->resource.sharerc_flags)
24#define VBOXSHRC_GET_SHAREHANDLE(_o) ((HANDLE)(_o)->resource.sharerc_handle)
25#define VBOXSHRC_SET_SHAREHANDLE(_o, _h) ((_o)->resource.sharerc_handle = (DWORD)(_h))
26#define VBOXSHRC_COPY_SHAREDATA(_oDst, _oSrc) do { \
27 VBOXSHRC_GET_SHAREFLAFS(_oDst) = VBOXSHRC_GET_SHAREFLAFS(_oSrc); \
28 VBOXSHRC_SET_SHAREHANDLE(_oDst, VBOXSHRC_GET_SHAREHANDLE(_oSrc)); \
29 } while (0)
30#define VBOXSHRC_SET_SHARED(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_SHARED)
31#define VBOXSHRC_SET_SHARED_OPENED(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_SHARED_OPENED)
32#define VBOXSHRC_SET_DONT_DELETE(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_DONT_DELETE)
33
34#define VBOXSHRC_IS_SHARED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED))
35#define VBOXSHRC_IS_SHARED_OPENED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED_OPENED))
36#define VBOXSHRC_IS_SHARED_UNLOCKED(_o) (VBOXSHRC_IS_SHARED(_o) && !VBOXSHRC_IS_LOCKED(_o))
37#define VBOXSHRC_CAN_DELETE(_d, _o) ( \
38 !VBOXSHRC_IS_SHARED(_o) \
39 || !(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_DONT_DELETE) \
40 )
41
42#define VBOXSHRC_LOCK(_o) do{ \
43 Assert(VBOXSHRC_IS_SHARED(_o)); \
44 ++(_o)->resource.sharerc_locks; \
45 } while (0)
46#define VBOXSHRC_UNLOCK(_o) do{ \
47 Assert(VBOXSHRC_IS_SHARED(_o)); \
48 --(_o)->resource.sharerc_locks; \
49 Assert((_o)->resource.sharerc_locks < UINT32_MAX/2); \
50 } while (0)
51#define VBOXSHRC_IS_LOCKED(_o) ( \
52 !!((_o)->resource.sharerc_locks) \
53 )
54
55#endif /* #ifndef ___vboxsharedrc_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