Author: tfaber Date: Sun May 12 15:31:01 2013 New Revision: 59004
URL: http://svn.reactos.org/svn/reactos?rev=59004&view=rev Log: [HIDCLASS] - Remove unnecessary casts - Fix DllInitialize/DllUnload prototype
Modified: trunk/reactos/drivers/hid/hidclass/fdo.c trunk/reactos/drivers/hid/hidclass/hidclass.c trunk/reactos/drivers/hid/hidclass/pdo.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 15:31:01 2013 @@ -42,7 +42,7 @@ // // get device extension // - FDODeviceExtension = (PHIDCLASS_FDO_EXTENSION)DeviceObject->DeviceExtension; + FDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(FDODeviceExtension->Common.IsFDO);
// @@ -77,7 +77,7 @@ // // set completion routine // - IoSetCompletionRoutine(Irp, HidClassFDO_QueryCapabilitiesCompletionRoutine, (PVOID)&Event, TRUE, TRUE, TRUE); + IoSetCompletionRoutine(Irp, HidClassFDO_QueryCapabilitiesCompletionRoutine, &Event, TRUE, TRUE, TRUE);
// // init capabilities @@ -158,7 +158,7 @@ // // get device extension // - CommonDeviceExtension = (PHIDCLASS_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + CommonDeviceExtension = DeviceObject->DeviceExtension;
// // set completion routine @@ -218,7 +218,7 @@ // // get device extension // - FDODeviceExtension = (PHIDCLASS_FDO_EXTENSION)DeviceObject->DeviceExtension; + FDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(FDODeviceExtension->Common.IsFDO);
// @@ -343,7 +343,7 @@ // // get device extension // - FDODeviceExtension = (PHIDCLASS_FDO_EXTENSION)DeviceObject->DeviceExtension; + FDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(FDODeviceExtension->Common.IsFDO);
// @@ -438,7 +438,7 @@ // // get device extension // - FDODeviceExtension = (PHIDCLASS_FDO_EXTENSION)DeviceObject->DeviceExtension; + FDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(FDODeviceExtension->Common.IsFDO);
// @@ -495,7 +495,7 @@ // // get device extension // - FDODeviceExtension = (PHIDCLASS_FDO_EXTENSION)DeviceObject->DeviceExtension; + FDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(FDODeviceExtension->Common.IsFDO);
// @@ -566,7 +566,7 @@ // // get device extension // - FDODeviceExtension = (PHIDCLASS_FDO_EXTENSION)DeviceObject->DeviceExtension; + FDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(FDODeviceExtension->Common.IsFDO);
//
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 15:31:01 2013 @@ -13,18 +13,19 @@ static LPWSTR ClientIdentificationAddress = L"HIDCLASS"; static ULONG HidClassDeviceNumber = 0;
-ULONG -NTAPI -DllInitialize(ULONG Unknown) -{ - return 0; -} - -ULONG -NTAPI -DllUnload() -{ - return 0; +NTSTATUS +NTAPI +DllInitialize( + IN PUNICODE_STRING RegistryPath) +{ + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +DllUnload(VOID) +{ + return STATUS_SUCCESS; }
NTSTATUS @@ -51,7 +52,7 @@ RtlInitUnicodeString(&DeviceName, CharDeviceName);
/* get driver object extension */ - DriverExtension = (PHIDCLASS_DRIVER_EXTENSION) IoGetDriverObjectExtension(DriverObject, ClientIdentificationAddress); + DriverExtension = IoGetDriverObjectExtension(DriverObject, ClientIdentificationAddress); if (!DriverExtension) { /* device removed */ @@ -72,7 +73,7 @@ }
/* get device extension */ - FDODeviceExtension = (PHIDCLASS_FDO_EXTENSION)NewDeviceObject->DeviceExtension; + FDODeviceExtension = NewDeviceObject->DeviceExtension;
/* zero device extension */ RtlZeroMemory(FDODeviceExtension, sizeof(HIDCLASS_FDO_EXTENSION)); @@ -139,7 +140,7 @@ // // get device extension // - CommonDeviceExtension = (PHIDCLASS_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + CommonDeviceExtension = DeviceObject->DeviceExtension; if (CommonDeviceExtension->IsFDO) { #ifndef __REACTOS__ @@ -169,7 +170,7 @@ // // get device extension // - PDODeviceExtension = (PHIDCLASS_PDO_DEVICE_EXTENSION)CommonDeviceExtension; + PDODeviceExtension = DeviceObject->DeviceExtension;
// // get stack location @@ -208,7 +209,7 @@ // store context // ASSERT(IoStack->FileObject); - IoStack->FileObject->FsContext = (PVOID)Context; + IoStack->FileObject->FsContext = Context;
// // done @@ -235,7 +236,7 @@ // // get device extension // - CommonDeviceExtension = (PHIDCLASS_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + CommonDeviceExtension = DeviceObject->DeviceExtension;
// // is it a FDO request @@ -264,7 +265,7 @@ // // get irp context // - IrpContext = (PHIDCLASS_FILEOP_CONTEXT)IoStack->FileObject->FsContext; + IrpContext = IoStack->FileObject->FsContext; ASSERT(IrpContext);
// @@ -322,7 +323,7 @@ // // get irp // - ListIrp = (PIRP)CONTAINING_RECORD(Entry, IRP, Tail.Overlay.ListEntry); + ListIrp = CONTAINING_RECORD(Entry, IRP, Tail.Overlay.ListEntry);
// // free the irp @@ -396,7 +397,7 @@ // // get irp context // - IrpContext = (PHIDCLASS_IRP_CONTEXT)Ctx; + IrpContext = Ctx;
DPRINT("HidClass_ReadCompleteIrp Irql %lu\n", KeGetCurrentIrql()); DPRINT("HidClass_ReadCompleteIrp Status %lx\n", Irp->IoStatus.Status); @@ -414,7 +415,7 @@ // // get address // - Address = (PUCHAR)HidClass_GetSystemAddress(IrpContext->OriginalIrp->MdlAddress); + Address = HidClass_GetSystemAddress(IrpContext->OriginalIrp->MdlAddress); if (Address) { // @@ -550,7 +551,7 @@ // // get irp // - Irp = (PIRP)CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry); + Irp = CONTAINING_RECORD(ListEntry, IRP, Tail.Overlay.ListEntry); }
// @@ -610,7 +611,7 @@ // // allocate completion context // - IrpContext = (PHIDCLASS_IRP_CONTEXT)ExAllocatePool(NonPagedPool, sizeof(HIDCLASS_IRP_CONTEXT)); + IrpContext = ExAllocatePool(NonPagedPool, sizeof(HIDCLASS_IRP_CONTEXT)); if (!IrpContext) { // @@ -623,7 +624,7 @@ // // get device extension // - PDODeviceExtension = (PHIDCLASS_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + PDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(PDODeviceExtension->Common.IsFDO == FALSE);
// @@ -733,7 +734,7 @@ // // get device extension // - CommonDeviceExtension = (PHIDCLASS_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + CommonDeviceExtension = DeviceObject->DeviceExtension; ASSERT(CommonDeviceExtension->IsFDO == FALSE);
// @@ -745,7 +746,7 @@ // // get context // - Context = (PHIDCLASS_FILEOP_CONTEXT)IoStack->FileObject->FsContext; + Context = IoStack->FileObject->FsContext; ASSERT(Context);
// @@ -855,7 +856,7 @@ // // get device extension // - CommonDeviceExtension = (PHIDCLASS_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + CommonDeviceExtension = DeviceObject->DeviceExtension;
// // only PDO are supported @@ -876,7 +877,7 @@ // // get pdo device extension // - PDODeviceExtension = (PHIDCLASS_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + PDODeviceExtension = DeviceObject->DeviceExtension;
// // get stack location @@ -903,7 +904,7 @@ // // get output buffer // - CollectionInformation = (PHID_COLLECTION_INFORMATION)Irp->AssociatedIrp.SystemBuffer; + CollectionInformation = Irp->AssociatedIrp.SystemBuffer; ASSERT(CollectionInformation);
// @@ -1010,7 +1011,7 @@ // // get common device extension // - CommonDeviceExtension = (PHIDCLASS_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + CommonDeviceExtension = DeviceObject->DeviceExtension;
// // check type of device object @@ -1042,7 +1043,7 @@ // // get common device extension // - CommonDeviceExtension = (PHIDCLASS_COMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + CommonDeviceExtension = DeviceObject->DeviceExtension;
// // FIXME: support PDO
Modified: trunk/reactos/drivers/hid/hidclass/pdo.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/pdo.c?... ============================================================================== --- trunk/reactos/drivers/hid/hidclass/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/hidclass/pdo.c [iso-8859-1] Sun May 12 15:31:01 2013 @@ -152,7 +152,7 @@ // // get device extension // - PDODeviceExtension = (PHIDCLASS_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + PDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(PDODeviceExtension->Common.IsFDO == FALSE);
// @@ -288,7 +288,7 @@ // // get device extension // - PDODeviceExtension = (PHIDCLASS_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + PDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(PDODeviceExtension->Common.IsFDO == FALSE);
// @@ -359,7 +359,7 @@ // // get device extension // - PDODeviceExtension = (PHIDCLASS_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + PDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(PDODeviceExtension->Common.IsFDO == FALSE);
// @@ -406,7 +406,7 @@ Status = HidClassPDO_HandleQueryCompatibleId(DeviceObject, Irp); break; } - + DPRINT1("[HIDCLASS]: IRP_MN_QUERY_ID IdType %x unimplemented\n", IoStack->Parameters.QueryId.IdType); Status = STATUS_NOT_SUPPORTED; Irp->IoStatus.Information = 0; @@ -642,7 +642,7 @@ // // get device extension // - FDODeviceExtension = (PHIDCLASS_FDO_EXTENSION)DeviceObject->DeviceExtension; + FDODeviceExtension = DeviceObject->DeviceExtension; ASSERT(FDODeviceExtension->Common.IsFDO);
// @@ -696,7 +696,7 @@ // // get device extension // - PDODeviceExtension = (PHIDCLASS_PDO_DEVICE_EXTENSION)PDODeviceObject->DeviceExtension; + PDODeviceExtension = PDODeviceObject->DeviceExtension;
// // init device extension