2 * Copyright 2010 Jacek Caban for CodeWeavers
3 * Copyright 2010 Thomas Mullaly
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "urlmon_main.h"
21 #include "wine/debug.h"
23 #define NO_SHLWAPI_REG
26 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
29 const IUriVtbl *lpIUriVtbl;
33 /* Information about the canonicalized URI's buffer. */
40 URL_SCHEME scheme_type;
44 const IUriBuilderVtbl *lpIUriBuilderVtbl;
55 URL_SCHEME scheme_type;
58 /* List of scheme types/scheme names that are recognized by the IUri interface as of IE 7. */
61 WCHAR scheme_name[16];
62 } recognized_schemes[] = {
63 {URL_SCHEME_FTP, {'f','t','p',0}},
64 {URL_SCHEME_HTTP, {'h','t','t','p',0}},
65 {URL_SCHEME_GOPHER, {'g','o','p','h','e','r',0}},
66 {URL_SCHEME_MAILTO, {'m','a','i','l','t','o',0}},
67 {URL_SCHEME_NEWS, {'n','e','w','s',0}},
68 {URL_SCHEME_NNTP, {'n','n','t','p',0}},
69 {URL_SCHEME_TELNET, {'t','e','l','n','e','t',0}},
70 {URL_SCHEME_WAIS, {'w','a','i','s',0}},
71 {URL_SCHEME_FILE, {'f','i','l','e',0}},
72 {URL_SCHEME_MK, {'m','k',0}},
73 {URL_SCHEME_HTTPS, {'h','t','t','p','s',0}},
74 {URL_SCHEME_SHELL, {'s','h','e','l','l',0}},
75 {URL_SCHEME_SNEWS, {'s','n','e','w','s',0}},
76 {URL_SCHEME_LOCAL, {'l','o','c','a','l',0}},
77 {URL_SCHEME_JAVASCRIPT, {'j','a','v','a','s','c','r','i','p','t',0}},
78 {URL_SCHEME_VBSCRIPT, {'v','b','s','c','r','i','p','t',0}},
79 {URL_SCHEME_ABOUT, {'a','b','o','u','t',0}},
80 {URL_SCHEME_RES, {'r','e','s',0}},
81 {URL_SCHEME_MSSHELLROOTED, {'m','s','-','s','h','e','l','l','-','r','o','o','t','e','d',0}},
82 {URL_SCHEME_MSSHELLIDLIST, {'m','s','-','s','h','e','l','l','-','i','d','l','i','s','t',0}},
83 {URL_SCHEME_MSHELP, {'h','c','p',0}},
84 {URL_SCHEME_WILDCARD, {'*',0}}
87 static inline BOOL is_alpha(WCHAR val) {
88 return ((val >= 'a' && val <= 'z') || (val >= 'A' && val <= 'Z'));
91 static inline BOOL is_num(WCHAR val) {
92 return (val >= '0' && val <= '9');
95 /* A URI is implicitly a file path if it begins with
96 * a drive letter (eg X:) or starts with "\\" (UNC path).
98 static inline BOOL is_implicit_file_path(const WCHAR *str) {
99 if(is_alpha(str[0]) && str[1] == ':')
101 else if(str[0] == '\\' && str[1] == '\\')
107 /* Tries to parse the scheme name of the URI.
109 * scheme = ALPHA *(ALPHA | NUM | '+' | '-' | '.') as defined by RFC 3896.
110 * NOTE: Windows accepts a number as the first character of a scheme.
112 static BOOL parse_scheme_name(const WCHAR **ptr, parse_data *data) {
113 const WCHAR *start = *ptr;
116 data->scheme_len = 0;
119 if(!is_num(**ptr) && !is_alpha(**ptr) && **ptr != '+' &&
120 **ptr != '-' && **ptr != '.')
129 /* Schemes must end with a ':' */
135 data->scheme = start;
136 data->scheme_len = *ptr - start;
142 /* Tries to deduce the corresponding URL_SCHEME for the given URI. Stores
143 * the deduced URL_SCHEME in data->scheme_type.
145 static BOOL parse_scheme_type(parse_data *data) {
146 /* If there's scheme data then see if it's a recognized scheme. */
147 if(data->scheme && data->scheme_len) {
150 for(i = 0; i < sizeof(recognized_schemes)/sizeof(recognized_schemes[0]); ++i) {
151 if(lstrlenW(recognized_schemes[i].scheme_name) == data->scheme_len) {
152 /* Has to be a case insensitive compare. */
153 if(!StrCmpNIW(recognized_schemes[i].scheme_name, data->scheme, data->scheme_len)) {
154 data->scheme_type = recognized_schemes[i].scheme;
160 /* If we get here it means it's not a recognized scheme. */
161 data->scheme_type = URL_SCHEME_UNKNOWN;
163 } else if(data->is_relative) {
164 /* Relative URI's have no scheme. */
165 data->scheme_type = URL_SCHEME_UNKNOWN;
168 /* Should never reach here! what happened... */
169 FIXME("(%p): Unable to determine scheme type for URI %s\n", data, debugstr_w(data->uri));
174 /* Tries to parse (or deduce) the scheme_name of a URI. If it can't
175 * parse a scheme from the URI it will try to deduce the scheme_name and scheme_type
176 * using the flags specified in 'flags' (if any). Flags that affect how this function
177 * operates are the Uri_CREATE_ALLOW_* flags.
179 * All parsed/deduced information will be stored in 'data' when the function returns.
181 * Returns TRUE if it was able to successfully parse the information.
183 static BOOL parse_scheme(const WCHAR **ptr, parse_data *data, DWORD flags) {
184 static const WCHAR fileW[] = {'f','i','l','e',0};
185 static const WCHAR wildcardW[] = {'*',0};
187 /* First check to see if the uri could implicitly be a file path. */
188 if(is_implicit_file_path(*ptr)) {
189 if(flags & Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME) {
190 data->scheme = fileW;
191 data->scheme_len = lstrlenW(fileW);
192 TRACE("(%p %p %x): URI is an implicit file path.\n", ptr, data, flags);
194 /* Window's does not consider anything that can implicitly be a file
195 * path to be a valid URI if the ALLOW_IMPLICIT_FILE_SCHEME flag is not set...
197 TRACE("(%p %p %x): URI is implicitly a file path, but, the ALLOW_IMPLICIT_FILE_SCHEME flag wasn't set.\n",
201 } else if(!parse_scheme_name(ptr, data)) {
202 /* No Scheme was found, this means it could be:
203 * a) an implicit Wildcard scheme
207 if(flags & Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME) {
208 data->scheme = wildcardW;
209 data->scheme_len = lstrlenW(wildcardW);
211 TRACE("(%p %p %x): URI is an implicit wildcard scheme.\n", ptr, data, flags);
212 } else if (flags & Uri_CREATE_ALLOW_RELATIVE) {
213 data->is_relative = TRUE;
214 TRACE("(%p %p %x): URI is relative.\n", ptr, data, flags);
216 TRACE("(%p %p %x): Malformed URI found. Unable to deduce scheme name.\n", ptr, data, flags);
221 if(!data->is_relative)
222 TRACE("(%p %p %x): Found scheme=%s scheme_len=%d\n", ptr, data, flags,
223 debugstr_wn(data->scheme, data->scheme_len), data->scheme_len);
225 if(!parse_scheme_type(data))
228 TRACE("(%p %p %x): Assigned %d as the URL_SCHEME.\n", ptr, data, flags, data->scheme_type);
232 /* Parses and validates the components of the specified by data->uri
233 * and stores the information it parses into 'data'.
235 * Returns TRUE if it successfully parsed the URI. False otherwise.
237 static BOOL parse_uri(parse_data *data, DWORD flags) {
244 TRACE("(%p %x): BEGINNING TO PARSE URI %s.\n", data, flags, debugstr_w(data->uri));
246 if(!parse_scheme(pptr, data, flags))
249 TRACE("(%p %x): FINISHED PARSING URI.\n", data, flags);
253 /* Canonicalizes the scheme information specified in the parse_data using the specified flags. */
254 static BOOL canonicalize_scheme(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) {
255 uri->scheme_start = -1;
259 /* The only type of URI that doesn't have to have a scheme is a relative
262 if(!data->is_relative) {
263 FIXME("(%p %p %x): Unable to determine the scheme type of %s.\n", data,
264 uri, flags, debugstr_w(data->uri));
270 INT pos = uri->canon_len;
272 for(i = 0; i < data->scheme_len; ++i) {
273 /* Scheme name must be lower case after canonicalization. */
274 uri->canon_uri[i + pos] = tolowerW(data->scheme[i]);
277 uri->canon_uri[i + pos] = ':';
278 uri->scheme_start = pos;
280 TRACE("(%p %p %x): Canonicalized scheme=%s, len=%d.\n", data, uri, flags,
281 debugstr_wn(uri->canon_uri, uri->scheme_len), data->scheme_len);
284 /* This happens in both compute only and non-compute only. */
285 uri->canon_len += data->scheme_len + 1;
286 uri->scheme_len = data->scheme_len;
291 /* Compute's what the length of the URI specified by the parse_data will be
292 * after canonicalization occurs using the specified flags.
294 * This function will return a non-zero value indicating the length of the canonicalized
295 * URI, or -1 on error.
297 static int compute_canonicalized_length(const parse_data *data, DWORD flags) {
300 memset(&uri, 0, sizeof(Uri));
302 TRACE("(%p %x): Beginning to compute canonicalized length for URI %s\n", data, flags,
303 debugstr_w(data->uri));
305 if(!canonicalize_scheme(data, &uri, flags, TRUE)) {
306 ERR("(%p %x): Failed to compute URI scheme length.\n", data, flags);
310 TRACE("(%p %x): Finished computing canonicalized URI length. length=%d\n", data, flags, uri.canon_len);
312 return uri.canon_len;
315 /* Canonicalizes the URI data specified in the parse_data, using the given flags. If the
316 * canonicalization succeededs it will store all the canonicalization information
317 * in the pointer to the Uri.
319 * To canonicalize a URI this function first computes what the length of the URI
320 * specified by the parse_data will be. Once this is done it will then perfom the actual
321 * canonicalization of the URI.
323 static HRESULT canonicalize_uri(const parse_data *data, Uri *uri, DWORD flags) {
326 uri->canon_uri = NULL;
327 len = uri->canon_size = uri->canon_len = 0;
329 TRACE("(%p %p %x): beginning to canonicalize URI %s.\n", data, uri, flags, debugstr_w(data->uri));
331 /* First try to compute the length of the URI. */
332 len = compute_canonicalized_length(data, flags);
334 ERR("(%p %p %x): Could not compute the canonicalized length of %s.\n", data, uri, flags,
335 debugstr_w(data->uri));
339 uri->canon_uri = heap_alloc((len+1)*sizeof(WCHAR));
341 return E_OUTOFMEMORY;
343 if(!canonicalize_scheme(data, uri, flags, FALSE)) {
344 ERR("(%p %p %x): Unable to canonicalize the scheme of the URI.\n", data, uri, flags);
345 heap_free(uri->canon_uri);
348 uri->scheme_type = data->scheme_type;
350 uri->canon_uri[uri->canon_len] = '\0';
351 TRACE("(%p %p %x): finished canonicalizing the URI.\n", data, uri, flags);
356 #define URI(x) ((IUri*) &(x)->lpIUriVtbl)
357 #define URIBUILDER(x) ((IUriBuilder*) &(x)->lpIUriBuilderVtbl)
359 #define URI_THIS(iface) DEFINE_THIS(Uri, IUri, iface)
361 static HRESULT WINAPI Uri_QueryInterface(IUri *iface, REFIID riid, void **ppv)
363 Uri *This = URI_THIS(iface);
365 if(IsEqualGUID(&IID_IUnknown, riid)) {
366 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
368 }else if(IsEqualGUID(&IID_IUri, riid)) {
369 TRACE("(%p)->(IID_IUri %p)\n", This, ppv);
372 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
374 return E_NOINTERFACE;
377 IUnknown_AddRef((IUnknown*)*ppv);
381 static ULONG WINAPI Uri_AddRef(IUri *iface)
383 Uri *This = URI_THIS(iface);
384 LONG ref = InterlockedIncrement(&This->ref);
386 TRACE("(%p) ref=%d\n", This, ref);
391 static ULONG WINAPI Uri_Release(IUri *iface)
393 Uri *This = URI_THIS(iface);
394 LONG ref = InterlockedDecrement(&This->ref);
396 TRACE("(%p) ref=%d\n", This, ref);
399 SysFreeString(This->raw_uri);
400 heap_free(This->canon_uri);
407 static HRESULT WINAPI Uri_GetPropertyBSTR(IUri *iface, Uri_PROPERTY uriProp, BSTR *pbstrProperty, DWORD dwFlags)
409 Uri *This = URI_THIS(iface);
411 TRACE("(%p)->(%d %p %x)\n", This, uriProp, pbstrProperty, dwFlags);
416 if(uriProp > Uri_PROPERTY_STRING_LAST) {
417 /* Windows allocates an empty BSTR for invalid Uri_PROPERTY's. */
418 *pbstrProperty = SysAllocStringLen(NULL, 0);
420 /* It only returns S_FALSE for the ZONE property... */
421 if(uriProp == Uri_PROPERTY_ZONE)
427 /* Don't have support for flags yet. */
429 FIXME("(%p)->(%d %p %x)\n", This, uriProp, pbstrProperty, dwFlags);
434 case Uri_PROPERTY_RAW_URI:
435 *pbstrProperty = SysAllocString(This->raw_uri);
436 if(!(*pbstrProperty))
437 hres = E_OUTOFMEMORY;
442 FIXME("(%p)->(%d %p %x)\n", This, uriProp, pbstrProperty, dwFlags);
449 static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags)
451 Uri *This = URI_THIS(iface);
453 TRACE("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags);
458 /* Can only return a length for a property if it's a string. */
459 if(uriProp > Uri_PROPERTY_STRING_LAST)
462 /* Don't have support for flags yet. */
464 FIXME("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags);
469 case Uri_PROPERTY_RAW_URI:
470 *pcchProperty = SysStringLen(This->raw_uri);
474 FIXME("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags);
481 static HRESULT WINAPI Uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY uriProp, DWORD *pcchProperty, DWORD dwFlags)
483 Uri *This = URI_THIS(iface);
484 FIXME("(%p)->(%d %p %x)\n", This, uriProp, pcchProperty, dwFlags);
489 /* Microsoft's implementation for the ZONE property of a URI seems to be lacking...
490 * From what I can tell, instead of checking which URLZONE the URI belongs to it
491 * simply assigns URLZONE_INVALID and returns E_NOTIMPL. This also applies to the GetZone
494 if(uriProp == Uri_PROPERTY_ZONE) {
495 *pcchProperty = URLZONE_INVALID;
499 if(uriProp < Uri_PROPERTY_DWORD_START) {
507 static HRESULT WINAPI Uri_HasProperty(IUri *iface, Uri_PROPERTY uriProp, BOOL *pfHasProperty)
509 Uri *This = URI_THIS(iface);
510 FIXME("(%p)->(%d %p)\n", This, uriProp, pfHasProperty);
518 static HRESULT WINAPI Uri_GetAbsoluteUri(IUri *iface, BSTR *pstrAbsoluteUri)
520 Uri *This = URI_THIS(iface);
521 FIXME("(%p)->(%p)\n", This, pstrAbsoluteUri);
529 static HRESULT WINAPI Uri_GetAuthority(IUri *iface, BSTR *pstrAuthority)
531 Uri *This = URI_THIS(iface);
532 FIXME("(%p)->(%p)\n", This, pstrAuthority);
540 static HRESULT WINAPI Uri_GetDisplayUri(IUri *iface, BSTR *pstrDisplayUri)
542 Uri *This = URI_THIS(iface);
543 FIXME("(%p)->(%p)\n", This, pstrDisplayUri);
551 static HRESULT WINAPI Uri_GetDomain(IUri *iface, BSTR *pstrDomain)
553 Uri *This = URI_THIS(iface);
554 FIXME("(%p)->(%p)\n", This, pstrDomain);
562 static HRESULT WINAPI Uri_GetExtension(IUri *iface, BSTR *pstrExtension)
564 Uri *This = URI_THIS(iface);
565 FIXME("(%p)->(%p)\n", This, pstrExtension);
573 static HRESULT WINAPI Uri_GetFragment(IUri *iface, BSTR *pstrFragment)
575 Uri *This = URI_THIS(iface);
576 FIXME("(%p)->(%p)\n", This, pstrFragment);
584 static HRESULT WINAPI Uri_GetHost(IUri *iface, BSTR *pstrHost)
586 Uri *This = URI_THIS(iface);
587 FIXME("(%p)->(%p)\n", This, pstrHost);
595 static HRESULT WINAPI Uri_GetPassword(IUri *iface, BSTR *pstrPassword)
597 Uri *This = URI_THIS(iface);
598 FIXME("(%p)->(%p)\n", This, pstrPassword);
606 static HRESULT WINAPI Uri_GetPath(IUri *iface, BSTR *pstrPath)
608 Uri *This = URI_THIS(iface);
609 FIXME("(%p)->(%p)\n", This, pstrPath);
617 static HRESULT WINAPI Uri_GetPathAndQuery(IUri *iface, BSTR *pstrPathAndQuery)
619 Uri *This = URI_THIS(iface);
620 FIXME("(%p)->(%p)\n", This, pstrPathAndQuery);
622 if(!pstrPathAndQuery)
628 static HRESULT WINAPI Uri_GetQuery(IUri *iface, BSTR *pstrQuery)
630 Uri *This = URI_THIS(iface);
631 FIXME("(%p)->(%p)\n", This, pstrQuery);
639 static HRESULT WINAPI Uri_GetRawUri(IUri *iface, BSTR *pstrRawUri)
641 Uri *This = URI_THIS(iface);
642 TRACE("(%p)->(%p)\n", This, pstrRawUri);
644 /* Just forward the call to GetPropertyBSTR. */
645 return Uri_GetPropertyBSTR(iface, Uri_PROPERTY_RAW_URI, pstrRawUri, 0);
648 static HRESULT WINAPI Uri_GetSchemeName(IUri *iface, BSTR *pstrSchemeName)
650 Uri *This = URI_THIS(iface);
651 FIXME("(%p)->(%p)\n", This, pstrSchemeName);
659 static HRESULT WINAPI Uri_GetUserInfo(IUri *iface, BSTR *pstrUserInfo)
661 Uri *This = URI_THIS(iface);
662 FIXME("(%p)->(%p)\n", This, pstrUserInfo);
670 static HRESULT WINAPI Uri_GetUserName(IUri *iface, BSTR *pstrUserName)
672 Uri *This = URI_THIS(iface);
673 FIXME("(%p)->(%p)\n", This, pstrUserName);
681 static HRESULT WINAPI Uri_GetHostType(IUri *iface, DWORD *pdwHostType)
683 Uri *This = URI_THIS(iface);
684 FIXME("(%p)->(%p)\n", This, pdwHostType);
692 static HRESULT WINAPI Uri_GetPort(IUri *iface, DWORD *pdwPort)
694 Uri *This = URI_THIS(iface);
695 FIXME("(%p)->(%p)\n", This, pdwPort);
703 static HRESULT WINAPI Uri_GetScheme(IUri *iface, DWORD *pdwScheme)
705 Uri *This = URI_THIS(iface);
706 FIXME("(%p)->(%p)\n", This, pdwScheme);
714 static HRESULT WINAPI Uri_GetZone(IUri *iface, DWORD *pdwZone)
716 Uri *This = URI_THIS(iface);
717 FIXME("(%p)->(%p)\n", This, pdwZone);
722 /* Microsoft doesn't seem to have this implemented yet... See
723 * the comment in Uri_GetPropertyDWORD for more about this.
725 *pdwZone = URLZONE_INVALID;
729 static HRESULT WINAPI Uri_GetProperties(IUri *iface, DWORD *pdwProperties)
731 Uri *This = URI_THIS(iface);
732 FIXME("(%p)->(%p)\n", This, pdwProperties);
740 static HRESULT WINAPI Uri_IsEqual(IUri *iface, IUri *pUri, BOOL *pfEqual)
742 Uri *This = URI_THIS(iface);
743 TRACE("(%p)->(%p %p)\n", This, pUri, pfEqual);
751 /* For some reason Windows returns S_OK here... */
755 FIXME("(%p)->(%p %p)\n", This, pUri, pfEqual);
761 static const IUriVtbl UriVtbl = {
766 Uri_GetPropertyLength,
767 Uri_GetPropertyDWORD,
792 /***********************************************************************
793 * CreateUri (urlmon.@)
795 HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
801 TRACE("(%s %x %x %p)\n", debugstr_w(pwzURI), dwFlags, (DWORD)dwReserved, ppURI);
811 ret = heap_alloc(sizeof(Uri));
813 return E_OUTOFMEMORY;
815 ret->lpIUriVtbl = &UriVtbl;
818 /* Create a copy of pwzURI and store it as the raw_uri. */
819 ret->raw_uri = SysAllocString(pwzURI);
822 return E_OUTOFMEMORY;
825 memset(&data, 0, sizeof(parse_data));
826 data.uri = ret->raw_uri;
828 /* Validate and parse the URI into it's components. */
829 if(!parse_uri(&data, dwFlags)) {
830 /* Encountered an unsupported or invalid URI */
831 SysFreeString(ret->raw_uri);
837 /* Canonicalize the URI. */
838 hr = canonicalize_uri(&data, ret, dwFlags);
840 SysFreeString(ret->raw_uri);
850 #define URIBUILDER_THIS(iface) DEFINE_THIS(UriBuilder, IUriBuilder, iface)
852 static HRESULT WINAPI UriBuilder_QueryInterface(IUriBuilder *iface, REFIID riid, void **ppv)
854 UriBuilder *This = URIBUILDER_THIS(iface);
856 if(IsEqualGUID(&IID_IUnknown, riid)) {
857 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
858 *ppv = URIBUILDER(This);
859 }else if(IsEqualGUID(&IID_IUriBuilder, riid)) {
860 TRACE("(%p)->(IID_IUri %p)\n", This, ppv);
861 *ppv = URIBUILDER(This);
863 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
865 return E_NOINTERFACE;
868 IUnknown_AddRef((IUnknown*)*ppv);
872 static ULONG WINAPI UriBuilder_AddRef(IUriBuilder *iface)
874 UriBuilder *This = URIBUILDER_THIS(iface);
875 LONG ref = InterlockedIncrement(&This->ref);
877 TRACE("(%p) ref=%d\n", This, ref);
882 static ULONG WINAPI UriBuilder_Release(IUriBuilder *iface)
884 UriBuilder *This = URIBUILDER_THIS(iface);
885 LONG ref = InterlockedDecrement(&This->ref);
887 TRACE("(%p) ref=%d\n", This, ref);
895 static HRESULT WINAPI UriBuilder_CreateUriSimple(IUriBuilder *iface,
896 DWORD dwAllowEncodingPropertyMask,
897 DWORD_PTR dwReserved,
900 UriBuilder *This = URIBUILDER_THIS(iface);
901 FIXME("(%p)->(%d %d %p)\n", This, dwAllowEncodingPropertyMask, (DWORD)dwReserved, ppIUri);
905 static HRESULT WINAPI UriBuilder_CreateUri(IUriBuilder *iface,
907 DWORD dwAllowEncodingPropertyMask,
908 DWORD_PTR dwReserved,
911 UriBuilder *This = URIBUILDER_THIS(iface);
912 FIXME("(%p)->(0x%08x %d %d %p)\n", This, dwCreateFlags, dwAllowEncodingPropertyMask, (DWORD)dwReserved, ppIUri);
916 static HRESULT WINAPI UriBuilder_CreateUriWithFlags(IUriBuilder *iface,
918 DWORD dwUriBuilderFlags,
919 DWORD dwAllowEncodingPropertyMask,
920 DWORD_PTR dwReserved,
923 UriBuilder *This = URIBUILDER_THIS(iface);
924 FIXME("(%p)->(0x%08x 0x%08x %d %d %p)\n", This, dwCreateFlags, dwUriBuilderFlags,
925 dwAllowEncodingPropertyMask, (DWORD)dwReserved, ppIUri);
929 static HRESULT WINAPI UriBuilder_GetIUri(IUriBuilder *iface, IUri **ppIUri)
931 UriBuilder *This = URIBUILDER_THIS(iface);
932 FIXME("(%p)->(%p)\n", This, ppIUri);
936 static HRESULT WINAPI UriBuilder_SetIUri(IUriBuilder *iface, IUri *pIUri)
938 UriBuilder *This = URIBUILDER_THIS(iface);
939 FIXME("(%p)->(%p)\n", This, pIUri);
943 static HRESULT WINAPI UriBuilder_GetFragment(IUriBuilder *iface, DWORD *pcchFragment, LPCWSTR *ppwzFragment)
945 UriBuilder *This = URIBUILDER_THIS(iface);
946 FIXME("(%p)->(%p %p)\n", This, pcchFragment, ppwzFragment);
950 static HRESULT WINAPI UriBuilder_GetHost(IUriBuilder *iface, DWORD *pcchHost, LPCWSTR *ppwzHost)
952 UriBuilder *This = URIBUILDER_THIS(iface);
953 FIXME("(%p)->(%p %p)\n", This, pcchHost, ppwzHost);
957 static HRESULT WINAPI UriBuilder_GetPassword(IUriBuilder *iface, DWORD *pcchPassword, LPCWSTR *ppwzPassword)
959 UriBuilder *This = URIBUILDER_THIS(iface);
960 FIXME("(%p)->(%p %p)\n", This, pcchPassword, ppwzPassword);
964 static HRESULT WINAPI UriBuilder_GetPath(IUriBuilder *iface, DWORD *pcchPath, LPCWSTR *ppwzPath)
966 UriBuilder *This = URIBUILDER_THIS(iface);
967 FIXME("(%p)->(%p %p)\n", This, pcchPath, ppwzPath);
971 static HRESULT WINAPI UriBuilder_GetPort(IUriBuilder *iface, BOOL *pfHasPort, DWORD *pdwPort)
973 UriBuilder *This = URIBUILDER_THIS(iface);
974 FIXME("(%p)->(%p %p)\n", This, pfHasPort, pdwPort);
978 static HRESULT WINAPI UriBuilder_GetQuery(IUriBuilder *iface, DWORD *pcchQuery, LPCWSTR *ppwzQuery)
980 UriBuilder *This = URIBUILDER_THIS(iface);
981 FIXME("(%p)->(%p %p)\n", This, pcchQuery, ppwzQuery);
985 static HRESULT WINAPI UriBuilder_GetSchemeName(IUriBuilder *iface, DWORD *pcchSchemeName, LPCWSTR *ppwzSchemeName)
987 UriBuilder *This = URIBUILDER_THIS(iface);
988 FIXME("(%p)->(%p %p)\n", This, pcchSchemeName, ppwzSchemeName);
992 static HRESULT WINAPI UriBuilder_GetUserName(IUriBuilder *iface, DWORD *pcchUserName, LPCWSTR *ppwzUserName)
994 UriBuilder *This = URIBUILDER_THIS(iface);
995 FIXME("(%p)->(%p %p)\n", This, pcchUserName, ppwzUserName);
999 static HRESULT WINAPI UriBuilder_SetFragment(IUriBuilder *iface, LPCWSTR pwzNewValue)
1001 UriBuilder *This = URIBUILDER_THIS(iface);
1002 FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
1006 static HRESULT WINAPI UriBuilder_SetHost(IUriBuilder *iface, LPCWSTR pwzNewValue)
1008 UriBuilder *This = URIBUILDER_THIS(iface);
1009 FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
1013 static HRESULT WINAPI UriBuilder_SetPassword(IUriBuilder *iface, LPCWSTR pwzNewValue)
1015 UriBuilder *This = URIBUILDER_THIS(iface);
1016 FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
1020 static HRESULT WINAPI UriBuilder_SetPath(IUriBuilder *iface, LPCWSTR pwzNewValue)
1022 UriBuilder *This = URIBUILDER_THIS(iface);
1023 FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
1027 static HRESULT WINAPI UriBuilder_SetPort(IUriBuilder *iface, BOOL fHasPort, DWORD dwNewValue)
1029 UriBuilder *This = URIBUILDER_THIS(iface);
1030 FIXME("(%p)->(%d %d)\n", This, fHasPort, dwNewValue);
1034 static HRESULT WINAPI UriBuilder_SetQuery(IUriBuilder *iface, LPCWSTR pwzNewValue)
1036 UriBuilder *This = URIBUILDER_THIS(iface);
1037 FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
1041 static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNewValue)
1043 UriBuilder *This = URIBUILDER_THIS(iface);
1044 FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
1048 static HRESULT WINAPI UriBuilder_SetUserName(IUriBuilder *iface, LPCWSTR pwzNewValue)
1050 UriBuilder *This = URIBUILDER_THIS(iface);
1051 FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
1055 static HRESULT WINAPI UriBuilder_RemoveProperties(IUriBuilder *iface, DWORD dwPropertyMask)
1057 UriBuilder *This = URIBUILDER_THIS(iface);
1058 FIXME("(%p)->(0x%08x)\n", This, dwPropertyMask);
1062 static HRESULT WINAPI UriBuilder_HasBeenModified(IUriBuilder *iface, BOOL *pfModified)
1064 UriBuilder *This = URIBUILDER_THIS(iface);
1065 FIXME("(%p)->(%p)\n", This, pfModified);
1069 #undef URIBUILDER_THIS
1071 static const IUriBuilderVtbl UriBuilderVtbl = {
1072 UriBuilder_QueryInterface,
1075 UriBuilder_CreateUriSimple,
1076 UriBuilder_CreateUri,
1077 UriBuilder_CreateUriWithFlags,
1080 UriBuilder_GetFragment,
1082 UriBuilder_GetPassword,
1085 UriBuilder_GetQuery,
1086 UriBuilder_GetSchemeName,
1087 UriBuilder_GetUserName,
1088 UriBuilder_SetFragment,
1090 UriBuilder_SetPassword,
1093 UriBuilder_SetQuery,
1094 UriBuilder_SetSchemeName,
1095 UriBuilder_SetUserName,
1096 UriBuilder_RemoveProperties,
1097 UriBuilder_HasBeenModified,
1100 /***********************************************************************
1101 * CreateIUriBuilder (urlmon.@)
1103 HRESULT WINAPI CreateIUriBuilder(IUri *pIUri, DWORD dwFlags, DWORD_PTR dwReserved, IUriBuilder **ppIUriBuilder)
1107 TRACE("(%p %x %x %p)\n", pIUri, dwFlags, (DWORD)dwReserved, ppIUriBuilder);
1109 ret = heap_alloc(sizeof(UriBuilder));
1111 return E_OUTOFMEMORY;
1113 ret->lpIUriBuilderVtbl = &UriBuilderVtbl;
1116 *ppIUriBuilder = URIBUILDER(ret);