Handle DeviceId property
Change InstanceId to Serenum\Mouse
Modified: trunk/reactos/drivers/bus/serenum/detect.c
Modified: trunk/reactos/drivers/bus/serenum/pdo.c
Modified: trunk/reactos/drivers/bus/serenum/serenum.c
Modified: trunk/reactos/drivers/bus/serenum/serenum.h

Modified: trunk/reactos/drivers/bus/serenum/detect.c
--- trunk/reactos/drivers/bus/serenum/detect.c	2005-06-13 21:44:32 UTC (rev 15899)
+++ trunk/reactos/drivers/bus/serenum/detect.c	2005-06-13 21:51:42 UTC (rev 15900)
@@ -141,6 +141,7 @@
 	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 @@
 	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 @@
 	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 @@
 			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 @@
 	UCHAR Buffer[16];
 	UNICODE_STRING DeviceDescription;
 	UNICODE_STRING DeviceId;
+	UNICODE_STRING InstanceId;
 	UNICODE_STRING HardwareIds;
 	UNICODE_STRING CompatibleIds;
 	NTSTATUS Status;
@@ -546,6 +552,8 @@
 	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 @@
 			 * 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 @@
 					 * 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 @@
 					 * 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;

Modified: trunk/reactos/drivers/bus/serenum/pdo.c
--- trunk/reactos/drivers/bus/serenum/pdo.c	2005-06-13 21:44:32 UTC (rev 15899)
+++ trunk/reactos/drivers/bus/serenum/pdo.c	2005-06-13 21:51:42 UTC (rev 15900)
@@ -61,11 +61,9 @@
 			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);

Modified: trunk/reactos/drivers/bus/serenum/serenum.c
--- trunk/reactos/drivers/bus/serenum/serenum.c	2005-06-13 21:44:32 UTC (rev 15899)
+++ trunk/reactos/drivers/bus/serenum/serenum.c	2005-06-13 21:51:42 UTC (rev 15900)
@@ -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)
  */

Modified: trunk/reactos/drivers/bus/serenum/serenum.h
--- trunk/reactos/drivers/bus/serenum/serenum.h	2005-06-13 21:44:32 UTC (rev 15899)
+++ trunk/reactos/drivers/bus/serenum/serenum.h	2005-06-13 21:51:42 UTC (rev 15900)
@@ -79,6 +79,7 @@
 
 	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;