winebus.sys: Rename "report_cs" to "cs".
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
092c7a09a5
commit
b6409950d9
|
@ -112,6 +112,8 @@ struct pnp_device
|
||||||
|
|
||||||
struct device_extension
|
struct device_extension
|
||||||
{
|
{
|
||||||
|
CRITICAL_SECTION cs;
|
||||||
|
|
||||||
struct pnp_device *pnp_device;
|
struct pnp_device *pnp_device;
|
||||||
|
|
||||||
WORD vid, pid, input;
|
WORD vid, pid, input;
|
||||||
|
@ -127,7 +129,6 @@ struct device_extension
|
||||||
BOOL last_report_read;
|
BOOL last_report_read;
|
||||||
DWORD buffer_size;
|
DWORD buffer_size;
|
||||||
LIST_ENTRY irp_queue;
|
LIST_ENTRY irp_queue;
|
||||||
CRITICAL_SECTION report_cs;
|
|
||||||
|
|
||||||
BYTE platform_private[1];
|
BYTE platform_private[1];
|
||||||
};
|
};
|
||||||
|
@ -285,8 +286,8 @@ DEVICE_OBJECT *bus_create_hid_device(const WCHAR *busidW, WORD vid, WORD pid,
|
||||||
memset(ext->platform_private, 0, platform_data_size);
|
memset(ext->platform_private, 0, platform_data_size);
|
||||||
|
|
||||||
InitializeListHead(&ext->irp_queue);
|
InitializeListHead(&ext->irp_queue);
|
||||||
InitializeCriticalSection(&ext->report_cs);
|
InitializeCriticalSection(&ext->cs);
|
||||||
ext->report_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": report_cs");
|
ext->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": cs");
|
||||||
|
|
||||||
/* add to list of pnp devices */
|
/* add to list of pnp devices */
|
||||||
pnp_dev->device = device;
|
pnp_dev->device = device;
|
||||||
|
@ -366,7 +367,7 @@ void bus_remove_hid_device(DEVICE_OBJECT *device)
|
||||||
TRACE("(%p)\n", device);
|
TRACE("(%p)\n", device);
|
||||||
|
|
||||||
/* Cancel pending IRPs */
|
/* Cancel pending IRPs */
|
||||||
EnterCriticalSection(&ext->report_cs);
|
EnterCriticalSection(&ext->cs);
|
||||||
while ((entry = RemoveHeadList(&ext->irp_queue)) != &ext->irp_queue)
|
while ((entry = RemoveHeadList(&ext->irp_queue)) != &ext->irp_queue)
|
||||||
{
|
{
|
||||||
irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.s.ListEntry);
|
irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.s.ListEntry);
|
||||||
|
@ -374,10 +375,10 @@ void bus_remove_hid_device(DEVICE_OBJECT *device)
|
||||||
irp->IoStatus.Information = 0;
|
irp->IoStatus.Information = 0;
|
||||||
IoCompleteRequest(irp, IO_NO_INCREMENT);
|
IoCompleteRequest(irp, IO_NO_INCREMENT);
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&ext->report_cs);
|
LeaveCriticalSection(&ext->cs);
|
||||||
|
|
||||||
ext->report_cs.DebugInfo->Spare[0] = 0;
|
ext->cs.DebugInfo->Spare[0] = 0;
|
||||||
DeleteCriticalSection(&ext->report_cs);
|
DeleteCriticalSection(&ext->cs);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, ext->serial);
|
HeapFree(GetProcessHeap(), 0, ext->serial);
|
||||||
HeapFree(GetProcessHeap(), 0, ext->last_report);
|
HeapFree(GetProcessHeap(), 0, ext->last_report);
|
||||||
|
@ -783,12 +784,12 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
|
||||||
{
|
{
|
||||||
HID_XFER_PACKET *packet = (HID_XFER_PACKET*)(irp->UserBuffer);
|
HID_XFER_PACKET *packet = (HID_XFER_PACKET*)(irp->UserBuffer);
|
||||||
TRACE_(hid_report)("IOCTL_HID_GET_INPUT_REPORT\n");
|
TRACE_(hid_report)("IOCTL_HID_GET_INPUT_REPORT\n");
|
||||||
EnterCriticalSection(&ext->report_cs);
|
EnterCriticalSection(&ext->cs);
|
||||||
status = ext->vtbl->begin_report_processing(device);
|
status = ext->vtbl->begin_report_processing(device);
|
||||||
if (status != STATUS_SUCCESS)
|
if (status != STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = status;
|
irp->IoStatus.u.Status = status;
|
||||||
LeaveCriticalSection(&ext->report_cs);
|
LeaveCriticalSection(&ext->cs);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -798,18 +799,18 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
|
||||||
|
|
||||||
if (status == STATUS_SUCCESS)
|
if (status == STATUS_SUCCESS)
|
||||||
packet->reportBufferLen = irp->IoStatus.Information;
|
packet->reportBufferLen = irp->IoStatus.Information;
|
||||||
LeaveCriticalSection(&ext->report_cs);
|
LeaveCriticalSection(&ext->cs);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IOCTL_HID_READ_REPORT:
|
case IOCTL_HID_READ_REPORT:
|
||||||
{
|
{
|
||||||
TRACE_(hid_report)("IOCTL_HID_READ_REPORT\n");
|
TRACE_(hid_report)("IOCTL_HID_READ_REPORT\n");
|
||||||
EnterCriticalSection(&ext->report_cs);
|
EnterCriticalSection(&ext->cs);
|
||||||
status = ext->vtbl->begin_report_processing(device);
|
status = ext->vtbl->begin_report_processing(device);
|
||||||
if (status != STATUS_SUCCESS)
|
if (status != STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
irp->IoStatus.u.Status = status;
|
irp->IoStatus.u.Status = status;
|
||||||
LeaveCriticalSection(&ext->report_cs);
|
LeaveCriticalSection(&ext->cs);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!ext->last_report_read)
|
if (!ext->last_report_read)
|
||||||
|
@ -824,7 +825,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
|
||||||
InsertTailList(&ext->irp_queue, &irp->Tail.Overlay.s.ListEntry);
|
InsertTailList(&ext->irp_queue, &irp->Tail.Overlay.s.ListEntry);
|
||||||
status = STATUS_PENDING;
|
status = STATUS_PENDING;
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&ext->report_cs);
|
LeaveCriticalSection(&ext->cs);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IOCTL_HID_SET_OUTPUT_REPORT:
|
case IOCTL_HID_SET_OUTPUT_REPORT:
|
||||||
|
@ -880,7 +881,7 @@ void process_hid_report(DEVICE_OBJECT *device, BYTE *report, DWORD length)
|
||||||
if (!length || !report)
|
if (!length || !report)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EnterCriticalSection(&ext->report_cs);
|
EnterCriticalSection(&ext->cs);
|
||||||
if (length > ext->buffer_size)
|
if (length > ext->buffer_size)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, ext->last_report);
|
HeapFree(GetProcessHeap(), 0, ext->last_report);
|
||||||
|
@ -891,7 +892,7 @@ void process_hid_report(DEVICE_OBJECT *device, BYTE *report, DWORD length)
|
||||||
ext->buffer_size = 0;
|
ext->buffer_size = 0;
|
||||||
ext->last_report_size = 0;
|
ext->last_report_size = 0;
|
||||||
ext->last_report_read = TRUE;
|
ext->last_report_read = TRUE;
|
||||||
LeaveCriticalSection(&ext->report_cs);
|
LeaveCriticalSection(&ext->cs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -914,7 +915,7 @@ void process_hid_report(DEVICE_OBJECT *device, BYTE *report, DWORD length)
|
||||||
ext->last_report_read = TRUE;
|
ext->last_report_read = TRUE;
|
||||||
IoCompleteRequest(irp, IO_NO_INCREMENT);
|
IoCompleteRequest(irp, IO_NO_INCREMENT);
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&ext->report_cs);
|
LeaveCriticalSection(&ext->cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD check_bus_option(const UNICODE_STRING *option, DWORD default_value)
|
DWORD check_bus_option(const UNICODE_STRING *option, DWORD default_value)
|
||||||
|
|
Loading…
Reference in New Issue