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 | #endif
|
---|
46 |
|
---|
47 | typedef struct _VBGLDRIVER
|
---|
48 | {
|
---|
49 | #ifdef __WIN__
|
---|
50 | PDEVICE_OBJECT pDeviceObject;
|
---|
51 | PFILE_OBJECT pFileObject;
|
---|
52 | #else /* !__WIN__ */
|
---|
53 | void *opaque;
|
---|
54 | #endif /* !__WIN__ */
|
---|
55 | } VBGLDRIVER;
|
---|
56 |
|
---|
57 |
|
---|
58 | #ifndef VBGL_VBOXGUEST
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * Open VBoxGuest driver.
|
---|
62 | *
|
---|
63 | * @param pDriver Pointer to the driver structure.
|
---|
64 | *
|
---|
65 | * @return VBox error code
|
---|
66 | */
|
---|
67 | int vbglDriverOpen (VBGLDRIVER *pDriver);
|
---|
68 |
|
---|
69 | /**
|
---|
70 | * Call VBoxGuest driver.
|
---|
71 | *
|
---|
72 | * @param pDriver Pointer to the driver structure.
|
---|
73 | * @param u32Function Function code.
|
---|
74 | * @param pvData Pointer to supplied in/out data buffer.
|
---|
75 | * @param cbData Size of data buffer.
|
---|
76 | *
|
---|
77 | * @return VBox error code
|
---|
78 | */
|
---|
79 | int vbglDriverIOCtl (VBGLDRIVER *pDriver, uint32_t u32Function, void *pvData, uint32_t cbData);
|
---|
80 |
|
---|
81 | /**
|
---|
82 | * Close VBoxGuest driver.
|
---|
83 | *
|
---|
84 | * @param pDriver Pointer to the driver structure.
|
---|
85 | *
|
---|
86 | * @return VBox error code
|
---|
87 | */
|
---|
88 | void vbglDriverClose (VBGLDRIVER *pDriver);
|
---|
89 |
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | #endif /* __SYSHLP__H */
|
---|