USBFilter.h revision 59190ecd61435d19ba3515b876272aee7bd12298
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
PURPOSE.
Module Name:
Abstract:
Contains structure definitions and function prototypes for filter driver.
Environment:
Kernel mode
Revision History:
Eliyas Yakub Oct 29 1998
--*/
#include <ntddk.h>
#include <wdmsec.h> // for IoCreateDeviceSecure
#include <initguid.h>
#define IOCTL_INTERFACE 1
#if !defined(_FILTER_H_)
#define _FILTER_H_
#define DRIVERNAME "VBoxUSBFlt.sys: "
#ifdef DEBUG
#define TRAP() DbgBreakPoint()
#else
#define DebugPrint(_x_)
#define TRAP()
#endif
#ifndef STATUS_CONTINUE_COMPLETION //required to build driver in Win2K and XP build environment
//
// This value should be returned from completion routines to continue
// completing the IRP upwards. Otherwise, STATUS_MORE_PROCESSING_REQUIRED
// should be returned.
//
#endif
#define POOL_TAG 'liFT'
//
// These are the states Filter transition to upon
// receiving a specific PnP Irp. Refer to the PnP Device States
// diagram in DDK documentation for better understanding.
//
typedef enum _DEVICE_PNP_STATE {
NotStarted = 0, // Not started yet
Started, // Device has received the START_DEVICE IRP
StopPending, // Device has received the QUERY_STOP IRP
Stopped, // Device has received the STOP_DEVICE IRP
RemovePending, // Device has received the QUERY_REMOVE IRP
SurpriseRemovePending, // Device has received the SURPRISE_REMOVE IRP
Deleted // Device has received the REMOVE_DEVICE IRP
#define INITIALIZE_PNP_STATE(_Data_) \
#define RESTORE_PREVIOUS_PNP_STATE(_Data_) \
typedef struct _DEVICE_EXTENSION
{
//
// A back pointer to the device object.
//
//
// The top of the stack before this filter was added.
//
//
// current PnP state of the device
//
//
// Remembers the previous pnp state
//
//
// Removelock to track IRPs so that device can be removed and
// the driver can be unloaded safely.
//
#ifdef __cplusplus
extern "C" {
#endif
#ifdef DEBUG
);
#endif
);
);
);
);
);
);
);
);
#ifdef IOCTL_INTERFACE
typedef struct _CONTROL_DEVICE_EXTENSION {
);
);
);
#endif
#ifdef __cplusplus
}
#endif
#endif