|
Process Hacker
|
Go to the source code of this file.
Macros | |
| #define | _PH_REF_PRIVATE |
| #define | REF_STAT_UP(Name) PHLIB_INC_STATISTIC(Name) |
Functions | |
| NTSTATUS | PhInitializeRef (VOID) |
| Initializes the object manager module. | |
| _May_raise_ PVOID | PhCreateObject (_In_ SIZE_T ObjectSize, _In_ PPH_OBJECT_TYPE ObjectType) |
| Allocates a object. | |
| PVOID | PhReferenceObject (_In_ PVOID Object) |
| References the specified object. | |
| _May_raise_ LONG | PhReferenceObjectEx (_In_ PVOID Object, _In_ LONG RefCount) |
| References the specified object. | |
| BOOLEAN | PhReferenceObjectSafe (_In_ PVOID Object) |
| Attempts to reference an object and fails if it is being destroyed. | |
| VOID | PhDereferenceObject (_In_ PVOID Object) |
| Dereferences the specified object. | |
| BOOLEAN | PhDereferenceObjectDeferDelete (_In_ PVOID Object) |
| Dereferences the specified object. | |
| _May_raise_ LONG | PhDereferenceObjectEx (_In_ PVOID Object, _In_ LONG RefCount, _In_ BOOLEAN DeferDelete) |
| Dereferences the specified object. | |
| PPH_OBJECT_TYPE | PhGetObjectType (_In_ PVOID Object) |
| Gets an object's type. | |
| PPH_OBJECT_TYPE | PhCreateObjectType (_In_ PWSTR Name, _In_ ULONG Flags, _In_opt_ PPH_TYPE_DELETE_PROCEDURE DeleteProcedure) |
| Creates an object type. | |
| PPH_OBJECT_TYPE | PhCreateObjectTypeEx (_In_ PWSTR Name, _In_ ULONG Flags, _In_opt_ PPH_TYPE_DELETE_PROCEDURE DeleteProcedure, _In_opt_ PPH_OBJECT_TYPE_PARAMETERS Parameters) |
| Creates an object type. | |
| VOID | PhGetObjectTypeInformation (_In_ PPH_OBJECT_TYPE ObjectType, _Out_ PPH_OBJECT_TYPE_INFORMATION Information) |
| Gets information about an object type. | |
| PPH_OBJECT_HEADER | PhpAllocateObject (_In_ PPH_OBJECT_TYPE ObjectType, _In_ SIZE_T ObjectSize) |
| Allocates storage for an object. | |
| VOID | PhpFreeObject (_In_ PPH_OBJECT_HEADER ObjectHeader) |
| Calls the delete procedure for an object and frees its allocated storage. | |
| VOID | PhpDeferDeleteObject (_In_ PPH_OBJECT_HEADER ObjectHeader) |
| Queues an object for deletion. | |
| NTSTATUS | PhpDeferDeleteObjectRoutine (_In_ PVOID Parameter) |
| Removes and frees objects from the to-free list. | |
| PVOID | PhCreateAlloc (_In_ SIZE_T Size) |
| Creates a reference-counted memory block. | |
| FORCEINLINE PPH_AUTO_POOL | PhpGetCurrentAutoPool (VOID) |
| Gets the current auto-dereference pool for the current thread. | |
| _May_raise_ FORCEINLINE VOID | PhpSetCurrentAutoPool (_In_ PPH_AUTO_POOL AutoPool) |
| Sets the current auto-dereference pool for the current thread. | |
| VOID | PhInitializeAutoPool (_Out_ PPH_AUTO_POOL AutoPool) |
| Initializes an auto-dereference pool and sets it as the current pool for the current thread. | |
| _May_raise_ VOID | PhDeleteAutoPool (_Inout_ PPH_AUTO_POOL AutoPool) |
| Deletes an auto-dereference pool. | |
| VOID | PhDrainAutoPool (_In_ PPH_AUTO_POOL AutoPool) |
| Dereferences and removes all objects in an auto-release pool. | |
| _May_raise_ PVOID | PhAutoDereferenceObject (_In_opt_ PVOID Object) |
| Adds an object to the current auto-dereference pool for the current thread. | |
| VOID | PhaDereferenceObject (PVOID Object) |
| Deprecated. | |
Variables | |
| PPH_OBJECT_TYPE | PhObjectTypeObject = NULL |
| SLIST_HEADER | PhObjectDeferDeleteListHead |
| PH_FREE_LIST | PhObjectSmallFreeList |
| PPH_OBJECT_TYPE | PhAllocType = NULL |
| ULONG | PhObjectTypeCount = 0 |
| PPH_OBJECT_TYPE | PhObjectTypeTable [PH_OBJECT_TYPE_TABLE_SIZE] |
| #define REF_STAT_UP | ( | Name | ) | PHLIB_INC_STATISTIC(Name) |
| VOID PhaDereferenceObject | ( | PVOID | Object | ) |
| _May_raise_ PVOID PhAutoDereferenceObject | ( | _In_opt_ PVOID | Object | ) |
Adds an object to the current auto-dereference pool for the current thread.
If the current thread does not have an auto-dereference pool, the function raises an exception.
| Object | A pointer to an object. The object will be dereferenced when the current auto-dereference pool is drained or freed. |
| PVOID PhCreateAlloc | ( | _In_ SIZE_T | Size | ) |
| _May_raise_ PVOID PhCreateObject | ( | _In_ SIZE_T | ObjectSize, |
| _In_ PPH_OBJECT_TYPE | ObjectType | ||
| ) |
| PPH_OBJECT_TYPE PhCreateObjectType | ( | _In_ PWSTR | Name, |
| _In_ ULONG | Flags, | ||
| _In_opt_ PPH_TYPE_DELETE_PROCEDURE | DeleteProcedure | ||
| ) |
Creates an object type.
| Name | The name of the type. |
| Flags | A combination of flags affecting the behaviour of the object type. |
| DeleteProcedure | A callback function that is executed when an object of this type is about to be freed (i.e. when its reference count is 0). |
| PPH_OBJECT_TYPE PhCreateObjectTypeEx | ( | _In_ PWSTR | Name, |
| _In_ ULONG | Flags, | ||
| _In_opt_ PPH_TYPE_DELETE_PROCEDURE | DeleteProcedure, | ||
| _In_opt_ PPH_OBJECT_TYPE_PARAMETERS | Parameters | ||
| ) |
Creates an object type.
| Name | The name of the type. |
| Flags | A combination of flags affecting the behaviour of the object type. |
| DeleteProcedure | A callback function that is executed when an object of this type is about to be freed (i.e. when its reference count is 0). |
| Parameters | A structure containing additional parameters for the object type. |
| _May_raise_ VOID PhDeleteAutoPool | ( | _Inout_ PPH_AUTO_POOL | AutoPool | ) |
| VOID PhDereferenceObject | ( | _In_ PVOID | Object | ) |
| BOOLEAN PhDereferenceObjectDeferDelete | ( | _In_ PVOID | Object | ) |
| _May_raise_ LONG PhDereferenceObjectEx | ( | _In_ PVOID | Object, |
| _In_ LONG | RefCount, | ||
| _In_ BOOLEAN | DeferDelete | ||
| ) |
Dereferences the specified object.
The object will be freed if its reference count reaches 0.
| Object | A pointer to the object to dereference. |
| RefCount | The number of references to remove. |
| DeferDelete | Whether to defer deletion of the object. |
| VOID PhDrainAutoPool | ( | _In_ PPH_AUTO_POOL | AutoPool | ) |
| PPH_OBJECT_TYPE PhGetObjectType | ( | _In_ PVOID | Object | ) |
| VOID PhGetObjectTypeInformation | ( | _In_ PPH_OBJECT_TYPE | ObjectType, |
| _Out_ PPH_OBJECT_TYPE_INFORMATION | Information | ||
| ) |
| VOID PhInitializeAutoPool | ( | _Out_ PPH_AUTO_POOL | AutoPool | ) |
Initializes an auto-dereference pool and sets it as the current pool for the current thread.
You must call PhDeleteAutoPool() before storage for the auto-dereference pool is freed.
| NTSTATUS PhInitializeRef | ( | VOID | ) |
| PPH_OBJECT_HEADER PhpAllocateObject | ( | _In_ PPH_OBJECT_TYPE | ObjectType, |
| _In_ SIZE_T | ObjectSize | ||
| ) |
| VOID PhpDeferDeleteObject | ( | _In_ PPH_OBJECT_HEADER | ObjectHeader | ) |
| NTSTATUS PhpDeferDeleteObjectRoutine | ( | _In_ PVOID | Parameter | ) |
| VOID PhpFreeObject | ( | _In_ PPH_OBJECT_HEADER | ObjectHeader | ) |
| FORCEINLINE PPH_AUTO_POOL PhpGetCurrentAutoPool | ( | VOID | ) |
| _May_raise_ FORCEINLINE VOID PhpSetCurrentAutoPool | ( | _In_ PPH_AUTO_POOL | AutoPool | ) |
| PVOID PhReferenceObject | ( | _In_ PVOID | Object | ) |
| _May_raise_ LONG PhReferenceObjectEx | ( | _In_ PVOID | Object, |
| _In_ LONG | RefCount | ||
| ) |
| BOOLEAN PhReferenceObjectSafe | ( | _In_ PVOID | Object | ) |
Attempts to reference an object and fails if it is being destroyed.
| Object | The object to reference if it is not being deleted. |
| PPH_OBJECT_TYPE PhAllocType = NULL |
| PH_FREE_LIST PhObjectSmallFreeList |
| PPH_OBJECT_TYPE PhObjectTypeObject = NULL |
| PPH_OBJECT_TYPE PhObjectTypeTable[PH_OBJECT_TYPE_TABLE_SIZE] |