| 1 | 
 /** | 
 
 
 
 
 
 | 2 | 
  * This file is part of the mingw-w64 runtime package. | 
 
 
 
 
 
 | 3 | 
  * No warranty is given; refer to the file DISCLAIMER within this package. | 
 
 
 
 
 
 | 4 | 
  */ | 
 
 
 
 
 
 | 5 | 
  | 
 
 
 
 
 
 | 6 | 
 cpp_quote("#include <winapifamily.h>") | 
 
 
 
 
 
 | 7 | 
 cpp_quote("") | 
 
 
 
 
 
 | 8 | 
 cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)") | 
 
 
 
 
 
 | 9 | 
  | 
 
 
 
 
 
 | 10 | 
 import "oaidl.idl"; | 
 
 
 
 
 
 | 11 | 
 import "wincrypt.idl"; | 
 
 
 
 
 
 | 12 | 
 import "msopc.idl"; | 
 
 
 
 
 
 | 13 | 
  | 
 
 
 
 
 
 | 14 | 
 cpp_quote("#if NTDDI_VERSION >= 0x06010000") | 
 
 
 
 
 
 | 15 | 
 cpp_quote("#define XPS_E_SIGREQUESTID_DUP  MAKE_HRESULT(1, FACILITY_XPS, 901)") | 
 
 
 
 
 
 | 16 | 
 cpp_quote("#define XPS_E_PACKAGE_NOT_OPENED MAKE_HRESULT(1, FACILITY_XPS, 902)") | 
 
 
 
 
 
 | 17 | 
 cpp_quote("#define XPS_E_PACKAGE_ALREADY_OPENED MAKE_HRESULT(1, FACILITY_XPS, 903)") | 
 
 
 
 
 
 | 18 | 
 cpp_quote("#define XPS_E_SIGNATUREID_DUP MAKE_HRESULT(1, FACILITY_XPS, 904)") | 
 
 
 
 
 
 | 19 | 
 cpp_quote("#define XPS_E_MARKUP_COMPATIBILITY_ELEMENTS MAKE_HRESULT(1, FACILITY_XPS, 905)") | 
 
 
 
 
 
 | 20 | 
 cpp_quote("#define XPS_E_OBJECT_DETACHED MAKE_HRESULT(1, FACILITY_XPS, 906)") | 
 
 
 
 
 
 | 21 | 
 cpp_quote("#define XPS_E_INVALID_SIGNATUREBLOCK_MARKUP MAKE_HRESULT(1, FACILITY_XPS, 907)") | 
 
 
 
 
 
 | 22 | 
  | 
 
 
 
 
 
 | 23 | 
 [uuid (8223a7eb-c4d5-474d-9bcc-ff67185e64a0)] | 
 
 
 
 
 
 | 24 | 
 library MSXPSSIG { | 
 
 
 
 
 
 | 25 | 
   interface IXpsSigningOptions; | 
 
 
 
 
 
 | 26 | 
   interface IXpsSignatureCollection; | 
 
 
 
 
 
 | 27 | 
   interface IXpsSignature; | 
 
 
 
 
 
 | 28 | 
   interface IXpsSignatureBlockCollection; | 
 
 
 
 
 
 | 29 | 
   interface IXpsSignatureBlock; | 
 
 
 
 
 
 | 30 | 
   interface IXpsSignatureRequestCollection; | 
 
 
 
 
 
 | 31 | 
   interface IXpsSignatureRequest; | 
 
 
 
 
 
 | 32 | 
  | 
 
 
 
 
 
 | 33 | 
   typedef [v1_enum] enum { | 
 
 
 
 
 
 | 34 | 
     XPS_SIGN_FLAGS_NONE = 0x0, | 
 
 
 
 
 
 | 35 | 
     XPS_SIGN_FLAGS_IGNORE_MARKUP_COMPATIBILITY = 0x1 | 
 
 
 
 
 
 | 36 | 
   } XPS_SIGN_FLAGS; | 
 
 
 
 
 
 | 37 | 
  | 
 
 
 
 
 
 | 38 | 
   typedef [v1_enum] enum { | 
 
 
 
 
 
 | 39 | 
     XPS_SIGN_POLICY_NONE = 0x0, | 
 
 
 
 
 
 | 40 | 
     XPS_SIGN_POLICY_CORE_PROPERTIES = 0x1, | 
 
 
 
 
 
 | 41 | 
     XPS_SIGN_POLICY_SIGNATURE_RELATIONSHIPS = 0x2, | 
 
 
 
 
 
 | 42 | 
     XPS_SIGN_POLICY_PRINT_TICKET = 0x4, | 
 
 
 
 
 
 | 43 | 
     XPS_SIGN_POLICY_DISCARD_CONTROL = 0x8, | 
 
 
 
 
 
 | 44 | 
  | 
 
 
 
 
 
 | 45 | 
     XPS_SIGN_POLICY_ALL = 0xf | 
 
 
 
 
 
 | 46 | 
   } XPS_SIGN_POLICY; | 
 
 
 
 
 
 | 47 | 
  | 
 
 
 
 
 
 | 48 | 
   typedef enum { | 
 
 
 
 
 
 | 49 | 
     XPS_SIGNATURE_STATUS_INCOMPLIANT = 1, | 
 
 
 
 
 
 | 50 | 
     XPS_SIGNATURE_STATUS_INCOMPLETE = 2, | 
 
 
 
 
 
 | 51 | 
     XPS_SIGNATURE_STATUS_BROKEN = 3, | 
 
 
 
 
 
 | 52 | 
     XPS_SIGNATURE_STATUS_QUESTIONABLE = 4, | 
 
 
 
 
 
 | 53 | 
     XPS_SIGNATURE_STATUS_VALID = 5 | 
 
 
 
 
 
 | 54 | 
   } XPS_SIGNATURE_STATUS; | 
 
 
 
 
 
 | 55 | 
  | 
 
 
 
 
 
 | 56 | 
   cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(XPS_SIGN_FLAGS)") | 
 
 
 
 
 
 | 57 | 
   cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(XPS_SIGN_POLICY)") | 
 
 
 
 
 
 | 58 | 
  | 
 
 
 
 
 
 | 59 | 
   [object, uuid (7718eae4-3215-49be-af5b-594fef7fcfa6)] | 
 
 
 
 
 
 | 60 | 
   interface IXpsSigningOptions : IUnknown { | 
 
 
 
 
 
 | 61 | 
     HRESULT GetSignatureId ([out, string, retval] LPWSTR *signatureId); | 
 
 
 
 
 
 | 62 | 
     HRESULT SetSignatureId ([in, string] LPCWSTR signatureId); | 
 
 
 
 
 
 | 63 | 
     HRESULT GetSignatureMethod ([out, string, retval] LPWSTR *signatureMethod); | 
 
 
 
 
 
 | 64 | 
     HRESULT SetSignatureMethod ([in, string] LPCWSTR signatureMethod); | 
 
 
 
 
 
 | 65 | 
     HRESULT GetDigestMethod ([out, string, retval] LPWSTR *digestMethod); | 
 
 
 
 
 
 | 66 | 
     HRESULT SetDigestMethod ([in, string] LPCWSTR digestMethod); | 
 
 
 
 
 
 | 67 | 
     HRESULT GetSignaturePartName ([out, retval] IOpcPartUri **signaturePartName); | 
 
 
 
 
 
 | 68 | 
     HRESULT SetSignaturePartName ([in] IOpcPartUri *signaturePartName); | 
 
 
 
 
 
 | 69 | 
     HRESULT GetPolicy ([out, retval] XPS_SIGN_POLICY *policy); | 
 
 
 
 
 
 | 70 | 
     HRESULT SetPolicy ([in] XPS_SIGN_POLICY policy); | 
 
 
 
 
 
 | 71 | 
     HRESULT GetSigningTimeFormat ([out, retval] OPC_SIGNATURE_TIME_FORMAT *timeFormat); | 
 
 
 
 
 
 | 72 | 
     HRESULT SetSigningTimeFormat ([in] OPC_SIGNATURE_TIME_FORMAT timeFormat); | 
 
 
 
 
 
 | 73 | 
     HRESULT GetCustomObjects ([out, retval] IOpcSignatureCustomObjectSet **customObjectSet); | 
 
 
 
 
 
 | 74 | 
     HRESULT GetCustomReferences ([out, retval] IOpcSignatureReferenceSet **customReferenceSet); | 
 
 
 
 
 
 | 75 | 
     HRESULT GetCertificateSet ([out, retval] IOpcCertificateSet **certificateSet); | 
 
 
 
 
 
 | 76 | 
     HRESULT GetFlags ([out, retval] XPS_SIGN_FLAGS *flags); | 
 
 
 
 
 
 | 77 | 
     HRESULT SetFlags ([in] XPS_SIGN_FLAGS flags); | 
 
 
 
 
 
 | 78 | 
   } | 
 
 
 
 
 
 | 79 | 
  | 
 
 
 
 
 
 | 80 | 
   [object, local, uuid (6ae4c93e-1ade-42fb-898b-3a5658284857)] | 
 
 
 
 
 
 | 81 | 
   interface IXpsSignature : IUnknown { | 
 
 
 
 
 
 | 82 | 
     HRESULT GetSignatureId ([out, string, retval] LPWSTR *sigId); | 
 
 
 
 
 
 | 83 | 
     HRESULT GetSignatureValue ([out, size_is (,*count)] UINT8 **signatureHashValue,[out] UINT32 *count); | 
 
 
 
 
 
 | 84 | 
     HRESULT GetCertificateEnumerator ([out, retval] IOpcCertificateEnumerator **certificateEnumerator); | 
 
 
 
 
 
 | 85 | 
     HRESULT GetSigningTime ([out, string, retval] LPWSTR *sigDateTimeString); | 
 
 
 
 
 
 | 86 | 
     HRESULT GetSigningTimeFormat ([out, retval] OPC_SIGNATURE_TIME_FORMAT *timeFormat); | 
 
 
 
 
 
 | 87 | 
     HRESULT GetSignaturePartName ([out, retval] IOpcPartUri **signaturePartName); | 
 
 
 
 
 
 | 88 | 
     HRESULT Verify ([in] const CERT_CONTEXT *x509Certificate,[out, retval] XPS_SIGNATURE_STATUS *sigStatus); | 
 
 
 
 
 
 | 89 | 
     HRESULT GetPolicy ([out, retval] XPS_SIGN_POLICY *policy); | 
 
 
 
 
 
 | 90 | 
     HRESULT GetCustomObjectEnumerator ([out, retval] IOpcSignatureCustomObjectEnumerator **customObjectEnumerator); | 
 
 
 
 
 
 | 91 | 
     HRESULT GetCustomReferenceEnumerator ([out, retval] IOpcSignatureReferenceEnumerator **customReferenceEnumerator); | 
 
 
 
 
 
 | 92 | 
     HRESULT GetSignatureXml ([out, size_is (,*count)] UINT8 **signatureXml,[out] UINT32 *count); | 
 
 
 
 
 
 | 93 | 
     HRESULT SetSignatureXml ([in, size_is (count)] const UINT8 *signatureXml,[in] UINT32 count); | 
 
 
 
 
 
 | 94 | 
   } | 
 
 
 
 
 
 | 95 | 
  | 
 
 
 
 
 
 | 96 | 
   [object, uuid (151fac09-0b97-4ac6-A323-5e4297d4322b)] | 
 
 
 
 
 
 | 97 | 
   interface IXpsSignatureBlock : IUnknown { | 
 
 
 
 
 
 | 98 | 
     HRESULT GetRequests ([out, retval] IXpsSignatureRequestCollection **requests); | 
 
 
 
 
 
 | 99 | 
     HRESULT GetPartName ([out, retval] IOpcPartUri **partName); | 
 
 
 
 
 
 | 100 | 
     HRESULT GetDocumentIndex ([out, retval] UINT32 *fixedDocumentIndex); | 
 
 
 
 
 
 | 101 | 
     HRESULT GetDocumentName ([out, retval] IOpcPartUri **fixedDocumentName); | 
 
 
 
 
 
 | 102 | 
     HRESULT CreateRequest ([in, string] LPCWSTR requestId,[out, retval] IXpsSignatureRequest **signatureRequest); | 
 
 
 
 
 
 | 103 | 
   } | 
 
 
 
 
 
 | 104 | 
  | 
 
 
 
 
 
 | 105 | 
   [object, uuid (23397050-FE99-467a-8dce-9237f074ffe4)] | 
 
 
 
 
 
 | 106 | 
   interface IXpsSignatureBlockCollection : IUnknown { | 
 
 
 
 
 
 | 107 | 
     HRESULT GetCount ([out, retval] UINT32 *count); | 
 
 
 
 
 
 | 108 | 
     HRESULT GetAt ([in] UINT32 index,[out, retval] IXpsSignatureBlock **signatureBlock); | 
 
 
 
 
 
 | 109 | 
     HRESULT RemoveAt (UINT32 index); | 
 
 
 
 
 
 | 110 | 
   } | 
 
 
 
 
 
 | 111 | 
  | 
 
 
 
 
 
 | 112 | 
   [object, uuid (A2D1D95D-ADD2-4dff-AB27-6b9c645ff322)] | 
 
 
 
 
 
 | 113 | 
   interface IXpsSignatureCollection : IUnknown { | 
 
 
 
 
 
 | 114 | 
     HRESULT GetCount ([out, retval] UINT32 *count); | 
 
 
 
 
 
 | 115 | 
     HRESULT GetAt ([in] UINT32 index,[out, retval] IXpsSignature **signature); | 
 
 
 
 
 
 | 116 | 
     HRESULT RemoveAt (UINT32 index); | 
 
 
 
 
 
 | 117 | 
   } | 
 
 
 
 
 
 | 118 | 
  | 
 
 
 
 
 
 | 119 | 
   [object, uuid (d3e8d338-fdc4-4afc-80b5-d532a1782ee1), local] | 
 
 
 
 
 
 | 120 | 
   interface IXpsSignatureManager : IUnknown { | 
 
 
 
 
 
 | 121 | 
     HRESULT LoadPackageFile ([in, string] LPCWSTR fileName); | 
 
 
 
 
 
 | 122 | 
     HRESULT LoadPackageStream ([in] IStream *stream); | 
 
 
 
 
 
 | 123 | 
     HRESULT Sign ([in] IXpsSigningOptions *signOptions,[in] const CERT_CONTEXT *x509Certificate,[out, retval] IXpsSignature **signature); | 
 
 
 
 
 
 | 124 | 
     HRESULT GetSignatureOriginPartName ([out, retval] IOpcPartUri **signatureOriginPartName); | 
 
 
 
 
 
 | 125 | 
     HRESULT SetSignatureOriginPartName ([in] IOpcPartUri *signatureOriginPartName); | 
 
 
 
 
 
 | 126 | 
     HRESULT GetSignatures ([out, retval] IXpsSignatureCollection **signatures); | 
 
 
 
 
 
 | 127 | 
     HRESULT AddSignatureBlock ([in] IOpcPartUri *partName,[in] UINT32 fixedDocumentIndex,[out, retval] IXpsSignatureBlock **signatureBlock); | 
 
 
 
 
 
 | 128 | 
     HRESULT GetSignatureBlocks ([out, retval] IXpsSignatureBlockCollection **signatureBlocks); | 
 
 
 
 
 
 | 129 | 
     HRESULT CreateSigningOptions ([out, retval] IXpsSigningOptions **signingOptions); | 
 
 
 
 
 
 | 130 | 
     HRESULT SavePackageToFile ([in, string] LPCWSTR fileName,[in, unique] LPSECURITY_ATTRIBUTES securityAttributes,[in] DWORD flagsAndAttributes); | 
 
 
 
 
 
 | 131 | 
     HRESULT SavePackageToStream ([in] IStream *stream); | 
 
 
 
 
 
 | 132 | 
   } | 
 
 
 
 
 
 | 133 | 
  | 
 
 
 
 
 
 | 134 | 
   [object, uuid (ac58950b-7208-4b2d-b2c4-951083d3b8eb)] | 
 
 
 
 
 
 | 135 | 
   interface IXpsSignatureRequest : IUnknown { | 
 
 
 
 
 
 | 136 | 
     HRESULT GetIntent ([out, string, retval] LPWSTR *intent); | 
 
 
 
 
 
 | 137 | 
     HRESULT SetIntent ([in, string] LPCWSTR intent); | 
 
 
 
 
 
 | 138 | 
     HRESULT GetRequestedSigner ([out, string, retval] LPWSTR *signerName); | 
 
 
 
 
 
 | 139 | 
     HRESULT SetRequestedSigner ([in, string] LPCWSTR signerName); | 
 
 
 
 
 
 | 140 | 
     HRESULT GetRequestSignByDate ([out, string, retval] LPWSTR *dateString); | 
 
 
 
 
 
 | 141 | 
     HRESULT SetRequestSignByDate ([in, string] LPCWSTR dateString); | 
 
 
 
 
 
 | 142 | 
     HRESULT GetSigningLocale ([out, string, retval] LPWSTR *place); | 
 
 
 
 
 
 | 143 | 
     HRESULT SetSigningLocale ([in, string] LPCWSTR place); | 
 
 
 
 
 
 | 144 | 
     HRESULT GetSpotLocation ([out] INT32 *pageIndex,[out] IOpcPartUri **pagePartName,[out] float *x,[out] float *y); | 
 
 
 
 
 
 | 145 | 
     HRESULT SetSpotLocation ([in] INT32 pageIndex,[in] float x,[in] float y); | 
 
 
 
 
 
 | 146 | 
     HRESULT GetRequestId ([out, string, retval] LPWSTR *requestId); | 
 
 
 
 
 
 | 147 | 
     HRESULT GetSignature ([out, retval] IXpsSignature **signature); | 
 
 
 
 
 
 | 148 | 
   } | 
 
 
 
 
 
 | 149 | 
  | 
 
 
 
 
 
 | 150 | 
   [object, uuid (F0253E68-9f19-412e-9b4f-54d3b0ac6cd9)] | 
 
 
 
 
 
 | 151 | 
   interface IXpsSignatureRequestCollection : IUnknown { | 
 
 
 
 
 
 | 152 | 
     HRESULT GetCount ([out, retval] UINT32 *count); | 
 
 
 
 
 
 | 153 | 
     HRESULT GetAt ([in] UINT32 index,[out, retval] IXpsSignatureRequest **signatureRequest); | 
 
 
 
 
 
 | 154 | 
     HRESULT RemoveAt ([in] UINT32 index); | 
 
 
 
 
 
 | 155 | 
   } | 
 
 
 
 
 
 | 156 | 
  | 
 
 
 
 
 
 | 157 | 
   [uuid (b0c43320-2315-44a2-b70a-0943a140a8ee)] | 
 
 
 
 
 
 | 158 | 
   coclass XpsSignatureManager { | 
 
 
 
 
 
 | 159 | 
     interface IXpsSignatureManager; | 
 
 
 
 
 
 | 160 | 
   }; | 
 
 
 
 
 
 | 161 | 
 }; | 
 
 
 
 
 
 | 162 | 
 cpp_quote("#endif") | 
 
 
 
 
 
 | 163 | 
 cpp_quote("#endif") |