mirror of
https://github.com/reactos/reactos.git
synced 2025-05-30 14:39:46 +00:00
Fix little bug in mouse detection
Create unnamed FDOs Read only registry parameters which make sense Start to read mouse only when receiving IRP_MN_START_DEVICE Cleanup of code svn path=/trunk/; revision=21714
This commit is contained in:
parent
d8c61be337
commit
5028ed87a4
8 changed files with 135 additions and 222 deletions
|
@ -1,10 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* PROJECT: ReactOS Serial mouse driver
|
||||||
* PROJECT: ReactOS Serial mouse driver
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: drivers/input/sermouse/fdo.c
|
* FILE: drivers/input/sermouse/createclose.c
|
||||||
* PURPOSE: IRP_MJ_CREATE and IRP_MJ_CLOSE operations
|
* PURPOSE: IRP_MJ_CREATE and IRP_MJ_CLOSE operations
|
||||||
*
|
* PROGRAMMERS: Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -12,11 +11,6 @@
|
||||||
|
|
||||||
#include "sermouse.h"
|
#include "sermouse.h"
|
||||||
|
|
||||||
NTSTATUS NTAPI
|
|
||||||
SermouseStartDevice(
|
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
|
||||||
IN PIRP Irp); /* FIXME: remove the declaration */
|
|
||||||
|
|
||||||
NTSTATUS NTAPI
|
NTSTATUS NTAPI
|
||||||
SermouseCreate(
|
SermouseCreate(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* PROJECT: ReactOS Serial mouse driver
|
||||||
* PROJECT: ReactOS Serial mouse driver
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: drivers/input/sermouse/detect.c
|
* FILE: drivers/input/sermouse/detect.c
|
||||||
* PURPOSE: Detect serial mouse type
|
* PURPOSE: Detect serial mouse type
|
||||||
*
|
* PROGRAMMERS: Copyright Jason Filby (jasonfilby@yahoo.com)
|
||||||
* PROGRAMMERS: Jason Filby (jasonfilby@yahoo.com)
|
Copyright Filip Navara (xnavara@volny.cz)
|
||||||
* Filip Navara (xnavara@volny.cz)
|
Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
|
||||||
* Hervé Poussineau (hpoussin@reactos.org)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -17,7 +16,7 @@
|
||||||
/* Most of this file is ripped from reactos/drivers/bus/serenum/detect.c */
|
/* Most of this file is ripped from reactos/drivers/bus/serenum/detect.c */
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
SermouseDeviceIoControl(
|
DeviceIoControl(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN ULONG CtlCode,
|
IN ULONG CtlCode,
|
||||||
IN PVOID InputBuffer OPTIONAL,
|
IN PVOID InputBuffer OPTIONAL,
|
||||||
|
@ -65,7 +64,7 @@ SermouseDeviceIoControl(
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
SermouseSendIrp(
|
SendIrp(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN ULONG MajorFunction)
|
IN ULONG MajorFunction)
|
||||||
{
|
{
|
||||||
|
@ -140,7 +139,8 @@ ReadBytes(
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
SermouseWait(ULONG milliseconds)
|
Wait(
|
||||||
|
IN ULONG milliseconds)
|
||||||
{
|
{
|
||||||
KTIMER Timer;
|
KTIMER Timer;
|
||||||
LARGE_INTEGER DueTime;
|
LARGE_INTEGER DueTime;
|
||||||
|
@ -165,16 +165,18 @@ SermouseDetectLegacyDevice(
|
||||||
SERMOUSE_MOUSE_TYPE MouseType = mtNone;
|
SERMOUSE_MOUSE_TYPE MouseType = mtNone;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
DPRINT("SermouseDetectLegacyDevice(LowerDevice %p)\n", LowerDevice);
|
||||||
|
|
||||||
RtlZeroMemory(Buffer, sizeof(Buffer));
|
RtlZeroMemory(Buffer, sizeof(Buffer));
|
||||||
|
|
||||||
/* Open port */
|
/* Open port */
|
||||||
Status = SermouseSendIrp(LowerDevice, IRP_MJ_CREATE);
|
Status = SendIrp(LowerDevice, IRP_MJ_CREATE);
|
||||||
if (!NT_SUCCESS(Status)) return mtNone;
|
if (!NT_SUCCESS(Status)) return mtNone;
|
||||||
|
|
||||||
/* Reset UART */
|
/* Reset UART */
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
Mcr = 0; /* MCR: DTR/RTS/OUT2 off */
|
Mcr = 0; /* MCR: DTR/RTS/OUT2 off */
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL,
|
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL,
|
||||||
&Mcr, sizeof(Mcr), NULL, NULL);
|
&Mcr, sizeof(Mcr), NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||||
|
|
||||||
|
@ -182,57 +184,47 @@ SermouseDetectLegacyDevice(
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
/* DLAB off */
|
/* DLAB off */
|
||||||
Fcr = 0;
|
Fcr = 0;
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_FIFO_CONTROL,
|
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_FIFO_CONTROL,
|
||||||
&Fcr, sizeof(Fcr), NULL, NULL);
|
&Fcr, sizeof(Fcr), NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||||
/* Set serial port speed */
|
/* Set serial port speed */
|
||||||
BaudRate = 1200;
|
BaudRate = 1200;
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_BAUD_RATE,
|
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_BAUD_RATE,
|
||||||
&BaudRate, sizeof(BaudRate), NULL, NULL);
|
&BaudRate, sizeof(BaudRate), NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||||
/* Set LCR */
|
/* Set LCR */
|
||||||
LCR.WordLength = 7;
|
LCR.WordLength = 7;
|
||||||
LCR.Parity = NO_PARITY;
|
LCR.Parity = NO_PARITY;
|
||||||
LCR.StopBits = STOP_BITS_2;
|
LCR.StopBits = STOP_BITS_2;
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_LINE_CONTROL,
|
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_LINE_CONTROL,
|
||||||
&LCR, sizeof(LCR), NULL, NULL);
|
&LCR, sizeof(LCR), NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||||
|
|
||||||
/* Disable DTR/RTS */
|
|
||||||
CHECKPOINT;
|
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_DTR,
|
|
||||||
NULL, 0, NULL, NULL);
|
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_RTS,
|
|
||||||
NULL, 0, NULL, NULL);
|
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
|
||||||
|
|
||||||
/* Flush receive buffer */
|
/* Flush receive buffer */
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
Command = SERIAL_PURGE_RXCLEAR;
|
Command = SERIAL_PURGE_RXCLEAR;
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL,
|
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL,
|
||||||
&Command, sizeof(Command), NULL, NULL);
|
&Command, sizeof(Command), NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||||
/* Wait 100 ms */
|
/* Wait 100 ms */
|
||||||
SermouseWait(100);
|
Wait(100);
|
||||||
|
|
||||||
/* Enable DTR/RTS */
|
/* Enable DTR/RTS */
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
|
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
|
||||||
NULL, 0, NULL, NULL);
|
NULL, 0, NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||||
SermouseWait(200);
|
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_RTS,
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_RTS,
|
|
||||||
NULL, 0, NULL, NULL);
|
NULL, 0, NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||||
|
|
||||||
/* Set timeout to 500 microseconds */
|
/* Set timeout to 500 microseconds */
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
Timeouts.ReadIntervalTimeout = 0;
|
Timeouts.ReadIntervalTimeout = 100;
|
||||||
Timeouts.ReadTotalTimeoutMultiplier = 0;
|
Timeouts.ReadTotalTimeoutMultiplier = 0;
|
||||||
Timeouts.ReadTotalTimeoutConstant = 500;
|
Timeouts.ReadTotalTimeoutConstant = 500;
|
||||||
Timeouts.WriteTotalTimeoutMultiplier = Timeouts.WriteTotalTimeoutConstant = 0;
|
Timeouts.WriteTotalTimeoutMultiplier = Timeouts.WriteTotalTimeoutConstant = 0;
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_TIMEOUTS,
|
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_TIMEOUTS,
|
||||||
&Timeouts, sizeof(Timeouts), NULL, NULL);
|
&Timeouts, sizeof(Timeouts), NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||||
|
|
||||||
|
@ -276,7 +268,7 @@ SermouseDetectLegacyDevice(
|
||||||
|
|
||||||
ByeBye:
|
ByeBye:
|
||||||
/* Close port */
|
/* Close port */
|
||||||
SermouseSendIrp(LowerDevice, IRP_MJ_CLOSE);
|
SendIrp(LowerDevice, IRP_MJ_CLOSE);
|
||||||
SermouseSendIrp(LowerDevice, IRP_MJ_CLEANUP);
|
SendIrp(LowerDevice, IRP_MJ_CLEANUP);
|
||||||
return MouseType;
|
return MouseType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* PROJECT: ReactOS Serial mouse driver
|
||||||
* PROJECT: ReactOS Serial mouse driver
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: drivers/input/sermouse/fdo.c
|
* FILE: drivers/input/sermouse/fdo.c
|
||||||
* PURPOSE: IRP_MJ_PNP operations for FDOs
|
* PURPOSE: IRP_MJ_PNP operations for FDOs
|
||||||
*
|
* PROGRAMMERS: Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -18,72 +17,27 @@ SermouseAddDevice(
|
||||||
IN PDEVICE_OBJECT Pdo)
|
IN PDEVICE_OBJECT Pdo)
|
||||||
{
|
{
|
||||||
PSERMOUSE_DRIVER_EXTENSION DriverExtension;
|
PSERMOUSE_DRIVER_EXTENSION DriverExtension;
|
||||||
ULONG DeviceId = 0;
|
|
||||||
ULONG PrefixLength;
|
|
||||||
UNICODE_STRING DeviceNameU;
|
|
||||||
PWSTR DeviceIdW = NULL; /* Pointer into DeviceNameU.Buffer */
|
|
||||||
PDEVICE_OBJECT Fdo;
|
PDEVICE_OBJECT Fdo;
|
||||||
PSERMOUSE_DEVICE_EXTENSION DeviceExtension;
|
PSERMOUSE_DEVICE_EXTENSION DeviceExtension = NULL;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("SermouseAddDevice called. Pdo = 0x%p\n", Pdo);
|
DPRINT("SermouseAddDevice called. Pdo = 0x%p\n", Pdo);
|
||||||
|
|
||||||
/* Create new device object */
|
/* Create new device object */
|
||||||
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
|
DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
|
||||||
DeviceNameU.Length = 0;
|
Status = IoCreateDevice(
|
||||||
DeviceNameU.MaximumLength =
|
DriverObject,
|
||||||
wcslen(L"\\Device\\") * sizeof(WCHAR) /* "\Device\" */
|
sizeof(SERMOUSE_DEVICE_EXTENSION),
|
||||||
+ DriverExtension->PointerDeviceBaseName.Length /* "PointerPort" */
|
NULL,
|
||||||
+ 4 * sizeof(WCHAR) /* Id between 0 and 9999 */
|
FILE_DEVICE_SERIAL_MOUSE_PORT,
|
||||||
+ sizeof(UNICODE_NULL); /* Final NULL char */
|
FILE_DEVICE_SECURE_OPEN,
|
||||||
DeviceNameU.Buffer = ExAllocatePool(PagedPool, DeviceNameU.MaximumLength);
|
TRUE,
|
||||||
if (!DeviceNameU.Buffer)
|
&Fdo);
|
||||||
{
|
|
||||||
DPRINT("ExAllocatePool() failed\n");
|
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
|
||||||
}
|
|
||||||
Status = RtlAppendUnicodeToString(&DeviceNameU, L"\\Device\\");
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("RtlAppendUnicodeToString() failed with status 0x%08lx\n", Status);
|
DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
Status = RtlAppendUnicodeStringToString(&DeviceNameU, &DriverExtension->PointerDeviceBaseName);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DPRINT("RtlAppendUnicodeStringToString() failed with status 0x%08lx\n", Status);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
PrefixLength = DeviceNameU.MaximumLength - 4 * sizeof(WCHAR) - sizeof(UNICODE_NULL);
|
|
||||||
DeviceIdW = &DeviceNameU.Buffer[PrefixLength / sizeof(WCHAR)];
|
|
||||||
while (DeviceId < 9999)
|
|
||||||
{
|
|
||||||
DeviceNameU.Length = PrefixLength + swprintf(DeviceIdW, L"%lu", DeviceId) * sizeof(WCHAR);
|
|
||||||
Status = IoCreateDevice(
|
|
||||||
DriverObject,
|
|
||||||
sizeof(SERMOUSE_DEVICE_EXTENSION),
|
|
||||||
&DeviceNameU,
|
|
||||||
FILE_DEVICE_SERIAL_MOUSE_PORT,
|
|
||||||
FILE_DEVICE_SECURE_OPEN,
|
|
||||||
TRUE,
|
|
||||||
&Fdo);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
goto cleanup;
|
|
||||||
else if (Status != STATUS_OBJECT_NAME_COLLISION)
|
|
||||||
{
|
|
||||||
DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
DeviceId++;
|
|
||||||
}
|
|
||||||
DPRINT("Too much devices starting with '\\Device\\%wZ'\n", &DriverExtension->PointerDeviceBaseName);
|
|
||||||
Status = STATUS_UNSUCCESSFUL;
|
|
||||||
cleanup:
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
ExFreePool(DeviceNameU.Buffer);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
DeviceExtension = (PSERMOUSE_DEVICE_EXTENSION)Fdo->DeviceExtension;
|
DeviceExtension = (PSERMOUSE_DEVICE_EXTENSION)Fdo->DeviceExtension;
|
||||||
RtlZeroMemory(DeviceExtension, sizeof(SERMOUSE_DEVICE_EXTENSION));
|
RtlZeroMemory(DeviceExtension, sizeof(SERMOUSE_DEVICE_EXTENSION));
|
||||||
|
@ -91,41 +45,22 @@ cleanup:
|
||||||
DeviceExtension->PnpState = dsStopped;
|
DeviceExtension->PnpState = dsStopped;
|
||||||
DeviceExtension->DriverExtension = DriverExtension;
|
DeviceExtension->DriverExtension = DriverExtension;
|
||||||
KeInitializeEvent(&DeviceExtension->StopWorkerThreadEvent, NotificationEvent, FALSE);
|
KeInitializeEvent(&DeviceExtension->StopWorkerThreadEvent, NotificationEvent, FALSE);
|
||||||
DeviceExtension->MouseInputData[0] = ExAllocatePool(NonPagedPool, DeviceExtension->DriverExtension->MouseDataQueueSize * sizeof(MOUSE_INPUT_DATA));
|
|
||||||
if (!DeviceExtension->MouseInputData[0])
|
|
||||||
{
|
|
||||||
DPRINT("ExAllocatePool() failed\n");
|
|
||||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
|
||||||
goto cleanupFDO;
|
|
||||||
}
|
|
||||||
DeviceExtension->MouseInputData[1] = ExAllocatePool(NonPagedPool, DeviceExtension->DriverExtension->MouseDataQueueSize * sizeof(MOUSE_INPUT_DATA));
|
|
||||||
if (!DeviceExtension->MouseInputData[1])
|
|
||||||
{
|
|
||||||
DPRINT("ExAllocatePool() failed\n");
|
|
||||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
|
||||||
goto cleanupFDO;
|
|
||||||
}
|
|
||||||
Fdo->Flags |= DO_POWER_PAGABLE;
|
Fdo->Flags |= DO_POWER_PAGABLE;
|
||||||
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
|
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
|
DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
|
||||||
goto cleanupFDO;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
Fdo->Flags |= DO_BUFFERED_IO;
|
|
||||||
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
|
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
|
||||||
|
|
||||||
ExFreePool(DeviceNameU.Buffer);
|
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
cleanupFDO:
|
cleanup:
|
||||||
if (DeviceExtension)
|
if (DeviceExtension)
|
||||||
{
|
{
|
||||||
if (DeviceExtension->LowerDevice)
|
if (DeviceExtension->LowerDevice)
|
||||||
IoDetachDevice(DeviceExtension->LowerDevice);
|
IoDetachDevice(DeviceExtension->LowerDevice);
|
||||||
ExFreePool(DeviceExtension->MouseInputData[0]);
|
|
||||||
ExFreePool(DeviceExtension->MouseInputData[1]);
|
|
||||||
}
|
}
|
||||||
if (Fdo)
|
if (Fdo)
|
||||||
{
|
{
|
||||||
|
@ -141,6 +76,7 @@ SermouseStartDevice(
|
||||||
{
|
{
|
||||||
PSERMOUSE_DEVICE_EXTENSION DeviceExtension;
|
PSERMOUSE_DEVICE_EXTENSION DeviceExtension;
|
||||||
SERMOUSE_MOUSE_TYPE MouseType;
|
SERMOUSE_MOUSE_TYPE MouseType;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
DeviceExtension = (PSERMOUSE_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PSERMOUSE_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
|
@ -169,7 +105,8 @@ SermouseStartDevice(
|
||||||
DeviceExtension->AttributesInformation.NumberOfButtons = 3;
|
DeviceExtension->AttributesInformation.NumberOfButtons = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CHECKPOINT;
|
DPRINT("Unknown mouse type 0x%lx\n", MouseType);
|
||||||
|
ASSERT(FALSE);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,12 +114,22 @@ SermouseStartDevice(
|
||||||
/* Override the number of buttons */
|
/* Override the number of buttons */
|
||||||
DeviceExtension->AttributesInformation.NumberOfButtons = DeviceExtension->DriverExtension->NumberOfButtons;
|
DeviceExtension->AttributesInformation.NumberOfButtons = DeviceExtension->DriverExtension->NumberOfButtons;
|
||||||
|
|
||||||
DeviceExtension->AttributesInformation.SampleRate = DeviceExtension->DriverExtension->SampleRate / 8;
|
DeviceExtension->AttributesInformation.SampleRate = 1200 / 8;
|
||||||
DeviceExtension->AttributesInformation.InputDataQueueLength = DeviceExtension->DriverExtension->MouseDataQueueSize;
|
DeviceExtension->AttributesInformation.InputDataQueueLength = 1;
|
||||||
DeviceExtension->MouseType = MouseType;
|
DeviceExtension->MouseType = MouseType;
|
||||||
DeviceExtension->PnpState = dsStarted;
|
DeviceExtension->PnpState = dsStarted;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
/* Start read loop */
|
||||||
|
Status = PsCreateSystemThread(
|
||||||
|
&DeviceExtension->WorkerThreadHandle,
|
||||||
|
(ACCESS_MASK)0L,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
SermouseDeviceWorker,
|
||||||
|
DeviceObject);
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS NTAPI
|
NTSTATUS NTAPI
|
||||||
|
@ -197,6 +144,7 @@ SermousePnp(
|
||||||
|
|
||||||
Stack = IoGetCurrentIrpStackLocation(Irp);
|
Stack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
MinorFunction = Stack->MinorFunction;
|
MinorFunction = Stack->MinorFunction;
|
||||||
|
Information = Irp->IoStatus.Information;
|
||||||
|
|
||||||
switch (MinorFunction)
|
switch (MinorFunction)
|
||||||
{
|
{
|
||||||
|
@ -207,7 +155,6 @@ SermousePnp(
|
||||||
IRP_MN_STOP_DEVICE 0x4
|
IRP_MN_STOP_DEVICE 0x4
|
||||||
IRP_MN_QUERY_STOP_DEVICE 0x5
|
IRP_MN_QUERY_STOP_DEVICE 0x5
|
||||||
IRP_MN_CANCEL_STOP_DEVICE 0x6
|
IRP_MN_CANCEL_STOP_DEVICE 0x6
|
||||||
IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations (optional) 0x7
|
|
||||||
IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations (optional) 0x7
|
IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations (optional) 0x7
|
||||||
IRP_MN_QUERY_INTERFACE (optional) 0x8
|
IRP_MN_QUERY_INTERFACE (optional) 0x8
|
||||||
IRP_MN_QUERY_CAPABILITIES (optional) 0x9
|
IRP_MN_QUERY_CAPABILITIES (optional) 0x9
|
||||||
|
@ -225,6 +172,35 @@ SermousePnp(
|
||||||
Status = SermouseStartDevice(DeviceObject, Irp);
|
Status = SermouseStartDevice(DeviceObject, Irp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case IRP_MN_QUERY_DEVICE_RELATIONS: /* 0x7 */
|
||||||
|
{
|
||||||
|
switch (Stack->Parameters.QueryDeviceRelations.Type)
|
||||||
|
{
|
||||||
|
case BusRelations:
|
||||||
|
{
|
||||||
|
PDEVICE_RELATIONS DeviceRelations = NULL;
|
||||||
|
DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n");
|
||||||
|
|
||||||
|
DeviceRelations = ExAllocatePool(PagedPool, FIELD_OFFSET(DEVICE_RELATIONS, Objects));
|
||||||
|
if (!DeviceRelations)
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DeviceRelations->Count = 0;
|
||||||
|
Status = STATUS_SUCCESS;
|
||||||
|
Information = (ULONG_PTR)DeviceRelations;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
|
||||||
|
Stack->Parameters.QueryDeviceRelations.Type);
|
||||||
|
return ForwardIrpAndForget(DeviceObject, Irp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
DPRINT1("IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
|
DPRINT1("IRP_MJ_PNP / unknown minor function 0x%lx\n", MinorFunction);
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* PROJECT: ReactOS Serial mouse driver
|
||||||
* PROJECT: ReactOS Serial mouse driver
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: drivers/input/sermouse/internaldevctl.c
|
* FILE: drivers/input/sermouse/fdo.c
|
||||||
* PURPOSE: IRP_MJ_INTERNAL_DEVICE_CONTROL operations
|
* PURPOSE: IRP_MJ_INTERNAL_DEVICE_CONTROL operations
|
||||||
*
|
* PROGRAMMERS: Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -31,16 +30,7 @@ SermouseInternalDeviceControl(
|
||||||
DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_MOUSE_CONNECT\n");
|
DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_MOUSE_CONNECT\n");
|
||||||
DeviceExtension->ConnectData =
|
DeviceExtension->ConnectData =
|
||||||
*((PCONNECT_DATA)Stack->Parameters.DeviceIoControl.Type3InputBuffer);
|
*((PCONNECT_DATA)Stack->Parameters.DeviceIoControl.Type3InputBuffer);
|
||||||
|
Status = STATUS_SUCCESS;
|
||||||
/* Start read loop */
|
|
||||||
Status = PsCreateSystemThread(
|
|
||||||
&DeviceExtension->WorkerThreadHandle,
|
|
||||||
(ACCESS_MASK)0L,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
SermouseDeviceWorker,
|
|
||||||
DeviceObject);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IOCTL_INTERNAL_MOUSE_DISCONNECT:
|
case IOCTL_INTERNAL_MOUSE_DISCONNECT:
|
||||||
|
@ -61,7 +51,9 @@ SermouseInternalDeviceControl(
|
||||||
DeviceExtension->AttributesInformation;
|
DeviceExtension->AttributesInformation;
|
||||||
Irp->IoStatus.Information = sizeof(MOUSE_ATTRIBUTES);
|
Irp->IoStatus.Information = sizeof(MOUSE_ATTRIBUTES);
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Status = STATUS_BUFFER_TOO_SMALL;
|
Status = STATUS_BUFFER_TOO_SMALL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -70,6 +62,7 @@ SermouseInternalDeviceControl(
|
||||||
{
|
{
|
||||||
DPRINT1("IRP_MJ_INTERNAL_DEVICE_CONTROL / unknown ioctl code 0x%lx\n",
|
DPRINT1("IRP_MJ_INTERNAL_DEVICE_CONTROL / unknown ioctl code 0x%lx\n",
|
||||||
Stack->Parameters.DeviceIoControl.IoControlCode);
|
Stack->Parameters.DeviceIoControl.IoControlCode);
|
||||||
|
ASSERT(FALSE);
|
||||||
Status = STATUS_INVALID_DEVICE_REQUEST;
|
Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* PROJECT: ReactOS Serial mouse driver
|
||||||
* PROJECT: ReactOS Serial mouse driver
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: drivers/input/sermouse/misc.c
|
* FILE: drivers/input/sermouse/fdo.c
|
||||||
* PURPOSE: Misceallenous operations
|
* PURPOSE: Misceallenous operations
|
||||||
*
|
* PROGRAMMERS: Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* PROJECT: ReactOS Serial mouse driver
|
||||||
* PROJECT: ReactOS Serial mouse driver
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: drivers/input/sermouse/readmouse.c
|
* FILE: drivers/input/sermouse/fdo.c
|
||||||
* PURPOSE: Read mouse moves and send them to mouclass
|
* PURPOSE: Read mouse moves and send them to mouclass
|
||||||
*
|
* PROGRAMMERS: Copyright Jason Filby (jasonfilby@yahoo.com)
|
||||||
* PROGRAMMERS: Jason Filby (jasonfilby@yahoo.com)
|
Copyright Filip Navara (xnavara@volny.cz)
|
||||||
* Filip Navara (xnavara@volny.cz)
|
Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
|
||||||
* Hervé Poussineau (hpoussin@reactos.org)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -106,7 +105,7 @@ SermouseDeviceWorker(
|
||||||
&Fcr, sizeof(Fcr), NULL, NULL);
|
&Fcr, sizeof(Fcr), NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) PsTerminateSystemThread(Status);
|
if (!NT_SUCCESS(Status)) PsTerminateSystemThread(Status);
|
||||||
/* Set serial port speed */
|
/* Set serial port speed */
|
||||||
BaudRate = DeviceExtension->DriverExtension->SampleRate;
|
BaudRate = DeviceExtension->AttributesInformation.SampleRate * 8;
|
||||||
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_BAUD_RATE,
|
Status = SermouseDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_BAUD_RATE,
|
||||||
&BaudRate, sizeof(BaudRate), NULL, NULL);
|
&BaudRate, sizeof(BaudRate), NULL, NULL);
|
||||||
if (!NT_SUCCESS(Status)) PsTerminateSystemThread(Status);
|
if (!NT_SUCCESS(Status)) PsTerminateSystemThread(Status);
|
||||||
|
@ -187,10 +186,10 @@ SermouseDeviceWorker(
|
||||||
Queue = DeviceExtension->ActiveQueue % 2;
|
Queue = DeviceExtension->ActiveQueue % 2;
|
||||||
|
|
||||||
/* Prevent buffer overflow */
|
/* Prevent buffer overflow */
|
||||||
if (DeviceExtension->InputDataCount[Queue] == DeviceExtension->DriverExtension->MouseDataQueueSize)
|
if (DeviceExtension->InputDataCount[Queue] == 1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Input = &DeviceExtension->MouseInputData[Queue][DeviceExtension->InputDataCount[Queue]];
|
Input = &DeviceExtension->MouseInputData[Queue];
|
||||||
|
|
||||||
if (DeviceExtension->PacketBufferPosition == 3)
|
if (DeviceExtension->PacketBufferPosition == 3)
|
||||||
{
|
{
|
||||||
|
@ -261,8 +260,8 @@ SermouseDeviceWorker(
|
||||||
InterlockedIncrement((PLONG)&DeviceExtension->ActiveQueue);
|
InterlockedIncrement((PLONG)&DeviceExtension->ActiveQueue);
|
||||||
(*(PSERVICE_CALLBACK_ROUTINE)DeviceExtension->ConnectData.ClassService)(
|
(*(PSERVICE_CALLBACK_ROUTINE)DeviceExtension->ConnectData.ClassService)(
|
||||||
DeviceExtension->ConnectData.ClassDeviceObject,
|
DeviceExtension->ConnectData.ClassDeviceObject,
|
||||||
DeviceExtension->MouseInputData[Queue],
|
&DeviceExtension->MouseInputData[Queue],
|
||||||
DeviceExtension->MouseInputData[Queue] + 1,
|
&DeviceExtension->MouseInputData[Queue] + 1,
|
||||||
&DeviceExtension->InputDataCount[Queue]);
|
&DeviceExtension->InputDataCount[Queue]);
|
||||||
KeLowerIrql(OldIrql);
|
KeLowerIrql(OldIrql);
|
||||||
DeviceExtension->InputDataCount[Queue] = 0;
|
DeviceExtension->InputDataCount[Queue] = 0;
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* PROJECT: ReactOS Serial mouse driver
|
||||||
* PROJECT: ReactOS Serial mouse driver
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: drivers/input/sermouse/sermouse.c
|
* FILE: drivers/input/sermouse/fdo.c
|
||||||
* PURPOSE: Serial mouse driver entry point
|
* PURPOSE: Serial mouse driver entry point
|
||||||
*
|
* PROGRAMMERS: Copyright 2005-2006 Hervé Poussineau (hpoussin@reactos.org)
|
||||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -36,13 +35,10 @@ ReadRegistryEntries(
|
||||||
IN PSERMOUSE_DRIVER_EXTENSION DriverExtension)
|
IN PSERMOUSE_DRIVER_EXTENSION DriverExtension)
|
||||||
{
|
{
|
||||||
UNICODE_STRING ParametersRegistryKey;
|
UNICODE_STRING ParametersRegistryKey;
|
||||||
RTL_QUERY_REGISTRY_TABLE Parameters[5];
|
RTL_QUERY_REGISTRY_TABLE Parameters[2];
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
ULONG DefaultMouseDataQueueSize = 0x64;
|
ULONG DefaultNumberOfButtons = 2;
|
||||||
ULONG DefaultNumberOfButtons = 0;
|
|
||||||
UNICODE_STRING DefaultPointerDeviceBaseName = RTL_CONSTANT_STRING(L"PointerPort");
|
|
||||||
ULONG DefaultSampleRate = 1200;
|
|
||||||
|
|
||||||
ParametersRegistryKey.Length = 0;
|
ParametersRegistryKey.Length = 0;
|
||||||
ParametersRegistryKey.MaximumLength = RegistryPath->Length + sizeof(L"\\Parameters") + sizeof(UNICODE_NULL);
|
ParametersRegistryKey.MaximumLength = RegistryPath->Length + sizeof(L"\\Parameters") + sizeof(UNICODE_NULL);
|
||||||
|
@ -59,33 +55,12 @@ ReadRegistryEntries(
|
||||||
RtlZeroMemory(Parameters, sizeof(Parameters));
|
RtlZeroMemory(Parameters, sizeof(Parameters));
|
||||||
|
|
||||||
Parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_REGISTRY_OPTIONAL;
|
Parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_REGISTRY_OPTIONAL;
|
||||||
Parameters[0].Name = L"MouseDataQueueSize";
|
Parameters[0].Name = L"NumberOfButtons";
|
||||||
Parameters[0].EntryContext = &DriverExtension->MouseDataQueueSize;
|
Parameters[0].EntryContext = &DriverExtension->NumberOfButtons;
|
||||||
Parameters[0].DefaultType = REG_DWORD;
|
Parameters[0].DefaultType = REG_DWORD;
|
||||||
Parameters[0].DefaultData = &DefaultMouseDataQueueSize;
|
Parameters[0].DefaultData = &DefaultNumberOfButtons;
|
||||||
Parameters[0].DefaultLength = sizeof(ULONG);
|
Parameters[0].DefaultLength = sizeof(ULONG);
|
||||||
|
|
||||||
Parameters[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_REGISTRY_OPTIONAL;
|
|
||||||
Parameters[1].Name = L"NumberOfButtons";
|
|
||||||
Parameters[1].EntryContext = &DriverExtension->NumberOfButtons;
|
|
||||||
Parameters[1].DefaultType = REG_DWORD;
|
|
||||||
Parameters[1].DefaultData = &DefaultNumberOfButtons;
|
|
||||||
Parameters[1].DefaultLength = sizeof(ULONG);
|
|
||||||
|
|
||||||
Parameters[2].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_REGISTRY_OPTIONAL;
|
|
||||||
Parameters[2].Name = L"PointerDeviceBaseName";
|
|
||||||
Parameters[2].EntryContext = &DriverExtension->PointerDeviceBaseName;
|
|
||||||
Parameters[2].DefaultType = REG_SZ;
|
|
||||||
Parameters[2].DefaultData = &DefaultPointerDeviceBaseName;
|
|
||||||
Parameters[2].DefaultLength = 0;
|
|
||||||
|
|
||||||
Parameters[3].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_REGISTRY_OPTIONAL;
|
|
||||||
Parameters[3].Name = L"SampleRate";
|
|
||||||
Parameters[3].EntryContext = &DriverExtension->SampleRate;
|
|
||||||
Parameters[3].DefaultType = REG_DWORD;
|
|
||||||
Parameters[3].DefaultData = &DefaultSampleRate;
|
|
||||||
Parameters[3].DefaultLength = sizeof(ULONG);
|
|
||||||
|
|
||||||
Status = RtlQueryRegistryValues(
|
Status = RtlQueryRegistryValues(
|
||||||
RTL_REGISTRY_ABSOLUTE,
|
RTL_REGISTRY_ABSOLUTE,
|
||||||
ParametersRegistryKey.Buffer,
|
ParametersRegistryKey.Buffer,
|
||||||
|
@ -96,21 +71,12 @@ ReadRegistryEntries(
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* Check values */
|
/* Check values */
|
||||||
if (DriverExtension->MouseDataQueueSize == 0)
|
|
||||||
{
|
|
||||||
DriverExtension->MouseDataQueueSize = DefaultMouseDataQueueSize;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
|
else if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
|
||||||
{
|
{
|
||||||
/* Registry path doesn't exist. Set defaults */
|
/* Registry path doesn't exist. Set defaults */
|
||||||
DriverExtension->MouseDataQueueSize = DefaultMouseDataQueueSize;
|
|
||||||
DriverExtension->NumberOfButtons = DefaultNumberOfButtons;
|
DriverExtension->NumberOfButtons = DefaultNumberOfButtons;
|
||||||
Status = RtlDuplicateUnicodeString(
|
Status = STATUS_SUCCESS;
|
||||||
RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE,
|
|
||||||
&DefaultPointerDeviceBaseName,
|
|
||||||
&DriverExtension->PointerDeviceBaseName);
|
|
||||||
DriverExtension->SampleRate = DefaultSampleRate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
|
@ -3,16 +3,13 @@
|
||||||
#include <ntddser.h>
|
#include <ntddser.h>
|
||||||
#include <ntddmou.h>
|
#include <ntddmou.h>
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(_MSC_VER)
|
||||||
#include <stdio.h>
|
/* Missing prototype */
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
NTSTATUS NTAPI
|
NTSTATUS NTAPI
|
||||||
IoAttachDeviceToDeviceStackSafe(
|
IoAttachDeviceToDeviceStackSafe(
|
||||||
IN PDEVICE_OBJECT SourceDevice,
|
IN PDEVICE_OBJECT SourceDevice,
|
||||||
IN PDEVICE_OBJECT TargetDevice,
|
IN PDEVICE_OBJECT TargetDevice,
|
||||||
OUT PDEVICE_OBJECT *AttachedToDeviceObject);
|
OUT PDEVICE_OBJECT *AttachedToDeviceObject);
|
||||||
#else
|
|
||||||
#error Unknown compiler!
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -57,10 +54,7 @@ typedef enum
|
||||||
|
|
||||||
typedef struct _SERMOUSE_DRIVER_EXTENSION
|
typedef struct _SERMOUSE_DRIVER_EXTENSION
|
||||||
{
|
{
|
||||||
ULONG MouseDataQueueSize;
|
|
||||||
ULONG NumberOfButtons;
|
ULONG NumberOfButtons;
|
||||||
UNICODE_STRING PointerDeviceBaseName;
|
|
||||||
ULONG SampleRate;
|
|
||||||
} SERMOUSE_DRIVER_EXTENSION, *PSERMOUSE_DRIVER_EXTENSION;
|
} SERMOUSE_DRIVER_EXTENSION, *PSERMOUSE_DRIVER_EXTENSION;
|
||||||
|
|
||||||
typedef struct _SERMOUSE_DEVICE_EXTENSION
|
typedef struct _SERMOUSE_DEVICE_EXTENSION
|
||||||
|
@ -76,7 +70,7 @@ typedef struct _SERMOUSE_DEVICE_EXTENSION
|
||||||
ULONG ActiveQueue;
|
ULONG ActiveQueue;
|
||||||
ULONG InputDataCount[2];
|
ULONG InputDataCount[2];
|
||||||
CONNECT_DATA ConnectData;
|
CONNECT_DATA ConnectData;
|
||||||
MOUSE_INPUT_DATA* MouseInputData[2];
|
MOUSE_INPUT_DATA MouseInputData[2];
|
||||||
UCHAR PacketBuffer[PACKET_BUFFER_SIZE];
|
UCHAR PacketBuffer[PACKET_BUFFER_SIZE];
|
||||||
ULONG PacketBufferPosition;
|
ULONG PacketBufferPosition;
|
||||||
ULONG PreviousButtons;
|
ULONG PreviousButtons;
|
||||||
|
|
Loading…
Reference in a new issue