vboxsharedrc.h revision 083cbf42ea3a1b9a6ba348928eaa0d5aed761b05
4e456e445297d61870d9301661f36e5cc946cbefvboxsync/* $Id$ */
4e456e445297d61870d9301661f36e5cc946cbefvboxsync/** @file
4e456e445297d61870d9301661f36e5cc946cbefvboxsync *
4e456e445297d61870d9301661f36e5cc946cbefvboxsync * VBox extension to Wine D3D
4e456e445297d61870d9301661f36e5cc946cbefvboxsync *
4e456e445297d61870d9301661f36e5cc946cbefvboxsync * Copyright (C) 2010 Oracle Corporation
4e456e445297d61870d9301661f36e5cc946cbefvboxsync *
4e456e445297d61870d9301661f36e5cc946cbefvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
4e456e445297d61870d9301661f36e5cc946cbefvboxsync * available from http://www.virtualbox.org. This file is free software;
4e456e445297d61870d9301661f36e5cc946cbefvboxsync * you can redistribute it and/or modify it under the terms of the GNU
4e456e445297d61870d9301661f36e5cc946cbefvboxsync * General Public License (GPL) as published by the Free Software
4e456e445297d61870d9301661f36e5cc946cbefvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
4e456e445297d61870d9301661f36e5cc946cbefvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
4e456e445297d61870d9301661f36e5cc946cbefvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
4e456e445297d61870d9301661f36e5cc946cbefvboxsync */
4e456e445297d61870d9301661f36e5cc946cbefvboxsync#ifndef ___vboxsharedrc_h___
4e456e445297d61870d9301661f36e5cc946cbefvboxsync#define ___vboxsharedrc_h___
4e456e445297d61870d9301661f36e5cc946cbefvboxsync
083cbf42ea3a1b9a6ba348928eaa0d5aed761b05vboxsync#define VBOXSHRC_F_SHARED 0x00000001 /* shared rc */
083cbf42ea3a1b9a6ba348928eaa0d5aed761b05vboxsync#define VBOXSHRC_F_SHARED_OPENED 0x00000002 /* if set shared rc is opened, otherwise it is created */
083cbf42ea3a1b9a6ba348928eaa0d5aed761b05vboxsync#define VBOXSHRC_F_INITIALIZED 0x00000004 /* set once shared rc is initialized */
4e456e445297d61870d9301661f36e5cc946cbefvboxsync
4e456e445297d61870d9301661f36e5cc946cbefvboxsync#define VBOXSHRC_GET_SHAREFLAFS(_o) ((_o)->resource.sharerc_flags)
4e456e445297d61870d9301661f36e5cc946cbefvboxsync#define VBOXSHRC_GET_SHAREHANDLE(_o) ((_o)->resource.sharerc_handle)
4e456e445297d61870d9301661f36e5cc946cbefvboxsync#define VBOXSHRC_SET_SHAREHANDLE(_o, _h) ((_o)->resource.sharerc_handle = (_h))
083cbf42ea3a1b9a6ba348928eaa0d5aed761b05vboxsync#define VBOXSHRC_SET_INITIALIZED(_o) (VBOXSHRC_GET_SHAREFLAFS(_o) |= VBOXSHRC_F_INITIALIZED)
4e456e445297d61870d9301661f36e5cc946cbefvboxsync#define VBOXSHRC_IS_SHARED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED))
4e456e445297d61870d9301661f36e5cc946cbefvboxsync#define VBOXSHRC_IS_SHARED_OPENED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_SHARED_OPENED))
083cbf42ea3a1b9a6ba348928eaa0d5aed761b05vboxsync#define VBOXSHRC_IS_INITIALIZED(_o) (!!(VBOXSHRC_GET_SHAREFLAFS(_o) & VBOXSHRC_F_INITIALIZED))
4e456e445297d61870d9301661f36e5cc946cbefvboxsync
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync#ifdef DEBUG_misha
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync/* just for simplicity */
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync#define AssertBreakpoint() do { __asm {int 3} } while (0)
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync#define Assert(_expr) do { \
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync if (!(_expr)) AssertBreakpoint(); \
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync } while (0)
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync#else
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync#define AssertBreakpoint() do { } while (0)
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync#define Assert(_expr) do { } while (0)
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync#endif
845d0e4d3aefdc097ff0b3f1b1808f4b72e0a7d0vboxsync
4e456e445297d61870d9301661f36e5cc946cbefvboxsync#endif /* #ifndef ___vboxsharedrc_h___ */