VirtualBox

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

Last change on this file since 4071 was 4071, checked in by vboxsync, 17 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 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-2007 innotek 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
19#ifndef __SYSHLP__H
20#define __SYSHLP__H
21
22#ifdef RT_OS_WINDOWS
23# if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
24# include <iprt/asm.h>
25# define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
26# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
27# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
28# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
29__BEGIN_DECLS
30# include <ntddk.h>
31__END_DECLS
32# undef _InterlockedExchange
33# undef _InterlockedExchangeAdd
34# undef _InterlockedCompareExchange
35# undef _InterlockedAddLargeStatistic
36# else
37__BEGIN_DECLS
38# include <ntddk.h>
39__END_DECLS
40# endif
41/* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist on NT4, so... */
42#undef ExFreePool
43#endif
44
45typedef struct _VBGLDRIVER
46{
47#ifdef RT_OS_WINDOWS
48 PDEVICE_OBJECT pDeviceObject;
49 PFILE_OBJECT pFileObject;
50#elif defined (RT_OS_LINUX)
51 void *opaque;
52#elif defined (RT_OS_OS2)
53 uint32_t u32Session; /**< just for sanity checking. */
54#else
55# error "Port me"
56#endif
57} VBGLDRIVER;
58
59int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size, bool fWriteAccess);
60void vbglUnlockLinear (void *pvCtx, void *pv, uint32_t u32Size);
61
62
63#ifndef VBGL_VBOXGUEST
64
65/**
66 * Open VBoxGuest driver.
67 *
68 * @param pDriver Pointer to the driver structure.
69 *
70 * @return VBox error code
71 */
72int vbglDriverOpen (VBGLDRIVER *pDriver);
73
74/**
75 * Call VBoxGuest driver.
76 *
77 * @param pDriver Pointer to the driver structure.
78 * @param u32Function Function code.
79 * @param pvData Pointer to supplied in/out data buffer.
80 * @param cbData Size of data buffer.
81 *
82 * @return VBox error code
83 */
84int vbglDriverIOCtl (VBGLDRIVER *pDriver, uint32_t u32Function, void *pvData, uint32_t cbData);
85
86/**
87 * Close VBoxGuest driver.
88 *
89 * @param pDriver Pointer to the driver structure.
90 *
91 * @return VBox error code
92 */
93void vbglDriverClose (VBGLDRIVER *pDriver);
94
95#endif
96
97#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