Provides functions for managing Handles.
More...
#include <public/IHandleSys.h>
Inherits SourceMod::SMInterface.
List of all members.
Public Member Functions |
|
virtual unsigned int | GetInterfaceVersion () |
| | Must return an integer defining the interface's version.
|
|
virtual const char * | GetInterfaceName () |
| | Must return a string defining the interface's unique name.
|
| virtual HandleType_t | CreateType (const char *name, IHandleTypeDispatch *dispatch, HandleType_t parent, const TypeAccess *typeAccess, const HandleAccess *hndlAccess, IdentityToken_t *ident, HandleError *err)=0 |
| | Creates a new Handle type. NOTE: Currently, a child type may not have its own children. NOTE: Handle names must be unique if not private.
|
| virtual bool | RemoveType (HandleType_t type, IdentityToken_t *ident)=0 |
| | Removes a handle type. NOTE: This removes all child types.
|
| virtual bool | FindHandleType (const char *name, HandleType_t *type)=0 |
| | Finds a handle type by name.
|
| virtual Handle_t | CreateHandle (HandleType_t type, void *object, IdentityToken_t *owner, IdentityToken_t *ident, HandleError *err)=0 |
| | Creates a new handle.
|
| virtual HandleError | FreeHandle (Handle_t handle, const HandleSecurity *pSecurity)=0 |
| | Frees the memory associated with a handle and calls any destructors. NOTE: This function will decrement the internal reference counter. It will only perform any further action if the counter hits 0.
|
| virtual HandleError | CloneHandle (Handle_t handle, Handle_t *newhandle, IdentityToken_t *newOwner, const HandleSecurity *pSecurity)=0 |
| | Clones a handle by adding to its internal reference count. Its data, type, and security permissions remain the same.
|
| virtual HandleError | ReadHandle (Handle_t handle, HandleType_t type, const HandleSecurity *pSecurity, void **object)=0 |
| | Retrieves the contents of a handle.
|
| virtual bool | InitAccessDefaults (TypeAccess *pTypeAccess, HandleAccess *pHandleAccess)=0 |
| | Sets access permissions on one or more structures.
|
| virtual Handle_t | CreateHandleEx (HandleType_t type, void *object, const HandleSecurity *pSec, const HandleAccess *pAccess, HandleError *err)=0 |
| | Creates a new handle.
|
| virtual Handle_t | FastCloneHandle (Handle_t hndl)=0 |
| | Clones a handle, bypassing security checks.
|
Detailed Description
Provides functions for managing Handles.
Definition at line 222 of file IHandleSys.h.
Member Function Documentation
| virtual HandleType_t SourceMod::IHandleSys::CreateType |
( |
const char * |
name, |
|
|
IHandleTypeDispatch * |
dispatch, |
|
|
HandleType_t |
parent, |
|
|
const TypeAccess * |
typeAccess, |
|
|
const HandleAccess * |
hndlAccess, |
|
|
IdentityToken_t * |
ident, |
|
|
HandleError * |
err | |
|
) |
| | [pure virtual] |
Creates a new Handle type. NOTE: Currently, a child type may not have its own children. NOTE: Handle names must be unique if not private.
- Parameters:
-
| name | Name of handle type (NULL or "" to be anonymous) |
| dispatch | Pointer to a valid IHandleTypeDispatch object. |
| parent | Parent handle to inherit from, 0 for none. |
| typeAccess | Pointer to a TypeAccess object, NULL to use default or inherited permissions. Pointer can be temporary. |
| hndlAccess | Pointer to a HandleAccess object to define default default permissions on each Handle. NULL to use default permissions. |
| ident | Security token for any permissions. If typeAccess is NULL, this becomes the owning identity. |
| err | Optional pointer to store an error code on failure (undefined on success). |
- Returns:
- A new HandleType_t unique ID, or 0 on failure.
| virtual bool SourceMod::IHandleSys::RemoveType |
( |
HandleType_t |
type, |
|
|
IdentityToken_t * |
ident | |
|
) |
| | [pure virtual] |
Removes a handle type. NOTE: This removes all child types.
- Parameters:
-
| type | Type chain to remove. |
| ident | Identity token. Removal fails if the token does not match. |
- Returns:
- True on success, false on failure.
| virtual bool SourceMod::IHandleSys::FindHandleType |
( |
const char * |
name, |
|
|
HandleType_t * |
type | |
|
) |
| | [pure virtual] |
Finds a handle type by name.
- Parameters:
-
| name | Name of handle type to find (anonymous not allowed). |
| type | Address to store found handle in (if not found, undefined). |
- Returns:
- True if found, false otherwise.
| virtual Handle_t SourceMod::IHandleSys::CreateHandle |
( |
HandleType_t |
type, |
|
|
void * |
object, |
|
|
IdentityToken_t * |
owner, |
|
|
IdentityToken_t * |
ident, |
|
|
HandleError * |
err | |
|
) |
| | [pure virtual] |
Creates a new handle.
- Parameters:
-
| type | Type to use on the handle. |
| object | Object to bind to the handle. |
| owner | Owner of the new Handle (may be NULL). |
| ident | Identity for type access if needed (may be NULL). |
| err | Optional pointer to store an error code on failure (undefined on success). |
- Returns:
- A new Handle_t, or 0 on failure.
| virtual HandleError SourceMod::IHandleSys::FreeHandle |
( |
Handle_t |
handle, |
|
|
const HandleSecurity * |
pSecurity | |
|
) |
| | [pure virtual] |
Frees the memory associated with a handle and calls any destructors. NOTE: This function will decrement the internal reference counter. It will only perform any further action if the counter hits 0.
- Parameters:
-
| handle | Handle_t identifier to destroy. |
| pSecurity | Security information struct (may be NULL). |
- Returns:
- A HandleError error code.
| virtual HandleError SourceMod::IHandleSys::CloneHandle |
( |
Handle_t |
handle, |
|
|
Handle_t * |
newhandle, |
|
|
IdentityToken_t * |
newOwner, |
|
|
const HandleSecurity * |
pSecurity | |
|
) |
| | [pure virtual] |
Clones a handle by adding to its internal reference count. Its data, type, and security permissions remain the same.
- Parameters:
-
| handle | Handle to duplicate. Any non-free handle target is valid. |
| newhandle | Stores the duplicated handle in the pointer (must not be NULL). |
| newOwner | New owner of cloned handle. |
| pSecurity | Security information struct (may be NULL). |
- Returns:
- A HandleError error code.
| virtual HandleError SourceMod::IHandleSys::ReadHandle |
( |
Handle_t |
handle, |
|
|
HandleType_t |
type, |
|
|
const HandleSecurity * |
pSecurity, |
|
|
void ** |
object | |
|
) |
| | [pure virtual] |
Retrieves the contents of a handle.
- Parameters:
-
| handle | Handle_t from which to retrieve contents. |
| type | Expected type to read as. 0 ignores typing rules. |
| pSecurity | Security information struct (may be NULL). |
| object | Optional address to store object in. |
- Returns:
- HandleError error code.
| virtual bool SourceMod::IHandleSys::InitAccessDefaults |
( |
TypeAccess * |
pTypeAccess, |
|
|
HandleAccess * |
pHandleAccess | |
|
) |
| | [pure virtual] |
Sets access permissions on one or more structures.
- Parameters:
-
| pTypeAccess | Optional TypeAccess buffer to initialize with the default values. |
| pHandleAccess | Optional HandleAccess buffer to initialize with the default values. |
- Returns:
- True on success, false if version is unsupported.
| virtual Handle_t SourceMod::IHandleSys::CreateHandleEx |
( |
HandleType_t |
type, |
|
|
void * |
object, |
|
|
const HandleSecurity * |
pSec, |
|
|
const HandleAccess * |
pAccess, |
|
|
HandleError * |
err | |
|
) |
| | [pure virtual] |
Creates a new handle.
- Parameters:
-
| type | Type to use on the handle. |
| object | Object to bind to the handle. |
| pSec | Security pointer; pOwner is written as the owner, pIdent is used as the parent identity for authorization. |
| pAccess | Access right descriptor for the Handle; NULL for type defaults. |
| err | Optional pointer to store an error code on failure (undefined on success). |
- Returns:
- A new Handle_t, or 0 on failure.
| virtual Handle_t SourceMod::IHandleSys::FastCloneHandle |
( |
Handle_t |
hndl |
) |
[pure virtual] |
Clones a handle, bypassing security checks.
- Returns:
- A new Handle_t, or 0 on failure.
The documentation for this class was generated from the following file: