VBoxGuest-win.h revision 9fdaf7db004cb3c2826776383b003c7e6693bd17
/** @file
*
* VBoxGuest - Windows specifics.
*
* Copyright (C) 2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ___VBoxGuest_win_h
#define ___VBoxGuest_win_h
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include <ntddk.h>
#include <iprt/spinlock.h>
#include <VBox/VBoxGuest.h>
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
/** Pointer to the VBoxGuest per session data. */
typedef struct VBOXGUESTSESSION *PVBOXGUESTSESSION;
/** Possible device states for our state machine. */
enum DEVSTATE
{
};
typedef struct VBOXGUESTWINBASEADDRESS
{
/** Original device physical address. */
/** Length of I/O or memory range. */
/** Flag: Unmapped range is I/O or memory range. */
/** Mapped I/O or memory range. */
/** Flag: mapped range is I/O or memory range. */
/** Flag: resource is mapped (i.e. MmMapIoSpace called). */
/** Windows-specific device extension bits. */
typedef struct VBOXGUESTDEVEXTWIN
{
/** Our functional driver object. */
/** Top of the stack. */
/** Currently active Irp. */
/** Interrupt object pointer. */
/** Bus number where the device is located. */
/** Slot number where the device is located. */
/** Device interrupt level. */
/** Device interrupt vector. */
/** Affinity mask. */
/** LevelSensitive or Latched. */
/** PCI base address information. */
/** Physical address and length of VMMDev memory. */
/** Device state. */
/** Last system power action set (see VBoxGuestPower). */
/** Preallocated generic request for shutdown. */
/** Preallocated VMMDevEvents for IRQ handler. */
/** Pre-allocated kernel session data. This is needed
* for handling kernel IOCtls. */
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/** CM_RESOURCE_MEMORY_* flags which were used on XP or earlier. */
#define VBOX_CM_PRE_VISTA_MASK (0x3f)
/** Windows version identifier. */
typedef enum
{
WINNT4 = 1,
WIN2K = 2,
WINXP = 3,
WIN2K3 = 4,
WINVISTA = 5,
WIN7 = 6
} winVersion_t;
extern winVersion_t winVersion;
/*******************************************************************************
* Declared prototypes for helper routines used in both (PnP and legacy) *
* driver versions. *
*******************************************************************************/
#include "VBoxGuestInternal.h"
#ifdef TARGET_NT4
NTSTATUS vboxguestwinnt4CreateDevice(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STRING pRegPath);
NTSTATUS vboxguestwinInit(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj, PUNICODE_STRING pRegPath);
#else
#endif
NTSTATUS vboxguestwinMapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength,
#ifdef TARGET_NT4
/*
* XP DDK #defines ExFreePool to ExFreePoolWithTag. The latter does not exist
* on NT4, so... The same for ExAllocatePool.
*/
#endif
#endif /* ___VBoxGuest_win_h */