- Fix a bug which was responsible for most audio-related crashes

- Found by DosX (Gregor Schneider)
- Fix memory leak

See issue #4674 for more details.

svn path=/trunk/; revision=41835
This commit is contained in:
Johannes Anderwald 2009-07-09 21:49:04 +00:00
parent 2d834b1bdd
commit d50238833b
2 changed files with 6 additions and 4 deletions

View file

@ -19,7 +19,7 @@ KspCreateObjectType(
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING Name;
Name.Length = (wcslen(ObjectType) + 1) * sizeof(WCHAR) + CreateParametersSize;
Name.Length = Name.MaximumLength = (wcslen(ObjectType) + 1) * sizeof(WCHAR) + CreateParametersSize;
Name.MaximumLength += sizeof(WCHAR);
Name.Buffer = ExAllocatePool(NonPagedPool, Name.MaximumLength);
@ -52,8 +52,7 @@ KspCreateObjectType(
NULL,
IO_NO_PARAMETER_CHECKING | IO_FORCE_ACCESS_CHECK);
// HACK HACK HACK HACK
//ExFreePool(Name.Buffer);
ExFreePool(Name.Buffer);
return Status;
}

View file

@ -42,7 +42,7 @@ KspCreateObjectType(
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING Name;
Name.Length = (wcslen(ObjectType) + 1) * sizeof(WCHAR) + CreateParametersSize;
Name.Length = Name.MaximumLength = (wcslen(ObjectType) + 1) * sizeof(WCHAR) + CreateParametersSize;
Name.MaximumLength += sizeof(WCHAR);
Name.Buffer = ExAllocatePool(NonPagedPool, Name.MaximumLength);
@ -75,6 +75,8 @@ KspCreateObjectType(
NULL,
IO_NO_PARAMETER_CHECKING | IO_FORCE_ACCESS_CHECK);
ExFreePool(Name.Buffer);
return Status;
}
@ -984,6 +986,7 @@ SysAudioHandleProperty(
RtlStringFromGUID(&Property->Set, &GuidString);
DPRINT1("Unhandeled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags);
DbgBreakPoint();
RtlFreeUnicodeString(&GuidString);
return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0);
}