// ntfill.h
// rev
typedef // routine: CiFreePolicyInfo
_Function_class_(CI_FREE_POLICY_INFO)
_IRQL_requires_max_(PASSIVE_LEVEL)
VOID
NTAPI
CI_FREE_POLICY_INFO(
_Inout_ PMINCRYPT_POLICY_INFO PolicyInfo
);
View code on GitHubFrees memory allocated by other Code Integrity signature verification functions and referenced from a MINCRYPT_POLICY_INFO structure.
PolicyInfo - a pointer to the MINCRYPT_POLICY_INFO structure to release. The structure itself is owned by the caller; the inner certificate chain information buffer is freed. The routine is safe to call on a structure that was not populated (for example, when the preceding verification call failed).This function is exported from ci.dll, the kernel-mode Code Integrity module.
Per the FIPS 140-2 Code Integrity Security Policy Document (Microsoft, Windows 10 1809 / Windows Server 2019), the function "frees memory allocated by the CiVerifyHashInCatalog, CiCheckSignedFile, CiFindPageHashesInCatalog, and CiFindPageHashesInSignedFile functions". The same release is used for the MINCRYPT_POLICY_INFO structures produced by CiValidateFileObject, as documented in the Cybereason write-up below.
For more details, see Code Integrity in the Kernel: A Look Into ci.dll by Liron Zuarets and Ido Moshe.