Table of Contents

Interface IExternalCallInterceptor

Namespace
RDCore.SDK.Runtime.Abstract.Execution
Assembly
RDCore.SDK.dll

Sees every call to something outside the workspace before it happens, and may refuse it or answer it.

public interface IExternalCallInterceptor

Remarks

🎯 The reason this exists: a VBA environment that can call into native libraries is a way to run arbitrary code, and the historical answer to that has been for administrators to disable the whole language because nothing could see what a macro actually did. This is the seam that makes the calls visible — every one of them, with its arguments, before it runs — and refusable one at a time.

Interceptors are ordered, and each sees the call until one refuses or answers it: that one stops it, and the interceptors after it do not see it. An interceptor is expected to be cheap and to have no opinion about most calls: it runs in front of every external call, not only the dangerous ones.

An interceptor allows, refuses or answers a call (ExternalCallDecision). An answered call is not run: the call site gets the ExternalCallAnswer, which is how a test fakes MsgBox.

Methods

Intercept(ExternalCallRequest, IRuntimeSession)

Decides whether request may proceed, or answers it.

ExternalCallDecision Intercept(ExternalCallRequest request, IRuntimeSession session)

Parameters

request ExternalCallRequest

The call about to be made.

session IRuntimeSession

The session making it.

Returns

ExternalCallDecision

Remarks

This is also the point at which a call can be logged: the request describes itself (Describe()), arguments included, and an interceptor that only wants a record of what a workspace did returns Allow having written one.