MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / GetHandle

Method GetHandle

core/logic/HandleSys.cpp:505–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505HandleError HandleSystem::GetHandle(Handle_t handle,
506 IdentityToken_t *ident,
507 QHandle **in_pHandle,
508 unsigned int *in_index,
509 bool ignoreFree)
510{
511 unsigned int serial = (handle >> HANDLESYS_HANDLE_BITS);
512 unsigned int index = (handle & HANDLESYS_HANDLE_MASK);
513
514 if (index == 0 || index > m_HandleTail || index > HANDLESYS_MAX_HANDLES)
515 {
516 return HandleError_Index;
517 }
518
519 QHandle *pHandle = &m_Handles[index];
520
521 if (!pHandle->set
522 || (pHandle->set == HandleSet_Freed && !ignoreFree))
523 {
524 return HandleError_Freed;
525 } else if (pHandle->set == HandleSet_Identity
526 && ident != g_ShareSys.GetIdentRoot())
527 {
528 /* Only IdentityHandle() can read this! */
529 return HandleError_Identity;
530 }
531 if (pHandle->serial != serial)
532 {
533 return HandleError_Changed;
534 }
535
536 *in_pHandle = pHandle;
537 *in_index = index;
538
539 return HandleError_None;
540}
541
542bool HandleSystem::CheckAccess(QHandle *pHandle, HandleAccessRight right, const HandleSecurity *pSecurity)
543{

Callers 12

IdentityHandleFunction · 0.45
RunThinkPartMethod · 0.45
SQL_GetDriverFunction · 0.45
SQL_ReadDriverFunction · 0.45
Database_Driver_getFunction · 0.45
DoActionMethod · 0.45
OnMenuVoteResultsMethod · 0.45
CreateMenuFunction · 0.45
GetMenuStyleFunction · 0.45
GetMenuStyleHandleFunction · 0.45
CreateMenuExFunction · 0.45
GetPanelStyleFunction · 0.45

Calls 1

GetIdentRootMethod · 0.80

Tested by

no test coverage detected