Skip to content

xport_cancel

xport_cancel() controls the ExportLatch owned by the current Hook account and identified by the 32-byte source Export transaction hash W.

  • With flags == 0, it stops further signature publication but retains the latch, owner reserve, and Import callback readiness.
  • With flags == tfExportEraseLatch (0x00010000), it erases the latch, releases its reserve, and intentionally forfeits any later callback.
  • Neither mode revokes signatures already released.
  • A Hook cannot control the latch being created or consumed by the same currently executing Export or Import transaction.
int64_t xport_cancel (
uint32_t read_ptr,
uint32_t read_len,
uint32_t flags
);

Stop publication and retain the latch:

int64_t result = xport_cancel(SBUF(origin), 0);
if (result != 1)
rollback(SBUF("Stop Export failed"), 1);

Erase the latch and release reserve:

int64_t result = xport_cancel(SBUF(origin), 0x00010000U);
if (result != 1)
rollback(SBUF("Erase Export failed"), 1);
NameTypeDescription
read_ptruint32_tPointer to the 32-byte W value returned by xport().
read_lenuint32_tMust be exactly 32.
flagsuint32_t0 to stop publication and retain the latch, or tfExportEraseLatch to erase it.

Returns 1 on success. Negative results include:

ErrorDescription
OUT_OF_BOUNDSThe input pointer or length is outside Hook memory.
INVALID_ARGUMENTW is zero, read_len is not 32, or the flags are unsupported.
PREREQUISITE_NOT_METThe current Export or Import execution is creating or consuming this same latch.
DOESNT_EXISTNo matching ExportLatch exists for W and the current Hook account.