VirtualBox

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

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

Additions/VBoxGuestLib: warnings

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/* $Revision: 40207 $ */
2/** @file
3 * VBoxGuestLibR0 - System dependent helpers internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. 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 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef __VBoxGuestLib_SysHlp_h
28#define __VBoxGuestLib_SysHlp_h
29
30#ifdef RT_OS_WINDOWS
31# undef PAGE_SIZE
32# undef PAGE_SHIFT
33# if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
34# include <iprt/asm.h>
35# define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
36# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
37# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
38# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
39# pragma warning(disable : 4163)
40RT_C_DECLS_BEGIN
41# include <ntddk.h>
42RT_C_DECLS_END
43# pragma warning(default : 4163)
44# undef _InterlockedExchange
45# undef _InterlockedExchangeAdd
46# undef _InterlockedCompareExchange
47# undef _InterlockedAddLargeStatistic
48# else
49RT_C_DECLS_BEGIN
50# include <ntddk.h>
51RT_C_DECLS_END
52# endif
53/* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist on NT4, so...
54 * The same for ExAllocatePool.
55 */
56#undef ExAllocatePool
57#undef ExFreePool
58#endif
59
60typedef struct _VBGLDRIVER
61{
62#ifdef RT_OS_WINDOWS
63 PDEVICE_OBJECT pDeviceObject;
64 PFILE_OBJECT pFileObject;
65#elif defined (RT_OS_OS2)
66 uint32_t u32Session; /**< just for sanity checking. */
67#else /* PORTME */
68 void *pvOpaque;
69#endif
70} VBGLDRIVER;
71
72int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size, bool fWriteAccess, uint32_t fFlags);
73void vbglUnlockLinear (void *pvCtx, void *pv, uint32_t u32Size);
74
75
76#ifndef VBGL_VBOXGUEST
77
78/**
79 * Open VBoxGuest driver.
80 *
81 * @param pDriver Pointer to the driver structure.
82 *
83 * @return VBox error code
84 */
85int vbglDriverOpen (VBGLDRIVER *pDriver);
86
87/**
88 * Call VBoxGuest driver.
89 *
90 * @param pDriver Pointer to the driver structure.
91 * @param u32Function Function code.
92 * @param pvData Pointer to supplied in/out data buffer.
93 * @param cbData Size of data buffer.
94 *
95 * @return VBox error code
96 */
97int vbglDriverIOCtl (VBGLDRIVER *pDriver, uint32_t u32Function, void *pvData, uint32_t cbData);
98
99/**
100 * Close VBoxGuest driver.
101 *
102 * @param pDriver Pointer to the driver structure.
103 *
104 * @return VBox error code
105 */
106void vbglDriverClose (VBGLDRIVER *pDriver);
107
108#endif
109
110#endif /* !__VBoxGuestLib_SysHlp_h */
111
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