urlmon: Implemented IUriBuilder_{Get/Set}SchemeName.

This commit is contained in:
Thomas Mullaly 2010-09-06 16:51:11 -04:00 committed by Alexandre Julliard
parent b27e9297b6
commit 7f6faca6f6
2 changed files with 14 additions and 17 deletions

View File

@ -4313,7 +4313,7 @@ static const uri_builder_test uri_builder_tests[] = {
}, },
{ "http://google.com/",0,S_OK,FALSE, { "http://google.com/",0,S_OK,FALSE,
{ {
{TRUE,"test",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,TRUE} {TRUE,"test",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE}
}, },
{TRUE,TRUE,120,S_OK,FALSE}, {TRUE,TRUE,120,S_OK,FALSE},
0,S_OK,TRUE, 0,S_OK,TRUE,
@ -4345,7 +4345,7 @@ static const uri_builder_test uri_builder_tests[] = {
}, },
{ "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE, { "/Test/test dir",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
{ {
{TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,TRUE}, {TRUE,"http",NULL,Uri_PROPERTY_SCHEME_NAME,S_OK,FALSE},
{TRUE,"::192.2.3.4",NULL,Uri_PROPERTY_HOST,S_OK,FALSE}, {TRUE,"::192.2.3.4",NULL,Uri_PROPERTY_HOST,S_OK,FALSE},
{TRUE,NULL,NULL,Uri_PROPERTY_PATH,S_OK,FALSE} {TRUE,NULL,NULL,Uri_PROPERTY_PATH,S_OK,FALSE}
}, },

View File

@ -97,6 +97,9 @@ typedef struct {
WCHAR *query; WCHAR *query;
DWORD query_len; DWORD query_len;
WCHAR *scheme;
DWORD scheme_len;
} UriBuilder; } UriBuilder;
typedef struct { typedef struct {
@ -4328,6 +4331,7 @@ static ULONG WINAPI UriBuilder_Release(IUriBuilder *iface)
heap_free(This->password); heap_free(This->password);
heap_free(This->path); heap_free(This->path);
heap_free(This->query); heap_free(This->query);
heap_free(This->scheme);
heap_free(This); heap_free(This);
} }
@ -4535,19 +4539,11 @@ static HRESULT WINAPI UriBuilder_GetSchemeName(IUriBuilder *iface, DWORD *pcchSc
UriBuilder *This = URIBUILDER_THIS(iface); UriBuilder *This = URIBUILDER_THIS(iface);
TRACE("(%p)->(%p %p)\n", This, pcchSchemeName, ppwzSchemeName); TRACE("(%p)->(%p %p)\n", This, pcchSchemeName, ppwzSchemeName);
if(!pcchSchemeName) { if(!This->uri || This->uri->scheme_start == -1 || This->modified_props & Uri_HAS_SCHEME_NAME)
if(ppwzSchemeName) return get_builder_component(&This->scheme, &This->scheme_len, NULL, 0, ppwzSchemeName, pcchSchemeName);
*ppwzSchemeName = NULL; else
return E_POINTER; return get_builder_component(&This->scheme, &This->scheme_len, This->uri->canon_uri+This->uri->scheme_start,
} This->uri->scheme_len, ppwzSchemeName, pcchSchemeName);
if(!ppwzSchemeName) {
*pcchSchemeName = 0;
return E_POINTER;
}
FIXME("(%p)->(%p %p)\n", This, pcchSchemeName, ppwzSchemeName);
return E_NOTIMPL;
} }
static HRESULT WINAPI UriBuilder_GetUserName(IUriBuilder *iface, DWORD *pcchUserName, LPCWSTR *ppwzUserName) static HRESULT WINAPI UriBuilder_GetUserName(IUriBuilder *iface, DWORD *pcchUserName, LPCWSTR *ppwzUserName)
@ -4624,8 +4620,9 @@ static HRESULT WINAPI UriBuilder_SetQuery(IUriBuilder *iface, LPCWSTR pwzNewValu
static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNewValue) static HRESULT WINAPI UriBuilder_SetSchemeName(IUriBuilder *iface, LPCWSTR pwzNewValue)
{ {
UriBuilder *This = URIBUILDER_THIS(iface); UriBuilder *This = URIBUILDER_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue)); TRACE("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
return E_NOTIMPL; return set_builder_component(&This->scheme, &This->scheme_len, pwzNewValue, 0,
&This->modified_props, Uri_HAS_SCHEME_NAME);
} }
static HRESULT WINAPI UriBuilder_SetUserName(IUriBuilder *iface, LPCWSTR pwzNewValue) static HRESULT WINAPI UriBuilder_SetUserName(IUriBuilder *iface, LPCWSTR pwzNewValue)