2005-10-31 16:46:46 +00:00
|
|
|
#include <ntifs.h>
|
2005-10-31 00:14:45 +00:00
|
|
|
#include <kbdmou.h>
|
2007-03-18 00:27:02 +00:00
|
|
|
#include <ntddkbd.h>
|
2005-10-31 00:14:45 +00:00
|
|
|
#include <stdio.h>
|
2008-11-30 19:28:11 +00:00
|
|
|
#include <pseh/pseh2.h>
|
2008-02-26 16:00:00 +00:00
|
|
|
|
2007-06-04 09:25:04 +00:00
|
|
|
#include <debug.h>
|
2007-03-18 00:27:02 +00:00
|
|
|
|
2006-01-07 06:31:55 +00:00
|
|
|
#define MAX_PATH 260
|
2006-02-24 13:38:14 +00:00
|
|
|
|
2006-07-17 22:13:40 +00:00
|
|
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
|
|
|
2009-08-24 17:12:25 +00:00
|
|
|
#define CLASS_TAG 'CuoM'
|
2008-07-25 20:24:46 +00:00
|
|
|
#define DPFLTR_CLASS_NAME_ID DPFLTR_MOUCLASS_ID
|
2007-06-04 09:25:04 +00:00
|
|
|
|
2005-10-31 00:14:45 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
dsStopped,
|
|
|
|
dsStarted,
|
|
|
|
dsPaused,
|
|
|
|
dsRemoved,
|
|
|
|
dsSurpriseRemoved
|
2005-11-05 08:37:01 +00:00
|
|
|
} PORT_DEVICE_STATE;
|
2005-10-31 00:14:45 +00:00
|
|
|
|
2005-11-05 08:37:01 +00:00
|
|
|
typedef struct _CLASS_DRIVER_EXTENSION
|
2005-10-31 00:14:45 +00:00
|
|
|
{
|
2005-11-09 11:16:43 +00:00
|
|
|
UNICODE_STRING RegistryPath;
|
|
|
|
|
2005-10-31 00:14:45 +00:00
|
|
|
/* Registry settings */
|
|
|
|
ULONG ConnectMultiplePorts;
|
2005-11-05 08:37:01 +00:00
|
|
|
ULONG DataQueueSize;
|
|
|
|
UNICODE_STRING DeviceBaseName;
|
2005-10-31 00:14:45 +00:00
|
|
|
|
2005-11-05 08:37:01 +00:00
|
|
|
PDEVICE_OBJECT MainClassDeviceObject;
|
|
|
|
} CLASS_DRIVER_EXTENSION, *PCLASS_DRIVER_EXTENSION;
|
2005-10-31 00:14:45 +00:00
|
|
|
|
|
|
|
typedef struct _COMMON_DEVICE_EXTENSION
|
|
|
|
{
|
|
|
|
BOOLEAN IsClassDO;
|
|
|
|
} COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
|
|
|
|
|
2005-11-05 08:37:01 +00:00
|
|
|
typedef struct _PORT_DEVICE_EXTENSION
|
2005-10-31 00:14:45 +00:00
|
|
|
{
|
|
|
|
COMMON_DEVICE_EXTENSION Common;
|
|
|
|
|
2006-02-24 13:38:14 +00:00
|
|
|
LIST_ENTRY ListEntry;
|
|
|
|
PDEVICE_OBJECT DeviceObject;
|
2005-11-05 08:37:01 +00:00
|
|
|
PORT_DEVICE_STATE PnpState;
|
|
|
|
PDEVICE_OBJECT LowerDevice;
|
2006-04-16 07:17:34 +00:00
|
|
|
PDEVICE_OBJECT ClassDO;
|
2012-01-21 02:59:46 +00:00
|
|
|
HANDLE FileHandle;
|
2005-11-05 08:37:01 +00:00
|
|
|
UNICODE_STRING InterfaceName;
|
|
|
|
} PORT_DEVICE_EXTENSION, *PPORT_DEVICE_EXTENSION;
|
|
|
|
|
|
|
|
typedef struct _CLASS_DEVICE_EXTENSION
|
2005-10-31 00:14:45 +00:00
|
|
|
{
|
|
|
|
COMMON_DEVICE_EXTENSION Common;
|
|
|
|
|
2005-11-05 08:37:01 +00:00
|
|
|
PCLASS_DRIVER_EXTENSION DriverExtension;
|
2005-10-31 00:14:45 +00:00
|
|
|
|
2006-02-24 13:38:14 +00:00
|
|
|
LIST_ENTRY ListHead;
|
|
|
|
KSPIN_LOCK ListSpinLock;
|
2005-10-31 00:14:45 +00:00
|
|
|
KSPIN_LOCK SpinLock;
|
2007-11-02 12:36:50 +00:00
|
|
|
PIRP PendingIrp;
|
2007-03-18 00:27:02 +00:00
|
|
|
SIZE_T InputCount;
|
2005-10-31 00:14:45 +00:00
|
|
|
PMOUSE_INPUT_DATA PortData;
|
2006-07-17 22:13:40 +00:00
|
|
|
LPCWSTR DeviceName;
|
2005-11-05 08:37:01 +00:00
|
|
|
} CLASS_DEVICE_EXTENSION, *PCLASS_DEVICE_EXTENSION;
|
2005-10-31 00:14:45 +00:00
|
|
|
|
|
|
|
/* misc.c */
|
|
|
|
|
2006-02-24 13:38:14 +00:00
|
|
|
NTSTATUS
|
|
|
|
ForwardIrpAndWait(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2007-06-04 09:25:04 +00:00
|
|
|
DRIVER_DISPATCH ForwardIrpAndForget;
|
2007-03-18 00:27:02 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
DuplicateUnicodeString(
|
|
|
|
IN ULONG Flags,
|
|
|
|
IN PCUNICODE_STRING SourceString,
|
|
|
|
OUT PUNICODE_STRING DestinationString);
|