Ejemplo n.º 1
0
static cell_t sm_GetForwardFunctionCount(IPluginContext *pContext, const cell_t *params)
{
	Handle_t hndl = static_cast<Handle_t>(params[1]);
	HandleError err;
	IForward *pForward;

	if ((err=g_HandleSys.ReadHandle(hndl, g_GlobalFwdType, NULL, (void **)&pForward))
		!= HandleError_None)
	{
		return pContext->ThrowNativeError("Invalid forward handle %x (error %d)", hndl, err);
	}

	return pForward->GetFunctionCount();
}
Ejemplo n.º 2
0
static cell_t sm_GetForwardFunctionCount(IPluginContext *pContext, const cell_t *params)
{
	Handle_t hndl = static_cast<Handle_t>(params[1]);
	HandleError err;
	IForward *pForward;
	HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);

	if ((err=handlesys->ReadHandle(hndl, g_GlobalFwdType, &sec, (void **)&pForward))
		!= HandleError_None)
	{
		return pContext->ThrowNativeError("Invalid forward handle %x (error %d)", hndl, err);
	}

	return pForward->GetFunctionCount();
}