mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 03:53:41 +00:00
[HIDCLASS]
- Fix some whitespace svn path=/trunk/; revision=59003
This commit is contained in:
parent
e0936866ae
commit
df2001250f
4 changed files with 131 additions and 115 deletions
|
@ -7,6 +7,7 @@
|
|||
* Michael Martin (michael.martin@reactos.org)
|
||||
* Johannes Anderwald (johannes.anderwald@reactos.org)
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
NTSTATUS
|
||||
|
@ -221,7 +222,7 @@ HidClassFDO_GetDescriptors(
|
|||
ASSERT(FDODeviceExtension->Common.IsFDO);
|
||||
|
||||
//
|
||||
// lets allocate irp
|
||||
// let's allocate irp
|
||||
//
|
||||
Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE);
|
||||
if (!Irp)
|
||||
|
@ -262,7 +263,7 @@ HidClassFDO_GetDescriptors(
|
|||
}
|
||||
|
||||
//
|
||||
// lets get device attributes
|
||||
// let's get device attributes
|
||||
//
|
||||
IoStack->Parameters.DeviceIoControl.IoControlCode = IOCTL_HID_GET_DEVICE_ATTRIBUTES;
|
||||
IoStack->Parameters.DeviceIoControl.OutputBufferLength = sizeof(HID_DEVICE_ATTRIBUTES);
|
||||
|
@ -290,7 +291,6 @@ HidClassFDO_GetDescriptors(
|
|||
ASSERT(FDODeviceExtension->HidDescriptor.DescriptorList[0].wReportLength > 0);
|
||||
ASSERT(FDODeviceExtension->HidDescriptor.DescriptorList[0].bReportType == HID_REPORT_DESCRIPTOR_TYPE);
|
||||
|
||||
|
||||
//
|
||||
// now allocate space for the report descriptor
|
||||
//
|
||||
|
@ -359,7 +359,7 @@ HidClassFDO_StartDevice(
|
|||
}
|
||||
|
||||
//
|
||||
// lets start the lower device too
|
||||
// let's start the lower device too
|
||||
//
|
||||
IoSkipCurrentIrpStackLocation(Irp);
|
||||
Status = HidClassFDO_DispatchRequestSynchronous(DeviceObject, Irp);
|
||||
|
@ -372,7 +372,7 @@ HidClassFDO_StartDevice(
|
|||
}
|
||||
|
||||
//
|
||||
// lets get the descriptors
|
||||
// let's get the descriptors
|
||||
//
|
||||
Status = HidClassFDO_GetDescriptors(DeviceObject);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -41,7 +41,6 @@ HidClassAddDevice(
|
|||
ULONG DeviceExtensionSize;
|
||||
PHIDCLASS_DRIVER_EXTENSION DriverExtension;
|
||||
|
||||
|
||||
/* increment device number */
|
||||
InterlockedIncrement((PLONG)&HidClassDeviceNumber);
|
||||
|
||||
|
@ -336,9 +335,6 @@ HidClass_Close(
|
|||
//
|
||||
KeReleaseSpinLock(&IrpContext->Lock, OldLevel);
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// remove context
|
||||
//
|
||||
|
@ -429,13 +425,15 @@ HidClass_ReadCompleteIrp(
|
|||
//
|
||||
// get collection description
|
||||
//
|
||||
CollectionDescription = HidClassPDO_GetCollectionDescription(&IrpContext->FileOp->DeviceExtension->Common.DeviceDescription, IrpContext->FileOp->DeviceExtension->CollectionNumber);
|
||||
CollectionDescription = HidClassPDO_GetCollectionDescription(&IrpContext->FileOp->DeviceExtension->Common.DeviceDescription,
|
||||
IrpContext->FileOp->DeviceExtension->CollectionNumber);
|
||||
ASSERT(CollectionDescription);
|
||||
|
||||
//
|
||||
// get report description
|
||||
//
|
||||
ReportDescription = HidClassPDO_GetReportDescription(&IrpContext->FileOp->DeviceExtension->Common.DeviceDescription, IrpContext->FileOp->DeviceExtension->CollectionNumber);
|
||||
ReportDescription = HidClassPDO_GetReportDescription(&IrpContext->FileOp->DeviceExtension->Common.DeviceDescription,
|
||||
IrpContext->FileOp->DeviceExtension->CollectionNumber);
|
||||
ASSERT(ReportDescription);
|
||||
|
||||
if (CollectionDescription && ReportDescription)
|
||||
|
@ -638,13 +636,15 @@ HidClass_BuildIrp(
|
|||
//
|
||||
// get collection description
|
||||
//
|
||||
CollectionDescription = HidClassPDO_GetCollectionDescription(&IrpContext->FileOp->DeviceExtension->Common.DeviceDescription, IrpContext->FileOp->DeviceExtension->CollectionNumber);
|
||||
CollectionDescription = HidClassPDO_GetCollectionDescription(&IrpContext->FileOp->DeviceExtension->Common.DeviceDescription,
|
||||
IrpContext->FileOp->DeviceExtension->CollectionNumber);
|
||||
ASSERT(CollectionDescription);
|
||||
|
||||
//
|
||||
// get report description
|
||||
//
|
||||
ReportDescription = HidClassPDO_GetReportDescription(&IrpContext->FileOp->DeviceExtension->Common.DeviceDescription, IrpContext->FileOp->DeviceExtension->CollectionNumber);
|
||||
ReportDescription = HidClassPDO_GetReportDescription(&IrpContext->FileOp->DeviceExtension->Common.DeviceDescription,
|
||||
IrpContext->FileOp->DeviceExtension->CollectionNumber);
|
||||
ASSERT(ReportDescription);
|
||||
|
||||
//
|
||||
|
@ -664,7 +664,6 @@ HidClass_BuildIrp(
|
|||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// store report length
|
||||
//
|
||||
|
@ -712,7 +711,6 @@ HidClass_BuildIrp(
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
HidClass_Read(
|
||||
|
@ -764,14 +762,18 @@ HidClass_Read(
|
|||
Irp->IoStatus.Status = STATUS_CANCELLED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_CANCELLED;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// build irp request
|
||||
//
|
||||
Status = HidClass_BuildIrp(DeviceObject, Irp, Context, IOCTL_HID_READ_REPORT, IoStack->Parameters.Read.Length, &NewIrp, &NewIrpContext);
|
||||
Status = HidClass_BuildIrp(DeviceObject,
|
||||
Irp,
|
||||
Context,
|
||||
IOCTL_HID_READ_REPORT,
|
||||
IoStack->Parameters.Read.Length,
|
||||
&NewIrp,
|
||||
&NewIrpContext);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
//
|
||||
|
@ -814,7 +816,7 @@ HidClass_Read(
|
|||
IoMarkIrpPending(Irp);
|
||||
|
||||
//
|
||||
// lets dispatch the request
|
||||
// let's dispatch the request
|
||||
//
|
||||
ASSERT(Context->DeviceExtension);
|
||||
Status = Context->DeviceExtension->Common.DriverExtension->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL](Context->DeviceExtension->FDODeviceObject, NewIrp);
|
||||
|
@ -907,7 +909,8 @@ HidClass_DeviceControl(
|
|||
//
|
||||
// get collection description
|
||||
//
|
||||
CollectionDescription = HidClassPDO_GetCollectionDescription(&CommonDeviceExtension->DeviceDescription, PDODeviceExtension->CollectionNumber);
|
||||
CollectionDescription = HidClassPDO_GetCollectionDescription(&CommonDeviceExtension->DeviceDescription,
|
||||
PDODeviceExtension->CollectionNumber);
|
||||
ASSERT(CollectionDescription);
|
||||
|
||||
//
|
||||
|
@ -932,7 +935,8 @@ HidClass_DeviceControl(
|
|||
//
|
||||
// get collection description
|
||||
//
|
||||
CollectionDescription = HidClassPDO_GetCollectionDescription(&CommonDeviceExtension->DeviceDescription, PDODeviceExtension->CollectionNumber);
|
||||
CollectionDescription = HidClassPDO_GetCollectionDescription(&CommonDeviceExtension->DeviceDescription,
|
||||
PDODeviceExtension->CollectionNumber);
|
||||
ASSERT(CollectionDescription);
|
||||
|
||||
//
|
||||
|
@ -985,7 +989,6 @@ HidClass_InternalDeviceControl(
|
|||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
HidClass_Power(
|
||||
|
@ -1134,7 +1137,9 @@ HidRegisterMinidriver(
|
|||
DriverExtension->DriverUnload = MinidriverRegistration->DriverObject->DriverUnload;
|
||||
|
||||
/* copy driver dispatch routines */
|
||||
RtlCopyMemory(DriverExtension->MajorFunction, MinidriverRegistration->DriverObject->MajorFunction, sizeof(PDRIVER_DISPATCH) * (IRP_MJ_MAXIMUM_FUNCTION+1));
|
||||
RtlCopyMemory(DriverExtension->MajorFunction,
|
||||
MinidriverRegistration->DriverObject->MajorFunction,
|
||||
sizeof(PDRIVER_DISPATCH) * (IRP_MJ_MAXIMUM_FUNCTION+1));
|
||||
|
||||
/* initialize lock */
|
||||
KeInitializeSpinLock(&DriverExtension->Lock);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* Michael Martin (michael.martin@reactos.org)
|
||||
* Johannes Anderwald (johannes.anderwald@reactos.org)
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
PHIDP_COLLECTION_DESC
|
||||
|
@ -290,7 +291,6 @@ HidClassPDO_HandleQueryInstanceId(
|
|||
PDODeviceExtension = (PHIDCLASS_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
ASSERT(PDODeviceExtension->Common.IsFDO == FALSE);
|
||||
|
||||
|
||||
//
|
||||
// allocate buffer
|
||||
//
|
||||
|
@ -426,7 +426,9 @@ HidClassPDO_PnP(
|
|||
//
|
||||
// copy capabilities
|
||||
//
|
||||
RtlCopyMemory(IoStack->Parameters.DeviceCapabilities.Capabilities, &PDODeviceExtension->Capabilities, sizeof(DEVICE_CAPABILITIES));
|
||||
RtlCopyMemory(IoStack->Parameters.DeviceCapabilities.Capabilities,
|
||||
&PDODeviceExtension->Capabilities,
|
||||
sizeof(DEVICE_CAPABILITIES));
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
@ -510,7 +512,10 @@ HidClassPDO_PnP(
|
|||
//
|
||||
// now register the device interface
|
||||
//
|
||||
Status = IoRegisterDeviceInterface(PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject, &GUID_DEVINTERFACE_HID, NULL, &PDODeviceExtension->DeviceInterface);
|
||||
Status = IoRegisterDeviceInterface(PDODeviceExtension->Common.HidDeviceExtension.PhysicalDeviceObject,
|
||||
&GUID_DEVINTERFACE_HID,
|
||||
NULL,
|
||||
&PDODeviceExtension->DeviceInterface);
|
||||
DPRINT("[HIDCLASS] IoRegisterDeviceInterfaceState Status %x\n", Status);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -659,15 +664,21 @@ HidClassPDO_CreatePDO(
|
|||
RtlZeroMemory(DeviceRelations, Length);
|
||||
|
||||
//
|
||||
// lets create a PDO for top level collection
|
||||
// let's create a PDO for top level collection
|
||||
//
|
||||
Index = 0;
|
||||
do
|
||||
{
|
||||
//
|
||||
// lets create the device object
|
||||
// let's create the device object
|
||||
//
|
||||
Status = IoCreateDevice(FDODeviceExtension->Common.DriverExtension->DriverObject, sizeof(HIDCLASS_PDO_DEVICE_EXTENSION), NULL, FILE_DEVICE_UNKNOWN, FILE_AUTOGENERATED_DEVICE_NAME, FALSE, &PDODeviceObject);
|
||||
Status = IoCreateDevice(FDODeviceExtension->Common.DriverExtension->DriverObject,
|
||||
sizeof(HIDCLASS_PDO_DEVICE_EXTENSION),
|
||||
NULL,
|
||||
FILE_DEVICE_UNKNOWN,
|
||||
FILE_AUTOGENERATED_DEVICE_NAME,
|
||||
FALSE,
|
||||
&PDODeviceObject);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue