[MMIXER] Fix additional data size initialization for different audio formats (#6753)
[reactos.git] / drivers / usb / usbccgp / misc.c
index 89a8ed9..9242fcf 100644 (file)
@@ -11,6 +11,9 @@
 
 #include "usbccgp.h"
 
+#define NDEBUG
+#include <debug.h>
+
 /* Driver verifier */
 IO_COMPLETION_ROUTINE SyncForwardIrpCompletionRoutine;
 
@@ -28,46 +31,6 @@ USBSTOR_SyncForwardIrpCompletionRoutine(
     return STATUS_MORE_PROCESSING_REQUIRED;
 }
 
-NTSTATUS
-NTAPI
-USBCCGP_SyncForwardIrp(
-    PDEVICE_OBJECT DeviceObject,
-    PIRP Irp)
-{
-    KEVENT Event;
-    NTSTATUS Status;
-
-    /* Initialize event */
-    KeInitializeEvent(&Event, NotificationEvent, FALSE);
-
-    /* Copy irp stack location */
-    IoCopyCurrentIrpStackLocationToNext(Irp);
-
-    /* Set completion routine */
-    IoSetCompletionRoutine(Irp,
-                           USBSTOR_SyncForwardIrpCompletionRoutine,
-                           &Event,
-                           TRUE,
-                           TRUE,
-                           TRUE);
-
-    /* Call driver */
-    Status = IoCallDriver(DeviceObject, Irp);
-
-    /* Check if pending */
-    if (Status == STATUS_PENDING)
-    {
-        /* Wait for the request to finish */
-        KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
-
-        /* Copy status code */
-        Status = Irp->IoStatus.Status;
-    }
-
-    /* Done */
-    return Status;
-}
-
 NTSTATUS
 USBCCGP_SyncUrbRequest(
     IN PDEVICE_OBJECT DeviceObject,
@@ -132,17 +95,8 @@ AllocateItem(
     IN POOL_TYPE PoolType,
     IN ULONG ItemSize)
 {
-    /* Allocate item */
-    PVOID Item = ExAllocatePoolWithTag(PoolType, ItemSize, USBCCPG_TAG);
-
-    if (Item)
-    {
-        /* Zero item */
-        RtlZeroMemory(Item, ItemSize);
-    }
-
-    /* Return element */
-    return Item;
+    /* Allocate, zero and return item */
+    return ExAllocatePoolZero(PoolType, ItemSize, USBCCPG_TAG);
 }
 
 VOID
@@ -160,31 +114,30 @@ DumpFunctionDescriptor(
 {
     ULONG Index, SubIndex;
 
-
-    DPRINT1("FunctionCount %lu\n", FunctionDescriptorCount);
+    DPRINT("FunctionCount %lu\n", FunctionDescriptorCount);
     for (Index = 0; Index < FunctionDescriptorCount; Index++)
     {
-        DPRINT1("Function %lu\n", Index);
-        DPRINT1("FunctionNumber %lu\n", FunctionDescriptor[Index].FunctionNumber);
-        DPRINT1("HardwareId %S\n", FunctionDescriptor[Index].HardwareId.Buffer);
-        DPRINT1("CompatibleId %S\n", FunctionDescriptor[Index].CompatibleId.Buffer);
-        DPRINT1("FunctionDescription %wZ\n", &FunctionDescriptor[Index].FunctionDescription);
-        DPRINT1("NumInterfaces %lu\n", FunctionDescriptor[Index].NumberOfInterfaces);
+        DPRINT("Function %lu\n", Index);
+        DPRINT("FunctionNumber %lu\n", FunctionDescriptor[Index].FunctionNumber);
+        DPRINT("HardwareId %S\n", FunctionDescriptor[Index].HardwareId.Buffer);
+        DPRINT("CompatibleId %S\n", FunctionDescriptor[Index].CompatibleId.Buffer);
+        DPRINT("FunctionDescription %wZ\n", &FunctionDescriptor[Index].FunctionDescription);
+        DPRINT("NumInterfaces %lu\n", FunctionDescriptor[Index].NumberOfInterfaces);
 
         for(SubIndex = 0; SubIndex < FunctionDescriptor[Index].NumberOfInterfaces; SubIndex++)
         {
-            DPRINT1(" Index %lu Interface %p\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]);
-            DPRINT1(" Index %lu Interface InterfaceNumber %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceNumber);
-            DPRINT1(" Index %lu Interface Alternate %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bAlternateSetting );
-            DPRINT1(" Index %lu bLength %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bLength);
-            DPRINT1(" Index %lu bDescriptorType %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bDescriptorType);
-            DPRINT1(" Index %lu bInterfaceNumber %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceNumber);
-            DPRINT1(" Index %lu bAlternateSetting %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bAlternateSetting);
-            DPRINT1(" Index %lu bNumEndpoints %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bNumEndpoints);
-            DPRINT1(" Index %lu bInterfaceClass %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceClass);
-            DPRINT1(" Index %lu bInterfaceSubClass %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceSubClass);
-            DPRINT1(" Index %lu bInterfaceProtocol %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceProtocol);
-            DPRINT1(" Index %lu iInterface %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->iInterface);
+            DPRINT(" Index %lu Interface %p\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]);
+            DPRINT(" Index %lu Interface InterfaceNumber %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceNumber);
+            DPRINT(" Index %lu Interface Alternate %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bAlternateSetting );
+            DPRINT(" Index %lu bLength %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bLength);
+            DPRINT(" Index %lu bDescriptorType %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bDescriptorType);
+            DPRINT(" Index %lu bInterfaceNumber %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceNumber);
+            DPRINT(" Index %lu bAlternateSetting %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bAlternateSetting);
+            DPRINT(" Index %lu bNumEndpoints %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bNumEndpoints);
+            DPRINT(" Index %lu bInterfaceClass %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceClass);
+            DPRINT(" Index %lu bInterfaceSubClass %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceSubClass);
+            DPRINT(" Index %lu bInterfaceProtocol %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->bInterfaceProtocol);
+            DPRINT(" Index %lu iInterface %x\n", SubIndex, FunctionDescriptor[Index].InterfaceDescriptorList[SubIndex]->iInterface);
         }
     }
-}
\ No newline at end of file
+}