mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
[USBAUDIO]
- fix warnings & leaks based on Thomas feedback svn path=/trunk/; revision=73020
This commit is contained in:
parent
d0b74180b2
commit
5dc6c5bb88
2 changed files with 13 additions and 10 deletions
|
@ -1083,6 +1083,11 @@ USBAudioGetDescriptor(
|
||||||
/* store result */
|
/* store result */
|
||||||
*OutDescriptor = Descriptor;
|
*OutDescriptor = Descriptor;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* failed */
|
||||||
|
FreeFunction(Descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
/* done */
|
/* done */
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -1098,7 +1103,6 @@ USBAudioGetStringDescriptor(
|
||||||
OUT PVOID *OutDescriptor)
|
OUT PVOID *OutDescriptor)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PUSB_STRING_DESCRIPTOR StringDescriptor;
|
|
||||||
|
|
||||||
/* retrieve descriptor */
|
/* retrieve descriptor */
|
||||||
Status = USBAudioGetDescriptor(DeviceObject, USB_STRING_DESCRIPTOR_TYPE, DescriptorLength, DescriptorIndex, LanguageId, OutDescriptor);
|
Status = USBAudioGetDescriptor(DeviceObject, USB_STRING_DESCRIPTOR_TYPE, DescriptorLength, DescriptorIndex, LanguageId, OutDescriptor);
|
||||||
|
@ -1124,14 +1128,14 @@ USBAudioRegCreateMediaCategoriesKey(
|
||||||
RtlInitUnicodeString(&DestinationString, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\MediaCategories\\");
|
RtlInitUnicodeString(&DestinationString, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\MediaCategories\\");
|
||||||
|
|
||||||
/* initialize object attributes */
|
/* initialize object attributes */
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &DestinationString, OBJ_CASE_INSENSITIVE | OBJ_OPENIF, NULL, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &DestinationString, OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_KERNEL_HANDLE, NULL, NULL);
|
||||||
|
|
||||||
/* create the key */
|
/* create the key */
|
||||||
Status = ZwOpenKey(&Handle, KEY_ALL_ACCESS, &ObjectAttributes);
|
Status = ZwOpenKey(&Handle, KEY_ALL_ACCESS, &ObjectAttributes);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* initialize object attributes */
|
/* initialize object attributes */
|
||||||
InitializeObjectAttributes(&ObjectAttributes, Name, OBJ_CASE_INSENSITIVE, Handle, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, Name, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, Handle, NULL);
|
||||||
|
|
||||||
Status = ZwCreateKey(OutHandle, KEY_ALL_ACCESS, &ObjectAttributes, 0, NULL, 0, NULL);
|
Status = ZwCreateKey(OutHandle, KEY_ALL_ACCESS, &ObjectAttributes, 0, NULL, 0, NULL);
|
||||||
ZwClose(Handle);
|
ZwClose(Handle);
|
||||||
|
@ -1228,8 +1232,8 @@ USBAudioCreateFilterContext(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* failed*/
|
/* failed*/
|
||||||
//FreeFunction(ComponentId);
|
FreeFunction(ComponentId);
|
||||||
//return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
FilterDescriptor->ComponentId = ComponentId;
|
FilterDescriptor->ComponentId = ComponentId;
|
||||||
|
|
||||||
|
@ -1247,8 +1251,8 @@ USBAudioCreateFilterContext(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* failed*/
|
/* failed*/
|
||||||
//FreeFunction(ComponentId);
|
FreeFunction(ComponentId);
|
||||||
//return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lets create the filter */
|
/* lets create the filter */
|
||||||
|
|
|
@ -789,7 +789,6 @@ PinCaptureProcess(
|
||||||
PPIN_CONTEXT PinContext;
|
PPIN_CONTEXT PinContext;
|
||||||
PLIST_ENTRY CurEntry;
|
PLIST_ENTRY CurEntry;
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
PIO_STACK_LOCATION IoStack;
|
|
||||||
PURB Urb;
|
PURB Urb;
|
||||||
PUCHAR TransferBuffer, OutBuffer;
|
PUCHAR TransferBuffer, OutBuffer;
|
||||||
ULONG Offset, Length;
|
ULONG Offset, Length;
|
||||||
|
@ -827,7 +826,6 @@ PinCaptureProcess(
|
||||||
Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry);
|
Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry);
|
||||||
|
|
||||||
/* get urb from irp */
|
/* get urb from irp */
|
||||||
IoStack = IoGetNextIrpStackLocation(Irp);
|
|
||||||
Urb = (PURB)Irp->Tail.Overlay.DriverContext[0];
|
Urb = (PURB)Irp->Tail.Overlay.DriverContext[0];
|
||||||
ASSERT(Urb);
|
ASSERT(Urb);
|
||||||
|
|
||||||
|
@ -882,6 +880,7 @@ PinCaptureProcess(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = KsStreamPointerAdvanceOffsets(LeadingStreamPointer, 0, Length, FALSE);
|
Status = KsStreamPointerAdvanceOffsets(LeadingStreamPointer, 0, Length, FALSE);
|
||||||
|
NT_ASSERT(NT_SUCCESS(Status));
|
||||||
ASSERT(Length == Urb->UrbIsochronousTransfer.TransferBufferLength - Offset);
|
ASSERT(Length == Urb->UrbIsochronousTransfer.TransferBufferLength - Offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1102,7 +1101,7 @@ UsbAudioPinDataIntersect(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get pin descriptor */
|
/* get pin descriptor */
|
||||||
PinDescriptor = &Filter->Descriptor->PinDescriptors[Pin->PinId];
|
PinDescriptor = (PKSPIN_DESCRIPTOR_EX)&Filter->Descriptor->PinDescriptors[Pin->PinId];
|
||||||
|
|
||||||
*DataSize = sizeof(KSDATAFORMAT_WAVEFORMATEX);
|
*DataSize = sizeof(KSDATAFORMAT_WAVEFORMATEX);
|
||||||
if (DataBufferSize == 0)
|
if (DataBufferSize == 0)
|
||||||
|
|
Loading…
Reference in a new issue