?? moufiltr.h
字號:
/*++
Copyright (c) 1997 Microsoft Corporation
Module Name:
moufiltr.h
Abstract:
This module contains the common private declarations for the mouse
packet filter
Environment:
kernel mode only
Notes:
Revision History:
--*/
#ifndef MOUFILTER_H
#define MOUFILTER_H
#include "ntddk.h"
#include "kbdmou.h"
#include <ntddmou.h>
#include <ntdd8042.h>
#define MOUFILTER_POOL_TAG (ULONG) 'tlFM'
#undef ExAllocatePool
#define ExAllocatePool(type, size) \
ExAllocatePoolWithTag (type, size, MOUFILTER_POOL_TAG)
#if DBG
#define TRAP() DbgBreakPoint()
#define DbgRaiseIrql(_x_,_y_) KeRaiseIrql(_x_,_y_)
#define DbgLowerIrql(_x_) KeLowerIrql(_x_)
#else // DBG
#define TRAP()
#define DbgRaiseIrql(_x_,_y_)
#define DbgLowerIrql(_x_)
#endif
typedef struct _DEVICE_EXTENSION
{
//
// A backpointer to the device object for which this is the extension
//
PDEVICE_OBJECT Self;
//
// "THE PDO" (ejected by the bus)
//
PDEVICE_OBJECT PDO;
//
// The top of the stack before this filter was added. AKA the location
// to which all IRPS should be directed.
//
PDEVICE_OBJECT TopOfStack;
//
// Number of creates sent down
//
LONG EnableCount;
//
// Previous hook routine and context
//
PVOID UpperContext;
PI8042_MOUSE_ISR UpperIsrHook;
//
// Write to the mouse in the context of MouFilter_IsrHook
//
IN PI8042_ISR_WRITE_PORT IsrWritePort;
//
// Context for IsrWritePort, QueueMousePacket
//
IN PVOID CallContext;
//
// Queue the current packet (ie the one passed into MouFilter_IsrHook)
// to be reported to the class driver
//
IN PI8042_QUEUE_PACKET QueueMousePacket;
//
// The real connect data that this driver reports to
//
CONNECT_DATA UpperConnectData;
//
// current power state of the device
//
DEVICE_POWER_STATE DeviceState;
//
// State of the stack and this device object
//
BOOLEAN Started;
BOOLEAN SurpriseRemoved;
BOOLEAN Removed;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
typedef struct _ZT_DEVICE_EXTENSION
{
//PDEVICE_OBJECT fdo;
//PDEVICE_OBJECT NextStackDevice;
//UNICODE_STRING ifSymLinkName;
ULONG ControlCode;
} ZT_DEVICE_EXTENSION,*PZT_DEVICE_EXTENSION;
#if DBG
#define DBGOUT(params_in_parentheses) \
{ \
DbgPrint("'yyx> "); \
DbgPrint params_in_parentheses; \
DbgPrint("\n"); \
}
#define TRAP1(msg) \
{ \
DBGOUT(("TRAP at file %s, line %d: '%s'.", __FILE__, __LINE__, msg)); \
DbgBreakPoint(); \
}
#else
#define DBGOUT(params_in_parentheses)
#define TRAP(msg)
#endif
//
// Prototypes
//
NTSTATUS
MouFilter_AddDevice(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT BusDeviceObject
);
NTSTATUS
MouFilter_CreateClose (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
NTSTATUS
MouFilter_DispatchPassThrough(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
NTSTATUS
MouFilter_InternIoCtl (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
NTSTATUS
MouFilter_IoCtl (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
NTSTATUS
MouFilter_PnP (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
NTSTATUS
MouFilter_Power (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
);
BOOLEAN
MouFilter_IsrHook (
PDEVICE_OBJECT DeviceObject,
PMOUSE_INPUT_DATA CurrentInput,
POUTPUT_PACKET CurrentOutput,
UCHAR StatusByte,
PUCHAR DataByte,
PBOOLEAN ContinueProcessing,
PMOUSE_STATE MouseState,
PMOUSE_RESET_SUBSTATE ResetSubState
);
VOID
MouFilter_ServiceCallback(
IN PDEVICE_OBJECT DeviceObject,
IN PMOUSE_INPUT_DATA InputDataStart,
IN PMOUSE_INPUT_DATA InputDataEnd,
IN OUT PULONG InputDataConsumed
);
VOID
MouFilter_Unload (
IN PDRIVER_OBJECT DriverObject
);
NTSTATUS Add_IoControlDevice(IN PDRIVER_OBJECT DriverObj,IN PUNICODE_STRING RegtryPath);
NTSTATUS IOControle_CreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
#endif // MOUFILTER_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -