Module: wine Branch: master Commit: ffe9cc87c0e759dffe2a19a96a1e5c7746c7ad62 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ffe9cc87c0e759dffe2a19a96a...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Sep 17 18:33:45 2010 +0200
mshtml: Added nsIURL::GetQuery implementation.
---
dlls/mshtml/nsio.c | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index d5a32e4..35a35f0 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -2105,14 +2105,41 @@ static nsresult NSAPI nsURL_SetParam(nsIURL *iface, const nsACString *aParam) static nsresult NSAPI nsURL_GetQuery(nsIURL *iface, nsACString *aQuery) { nsWineURI *This = NSURI_THIS(iface); + URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)}; + WCHAR *ptr_end, *ptr; + char *query; + int len;
TRACE("(%p)->(%p)\n", This, aQuery);
if(This->nsurl) return nsIURL_GetQuery(This->nsurl, aQuery);
- FIXME("default action not implemented\n"); - return NS_ERROR_NOT_IMPLEMENTED; + url.dwExtraInfoLength = 1; + if(!InternetCrackUrlW(This->wine_url, 0, 0, &url)) { + WARN("InternetCrackUrlW failed: 0x%08x\n", GetLastError()); + nsACString_SetData(aQuery, ""); + return NS_OK; + } + + ptr_end = url.lpszExtraInfo+url.dwExtraInfoLength; + for(ptr = url.lpszExtraInfo; ptr < ptr_end; ptr++) { + if(*ptr == '#') + break; + } + + ptr = url.lpszExtraInfo; + len = WideCharToMultiByte(CP_ACP, 0, ptr, ptr_end-ptr, NULL, 0, NULL, NULL); + query = heap_alloc(len+1); + if(!query) + return NS_ERROR_OUT_OF_MEMORY; + WideCharToMultiByte(CP_ACP, 0, ptr, ptr_end-ptr, query, len, NULL, NULL); + query[len] = 0; + nsACString_SetData(aQuery, query); + + TRACE("ret %s\n", debugstr_a(query)); + heap_free(query); + return NS_OK; }
static nsresult NSAPI nsURL_SetQuery(nsIURL *iface, const nsACString *aQuery)