📄 vkeyfdo.h
字号:
//////////////////////////////////////////////////////////////////////////////
// Copyright 2004 by leiwhere
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Include WDM standard header with C linkage
extern "C"
{
#include "wdm.h"
#include "kbdmou.h"
#include <ntddkbd.h>
}
typedef VOID (*MouseClassServiceCallback)(
IN PDEVICE_OBJECT DeviceObject,
IN PMOUSE_INPUT_DATA InputDataStart,
IN PMOUSE_INPUT_DATA InputDataEnd,
IN OUT PULONG InputDataConsumed);
typedef VOID (*KeyboardClassServiceCallback)(
IN PDEVICE_OBJECT DeviceObject,
IN PKEYBOARD_INPUT_DATA InputDataStart,
IN PKEYBOARD_INPUT_DATA InputDataEnd,
IN OUT PULONG InputDataConsumed);
/////////////////////////////////////////////////////////////////////////////
// Our device extension
/*
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
{
PDEVICE_OBJECT fdo;
PDEVICE_OBJECT NextStackDevice;
CONNECT_DATA UpperConnectData;
PDEVICE_OBJECT Self;
}DEVICE_EXTENSION, *PDEVICE_EXTENSION;
extern PDEVICE_OBJECT FunctionDevice;
class MYMOUSE_INPUT_DATA : public MOUSE_INPUT_DATA
{
public:
MYMOUSE_INPUT_DATA()
{
RtlZeroMemory(this,sizeof(MOUSE_INPUT_DATA));
}
};
class MYKEYBOARD_INPUT_DATA : public KEYBOARD_INPUT_DATA
{
public:
MYKEYBOARD_INPUT_DATA()
{
RtlZeroMemory(this,sizeof(MYKEYBOARD_INPUT_DATA));
}
};
/////////////////////////////////////////////////////////////////////////////
// Forward declarations of global functions
VOID Unload(IN PDRIVER_OBJECT DriverObject);
NTSTATUS Power( IN PDEVICE_OBJECT fdo,IN PIRP Irp);
NTSTATUS Pnp(IN PDEVICE_OBJECT fdo,IN PIRP Irp);
NTSTATUS AddDevice(IN PDRIVER_OBJECT DriverObject,IN PDEVICE_OBJECT pdo);
NTSTATUS Create(IN PDEVICE_OBJECT fdo,IN PIRP Irp);
NTSTATUS Close(IN PDEVICE_OBJECT fdo,IN PIRP Irp);
NTSTATUS DeviceControl( IN PDEVICE_OBJECT fdo,IN PIRP Irp);
NTSTATUS InternalControl(IN PDEVICE_OBJECT fdo,IN PIRP Irp);
NTSTATUS SystemControl( IN PDEVICE_OBJECT fdo,IN PIRP Irp);
NTSTATUS CompleteIrp( PIRP Irp, NTSTATUS status, ULONG info);
/////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -