SysHlp.h revision c97989161fbe75bc14cea477a5443bbf474dd3ad
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico/** @file
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico *
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * VBoxGuestLib - A support library for VirtualBox guest additions:
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * System dependent helpers internal header
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico */
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico/*
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * Copyright (C) 2006-2007 innotek GmbH
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico *
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * This file is part of VirtualBox Open Source Edition (OSE), as
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * available from http://www.virtualbox.org. This file is free software;
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * you can redistribute it and/or modify it under the terms of the GNU
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * General Public License as published by the Free Software Foundation,
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * distribution. VirtualBox OSE is distributed in the hope that it will
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * be useful, but WITHOUT ANY WARRANTY of any kind.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico *
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * If you received this file as part of a commercial VirtualBox
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * distribution, then only the terms of your commercial VirtualBox
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * license agreement apply instead of the previous paragraph.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico */
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#ifndef __SYSHLP__H
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#define __SYSHLP__H
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#ifdef __WIN__
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# include <iprt/asm.h>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico__BEGIN_DECLS
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# include <ntddk.h>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico__END_DECLS
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# undef _InterlockedExchange
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# undef _InterlockedExchangeAdd
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# undef _InterlockedCompareExchange
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# undef _InterlockedAddLargeStatistic
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# else
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico__BEGIN_DECLS
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# include <ntddk.h>
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico__END_DECLS
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico# endif
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico/* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist on NT4, so... */
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#undef ExFreePool
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#endif
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicotypedef struct _VBGLDRIVER
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico{
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#ifdef __WIN__
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico PDEVICE_OBJECT pDeviceObject;
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico PFILE_OBJECT pFileObject;
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#else /* !__WIN__ */
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico void *opaque;
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#endif /* !__WIN__ */
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico} VBGLDRIVER;
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#ifndef VBGL_VBOXGUEST
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico/**
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * Open VBoxGuest driver.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico *
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * @param pDriver Pointer to the driver structure.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico *
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * @return VBox error code
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico */
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoint vbglDriverOpen (VBGLDRIVER *pDriver);
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico/**
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * Call VBoxGuest driver.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico *
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * @param pDriver Pointer to the driver structure.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * @param u32Function Function code.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * @param pvData Pointer to supplied in/out data buffer.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * @param cbData Size of data buffer.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico *
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * @return VBox error code
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico */
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicoint vbglDriverIOCtl (VBGLDRIVER *pDriver, uint32_t u32Function, void *pvData, uint32_t cbData);
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico/**
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * Close VBoxGuest driver.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico *
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * @param pDriver Pointer to the driver structure.
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico *
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico * @return VBox error code
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico */
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNicovoid vbglDriverClose (VBGLDRIVER *pDriver);
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#endif
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico#endif /* __SYSHLP__H */
55409b97452fc42cc6fbb542da79ab133ed705b3JazzyNico