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.

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 every one of them sees the call; the first to refuse it stops 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 cannot yet answer a call. That is the same seam a mock needs, and is where the planned Unit Testing extension's MsgBox/InputBox substitution lands — TODO extend ExternalCallDecision with a result rather than adding a second mechanism beside this one.

Methods

Intercept(ExternalCallRequest, IRuntimeSession)

Decides whether request may proceed.

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.