ObjectBody->Permanent setting cleaned.
Modified: trunk/reactos/ntoskrnl/include/internal/ob.h
Modified: trunk/reactos/ntoskrnl/ob/ntobj.c
_____
Modified: trunk/reactos/ntoskrnl/include/internal/ob.h
--- trunk/reactos/ntoskrnl/include/internal/ob.h 2005-01-23
22:25:11 UTC (rev 13233)
+++ trunk/reactos/ntoskrnl/include/internal/ob.h 2005-01-23
22:42:31 UTC (rev 13234)
@@ -297,6 +297,10 @@
STDCALL
ObQueryDeviceMapInformation(PEPROCESS Process,
PPROCESS_DEVICEMAP_INFORMATION DeviceMapInfo);
+VOID FASTCALL
+ObpSetPermanentObject (IN PVOID ObjectBody, IN BOOLEAN Permanent);
+
+
/* Security descriptor cache functions */
NTSTATUS
_____
Modified: trunk/reactos/ntoskrnl/ob/ntobj.c
--- trunk/reactos/ntoskrnl/ob/ntobj.c 2005-01-23 22:25:11 UTC (rev
13233)
+++ trunk/reactos/ntoskrnl/ob/ntobj.c 2005-01-23 22:42:31 UTC (rev
13234)
@@ -207,8 +207,25 @@
/**********************************************************************
+ * NAME PRIVATE
+ * ObpSetPermanentObject/2
+ *
+ * DESCRIPTION
+ * Fast general purpose routine to set an object's permanent
+ * attribute, given a pointer to the object's body.
+ */
+VOID FASTCALL
+ObpSetPermanentObject (IN PVOID ObjectBody, IN BOOLEAN Permanent)
+{
+ POBJECT_HEADER ObjectHeader;
+
+ ObjectHeader = BODY_TO_HEADER(ObjectBody);
+ ObjectHeader->Permanent = Permanent;
+}
+
+/**********************************************************************
* NAME EXPORTED
- * ObMakeTemporaryObject
+ * ObMakeTemporaryObject/1
*
* DESCRIPTION
*
@@ -223,10 +240,7 @@
VOID STDCALL
ObMakeTemporaryObject(IN PVOID ObjectBody)
{
- POBJECT_HEADER ObjectHeader;
-
- ObjectHeader = BODY_TO_HEADER(ObjectBody);
- ObjectHeader->Permanent = FALSE;
+ ObpSetPermanentObject (ObjectBody, FALSE);
}
@@ -245,25 +259,23 @@
NTSTATUS STDCALL
NtMakeTemporaryObject(IN HANDLE ObjectHandle)
{
- POBJECT_HEADER ObjectHeader;
- PVOID Object;
+ PVOID ObjectBody;
NTSTATUS Status;
Status = ObReferenceObjectByHandle(ObjectHandle,
0,
NULL,
(KPROCESSOR_MODE)KeGetPreviousMode(),
- &Object,
+ &ObjectBody,
NULL);
if (Status != STATUS_SUCCESS)
{
return Status;
}
- ObjectHeader = BODY_TO_HEADER(Object);
- ObjectHeader->Permanent = FALSE;
+ ObpSetPermanentObject (ObjectBody, FALSE);
- ObDereferenceObject(Object);
+ ObDereferenceObject(ObjectBody);
return STATUS_SUCCESS;
}
@@ -271,7 +283,7 @@
/**********************************************************************
* NAME EXPORTED
- * NtMakePermanentObject
+ * NtMakePermanentObject/1
*
* DESCRIPTION
*
@@ -286,25 +298,23 @@
NTSTATUS STDCALL
NtMakePermanentObject(IN HANDLE ObjectHandle)
{
- POBJECT_HEADER ObjectHeader;
- PVOID Object;
+ PVOID ObjectBody;
NTSTATUS Status;
Status = ObReferenceObjectByHandle(ObjectHandle,
0,
NULL,
(KPROCESSOR_MODE)KeGetPreviousMode(),
- &Object,
+ &ObjectBody,
NULL);
if (Status != STATUS_SUCCESS)
{
return Status;
}
- ObjectHeader = BODY_TO_HEADER(Object);
- ObjectHeader->Permanent = TRUE;
+ ObpSetPermanentObject (ObjectBody, TRUE);
- ObDereferenceObject(Object);
+ ObDereferenceObject(ObjectBody);
return STATUS_SUCCESS;
}
Show replies by date