VirtualBox

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

Last change on this file since 3333 was 3306, checked in by vboxsync, 18 years ago

Added a IPRT base fallback implementation for locking and completed the OS/2 client code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 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 * 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#elif defined (__LINUX__)
55 void *opaque;
56#elif defined (__OS2__)
57 uint32_t u32Session; /**< just for sanity checking. */
58#else
59# error "Port me"
60#endif
61} VBGLDRIVER;
62
63int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size);
64void vbglUnlockLinear (void *pvCtx, void *pv, uint32_t u32Size);
65
66
67#ifndef VBGL_VBOXGUEST
68
69/**
70 * Open VBoxGuest driver.
71 *
72 * @param pDriver Pointer to the driver structure.
73 *
74 * @return VBox error code
75 */
76int vbglDriverOpen (VBGLDRIVER *pDriver);
77
78/**
79 * Call VBoxGuest driver.
80 *
81 * @param pDriver Pointer to the driver structure.
82 * @param u32Function Function code.
83 * @param pvData Pointer to supplied in/out data buffer.
84 * @param cbData Size of data buffer.
85 *
86 * @return VBox error code
87 */
88int vbglDriverIOCtl (VBGLDRIVER *pDriver, uint32_t u32Function, void *pvData, uint32_t cbData);
89
90/**
91 * Close VBoxGuest driver.
92 *
93 * @param pDriver Pointer to the driver structure.
94 *
95 * @return VBox error code
96 */
97void vbglDriverClose (VBGLDRIVER *pDriver);
98
99#endif
100
101#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