No supported public Defender Win32 field or event documented here proves that a particular file revision was fully inspected, records a per-file skipped/excluded/cached/partial disposition, or guarantees callback and file-handle settlement after return or abort.
What the public contracts establish
- A resource scan identifies its input by
Schemeand absolutePath.MPRESOURCE_INFOhas no file ID, content hash, size, last-write time, USN, or other revision identifier. ItsClassmember classifies a resource associated with a threat; it is not an inspection disposition. ^1^ -
MPSCAN_DATAcontains the scan type, optional resource information, cumulative resource statistics, and cumulative threat statistics. It has no per-file revision or outcome field. ^2^ -
MPRESOURCE_STATSreports aggregate counts—files, bytes, processes, registry keys—and approximate overall progress. Those counters cannot establish that the one named file, or a particular revision of it, supplied the increment. ^3^ - Callback data adds a notification type, timestamp, failure
HRESULT, and type-dependent payload. It does not add a content identity or per-file disposition. ^4^
Consequently, none of these outcomes has a documented per-file proof field:
- fully inspected;
- skipped or only partially inspected;
- excluded;
- satisfied from cache;
- inspected bytes matching the revision staged by the caller.
MPNOTIFY_SCAN_ERROR can report an error for a specific resource, and MPNOTIFY_SCAN_INFECTED can identify an infected resource. The documentation also notes that an infected indication might not become a final threat because of exclusions. Neither notification provides a general “clean and fully inspected” receipt. ^5^
Completion versus settlement
For a synchronous scan, the documented behavior is that MpScanStart returns only after the scan is finished. For an asynchronous scan, it returns immediately after successful initiation. The callback set includes MPNOTIFY_SCAN_START, MPNOTIFY_SCAN_COMPLETE, MPNOTIFY_SCAN_CANCEL, resource errors, and internal failure. ^5^
Those contracts do not document that:
- synchronous return is a callback-drain barrier;
-
MPNOTIFY_SCAN_COMPLETEorMPNOTIFY_SCAN_CANCELmust be the final callback; - no callback can already be queued or execute concurrently afterward;
- callback context is no longer in use when the API returns;
- Defender has released every underlying file object or section;
- the file can immediately be replaced, deleted, or exclusively reopened.
For an asynchronous scan, MpScanControl(handle, MPCONTROL_ABORT) requests that the scan be aborted. S_OK means the control call succeeded; the contract does not define it as a synchronous cancellation-and-drain acknowledgment. It provides no timeout, terminal-state query, or callback-settlement rule. ^6^
MpHandleClose only documents closing the scan handle. It does not state that closure waits for provider work, drains callbacks, or releases the scanned file. ^7^
Therefore, callback-owned state cannot safely be freed merely on the assumption that abort success, synchronous return, or handle closure is a documented callback fence. Any stronger behavior observed experimentally remains an implementation observation, not a public API guarantee.
MPSCAN_RESULT does not supply the missing proof
MPSCAN_RESULT records scan-level metadata: scan type/source, GUID, start and end times, aggregate threat/resource statistics, and signature version. It contains neither the scanned path nor an exact-file identity or per-file disposition. ^8^
MPSTATUS_INFO exposes the last quick- and full-scan results, but that does not correlate an individual resource revision with an inspection result. ^9^
Although MpScanStart says its returned handle can be used in later calls “such as to retrieve a scan result,” the published public function index shown here does not identify a scan-handle result-retrieval function. The documented functions include start, control, status, threat enumeration, and handle close, but no public call that converts a resource-scan handle into stronger per-file evidence. ^10^
Deadlines and process/service termination
The public contracts cited above specify no:
- deadline from
S_OKinitiation toMPNOTIFY_SCAN_START; - maximum resource-scan duration;
- grace or settlement period following abort;
- callback behavior after caller termination;
- settlement guarantee after Defender service termination or restart;
- deadline by which file resources must be released.
The documented one-day and seven-day limits apply to particular scheduled or MpCmdRun quick/full scans. They do not establish a deadline for a resource scan started through this API and should not be applied to this case. ^11^
If an application requires auditable proof for immutable bytes, a separate application-level protocol is necessary: preserve or snapshot the input revision, calculate its identity independently, and treat Defender’s result only as a scan-level signal. The available public Defender interface cannot bind that identity to a documented “fully inspected” disposition or provide the requested settlement fence.
References