{ "http://google.com/",0,S_OK,FALSE,
{
{TRUE,"#fragment",NULL,Uri_PROPERTY_FRAGMENT,S_OK,FALSE},
- {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,TRUE},
+ {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE},
{TRUE,"?query=x",NULL,Uri_PROPERTY_QUERY,S_OK,TRUE},
{TRUE,"username",NULL,Uri_PROPERTY_USER_NAME,S_OK,TRUE}
},
{URL_SCHEME_HTTP,S_OK},
{URLZONE_INVALID,E_NOTIMPL}
}
+ },
+ { "http://google.com/",0,S_OK,FALSE,
+ {
+ {TRUE,":password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
+ },
+ {FALSE},
+ 0,S_OK,TRUE,
+ 0,S_OK,TRUE,
+ 0,0,0,S_OK,TRUE,
+ {
+ {"http://::password@google.com/",S_OK},
+ {"::password@google.com",S_OK},
+ {"http://google.com/",S_OK},
+ {"google.com",S_OK},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"google.com",S_OK},
+ {":password",S_OK},
+ {"/",S_OK},
+ {"/",S_OK},
+ {"",S_FALSE},
+ {"http://::password@google.com/",S_OK},
+ {"http",S_OK},
+ {"::password",S_OK},
+ {"",S_FALSE}
+ },
+ {
+ {Uri_HOST_DNS,S_OK},
+ {80,S_OK},
+ {URL_SCHEME_HTTP,S_OK},
+ {URLZONE_INVALID,E_NOTIMPL}
+ }
+ },
+ { "test/test",Uri_CREATE_ALLOW_RELATIVE,S_OK,FALSE,
+ {
+ {TRUE,"password",NULL,Uri_PROPERTY_PASSWORD,S_OK,FALSE}
+ },
+ {FALSE},
+ Uri_CREATE_ALLOW_RELATIVE,S_OK,TRUE,
+ 0,S_OK,TRUE,
+ Uri_CREATE_ALLOW_RELATIVE,0,0,S_OK,TRUE,
+ {
+ {":password@test/test",S_OK},
+ {":password@",S_OK},
+ {":password@test/test",S_OK},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"",S_FALSE},
+ {"password",S_OK},
+ {"test/test",S_OK},
+ {"test/test",S_OK},
+ {"",S_FALSE},
+ {":password@test/test",S_OK},
+ {"",S_FALSE},
+ {":password",S_OK},
+ {"",S_FALSE}
+ },
+ {
+ {Uri_HOST_UNKNOWN,S_OK},
+ {0,S_FALSE},
+ {URL_SCHEME_UNKNOWN,S_OK},
+ {URLZONE_INVALID,E_NOTIMPL}
+ }
}
};
WCHAR *host;
DWORD host_len;
+
+ WCHAR *password;
+ DWORD password_len;
} UriBuilder;
typedef struct {
if(This->uri) IUri_Release(URI(This->uri));
heap_free(This->fragment);
heap_free(This->host);
+ heap_free(This->password);
heap_free(This);
}
UriBuilder *This = URIBUILDER_THIS(iface);
TRACE("(%p)->(%p %p)\n", This, pcchPassword, ppwzPassword);
- if(!pcchPassword) {
- if(ppwzPassword)
- *ppwzPassword = NULL;
- return E_POINTER;
- }
-
- if(!ppwzPassword) {
- *pcchPassword = 0;
- return E_POINTER;
+ if(!This->uri || This->uri->userinfo_split == -1 || This->modified_props & Uri_HAS_PASSWORD)
+ return get_builder_component(&This->password, &This->password_len, NULL, 0, ppwzPassword, pcchPassword);
+ else {
+ const WCHAR *start = This->uri->canon_uri+This->uri->userinfo_start+This->uri->userinfo_split+1;
+ DWORD len = This->uri->userinfo_len-This->uri->userinfo_split-1;
+ return get_builder_component(&This->password, &This->password_len, start, len, ppwzPassword, pcchPassword);
}
-
- FIXME("(%p)->(%p %p)\n", This, pcchPassword, ppwzPassword);
- return E_NOTIMPL;
}
static HRESULT WINAPI UriBuilder_GetPath(IUriBuilder *iface, DWORD *pcchPath, LPCWSTR *ppwzPath)
static HRESULT WINAPI UriBuilder_SetPassword(IUriBuilder *iface, LPCWSTR pwzNewValue)
{
UriBuilder *This = URIBUILDER_THIS(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
- return E_NOTIMPL;
+ TRACE("(%p)->(%s)\n", This, debugstr_w(pwzNewValue));
+
+ This->modified_props |= Uri_HAS_PASSWORD;
+ return set_builder_component(&This->password, &This->password_len, pwzNewValue, 0);
}
static HRESULT WINAPI UriBuilder_SetPath(IUriBuilder *iface, LPCWSTR pwzNewValue)