Ejemplo n.º 1
0
static cell_t sm_CallFinish(IPluginContext *pContext, const cell_t *params)
{
	int err = SP_ERROR_NOT_RUNNABLE;
	cell_t *result;

	if (!s_CallStarted)
	{
		return pContext->ThrowNativeError("Cannot finish call when there is no call in progress");
	}

	pContext->LocalToPhysAddr(params[1], &result);

	if (s_pFunction)
	{
		IPluginFunction *pFunction = s_pFunction;
		ResetCall();
		err = pFunction->Execute(result);
	} else if (s_pForward) {
		IForward *pForward = s_pForward;
		ResetCall();
		err = pForward->Execute(result, NULL);
	}

	return err;
}
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;

	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.º 3
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();
}