mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:02:59 +00:00
[NTOS:EX]
- Remove superfluous dereference in NtCreateProfile - Allocate the right size for KPROFILE object - Don't leak the KPROFILE when deleting an EPROFILE - Avoid some casts CORE-10066 svn path=/trunk/; revision=68852
This commit is contained in:
parent
dd088b28fc
commit
f917e6193e
1 changed files with 4 additions and 4 deletions
|
@ -42,7 +42,7 @@ ExpDeleteProfile(PVOID ObjectBody)
|
||||||
ULONG State;
|
ULONG State;
|
||||||
|
|
||||||
/* Typecast the Object */
|
/* Typecast the Object */
|
||||||
Profile = (PEPROFILE)ObjectBody;
|
Profile = ObjectBody;
|
||||||
|
|
||||||
/* Check if there if the Profile was started */
|
/* Check if there if the Profile was started */
|
||||||
if (Profile->LockedBufferAddress)
|
if (Profile->LockedBufferAddress)
|
||||||
|
@ -55,6 +55,7 @@ ExpDeleteProfile(PVOID ObjectBody)
|
||||||
MmUnmapLockedPages(Profile->LockedBufferAddress, Profile->Mdl);
|
MmUnmapLockedPages(Profile->LockedBufferAddress, Profile->Mdl);
|
||||||
MmUnlockPages(Profile->Mdl);
|
MmUnlockPages(Profile->Mdl);
|
||||||
IoFreeMdl(Profile->Mdl);
|
IoFreeMdl(Profile->Mdl);
|
||||||
|
ExFreePoolWithTag(Profile->ProfileObject, TAG_PROFILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if a Process is associated and reference it */
|
/* Check if a Process is associated and reference it */
|
||||||
|
@ -247,7 +248,6 @@ NtCreateProfile(OUT PHANDLE ProfileHandle,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
&hProfile);
|
&hProfile);
|
||||||
ObDereferenceObject(Profile);
|
|
||||||
|
|
||||||
/* Check for Success */
|
/* Check for Success */
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
@ -361,7 +361,7 @@ NtStartProfile(IN HANDLE ProfileHandle)
|
||||||
|
|
||||||
/* Allocate a Kernel Profile Object. */
|
/* Allocate a Kernel Profile Object. */
|
||||||
ProfileObject = ExAllocatePoolWithTag(NonPagedPool,
|
ProfileObject = ExAllocatePoolWithTag(NonPagedPool,
|
||||||
sizeof(EPROFILE),
|
sizeof(*ProfileObject),
|
||||||
TAG_PROFILE);
|
TAG_PROFILE);
|
||||||
if (!ProfileObject)
|
if (!ProfileObject)
|
||||||
{
|
{
|
||||||
|
@ -396,7 +396,7 @@ NtStartProfile(IN HANDLE ProfileHandle)
|
||||||
/* Initialize the Kernel Profile Object */
|
/* Initialize the Kernel Profile Object */
|
||||||
Profile->ProfileObject = ProfileObject;
|
Profile->ProfileObject = ProfileObject;
|
||||||
KeInitializeProfile(ProfileObject,
|
KeInitializeProfile(ProfileObject,
|
||||||
(PKPROCESS)Profile->Process,
|
&Profile->Process->Pcb,
|
||||||
Profile->RangeBase,
|
Profile->RangeBase,
|
||||||
Profile->RangeSize,
|
Profile->RangeSize,
|
||||||
Profile->BucketSize,
|
Profile->BucketSize,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue