VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.h@ 21211

Last change on this file since 21211 was 21211, checked in by vboxsync, 16 years ago

VBoxGuest.h,VBoxGuestLib: Moved the VbglR3 API out of VBoxGuest.h and did some cleanup.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/* $Revision: 21211 $ */
2/** @file
3 * VBoxGuestLibR0 - System dependent helpers internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.215389.xyz. 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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef __VBoxGuestLib_SysHlp_h
23#define __VBoxGuestLib_SysHlp_h
24
25#ifdef RT_OS_WINDOWS
26# if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
27# include <iprt/asm.h>
28# define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
29# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
30# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
31# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
32# pragma warning(disable : 4163)
33RT_C_DECLS_BEGIN
34# include <ntddk.h>
35RT_C_DECLS_END
36# pragma warning(default : 4163)
37# undef _InterlockedExchange
38# undef _InterlockedExchangeAdd
39# undef _InterlockedCompareExchange
40# undef _InterlockedAddLargeStatistic
41# else
42RT_C_DECLS_BEGIN
43# include <ntddk.h>
44RT_C_DECLS_END
45# endif
46/* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist on NT4, so...
47 * The same for ExAllocatePool.
48 */
49#undef ExAllocatePool
50#undef ExFreePool
51#endif
52
53typedef struct _VBGLDRIVER
54{
55#ifdef RT_OS_WINDOWS
56 PDEVICE_OBJECT pDeviceObject;
57 PFILE_OBJECT pFileObject;
58#elif defined (RT_OS_LINUX)
59 void *opaque;
60#elif defined (RT_OS_OS2)
61 uint32_t u32Session; /**< just for sanity checking. */
62#elif defined (RT_OS_SOLARIS)
63 void *pvOpaque;
64#elif defined (RT_OS_FREEBSD)
65 void *pvOpaque;
66#else
67# error "Port me"
68#endif
69} VBGLDRIVER;
70
71int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size, bool fWriteAccess);
72void vbglUnlockLinear (void *pvCtx, void *pv, uint32_t u32Size);
73
74
75#ifndef VBGL_VBOXGUEST
76
77/**
78 * Open VBoxGuest driver.
79 *
80 * @param pDriver Pointer to the driver structure.
81 *
82 * @return VBox error code
83 */
84int vbglDriverOpen (VBGLDRIVER *pDriver);
85
86/**
87 * Call VBoxGuest driver.
88 *
89 * @param pDriver Pointer to the driver structure.
90 * @param u32Function Function code.
91 * @param pvData Pointer to supplied in/out data buffer.
92 * @param cbData Size of data buffer.
93 *
94 * @return VBox error code
95 */
96int vbglDriverIOCtl (VBGLDRIVER *pDriver, uint32_t u32Function, void *pvData, uint32_t cbData);
97
98/**
99 * Close VBoxGuest driver.
100 *
101 * @param pDriver Pointer to the driver structure.
102 *
103 * @return VBox error code
104 */
105void vbglDriverClose (VBGLDRIVER *pDriver);
106
107#endif
108
109#endif /* !__VBoxGuestLib_SysHlp_h */
110
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette