MsiGetFileSignatureInformation
C# Signature:
[Flags]
public enum MSISIGINFO : uint
{
None = 0,
MSI_INVALID_HASH_IS_FATAL = 1
}
public enum HRESULT
{
S_OK = unchecked(0x00000000),
S_FALSE = unchecked(0x00000001),
E_FAIL = unchecked((int)0x80004005),
E_INVALIDARG = unchecked((int)0x80070057),
E_MOREDATA = unchecked((int)0x800700EA),
E_OUTOFMEMORY = unchecked((int)0x8007000E),
ERROR_FUNCTION_FAILED = unchecked((int)0x8007065B),
TRUST_E_NOSIGNATURE = unchecked((int)0x800B0100),
TRUST_E_BAD_DIGEST = unchecked((int)0x80096010),
CERT_E_REVOKED = unchecked((int)0x800B010C),
TRUST_E_SUBJECT_NOT_TRUSTED = unchecked((int)0x800B0004),
TRUST_E_PROVIDER_UNKNOWN = unchecked((int)0x800B0001),
TRUST_E_ACTION_UNKNOWN = unchecked((int)0x800B0002),
TRUST_E_SUBJECT_FORM_UNKNOWN = unchecked((int)0x800B0003),
}
[StructLayout(LayoutKind.Sequential)]
public struct CERT_CONTEXT
{
public CertEncodingType dwCertEncodingType;
public IntPtr pbCertEncoded;
public uint cbCertEncoded;
public IntPtr pCertInfo;
public IntPtr hCertStore;
}
[DllImport("msi.dll", CharSet = CharSet.Unicode)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern HRESULT MsiGetFileSignatureInformation(
[In] string szSignedObjectPath,
[In] MSISIGINFO dwFlags,
[In, Out] ref IntPtr ppcCertContext,
[Out] byte[] pbHashData,
[In, Out] ref int pcbHashData);Sample Code:
Última actualización