#include "..\inc\dispids.h" [ uuid(304691b9-cd81-46b0-beea-0914154c1db4), helpstring("WinHTTP Test 1.0 Type Library"), lcid(0x0000), version(1.0) ] library WinHttpTest { importlib ("stdole32.tlb"); importlib ("stdole2.tlb"); // ==================================== IWinHttpTest ==================================== [ uuid(ce3aa519-f3ab-4e9e-88cc-b4fec3d326cf), object, dual, nonextensible, helpstring("IWinHttpTest Interface"), pointer_default(unique) ] interface IWinHttpTest : IDispatch { [ id(DISPID_WINHTTPTEST_OPEN), helpstring("wraps winhttp5!WinHttpOpen()") ] HRESULT WinHttpOpen( [in] VARIANT UserAgent, [in] VARIANT AccessType, [in] VARIANT ProxyName, [in] VARIANT ProxyBypass, [in] VARIANT Flags, [out, retval] VARIANT* OpenHandle ); [ id(DISPID_WINHTTPTEST_CONNECT), helpstring("wraps winhttp5!WinHttpConnect()") ] HRESULT WinHttpConnect( [in] VARIANT OpenHandle, [in] VARIANT ServerName, [in] VARIANT ServerPort, [in] VARIANT Reserved, [out, retval] VARIANT* ConnectHandle ); [ id(DISPID_WINHTTPTEST_OPENREQUEST), helpstring("wraps winhttp5!WinHttpRequest()") ] HRESULT WinHttpOpenRequest( [in] VARIANT ConnectHandle, [in] VARIANT Verb, [in] VARIANT ObjectName, [in] VARIANT Version, [in] VARIANT Referrer, [in] VARIANT AcceptTypes, [in] VARIANT Flags, [out, retval] VARIANT* RequestHandle ); [ id(DISPID_WINHTTPTEST_SENDREQUEST), helpstring("wraps winhttp5!WinHttpSendRequest()") ] HRESULT WinHttpSendRequest( [in] VARIANT RequestHandle, [in] VARIANT Headers, [in] VARIANT HeadersLength, [in] VARIANT OptionalData, [in] VARIANT OptionalLength, [in] VARIANT TotalLength, [in] VARIANT Context, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_RECEIVERESPONSE), helpstring("wraps winhttp5!WinHttpReceiveResponse()") ] HRESULT WinHttpReceiveResponse( [in] VARIANT RequestHandle, [in] VARIANT Reserved, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_CLOSEHANDLE), helpstring("wraps winhttp5!WinHttpCloseHandle()") ] HRESULT WinHttpCloseHandle( [in] VARIANT InternetHandle, [out, retval] VARIANT* Success ); //+======================================================================== // NB: WinHttpReadData // // The BufferObject parameter replaces the following C API params: // // - [out] LPVOID lpBuffer // - [in] DWORD dwNumberOfBytesToRead // - [out] LPDWORD lpdwNumberOfBytesRead //-======================================================================== [ id(DISPID_WINHTTPTEST_READDATA), helpstring("wraps winhttp5!WinHttpReadData()") ] HRESULT WinHttpReadData( [in] VARIANT RequestHandle, [in] VARIANT BufferObject, [out, retval] VARIANT* Success ); //+======================================================================== // NB: WinHttpWriteData // // The BufferObject parameter replaces the following C API params: // // - [in] LPCVOID lpBuffer // - [in] DWORD dwNumberOfBytesToWrite // - [out] LPDWORD lpdwNumberOfBytesWritten //-======================================================================== [ id(DISPID_WINHTTPTEST_WRITEDATA), helpstring("wraps winhttp5!WinHttpWriteData()") ] HRESULT WinHttpWriteData( [in] VARIANT RequestHandle, [in] VARIANT BufferObject, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_QUERYDATAAVAILABLE), helpstring("wraps winhttp5!WinHttpQueryDataAvailable()") ] HRESULT WinHttpQueryDataAvailable( [in] VARIANT RequestHandle, [in] VARIANT boNumberOfBytesAvailable, [out, retval] VARIANT* Success ); //+======================================================================== // NB: WinHttpQueryOption // // The BufferObject parameter replaces the following C API params: // // - [out] LPVOID lpBuffer // - [in, out] LPDWORD lpdwBufferLength //-======================================================================== [ id(DISPID_WINHTTPTEST_QUERYOPTION), helpstring("wraps winhttp5!WinHttpQueryOption()") ] HRESULT WinHttpQueryOption( [in] VARIANT InternetHandle, [in] VARIANT Option, [in] VARIANT BufferObject, [out, retval] VARIANT* Success ); //+======================================================================== // NB: WinHttpSetOption // // The BufferObject parameter replaces the following C API params: // // - [in] LPVOID lpBuffer // - [in] DWORD dwBufferLength //-======================================================================== [ id(DISPID_WINHTTPTEST_SETOPTION), helpstring("wraps winhttp5!WinHttpSetOption()") ] HRESULT WinHttpSetOption( [in] VARIANT InternetHandle, [in] VARIANT Option, [in] VARIANT BufferObject, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_SETTIMEOUTS), helpstring("wraps winhttp5!WinHttpSetTimeouts()") ] HRESULT WinHttpSetTimeouts( [in] VARIANT InternetHandle, [in] VARIANT ResolveTimeout, [in] VARIANT ConnectTimeout, [in] VARIANT SendTimeout, [in] VARIANT ReceiveTimeout, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_ADDREQUESTHEADERS), helpstring("wraps winhttp5!WinHttpAddRequestHeaders()") ] HRESULT WinHttpAddRequestHeaders( [in] VARIANT RequestHandle, [in] VARIANT Headers, [in] VARIANT HeadersLength, [in] VARIANT Modifiers, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_SETCREDENTIALS), helpstring("wraps winhttp5!WinHttpSetCredentials()") ] HRESULT WinHttpSetCredentials( [in] VARIANT RequestHandle, [in] VARIANT AuthTargets, [in] VARIANT AuthScheme, [in] VARIANT UserName, [in] VARIANT Password, [in] VARIANT AuthParams, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_QUERYAUTHSCHEMES), helpstring("wraps winhttp5!WinHttpQueryAuthSchemes()") ] HRESULT WinHttpQueryAuthSchemes( [in] VARIANT RequestHandle, [in] VARIANT SupportedSchemes, [in] VARIANT PreferredSchemes, [in] VARIANT AuthTarget, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_QUERYHEADERS), helpstring("wraps winhttp5!WinHttpQueryHeaders()") ] HRESULT WinHttpQueryHeaders( [in] VARIANT RequestHandle, [in] VARIANT InfoLevel, [in] VARIANT HeaderName, [in] VARIANT HeaderValue, [in] VARIANT HeaderValueLength, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_TIMEFROMSYSTEMTIME), helpstring("wraps winhttp5!WinHttpTimeFromSystemTime()") ] HRESULT WinHttpTimeFromSystemTime( [in] VARIANT SystemTime, [in] VARIANT boHttpTime, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_TIMETOSYSTEMTIME), helpstring("wraps winhttp5!WinHttpTimeToSystemTime()") ] HRESULT WinHttpTimeToSystemTime( [in] VARIANT boHttpTime, [in] VARIANT SystemTime, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_CRACKURL), helpstring("wraps winhttp5!WinHttpCrackUrl()") ] HRESULT WinHttpCrackUrl( [in] VARIANT Url, [in] VARIANT UrlLength, [in] VARIANT Flags, [in] VARIANT UrlComponents, [out, retval] VARIANT* Success ); //+======================================================================== // NB: WinHttpCreateUrl // // The BufferObject parameter replaces the following C API params: // // - [out] LPWSTR pwszUrl // - [in, out] LPDWORD lpdwUrlLength //-======================================================================== [ id(DISPID_WINHTTPTEST_CREATEURL), helpstring("wraps winhttp5!WinHttpCreateUrl()") ] HRESULT WinHttpCreateUrl( [in] VARIANT UrlComponents, [in] VARIANT Flags, [in] VARIANT BufferObject, [out, retval] VARIANT* Success ); [ id(DISPID_WINHTTPTEST_SETSTATUSCALLBACK), helpstring("wraps winhttp5!WinHttpSetStatusCallback()") ] HRESULT WinHttpSetStatusCallback( [in] VARIANT InternetHandle, [in] VARIANT CallbackFunction, [in] VARIANT NotificationFlags, [in] VARIANT Reserved, [out, retval] VARIANT* RetVal ); [ id(DISPID_WINHTTPTEST_HELPER_GETBUFFEROBJECT), helpstring("creates a BufferObject Object") ] HRESULT HelperGetBufferObject( [in] VARIANT Size, [in] VARIANT Type, [in] VARIANT Flags, [out, retval] VARIANT* BufferObject ); [ id(DISPID_WINHTTPTEST_HELPER_GETURLCOMPONENTS), helpstring("creates an UrlComponents Object") ] HRESULT HelperGetUrlComponents( [in] VARIANT Flags, [out, retval] VARIANT* UrlComponents ); [ id(DISPID_WINHTTPTEST_HELPER_GETSYSTEMTIME), helpstring("creates a SystemTime Object") ] HRESULT HelperGetSystemTime( [in] VARIANT Flags, [out, retval] VARIANT* SystemTime ); [ id(DISPID_WINHTTPTEST_HELPER_GETLASTERROR), helpstring("creates a Win32ErrorCode Object") ] HRESULT HelperGetLastError( [out, retval] VARIANT* Win32ErrorCode ); }; // ====================================================================================== // ================================== IWHTBufferObject ================================== [ uuid(12384cab-a208-49c2-b411-db6a8788e46d), object, local, dual, nonextensible, helpstring("IWHTBufferObject Interface"), pointer_default(unique) ] interface IWHTBufferObject : IDispatch { [ id(DISPID_BUFFEROBJECT_SIZE), propget, helpstring("returns the buffer size in terms of the type") ] HRESULT Size( [out, retval] VARIANT* Size ); [ id(DISPID_BUFFEROBJECT_TYPE), propget, helpstring("returns the data type of the buffer") ] HRESULT Type( [out, retval] VARIANT* Type ); [ id(DISPID_BUFFEROBJECT_BYTESTRANSFERRED), propget, helpstring("returns the number of bytes transferred in the last i/o operation") ] HRESULT BytesTransferred( [out, retval] VARIANT* BytesTransferred ); [ id(DISPID_BUFFEROBJECT_FLAGS), propget, helpstring("returns the creation flags for the buffer object") ] HRESULT Flags( [out, retval] VARIANT* Flags ); }; // ====================================================================================== // ================================= IWHTUrlComponents ================================== [ uuid(e4b8fede-7ab8-4478-a805-492f0d86fd6d), object, local, dual, nonextensible, helpstring("IWHTUrlComponents Interface"), pointer_default(unique) ] interface IWHTUrlComponents : IDispatch { [ id(DISPID_URLCOMPONENTS_STRUCTSIZE), propget, helpstring("gets the size of the structure") ] HRESULT StructSize( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_STRUCTSIZE), propput, helpstring("sets the size of the structure") ] HRESULT StructSize( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_SCHEME), propget, helpstring("gets the url scheme") ] HRESULT Scheme( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_SCHEME), propput, helpstring("sets the url scheme") ] HRESULT Scheme( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_SCHEMELENGTH), propget, helpstring("gets the scheme length") ] HRESULT SchemeLength( [out, retval] VARIANT* Length ); [ id(DISPID_URLCOMPONENTS_SCHEMELENGTH), propput, helpstring("sets the scheme length") ] HRESULT SchemeLength( [in] VARIANT Length ); [ id(DISPID_URLCOMPONENTS_SCHEMEID), propget, helpstring("gets the scheme id") ] HRESULT SchemeId( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_SCHEMEID), propput, helpstring("sets the scheme id") ] HRESULT SchemeId( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_HOSTNAME), propget, helpstring("gets the host name") ] HRESULT HostName( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_HOSTNAME), propput, helpstring("sets the host name") ] HRESULT HostName( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_HOSTNAMELENGTH), propget, helpstring("gets the hostname length") ] HRESULT HostNameLength( [out, retval] VARIANT* Length ); [ id(DISPID_URLCOMPONENTS_HOSTNAMELENGTH), propput, helpstring("sets the hostname length") ] HRESULT HostNameLength( [in] VARIANT Length ); [ id(DISPID_URLCOMPONENTS_PORT), propget, helpstring("gets the port value") ] HRESULT Port( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_PORT), propput, helpstring("sets the port value") ] HRESULT Port( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_USERNAME), propget, helpstring("gets the username") ] HRESULT UserName( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_USERNAME), propput, helpstring("sets the username") ] HRESULT UserName( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_USERNAMELENGTH), propget, helpstring("gets the username length") ] HRESULT UserNameLength( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_USERNAMELENGTH), propput, helpstring("sets the username length") ] HRESULT UserNameLength( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_PASSWORD), propget, helpstring("gets the password") ] HRESULT Password( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_PASSWORD), propput, helpstring("sets the password") ] HRESULT Password( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_PASSWORDLENGTH), propget, helpstring("gets the password length") ] HRESULT PasswordLength( [out, retval] VARIANT* Length ); [ id(DISPID_URLCOMPONENTS_PASSWORDLENGTH), propput, helpstring("sets the password length") ] HRESULT PasswordLength( [in] VARIANT Length ); [ id(DISPID_URLCOMPONENTS_URLPATH), propget, helpstring("gets the url path") ] HRESULT UrlPath( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_URLPATH), propput, helpstring("sets the url path") ] HRESULT UrlPath( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_URLPATHLENGTH), propget, helpstring("gets the url path length") ] HRESULT UrlPathLength( [out, retval] VARIANT* Length ); [ id(DISPID_URLCOMPONENTS_URLPATHLENGTH), propput, helpstring("sets the url path length") ] HRESULT UrlPathLength( [in] VARIANT Length ); [ id(DISPID_URLCOMPONENTS_EXTRAINFO), propget, helpstring("gets the extra information") ] HRESULT ExtraInfo( [out, retval] VARIANT* Value ); [ id(DISPID_URLCOMPONENTS_EXTRAINFO), propput, helpstring("sets the extra info") ] HRESULT ExtraInfo( [in] VARIANT Value ); [ id(DISPID_URLCOMPONENTS_EXTRAINFOLENGTH), propget, helpstring("gets the extra info length") ] HRESULT ExtraInfoLength( [out, retval] VARIANT* Length ); [ id(DISPID_URLCOMPONENTS_EXTRAINFOLENGTH), propput, helpstring("sets the extra info length") ] HRESULT ExtraInfoLength( [in] VARIANT Length ); // // TODO // // 1. stub in a property for each part of the urlcomp struct // // - every DWORD represents a buffer length // - every LPWSTR is a buffer // // rather than use a bufferobject for each pair, instead use // boolean values to figure out what to do. // // if dword == 0 && wstr == 0, crack: not returned; create: not required // != 0 && wstr == 0, crack: both returned, api allocs; create: undefined // != 0 && wstr != 0, crack: user allocs; create: data & length supplied // == 0 && wstr != 0, crack: undefined; create: data supplied, api figure out length // }; // ====================================================================================== // =================================== IWHTSystemTime =================================== [ uuid(e71d43a4-451e-496b-98e5-3dc548eabe7a), object, local, dual, nonextensible, helpstring("IWHTSystemTime Interface"), pointer_default(unique) ] interface IWHTSystemTime : IDispatch { [ id(DISPID_SYSTEMTIME_YEAR), propget, helpstring("gets the current year") ] HRESULT Year( [out, retval] VARIANT* Value ); [ id(DISPID_SYSTEMTIME_YEAR), propput, helpstring("sets the current year") ] HRESULT Year( [in] VARIANT Value ); [ id(DISPID_SYSTEMTIME_MONTH), propget, helpstring("gets the current month") ] HRESULT Month( [out, retval] VARIANT* Value ); [ id(DISPID_SYSTEMTIME_MONTH), propput, helpstring("sets the current month") ] HRESULT Month( [in] VARIANT Value ); [ id(DISPID_SYSTEMTIME_DAYOFWEEK), propget, helpstring("gets the day of the week") ] HRESULT DayOfWeek( [out, retval] VARIANT* Value ); [ id(DISPID_SYSTEMTIME_DAYOFWEEK), propput, helpstring("sets the day of the week") ] HRESULT DayOfWeek( [in] VARIANT Value ); [ id(DISPID_SYSTEMTIME_DAY), propget, helpstring("gets the current day of the month") ] HRESULT Day( [out, retval] VARIANT* Value ); [ id(DISPID_SYSTEMTIME_DAY), propput, helpstring("sets the current day of the month") ] HRESULT Day( [in] VARIANT Value ); [ id(DISPID_SYSTEMTIME_HOUR), propget, helpstring("gets the current hour") ] HRESULT Hour( [out, retval] VARIANT* Value ); [ id(DISPID_SYSTEMTIME_HOUR), propput, helpstring("sets the current hour") ] HRESULT Hour( [in] VARIANT Value ); [ id(DISPID_SYSTEMTIME_MINUTE), propget, helpstring("gets the current minute") ] HRESULT Minute( [out, retval] VARIANT* Value ); [ id(DISPID_SYSTEMTIME_MINUTE), propput, helpstring("sets the current minute") ] HRESULT Minute( [in] VARIANT Value ); [ id(DISPID_SYSTEMTIME_SECOND), propget, helpstring("gets the current second") ] HRESULT Second( [out, retval] VARIANT* Value ); [ id(DISPID_SYSTEMTIME_SECOND), propput, helpstring("sets the current second") ] HRESULT Second( [in] VARIANT Value ); [ id(DISPID_SYSTEMTIME_MSEC), propget, helpstring("gets the current millisecond") ] HRESULT MSec( [out, retval] VARIANT* Value ); [ id(DISPID_SYSTEMTIME_MSEC), propput, helpstring("sets the current millisecond") ] HRESULT MSec( [in] VARIANT Value ); }; // ====================================================================================== // ================================= IWHTWin32ErrorCode ================================= [ uuid(564782a9-38db-4039-8888-f8c7576fbec5), object, local, dual, nonextensible, helpstring("IWHTWin32ErrorCode Interface"), pointer_default(unique) ] interface IWHTWin32ErrorCode : IDispatch { [ id(DISPID_WIN32ERRORCODE_ERRORCODE), propget, helpstring("returns the numeric Win32 error status.") ] HRESULT ErrorCode( [out, retval] VARIANT* ErrorCode ); [ id(DISPID_WIN32ERRORCODE_ERRORSTRING), propget, helpstring("returns the stringized Win32 error status.") ] HRESULT ErrorString( [out, retval] VARIANT* ErrorString ); [ id(DISPID_WIN32ERRORCODE_ISEXCEPTION), propget, helpstring("indicates whether the error is an exception.") ] HRESULT IsException( [out, retval] VARIANT* IsException ); }; // ====================================================================================== // ===================================== coclasses ====================================== [ uuid(9c7ef150-62a0-46ce-9e15-86a20a6c129a), helpstring("WinHTTPTest class.") ] coclass WinHttpTest { [default] interface IWinHttpTest; }; [ uuid(d8c8a76a-14b2-40dd-9847-ecb302e2f57f), hidden, helpstring("WHTUrlComponents class.") ] coclass WHTUrlComponents { [default] interface IWHTUrlComponents; }; [ uuid(465922de-2ba5-4e98-8c99-f26a3c169aa3), hidden, helpstring("WHTWin32ErrorCode class.") ] coclass WHTWin32ErrorCode { [default] interface IWHTWin32ErrorCode; }; // ====================================================================================== }