From: Alistair Leslie-Hughes Subject: [PATCH v3 4/4] include: Add IXMLHTTPRequest2/3 interfaces Message-Id: Date: Fri, 4 Sep 2020 18:09:27 +1000 In-Reply-To: <20200904080927.220712-1-leslie_alistair@hotmail.com> References: <20200904080927.220712-1-leslie_alistair@hotmail.com> Signed-off-by: Alistair Leslie-Hughes --- include/msxml6.idl | 106 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/include/msxml6.idl b/include/msxml6.idl index 1f657a8cde..b837e42477 100644 --- a/include/msxml6.idl +++ b/include/msxml6.idl @@ -109,6 +109,8 @@ interface ISchemaAny; interface ISchemaIdentityConstraint; interface ISchemaNotation; +interface IXMLHTTPRequest2Callback; +interface IXMLHTTPRequest3Callback; cpp_quote("#define DOMDocument DOMDocument2") cpp_quote("#define CLSID_DOMDocument CLSID_DOMDocument2") @@ -261,6 +263,35 @@ typedef enum _SCHEMATYPEVARIETY SCHEMATYPEVARIETY_UNION = 2, } SCHEMATYPEVARIETY; +typedef struct tagXHR_COOKIE +{ + [ref, string] WCHAR *pwszUrl; + [ref, string] WCHAR *pwszName; + [unique, string] WCHAR *pwszValue; + [unique, string] WCHAR *pwszP3PPolicy; + FILETIME ftExpires; + DWORD dwFlags; +} XHR_COOKIE; + +typedef [v1_enum] enum _XHR_PROPERTY +{ + XHR_PROP_NO_CRED_PROMPT = 0x0, + XHR_PROP_NO_AUTH = 0x1, + XHR_PROP_TIMEOUT = 0x2, + XHR_PROP_NO_DEFAULT_HEADERS = 0x3, + XHR_PROP_REPORT_REDIRECT_STATUS = 0x4, + XHR_PROP_NO_CACHE = 0x5, + XHR_PROP_EXTENDED_ERROR = 0x6, + XHR_PROP_QUERY_STRING_UTF8 = 0x7, + XHR_PROP_IGNORE_CERT_ERRORS = 0x8, +} XHR_PROPERTY; + +typedef struct tagXHR_CERT +{ + DWORD cbCert; + [ref, size_is(cbCert)] BYTE *pbCert; +} XHR_CERT; + [ local, object, @@ -1265,6 +1296,70 @@ interface IXMLHTTPRequest : IDispatch HRESULT onreadystatechange([in] IDispatch *pReadyStateSink); } +[ + object, + uuid(e5d37dc0-552a-4d52-9cc0-a14d546fbd04), + helpstring("IXMLHTTPRequest2 Interface") +] +interface IXMLHTTPRequest2 : IUnknown +{ + HRESULT Open([in, string, ref] const WCHAR *method, [in, string, ref] const WCHAR *url, + [in] IXMLHTTPRequest2Callback *callback, + [in, string, unique] const WCHAR *username, [in, string, unique] const WCHAR *password, + [in, string, unique] const WCHAR *proxy_username, [in, string, unique] const WCHAR *proxy_password); + HRESULT Send([in] ISequentialStream *body, [in] ULONGLONG body_size); + HRESULT Abort(); + HRESULT SetCookie([in, ref] const XHR_COOKIE *cookie, [out] DWORD *state); + HRESULT SetCustomResponseStream([in] ISequentialStream *stream); + HRESULT SetProperty([in] XHR_PROPERTY property, [in] ULONGLONG value); + HRESULT SetRequestHeader([in, string, ref] const WCHAR *header, [in, string, unique] const WCHAR *value); + HRESULT GetAllResponseHeaders([out, string] WCHAR **headers); + HRESULT GetCookie([in, ref, string] const WCHAR *url, [in, unique, string] const WCHAR *name, [in] DWORD dwFlags, + [out] ULONG *cookies_count, [out, size_is(,*cookies_count)] XHR_COOKIE **cookies); + HRESULT GetResponseHeader([in, string, ref] const WCHAR *header, [out, string] WCHAR **value); +} + +[ + object, + uuid(a1c9feee-0617-4f23-9d58-8961ea43567c), + helpstring("IXMLHttpRequest3 Interface") +] +interface IXMLHTTPRequest3 : IXMLHTTPRequest2 +{ + HRESULT SetClientCertificate([in] DWORD hash_size, [in, unique, size_is(hash_size)] const BYTE *hash, + [in, string, unique] const WCHAR *pin); +} + +[ + object, + uuid(a44a9299-e321-40de-8866-341b41669162), + helpstring("IXMLHTTPRequest2Callback Interface"), + pointer_default(ref) +] +interface IXMLHTTPRequest2Callback : IUnknown +{ + HRESULT OnRedirect([in] IXMLHTTPRequest2 *request, [in, string] const WCHAR* redirect_url); + HRESULT OnHeadersAvailable([in] IXMLHTTPRequest2 *request, [in] DWORD status, [in, string] const WCHAR *status_str); + HRESULT OnDataAvailable([in] IXMLHTTPRequest2 *request, [in] ISequentialStream *response); + HRESULT OnResponseReceived([in] IXMLHTTPRequest2 *request, [in] ISequentialStream *response); + HRESULT OnError([in] IXMLHTTPRequest2 *request, [in] HRESULT error); +} + +[ + object, + uuid(b9e57830-8c6c-4a6f-9c13-47772bb047bb), + helpstring("IXMLHttpRequest3Callback Interface") +] +interface IXMLHTTPRequest3Callback : IXMLHTTPRequest2Callback +{ + HRESULT OnServerCertificateReceived([in] IXMLHTTPRequest3 *request, [in] DWORD errors, + [in] DWORD chain_size, + [in, unique,size_is(chain_size)] const XHR_CERT *chain); + HRESULT OnClientCertificateRequested([in] IXMLHTTPRequest3 *request, [in] DWORD issuers_size, + [in, string, unique, size_is(issuers_size)] const WCHAR **issuers); +}; + + [ object, dual, @@ -1554,6 +1649,17 @@ coclass XMLHTTP60 [default] interface IXMLHTTPRequest; } +[ + helpstring("Free Threaded XML HTTP Request class 6.0"), + progid("Msxml2.FreeThreadedXMLHTTP60.6.0"), + threading(both), + uuid(88d96a09-f192-11d4-a65f-0040963251e5) +] +coclass FreeThreadedXMLHTTP60 +{ + interface IXMLHTTPRequest2; +} + [ uuid(afba6b42-5692-48ea-8141-dc517dcf0ef1) ] -- 2.28.0