Author: tfaber Date: Sun May 12 17:16:41 2013 New Revision: 59008
URL: http://svn.reactos.org/svn/reactos?rev=59008&view=rev Log: [HIDCLASS] - Get rid of HidClass_GetSystemAddress - More minor fixes
Modified: trunk/reactos/drivers/hid/hidclass/fdo.c trunk/reactos/drivers/hid/hidclass/hidclass.c
Modified: trunk/reactos/drivers/hid/hidclass/fdo.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/fdo.c?... ============================================================================== --- trunk/reactos/drivers/hid/hidclass/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/hidclass/fdo.c [iso-8859-1] Sun May 12 17:16:41 2013 @@ -20,7 +20,7 @@ // // set event // - KeSetEvent((PRKEVENT)Context, 0, FALSE); + KeSetEvent(Context, 0, FALSE);
// // completion is done in the HidClassFDO_QueryCapabilities routine @@ -131,7 +131,7 @@ // // signal event // - KeSetEvent((PRKEVENT)Context, 0, FALSE); + KeSetEvent(Context, 0, FALSE);
// // done @@ -447,7 +447,7 @@ // allocate result // DeviceRelations = ExAllocatePoolWithTag(NonPagedPool, - sizeof(DEVICE_RELATIONS) + (FDODeviceExtension->DeviceRelations->Count-1) * sizeof(PDEVICE_OBJECT), + sizeof(DEVICE_RELATIONS) + (FDODeviceExtension->DeviceRelations->Count - 1) * sizeof(PDEVICE_OBJECT), HIDCLASS_TAG); if (!DeviceRelations) {
Modified: trunk/reactos/drivers/hid/hidclass/hidclass.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/hidcla... ============================================================================== --- trunk/reactos/drivers/hid/hidclass/hidclass.c [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/hidclass/hidclass.c [iso-8859-1] Sun May 12 17:16:41 2013 @@ -354,31 +354,6 @@ return STATUS_SUCCESS; }
-PVOID -HidClass_GetSystemAddress( - IN PMDL ReportMDL) -{ - // - // sanity check - // - ASSERT(ReportMDL); - - if (ReportMDL->MdlFlags & (MDL_SOURCE_IS_NONPAGED_POOL | MDL_MAPPED_TO_SYSTEM_VA)) - { - // - // buffer is non paged pool - // - return ReportMDL->MappedSystemVa; - } - else - { - // - // map mdl - // - return MmMapLockedPages(ReportMDL, KernelMode); - } -} - NTSTATUS NTAPI HidClass_ReadCompleteIrp( @@ -415,7 +390,7 @@ // // get address // - Address = HidClass_GetSystemAddress(IrpContext->OriginalIrp->MdlAddress); + Address = MmGetSystemAddressForMdlSafe(IrpContext->OriginalIrp->MdlAddress, NormalPagePriority); if (Address) { // @@ -1060,7 +1035,6 @@ // return IoCallDriver(CommonDeviceExtension->HidDeviceExtension.NextDeviceObject, Irp); } -
NTSTATUS NTAPI @@ -1119,7 +1093,10 @@ }
/* now allocate the driver object extension */ - Status = IoAllocateDriverObjectExtension(MinidriverRegistration->DriverObject, (PVOID)ClientIdentificationAddress, sizeof(HIDCLASS_DRIVER_EXTENSION), (PVOID*)&DriverExtension); + Status = IoAllocateDriverObjectExtension(MinidriverRegistration->DriverObject, + ClientIdentificationAddress, + sizeof(HIDCLASS_DRIVER_EXTENSION), + (PVOID *)&DriverExtension); if (!NT_SUCCESS(Status)) { /* failed to allocate driver extension */ @@ -1140,7 +1117,7 @@ /* copy driver dispatch routines */ RtlCopyMemory(DriverExtension->MajorFunction, MinidriverRegistration->DriverObject->MajorFunction, - sizeof(PDRIVER_DISPATCH) * (IRP_MJ_MAXIMUM_FUNCTION+1)); + sizeof(PDRIVER_DISPATCH) * (IRP_MJ_MAXIMUM_FUNCTION + 1));
/* initialize lock */ KeInitializeSpinLock(&DriverExtension->Lock);