VirtualBox

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

Last change on this file since 2412 was 2103, checked in by vboxsync, 18 years ago

Fix for ExFreePoolWithTag which does not exist on NT4 and must not be referenced
by the guest drivers (ExFreePool is mapped to ExFreePoolWithTag by XP DDK headers).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/** @file
2 *
3 * VBoxGuestLib - A support library for VirtualBox guest additions:
4 * System dependent helpers internal header
5 */
6
7/*
8 * Copyright (C) 2006 InnoTek Systemberatung GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * If you received this file as part of a commercial VirtualBox
19 * distribution, then only the terms of your commercial VirtualBox
20 * license agreement apply instead of the previous paragraph.
21 */
22
23#ifndef __SYSHLP__H
24#define __SYSHLP__H
25
26#ifdef __WIN__
27# if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
28# include <iprt/asm.h>
29# define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
30# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
31# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
32# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
33__BEGIN_DECLS
34# include <ntddk.h>
35__END_DECLS
36# undef _InterlockedExchange
37# undef _InterlockedExchangeAdd
38# undef _InterlockedCompareExchange
39# undef _InterlockedAddLargeStatistic
40# else
41__BEGIN_DECLS
42# include <ntddk.h>
43__END_DECLS
44# endif
45/* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist on NT4, so... */
46#undef ExFreePool
47#endif
48
49typedef struct _VBGLDRIVER
50{
51#ifdef __WIN__
52 PDEVICE_OBJECT pDeviceObject;
53 PFILE_OBJECT pFileObject;
54#else /* !__WIN__ */
55 void *opaque;
56#endif /* !__WIN__ */
57} VBGLDRIVER;
58
59
60#ifndef VBGL_VBOXGUEST
61
62/**
63 * Open VBoxGuest driver.
64 *
65 * @param pDriver Pointer to the driver structure.
66 *
67 * @return VBox error code
68 */
69int vbglDriverOpen (VBGLDRIVER *pDriver);
70
71/**
72 * Call VBoxGuest driver.
73 *
74 * @param pDriver Pointer to the driver structure.
75 * @param u32Function Function code.
76 * @param pvData Pointer to supplied in/out data buffer.
77 * @param cbData Size of data buffer.
78 *
79 * @return VBox error code
80 */
81int vbglDriverIOCtl (VBGLDRIVER *pDriver, uint32_t u32Function, void *pvData, uint32_t cbData);
82
83/**
84 * Close VBoxGuest driver.
85 *
86 * @param pDriver Pointer to the driver structure.
87 *
88 * @return VBox error code
89 */
90void vbglDriverClose (VBGLDRIVER *pDriver);
91
92#endif
93
94#endif /* __SYSHLP__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