mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 02:18:35 +00:00
Introduce GetHandleAccess to (I)HandleSys.
This commit is contained in:
parent
b290099572
commit
45dd841330
@ -1169,3 +1169,16 @@ void HandleSystem::Dump(const HandleReporter &fn)
|
||||
rep(fn, "-- Approximately %d bytes of memory are in use by Handles.\n", total_size);
|
||||
}
|
||||
|
||||
HandleError HandleSystem::GetHandleAccess(Handle_t handle, HandleAccess &*pAccess)
|
||||
{
|
||||
unsigned int index;
|
||||
QHandle *pHandle;
|
||||
HandleError err;
|
||||
IdentityToken_t *ident = NULL;
|
||||
|
||||
if ((err=GetHandle(handle, ident, &pHandle, &index)) != HandleError_None)
|
||||
return err;
|
||||
|
||||
pAccess = &(pHandle->sec);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -173,6 +173,8 @@ public: //IHandleSystem
|
||||
|
||||
/* Bypasses security checks. */
|
||||
Handle_t FastCloneHandle(Handle_t hndl);
|
||||
|
||||
HandleError GetHandleAccess(Handle_t handle, HandleAccess &*pSecurity);
|
||||
protected:
|
||||
/**
|
||||
* Decodes a handle with sanity and security checking.
|
||||
|
||||
@ -375,6 +375,15 @@ namespace SourceMod
|
||||
* @return True if "given" is a subtype of "actual", false otherwise.
|
||||
*/
|
||||
virtual bool TypeCheck(HandleType_t given, HandleType_t actual) = 0;
|
||||
|
||||
/**
|
||||
* @brief Obtain the HandleAccess address from the passed in handle.
|
||||
*
|
||||
* @param handle Handle_t identifier to destroy.
|
||||
* @param pAccess Access information struct.
|
||||
* @return HandleError error code.
|
||||
*/
|
||||
virtual HandleError GetHandleAccess(Handle_t handle, HandleAccess &*pAccess) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user