Jacek Caban : mshtml: Use IUri for nsURL::[Get|Set]Password implementation.

Alexandre Julliard julliard at winehq.org
Mon Jan 3 10:58:05 CST 2011


Module: wine
Branch: master
Commit: 0aefffe9b4570374d8fc1874ab5e1cb438ba9eb0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0aefffe9b4570374d8fc1874ab5e1cb438ba9eb0

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Jan  3 14:52:34 2011 +0100

mshtml: Use IUri for nsURL::[Get|Set]Password implementation.

---

 dlls/mshtml/nsio.c |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index e7f8a70..ed098e3 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -1780,26 +1780,33 @@ static nsresult NSAPI nsURI_GetPassword(nsIURL *iface, nsACString *aPassword)
 
     TRACE("(%p)->(%p)\n", This, aPassword);
 
-    if(This->nsuri)
-        return nsIURI_GetPassword(This->nsuri, aPassword);
-
-    FIXME("default action not implemented\n");
-    return NS_ERROR_NOT_IMPLEMENTED;
+    return get_uri_string(This, Uri_PROPERTY_PASSWORD, aPassword);
 }
 
 static nsresult NSAPI nsURI_SetPassword(nsIURL *iface, const nsACString *aPassword)
 {
     nsWineURI *This = NSURI_THIS(iface);
+    const char *passa;
+    WCHAR *pass;
+    HRESULT hres;
 
     TRACE("(%p)->(%s)\n", This, debugstr_nsacstr(aPassword));
 
-    if(This->nsuri) {
-        invalidate_uri(This);
-        return nsIURI_SetPassword(This->nsuri, aPassword);
-    }
+    if(!ensure_uri_builder(This))
+        return NS_ERROR_UNEXPECTED;
 
-    FIXME("default action not implemented\n");
-    return NS_ERROR_NOT_IMPLEMENTED;
+    nsACString_GetData(aPassword, &passa);
+    pass = heap_strdupAtoW(passa);
+    if(!pass)
+        return NS_ERROR_OUT_OF_MEMORY;
+
+    hres = IUriBuilder_SetPassword(This->uri_builder, pass);
+    heap_free(pass);
+    if(FAILED(hres))
+        return NS_ERROR_UNEXPECTED;
+
+    sync_wine_url(This);
+    return NS_OK;
 }
 
 static nsresult NSAPI nsURI_GetHostPort(nsIURL *iface, nsACString *aHostPort)




More information about the wine-cvs mailing list