SourceMod SDK
1.7
|
Provides functions for managing Handles. More...
#include <public/IHandleSys.h>
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. More... | |
virtual bool | RemoveType (HandleType_t type, IdentityToken_t *ident)=0 |
Removes a handle type. NOTE: This removes all child types. More... | |
virtual bool | FindHandleType (const char *name, HandleType_t *type)=0 |
Finds a handle type by name. More... | |
virtual Handle_t | CreateHandle (HandleType_t type, void *object, IdentityToken_t *owner, IdentityToken_t *ident, HandleError *err)=0 |
Creates a new handle. More... | |
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. More... | |
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. More... | |
virtual HandleError | ReadHandle (Handle_t handle, HandleType_t type, const HandleSecurity *pSecurity, void **object)=0 |
Retrieves the contents of a handle. More... | |
virtual bool | InitAccessDefaults (TypeAccess *pTypeAccess, HandleAccess *pHandleAccess)=0 |
Sets access permissions on one or more structures. More... | |
virtual Handle_t | CreateHandleEx (HandleType_t type, void *object, const HandleSecurity *pSec, const HandleAccess *pAccess, HandleError *err)=0 |
Creates a new handle. More... | |
virtual Handle_t | FastCloneHandle (Handle_t hndl)=0 |
Clones a handle, bypassing security checks. More... | |
virtual bool | TypeCheck (HandleType_t given, HandleType_t actual)=0 |
Type checks two handles. More... | |
Public Member Functions inherited from SourceMod::SMInterface | |
virtual bool | IsVersionCompatible (unsigned int version) |
Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning. More... | |
Provides functions for managing Handles.
|
pure virtual |
Clones a handle by adding to its internal reference count. Its data, type, and security permissions remain the same.
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). |
|
pure virtual |
Creates a new handle.
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). |
|
pure virtual |
Creates a new handle.
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). |
|
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.
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). |
|
pure virtual |
Clones a handle, bypassing security checks.
|
pure virtual |
Finds a handle type by name.
name | Name of handle type to find (anonymous not allowed). |
type | Address to store found handle in (if not found, undefined). |
|
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.
handle | Handle_t identifier to destroy. |
pSecurity | Security information struct (may be NULL). |
|
pure virtual |
Sets access permissions on one or more structures.
pTypeAccess | Optional TypeAccess buffer to initialize with the default values. |
pHandleAccess | Optional HandleAccess buffer to initialize with the default values. |
|
pure virtual |
Retrieves the contents of a handle.
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. |
|
pure virtual |
Removes a handle type. NOTE: This removes all child types.
type | Type chain to remove. |
ident | Identity token. Removal fails if the token does not match. |
|
pure virtual |
Type checks two handles.
given | Type to test. |
actual | Type to check for. |