RtlFreeUnicodeString -> ExFreePool changes

svn path=/trunk/; revision=15021
This commit is contained in:
Hervé Poussineau 2005-05-05 20:19:01 +00:00
parent 6758bb095b
commit cb0daf73fd
6 changed files with 27 additions and 27 deletions

View file

@ -125,14 +125,14 @@ InitSystemSharedUserPage (PCSZ ParameterLine)
&ObjectAttributes); &ObjectAttributes);
/* Free the String */ /* Free the String */
RtlFreeUnicodeString(&ArcName); ExFreePool(ArcName.Buffer);
/* Check for Success */ /* Check for Success */
if (!NT_SUCCESS(Status)) { if (!NT_SUCCESS(Status)) {
/* Free the Strings */ /* Free the Strings */
RtlFreeUnicodeString(&BootPath); RtlFreeUnicodeString(&BootPath);
RtlFreeUnicodeString(&ArcDeviceName); ExFreePool(ArcDeviceName.Buffer);
CPRINT("NtOpenSymbolicLinkObject() failed (Status %x)\n", Status); CPRINT("NtOpenSymbolicLinkObject() failed (Status %x)\n", Status);
KEBUGCHECK(0); KEBUGCHECK(0);
} }
@ -148,7 +148,7 @@ InitSystemSharedUserPage (PCSZ ParameterLine)
/* Free the Strings */ /* Free the Strings */
RtlFreeUnicodeString(&BootPath); RtlFreeUnicodeString(&BootPath);
RtlFreeUnicodeString(&ArcDeviceName); ExFreePool(ArcDeviceName.Buffer);
CPRINT("NtQuerySymbolicLinkObject() failed (Status %x)\n", Status); CPRINT("NtQuerySymbolicLinkObject() failed (Status %x)\n", Status);
KEBUGCHECK(0); KEBUGCHECK(0);
} }
@ -209,8 +209,8 @@ InitSystemSharedUserPage (PCSZ ParameterLine)
/* Free all the Strings we have in memory */ /* Free all the Strings we have in memory */
RtlFreeUnicodeString (&BootPath); RtlFreeUnicodeString (&BootPath);
RtlFreeUnicodeString (&DriveDeviceName); ExFreePool(DriveDeviceName.Buffer);
RtlFreeUnicodeString (&ArcDeviceName); ExFreePool(ArcDeviceName.Buffer);
/* Make sure we found the Boot Drive */ /* Make sure we found the Boot Drive */
if (BootDriveFound == FALSE) { if (BootDriveFound == FALSE) {

View file

@ -413,15 +413,15 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
RtlFreeUnicodeString(&BootPath); RtlFreeUnicodeString(&BootPath);
RtlFreeUnicodeString(&DeviceName); ExFreePool(DeviceName.Buffer);
CPRINT("ZwOpenSymbolicLinkObject() '%wZ' failed (Status %x)\n", CPRINT("ZwOpenSymbolicLinkObject() '%wZ' failed (Status %x)\n",
&ArcName, &ArcName,
Status); Status);
RtlFreeUnicodeString(&ArcName); ExFreePool(ArcName.Buffer);
return(Status); return(Status);
} }
RtlFreeUnicodeString(&ArcName); ExFreePool(ArcName.Buffer);
Status = ZwQuerySymbolicLinkObject(Handle, Status = ZwQuerySymbolicLinkObject(Handle,
&DeviceName, &DeviceName,
@ -430,7 +430,7 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
RtlFreeUnicodeString(&BootPath); RtlFreeUnicodeString(&BootPath);
RtlFreeUnicodeString(&DeviceName); ExFreePool(DeviceName.Buffer);
CPRINT("ZwQuerySymbolicObject() failed (Status %x)\n", CPRINT("ZwQuerySymbolicObject() failed (Status %x)\n",
Status); Status);
@ -450,7 +450,7 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
Status = IoCreateSymbolicLink(&LinkName, Status = IoCreateSymbolicLink(&LinkName,
&DeviceName); &DeviceName);
RtlFreeUnicodeString (&DeviceName); ExFreePool(DeviceName.Buffer);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
CPRINT("IoCreateSymbolicLink() failed (Status %x)\n", CPRINT("IoCreateSymbolicLink() failed (Status %x)\n",

View file

@ -188,7 +188,7 @@ IopDeleteDriver(PVOID ObjectBody)
DPRINT("IopDeleteDriver(ObjectBody %x)\n", ObjectBody); DPRINT("IopDeleteDriver(ObjectBody %x)\n", ObjectBody);
ExFreePool(Object->DriverExtension); ExFreePool(Object->DriverExtension);
RtlFreeUnicodeString(&Object->DriverName); ExFreePool(Object->DriverName.Buffer);
OldIrql = KeRaiseIrqlToDpcLevel(); OldIrql = KeRaiseIrqlToDpcLevel();
@ -197,7 +197,7 @@ IopDeleteDriver(PVOID ObjectBody)
DriverExtension = NextDriverExtension) DriverExtension = NextDriverExtension)
{ {
NextDriverExtension = DriverExtension->Link; NextDriverExtension = DriverExtension->Link;
ExFreePool(DriverExtension); ExFreePoolWithTag(DriverExtension, TAG_DRIVER_EXTENSION);
} }
KfLowerIrql(OldIrql); KfLowerIrql(OldIrql);
@ -358,7 +358,7 @@ IopNormalizeImagePath(
wcscpy(ImagePath->Buffer, L"\\SystemRoot\\"); wcscpy(ImagePath->Buffer, L"\\SystemRoot\\");
wcscat(ImagePath->Buffer, InputImagePath.Buffer); wcscat(ImagePath->Buffer, InputImagePath.Buffer);
RtlFreeUnicodeString(&InputImagePath); ExFreePool(InputImagePath.Buffer);
} }
return STATUS_SUCCESS; return STATUS_SUCCESS;
@ -496,7 +496,7 @@ IopLoadServiceModule(
Status = STATUS_IMAGE_ALREADY_LOADED; Status = STATUS_IMAGE_ALREADY_LOADED;
} }
RtlFreeUnicodeString(&ServiceImagePath); ExFreePool(ServiceImagePath.Buffer);
/* /*
* Now check if the module was loaded successfully. * Now check if the module was loaded successfully.
@ -908,8 +908,8 @@ IopCreateServiceListEntry(PUNICODE_STRING ServiceName)
NULL); NULL);
if (!NT_SUCCESS(Status) || Service->Start > 1) if (!NT_SUCCESS(Status) || Service->Start > 1)
{ {
RtlFreeUnicodeString(&Service->ServiceGroup); ExFreePool(Service->ServiceGroup.Buffer);
RtlFreeUnicodeString(&Service->ImagePath); ExFreePool(Service->ImagePath.Buffer);
ExFreePool(Service); ExFreePool(Service);
return(Status); return(Status);
} }
@ -1065,7 +1065,7 @@ IoDestroyDriverList(VOID)
{ {
CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry); CurrentGroup = CONTAINING_RECORD(GroupEntry, SERVICE_GROUP, GroupListEntry);
RtlFreeUnicodeString(&CurrentGroup->GroupName); ExFreePool(CurrentGroup->GroupName.Buffer);
RemoveEntryList(GroupEntry); RemoveEntryList(GroupEntry);
if (CurrentGroup->TagArray) if (CurrentGroup->TagArray)
{ {
@ -1082,10 +1082,10 @@ IoDestroyDriverList(VOID)
{ {
CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry); CurrentService = CONTAINING_RECORD(ServiceEntry, SERVICE, ServiceListEntry);
RtlFreeUnicodeString(&CurrentService->ServiceName); ExFreePool(CurrentService->ServiceName.Buffer);
RtlFreeUnicodeString(&CurrentService->RegistryPath); ExFreePool(CurrentService->RegistryPath.Buffer);
RtlFreeUnicodeString(&CurrentService->ServiceGroup); ExFreePool(CurrentService->ServiceGroup.Buffer);
RtlFreeUnicodeString(&CurrentService->ImagePath); ExFreePool(CurrentService->ImagePath.Buffer);
RemoveEntryList(ServiceEntry); RemoveEntryList(ServiceEntry);
ExFreePool(CurrentService); ExFreePool(CurrentService);
@ -1547,7 +1547,7 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
* Free the service path * Free the service path
*/ */
RtlFreeUnicodeString(&ImagePath); ExFreePool(ImagePath.Buffer);
/* /*
* Unload the module and release the references to the device object * Unload the module and release the references to the device object
@ -1865,7 +1865,7 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("RtlQueryRegistryValues() failed (Status %lx)\n", Status); DPRINT("RtlQueryRegistryValues() failed (Status %lx)\n", Status);
RtlFreeUnicodeString(&ImagePath); ExFreePool(ImagePath.Buffer);
goto ReleaseCapturedString; goto ReleaseCapturedString;
} }

View file

@ -17,7 +17,7 @@
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
#define TAG_IRP TAG('I', 'R', 'P', ' ') #define TAG_IRP TAG('I', 'R', 'P', ' ')
#define TAG_SYS_BUF TAG('I', 'o', ' ' , ' ') #define TAG_SYS_BUF TAG('S', 'Y', 'S' , 'B')
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/

View file

@ -72,7 +72,7 @@ ObpDeleteSymbolicLink(PVOID ObjectBody)
{ {
PSYMLINK_OBJECT SymlinkObject = (PSYMLINK_OBJECT)ObjectBody; PSYMLINK_OBJECT SymlinkObject = (PSYMLINK_OBJECT)ObjectBody;
RtlFreeUnicodeString(&SymlinkObject->TargetName); ExFreePool(SymlinkObject->TargetName.Buffer);
} }
@ -129,7 +129,7 @@ ObpParseSymbolicLink(PVOID Object,
} }
/* transfer target path buffer into FullPath */ /* transfer target path buffer into FullPath */
RtlFreeUnicodeString(FullPath); ExFreePool(FullPath->Buffer);
FullPath->Length = TargetPath.Length; FullPath->Length = TargetPath.Length;
FullPath->MaximumLength = TargetPath.MaximumLength; FullPath->MaximumLength = TargetPath.MaximumLength;
FullPath->Buffer = TargetPath.Buffer; FullPath->Buffer = TargetPath.Buffer;

View file

@ -123,7 +123,7 @@ RtlReleaseCapturedUnicodeString(IN PUNICODE_STRING CapturedString,
{ {
if(CurrentMode != KernelMode || CaptureIfKernel ) if(CurrentMode != KernelMode || CaptureIfKernel )
{ {
RtlFreeUnicodeString(CapturedString); ExFreePool(CapturedString->Buffer);
} }
} }