mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Handle DeviceId property
Change InstanceId to Serenum\Mouse svn path=/trunk/; revision=15900
This commit is contained in:
parent
a189416191
commit
f5f855488d
4 changed files with 16 additions and 12 deletions
|
@ -141,6 +141,7 @@ ReportDetectedDevice(
|
|||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PUNICODE_STRING DeviceDescription,
|
||||
IN PUNICODE_STRING DeviceId,
|
||||
IN PUNICODE_STRING InstanceId,
|
||||
IN PUNICODE_STRING HardwareIds,
|
||||
IN PUNICODE_STRING CompatibleIds)
|
||||
{
|
||||
|
@ -149,7 +150,7 @@ ReportDetectedDevice(
|
|||
PFDO_DEVICE_EXTENSION FdoDeviceExtension;
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT("Serenum: SerenumReportDetectedDevice() called with %wZ (%wZ) detected\n", DeviceId, DeviceDescription);
|
||||
DPRINT("Serenum: ReportDetectedDevice() called with %wZ (%wZ) detected\n", DeviceId, DeviceDescription);
|
||||
|
||||
Status = IoCreateDevice(
|
||||
DeviceObject->DriverObject,
|
||||
|
@ -171,6 +172,8 @@ ReportDetectedDevice(
|
|||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||
Status = SerenumDuplicateUnicodeString(&PdoDeviceExtension->DeviceId, DeviceId, PagedPool);
|
||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||
Status = SerenumDuplicateUnicodeString(&PdoDeviceExtension->InstanceId, InstanceId, PagedPool);
|
||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||
Status = SerenumDuplicateUnicodeString(&PdoDeviceExtension->HardwareIds, HardwareIds, PagedPool);
|
||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||
Status = SerenumDuplicateUnicodeString(&PdoDeviceExtension->CompatibleIds, CompatibleIds, PagedPool);
|
||||
|
@ -195,6 +198,8 @@ ByeBye:
|
|||
RtlFreeUnicodeString(&PdoDeviceExtension->DeviceDescription);
|
||||
if (PdoDeviceExtension->DeviceId.Buffer)
|
||||
RtlFreeUnicodeString(&PdoDeviceExtension->DeviceId);
|
||||
if (PdoDeviceExtension->InstanceId.Buffer)
|
||||
RtlFreeUnicodeString(&PdoDeviceExtension->InstanceId);
|
||||
if (PdoDeviceExtension->HardwareIds.Buffer)
|
||||
RtlFreeUnicodeString(&PdoDeviceExtension->HardwareIds);
|
||||
if (PdoDeviceExtension->CompatibleIds.Buffer)
|
||||
|
@ -472,6 +477,7 @@ SerenumDetectLegacyDevice(
|
|||
UCHAR Buffer[16];
|
||||
UNICODE_STRING DeviceDescription;
|
||||
UNICODE_STRING DeviceId;
|
||||
UNICODE_STRING InstanceId;
|
||||
UNICODE_STRING HardwareIds;
|
||||
UNICODE_STRING CompatibleIds;
|
||||
NTSTATUS Status;
|
||||
|
@ -546,6 +552,8 @@ SerenumDetectLegacyDevice(
|
|||
Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), &Count);
|
||||
if (!NT_SUCCESS(Status)) goto ByeBye;
|
||||
|
||||
RtlInitUnicodeString(&DeviceId, L"Serenum\\Mouse");
|
||||
RtlInitUnicodeString(&InstanceId, L"0000"); /* FIXME */
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
if (Buffer[i] == 'B')
|
||||
|
@ -555,11 +563,10 @@ SerenumDetectLegacyDevice(
|
|||
* Compatible id: *PNP0F0F, SERIAL_MOUSE
|
||||
*/
|
||||
RtlInitUnicodeString(&DeviceDescription, L"Microsoft Ballpoint device");
|
||||
RtlInitUnicodeString(&DeviceId, L"*PNP0F09");
|
||||
SerenumInitMultiSzString(&HardwareIds, "*PNP0F09", NULL);
|
||||
SerenumInitMultiSzString(&CompatibleIds, "*PNP0F0F", "SERIAL_MOUSE", NULL);
|
||||
Status = ReportDetectedDevice(DeviceObject,
|
||||
&DeviceDescription, &DeviceId, &HardwareIds, &CompatibleIds);
|
||||
&DeviceDescription, &DeviceId, &InstanceId, &HardwareIds, &CompatibleIds);
|
||||
RtlFreeUnicodeString(&HardwareIds);
|
||||
RtlFreeUnicodeString(&CompatibleIds);
|
||||
goto ByeBye;
|
||||
|
@ -580,7 +587,6 @@ SerenumDetectLegacyDevice(
|
|||
* Compatible id: SERIAL_MOUSE
|
||||
*/
|
||||
RtlInitUnicodeString(&DeviceDescription, L"Microsoft Mouse with 3-buttons");
|
||||
RtlInitUnicodeString(&DeviceId, L"*PNP0F08");
|
||||
SerenumInitMultiSzString(&HardwareIds, "*PNP0F08", NULL);
|
||||
SerenumInitMultiSzString(&CompatibleIds, "SERIAL_MOUSE", NULL);
|
||||
default:
|
||||
|
@ -588,12 +594,11 @@ SerenumDetectLegacyDevice(
|
|||
* Compatible id: SERIAL_MOUSE
|
||||
*/
|
||||
RtlInitUnicodeString(&DeviceDescription, L"Microsoft Mouse with 2-buttons or Microsoft Wheel Mouse");
|
||||
RtlInitUnicodeString(&DeviceId, L"*PNP0F01");
|
||||
SerenumInitMultiSzString(&HardwareIds, "*PNP0F01", NULL);
|
||||
SerenumInitMultiSzString(&CompatibleIds, "SERIAL_MOUSE", NULL);
|
||||
}
|
||||
Status = ReportDetectedDevice(DeviceObject,
|
||||
&DeviceDescription, &DeviceId, &HardwareIds, &CompatibleIds);
|
||||
&DeviceDescription, &DeviceId, &InstanceId, &HardwareIds, &CompatibleIds);
|
||||
RtlFreeUnicodeString(&HardwareIds);
|
||||
RtlFreeUnicodeString(&CompatibleIds);
|
||||
goto ByeBye;
|
||||
|
|
|
@ -61,11 +61,9 @@ SerenumPdoQueryId(
|
|||
break;
|
||||
case BusQueryInstanceID:
|
||||
{
|
||||
/* We don't have any instance id to report, and
|
||||
* this query is optional, so ignore it.
|
||||
*/
|
||||
*Information = Irp->IoStatus.Information;
|
||||
return Irp->IoStatus.Status;
|
||||
DPRINT("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
|
||||
SourceString = &DeviceExtension->InstanceId;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
DPRINT1("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS Serial enumerator driver
|
||||
* FILE: drivers/bus/serenum/serenum.c
|
||||
* PURPOSE: Serial enumeration driver entry point
|
||||
* PURPOSE: Serial enumerator driver entry point
|
||||
*
|
||||
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com)
|
||||
*/
|
||||
|
|
|
@ -79,6 +79,7 @@ typedef struct _PDO_DEVICE_EXTENSION
|
|||
|
||||
UNICODE_STRING DeviceDescription; // REG_SZ
|
||||
UNICODE_STRING DeviceId; // REG_SZ
|
||||
UNICODE_STRING InstanceId; // REG_SZ
|
||||
UNICODE_STRING HardwareIds; // REG_MULTI_SZ
|
||||
UNICODE_STRING CompatibleIds; // REG_MULTI_SZ
|
||||
} PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
|
||||
|
|
Loading…
Reference in a new issue