Commit bfb7fe4b authored by Claire Girka's avatar Claire Girka Committed by Alexandre Julliard

hidclass: Expose ContainerID from underlying driver.

parent 8ed6b160
...@@ -81,6 +81,7 @@ typedef struct _BASE_DEVICE_EXTENSION ...@@ -81,6 +81,7 @@ typedef struct _BASE_DEVICE_EXTENSION
* for convenience. */ * for convenience. */
WCHAR device_id[MAX_DEVICE_ID_LEN]; WCHAR device_id[MAX_DEVICE_ID_LEN];
WCHAR instance_id[MAX_DEVICE_ID_LEN]; WCHAR instance_id[MAX_DEVICE_ID_LEN];
WCHAR container_id[MAX_GUID_STRING_LEN];
const GUID *class_guid; const GUID *class_guid;
BOOL is_fdo; BOOL is_fdo;
......
...@@ -173,6 +173,9 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b ...@@ -173,6 +173,9 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
swprintf(ext->device_id, ARRAY_SIZE(ext->device_id), L"HID\\%s", wcsrchr(device_id, '\\') + 1); swprintf(ext->device_id, ARRAY_SIZE(ext->device_id), L"HID\\%s", wcsrchr(device_id, '\\') + 1);
wcscpy(ext->instance_id, instance_id); wcscpy(ext->instance_id, instance_id);
if (get_device_id(bus_pdo, BusQueryContainerID, ext->container_id))
ext->container_id[0] = 0;
is_xinput_class = !wcsncmp(device_id, L"WINEXINPUT\\", 7) && wcsstr(device_id, L"&XI_") != NULL; is_xinput_class = !wcsncmp(device_id, L"WINEXINPUT\\", 7) && wcsstr(device_id, L"&XI_") != NULL;
if (is_xinput_class) ext->class_guid = &GUID_DEVINTERFACE_WINEXINPUT; if (is_xinput_class) ext->class_guid = &GUID_DEVINTERFACE_WINEXINPUT;
else ext->class_guid = &GUID_DEVINTERFACE_HID; else ext->class_guid = &GUID_DEVINTERFACE_HID;
...@@ -229,6 +232,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo) ...@@ -229,6 +232,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
KeInitializeSpinLock( &pdo_ext->u.pdo.queues_lock ); KeInitializeSpinLock( &pdo_ext->u.pdo.queues_lock );
wcscpy(pdo_ext->device_id, fdo_ext->device_id); wcscpy(pdo_ext->device_id, fdo_ext->device_id);
wcscpy(pdo_ext->instance_id, fdo_ext->instance_id); wcscpy(pdo_ext->instance_id, fdo_ext->instance_id);
wcscpy(pdo_ext->container_id, fdo_ext->container_id);
pdo_ext->class_guid = fdo_ext->class_guid; pdo_ext->class_guid = fdo_ext->class_guid;
pdo_ext->u.pdo.information.VendorID = attr.VendorID; pdo_ext->u.pdo.information.VendorID = attr.VendorID;
...@@ -416,8 +420,19 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp) ...@@ -416,8 +420,19 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp)
irp->IoStatus.Information = (ULONG_PTR)id; irp->IoStatus.Information = (ULONG_PTR)id;
status = STATUS_SUCCESS; status = STATUS_SUCCESS;
break; break;
case BusQueryContainerID: case BusQueryContainerID:
if (ext->container_id[0])
{
lstrcpyW(id, ext->container_id);
irp->IoStatus.Information = (ULONG_PTR)id;
status = STATUS_SUCCESS;
}
else
{
ExFreePool(id);
}
break;
case BusQueryDeviceSerialNumber: case BusQueryDeviceSerialNumber:
FIXME("unimplemented id type %#x\n", irpsp->Parameters.QueryId.IdType); FIXME("unimplemented id type %#x\n", irpsp->Parameters.QueryId.IdType);
ExFreePool(id); ExFreePool(id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment