- fixed uninitialized variable warning

- ProbeAndCaptureUnicodeString should check if allocating memory succeeded

svn path=/trunk/; revision=18061
This commit is contained in:
Thomas Bluemel 2005-09-25 17:49:14 +00:00
parent 18494d1af0
commit 2148ae3457
2 changed files with 10 additions and 5 deletions

View file

@ -130,11 +130,16 @@ ProbeAndCaptureUnicodeString(OUT PUNICODE_STRING Dest,
/* Allocate space for the buffer */
Buffer = ExAllocatePool(PagedPool, Dest->MaximumLength);
/* Copy it */
RtlCopyMemory(Buffer, Dest->Buffer, Dest->MaximumLength);
if (Buffer != NULL)
{
/* Copy it */
RtlCopyMemory(Buffer, Dest->Buffer, Dest->MaximumLength);
/* Set it as the buffer */
Dest->Buffer = Buffer;
/* Set it as the buffer */
Dest->Buffer = Buffer;
}
else
Status = STATUS_INSUFFICIENT_RESOURCES;
/* Return */
return Status;

View file

@ -1852,7 +1852,7 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
RTL_QUERY_REGISTRY_TABLE QueryTable[3];
UNICODE_STRING ImagePath;
UNICODE_STRING ServiceName;
UNICODE_STRING CapturedDriverServiceName;
UNICODE_STRING CapturedDriverServiceName = {0};
KPROCESSOR_MODE PreviousMode;
NTSTATUS Status;
ULONG Type;