winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2006
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
5 participants
746 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Continue searching for Gecko if loading xpcom. dll failed.
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: 3d506d8575a28d2d29ecef53bbcb5c9ad29961e5 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=3d506d8575a28d2d29ecef5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Aug 9 16:38:42 2006 +0200 mshtml: Continue searching for Gecko if loading xpcom.dll failed. --- dlls/mshtml/nsembed.c | 104 ++++++++++++++++++++++++++----------------------- 1 files changed, 55 insertions(+), 49 deletions(-) diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 25dc217..77c08b0 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -117,7 +117,53 @@ static void register_nscontainer_class(v nscontainer_class = RegisterClassExW(&wndclass); } -static BOOL get_mozilla_path(PRUnichar *gre_path) +static BOOL load_xpcom(PRUnichar *gre_path) +{ + WCHAR path_env[MAX_PATH]; + int len; + + static const WCHAR wszPATH[] = {'P','A','T','H',0}; + static const WCHAR strXPCOM[] = {'x','p','c','o','m','.','d','l','l',0}; + + TRACE("(%s)\n", debugstr_w(gre_path)); + + /* We have to modify PATH as XPCOM loads other DLLs from this directory. */ + GetEnvironmentVariableW(wszPATH, path_env, sizeof(path_env)/sizeof(WCHAR)); + len = strlenW(path_env); + path_env[len++] = ';'; + strcpyW(path_env+len, gre_path); + SetEnvironmentVariableW(wszPATH, path_env); + + hXPCOM = LoadLibraryW(strXPCOM); + if(!hXPCOM) { + WARN("Could not load XPCOM: %ld\n", GetLastError()); + return FALSE; + } + +#define NS_DLSYM(func) \ + func = (typeof(func))GetProcAddress(hXPCOM, #func); \ + if(!func) \ + ERR("Could not GetProcAddress(" #func ") failed\n") + + NS_DLSYM(NS_InitXPCOM2); + NS_DLSYM(NS_ShutdownXPCOM); + NS_DLSYM(NS_GetComponentRegistrar); + NS_DLSYM(NS_StringContainerInit); + NS_DLSYM(NS_CStringContainerInit); + NS_DLSYM(NS_StringContainerFinish); + NS_DLSYM(NS_CStringContainerFinish); + NS_DLSYM(NS_StringSetData); + NS_DLSYM(NS_CStringSetData); + NS_DLSYM(NS_NewLocalFile); + NS_DLSYM(NS_StringGetData); + NS_DLSYM(NS_CStringGetData); + +#undef NS_DLSYM + + return TRUE; +} + +static BOOL load_mozilla(PRUnichar *gre_path) { DWORD res, type, i, size = MAX_PATH; HKEY mozilla_key, hkey; @@ -146,10 +192,10 @@ static BOOL get_mozilla_path(PRUnichar * } RegCloseKey(mozilla_key); - return ret; + return ret ? load_xpcom(gre_path) : FALSE; } -static BOOL get_mozctl_path(PRUnichar *gre_path) +static BOOL load_mozctl(PRUnichar *gre_path) { HKEY hkey; DWORD res, type, size = MAX_PATH; @@ -168,7 +214,7 @@ static BOOL get_mozctl_path(PRUnichar *g if(res == ERROR_SUCCESS) { res = RegQueryValueExW(hkey, wszBinDirectoryPath, NULL, &type, (LPBYTE)gre_path, &size); if(res == ERROR_SUCCESS) - return TRUE; + return load_xpcom(gre_path); else ERR("Could not get value %s\n", debugstr_w(wszBinDirectoryPath)); } @@ -180,7 +226,7 @@ static BOOL get_mozctl_path(PRUnichar *g WCHAR *ptr; if((ptr = strrchrW(gre_path, '\\'))) ptr[1] = 0; - return TRUE; + load_xpcom(gre_path); }else { ERR("Could not get value of %s\n", debugstr_w(wszMozCtlClsidKey)); } @@ -191,7 +237,7 @@ static BOOL get_mozctl_path(PRUnichar *g return FALSE; } -static BOOL get_wine_gecko_path(PRUnichar *gre_path) +static BOOL load_wine_gecko(PRUnichar *gre_path) { HKEY hkey; DWORD res, type, size = MAX_PATH; @@ -211,7 +257,7 @@ static BOOL get_wine_gecko_path(PRUnicha if(res != ERROR_SUCCESS || type != REG_SZ) return FALSE; - return TRUE; + return load_xpcom(gre_path); } static void set_profile(void) @@ -251,12 +297,8 @@ static BOOL load_gecko(void) nsAString path; nsIFile *gre_dir; PRUnichar gre_path[MAX_PATH]; - WCHAR path_env[MAX_PATH]; - int len; static BOOL tried_load = FALSE; - static const WCHAR wszPATH[] = {'P','A','T','H',0}; - static const WCHAR strXPCOM[] = {'x','p','c','o','m','.','d','l','l',0}; TRACE("()\n"); @@ -264,50 +306,14 @@ static BOOL load_gecko(void) return pCompMgr != NULL; tried_load = TRUE; - if(!get_wine_gecko_path(gre_path) && !get_mozctl_path(gre_path) - && !get_mozilla_path(gre_path)) { + if(!load_wine_gecko(gre_path) && !load_mozctl(gre_path) && !load_mozilla(gre_path)) { install_wine_gecko(); - if(!get_wine_gecko_path(gre_path)) { + if(!load_wine_gecko(gre_path)) { MESSAGE("Could not load Mozilla. HTML rendering will be disabled.\n"); return FALSE; } } - TRACE("found path %s\n", debugstr_w(gre_path)); - - /* We have to modify PATH as XPCOM loads other DLLs from this directory. */ - GetEnvironmentVariableW(wszPATH, path_env, sizeof(path_env)/sizeof(WCHAR)); - len = strlenW(path_env); - path_env[len++] = ';'; - strcpyW(path_env+len, gre_path); - SetEnvironmentVariableW(wszPATH, path_env); - - hXPCOM = LoadLibraryW(strXPCOM); - if(!hXPCOM) { - ERR("Could not load XPCOM: %ld\n", GetLastError()); - return FALSE; - } - -#define NS_DLSYM(func) \ - func = (typeof(func))GetProcAddress(hXPCOM, #func); \ - if(!func) \ - ERR("Could not GetProcAddress(" #func ") failed\n") - - NS_DLSYM(NS_InitXPCOM2); - NS_DLSYM(NS_ShutdownXPCOM); - NS_DLSYM(NS_GetComponentRegistrar); - NS_DLSYM(NS_StringContainerInit); - NS_DLSYM(NS_CStringContainerInit); - NS_DLSYM(NS_StringContainerFinish); - NS_DLSYM(NS_CStringContainerFinish); - NS_DLSYM(NS_StringSetData); - NS_DLSYM(NS_CStringSetData); - NS_DLSYM(NS_NewLocalFile); - NS_DLSYM(NS_StringGetData); - NS_DLSYM(NS_CStringGetData); - -#undef NS_DLSYM - NS_StringContainerInit(&path); NS_StringSetData(&path, gre_path, PR_UINT32_MAX); nsres = NS_NewLocalFile(&path, FALSE, &gre_dir);
1
0
0
0
Jacek Caban : mshtml: Store IMoniker in BSCallback.
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: aa760c8b1e3ad91064944ab527476157a8edd9d2 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=aa760c8b1e3ad91064944ab…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Aug 9 16:37:48 2006 +0200 mshtml: Store IMoniker in BSCallback. --- dlls/mshtml/mshtml_private.h | 7 +++++-- dlls/mshtml/navigate.c | 18 +++++++++++++----- dlls/mshtml/persist.c | 4 ++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e34c0fa..8f293f8 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -172,6 +172,8 @@ struct BSCallback { nsIStreamListener *nslistener; nsISupports *nscontext; + IMoniker *mon; + nsProtocolStream *nsstream; }; @@ -308,8 +310,9 @@ void nsAString_Finish(nsAString*); nsIInputStream *create_nsstream(const char*,PRInt32); -BSCallback *create_bscallback(HTMLDocument*,LPCOLESTR); -HRESULT start_binding(BSCallback*,IMoniker*); +BSCallback *create_bscallback(HTMLDocument*,IMoniker*); +HRESULT start_binding(BSCallback*); +void create_hidden_hwnd(HTMLDocument*); IHlink *Hlink_Create(void); IHTMLSelectionObject *HTMLSelectionObject_Create(nsISelection*); diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 2b0b194..c37c475 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -131,7 +131,7 @@ static nsresult NSAPI nsInputStream_Read PRUint32 written = 0; nsresult nsres; - FIXME("(%p)->(%p %p %ld %p)\n", This, aWriter, aClousure, aCount, _retval); + TRACE("(%p)->(%p %p %ld %p)\n", This, aWriter, aClousure, aCount, _retval); if(!This->buf_size) return S_OK; @@ -246,6 +246,8 @@ static ULONG WINAPI BindStatusCallback_R nsISupports_Release(This->nscontext); if(This->nsstream) nsIInputStream_Release(NSINSTREAM(This->nsstream)); + if(This->mon) + IMoniker_Release(This->mon); mshtml_free(This->headers); mshtml_free(This); } @@ -564,7 +566,7 @@ static const IServiceProviderVtbl Servic BSCServiceProvider_QueryService }; -BSCallback *create_bscallback(HTMLDocument *doc, LPCOLESTR url) +BSCallback *create_bscallback(HTMLDocument *doc, IMoniker *mon) { BSCallback *ret = mshtml_alloc(sizeof(BSCallback)); @@ -582,6 +584,10 @@ BSCallback *create_bscallback(HTMLDocume ret->nscontext = NULL; ret->nsstream = NULL; + if(mon) + IMoniker_AddRef(mon); + ret->mon = mon; + return ret; } @@ -663,7 +669,7 @@ void hlink_frame_navigate(HTMLDocument * IMoniker *mon; IHlink *hlink; - callback = create_bscallback(doc, uri); + callback = create_bscallback(doc, NULL); if(post_data_stream) { parse_post_data(post_data_stream, &callback->headers, &callback->post_data, @@ -692,7 +698,7 @@ void hlink_frame_navigate(HTMLDocument * } -HRESULT start_binding(BSCallback *bscallback, IMoniker *mon) +HRESULT start_binding(BSCallback *bscallback) { IStream *str = NULL; IBindCtx *bctx; @@ -704,7 +710,7 @@ HRESULT start_binding(BSCallback *bscall return hres; } - hres = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&str); + hres = IMoniker_BindToStorage(bscallback->mon, bctx, NULL, &IID_IStream, (void**)&str); IBindCtx_Release(bctx); if(FAILED(hres)) { WARN("BindToStorage failed: %08lx\n", hres); @@ -714,5 +720,7 @@ HRESULT start_binding(BSCallback *bscall if(str) IStream_Release(str); + IMoniker_Release(bscallback->mon); + bscallback->mon = NULL; return S_OK; } diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index d935aaf..d6a49f5 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -215,7 +215,7 @@ static HRESULT WINAPI PersistMoniker_Loa } } - bscallback = create_bscallback(This, url); + bscallback = create_bscallback(This, pimkName); if(This->nscontainer) { nsIInputStream *post_data_stream = get_post_data_stream(pibc); @@ -249,7 +249,7 @@ static HRESULT WINAPI PersistMoniker_Loa if(pibc) FIXME("not supported pibc\n"); - hres = start_binding(bscallback, pimkName); + hres = start_binding(bscallback); IBindStatusCallback_Release(STATUSCLB(bscallback)); CoTaskMemFree(url);
1
0
0
0
Jacek Caban : mshtml: Added GetMoniker and SetMoniker methods to nsIWineURI .
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: f0ca85f78eebdefa4e65e5053aaed529cf38392e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=f0ca85f78eebdefa4e65e50…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Aug 9 16:34:59 2006 +0200 mshtml: Added GetMoniker and SetMoniker methods to nsIWineURI. --- dlls/mshtml/nsiface.idl | 4 ++++ dlls/mshtml/nsio.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index c1d5bb4..ee17638 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -69,6 +69,8 @@ interface nsILoadGroup; interface nsIDOMNode; interface nsIDOMDocument; +interface IMoniker; + [ object, uuid(00000000-0000-0000-c000-000000000046) @@ -1170,4 +1172,6 @@ interface nsIWineURI : nsIURI nsresult GetNSContainer(NSContainer **aNSContainer); nsresult SetNSContainer(NSContainer *aNSContainer); + nsresult GetMoniker(IMoniker **aMoniker); + nsresult SetMoniker(IMoniker *aMoniker); } diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index fb578c4..67207bb 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -52,6 +52,7 @@ typedef struct { nsIURI *uri; NSContainer *container; + IMoniker *mon; } nsURI; #define NSURI(x) ((nsIURI*) &(x)->lpWineURIVtbl) @@ -1436,6 +1437,37 @@ static nsresult NSAPI nsURI_SetNSContain return NS_OK; } +static nsresult NSAPI nsURI_GetMoniker(nsIWineURI *iface, IMoniker **aMoniker) +{ + nsURI *This = NSURI_THIS(iface); + + TRACE("(%p)->(%p)\n", This, aMoniker); + + if(This->mon) + IMoniker_AddRef(This->mon); + *aMoniker = This->mon; + + return NS_OK; +} + +static nsresult NSAPI nsURI_SetMoniker(nsIWineURI *iface, IMoniker *aMoniker) +{ + nsURI *This = NSURI_THIS(iface); + + TRACE("(%p)->(%p)\n", This, aMoniker); + + if(This->mon) { + WARN("Moniker already set: %p\n", This->container); + IMoniker_Release(This->mon); + } + + if(aMoniker) + IMoniker_AddRef(aMoniker); + This->mon = aMoniker; + + return NS_OK; +} + #undef NSURI_THIS static const nsIWineURIVtbl nsWineURIVtbl = { @@ -1470,6 +1502,8 @@ static const nsIWineURIVtbl nsWineURIVtb nsURI_GetOriginCharset, nsURI_GetNSContainer, nsURI_SetNSContainer, + nsURI_GetMoniker, + nsURI_SetMoniker }; static nsresult create_uri(nsIURI *uri, NSContainer *container, nsIURI **_retval) @@ -1480,6 +1514,7 @@ static nsresult create_uri(nsIURI *uri, ret->ref = 1; ret->uri = uri; ret->container = container; + ret->mon = NULL; if(container) nsIWebBrowserChrome_AddRef(NSWBCHROME(container));
1
0
0
0
Jacek Caban : mshtml: Create "Internet Explorer_Hidden" window.
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: cba2e19409f3360ff8fd5fff2da0a281e0ba9d6e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=cba2e19409f3360ff8fd5ff…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Aug 9 16:34:02 2006 +0200 mshtml: Create "Internet Explorer_Hidden" window. --- dlls/mshtml/htmldoc.c | 1 + dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/view.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 0 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index e3c7e32..c991e28 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -154,6 +154,7 @@ static ULONG WINAPI HTMLDocument_Release DestroyWindow(This->tooltips_hwnd); if(This->hwnd) DestroyWindow(This->hwnd); + DestroyWindow(This->hidden_hwnd); release_nodes(This); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 5f6bece..e34c0fa 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -87,6 +87,7 @@ struct HTMLDocument { IOleInPlaceFrame *frame; HWND hwnd; + HWND hidden_hwnd; HWND tooltips_hwnd; USERMODE usermode; diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c index b0cf67c..3302f5f 100644 --- a/dlls/mshtml/view.c +++ b/dlls/mshtml/view.c @@ -49,6 +49,36 @@ typedef struct { WNDPROC proc; } tooltip_data; +static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + if(msg > WM_USER) + FIXME("(%p %d %x %lx)\n", hwnd, msg, wParam, lParam); + + return DefWindowProcW(hwnd, msg, wParam, lParam); +} + +static void create_hidden_window(HTMLDocument *This) +{ + static ATOM hidden_wnd_class = 0; + static const WCHAR wszInternetExplorer_Hidden[] = {'I','n','t','e','r','n','e','t', + ' ','E','x','p','l','o','r','e','r','_','H','i','d','d','e','n',0}; + + if(!hidden_wnd_class) { + WNDCLASSEXW wndclass = { + sizeof(WNDCLASSEXW), 0, + hidden_proc, + 0, 0, hInst, NULL, NULL, NULL, NULL, + wszInternetExplorer_Hidden, + NULL + }; + + hidden_wnd_class = RegisterClassExW(&wndclass); + } + + This->hidden_hwnd = CreateWindowExW(0, wszInternetExplorer_Hidden, NULL, WS_POPUP, + 0, 0, 0, 0, NULL, NULL, hInst, This); +} + static void paint_disabled(HWND hwnd) { HDC hdc; PAINTSTRUCT ps; @@ -664,4 +694,6 @@ void HTMLDocument_View_Init(HTMLDocument This->in_place_active = FALSE; This->ui_active = FALSE; This->window_active = FALSE; + + create_hidden_window(This); }
1
0
0
0
Jacek Caban : mshtml: Load the page from moniker if we don' t have nsIChannel.
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: 3f05182335b5ddc77f32a35625cb7fde4dfa576d URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=3f05182335b5ddc77f32a35…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Aug 9 16:33:00 2006 +0200 mshtml: Load the page from moniker if we don't have nsIChannel. --- dlls/mshtml/mshtml_private.h | 5 +++++ dlls/mshtml/nsio.c | 3 +++ dlls/mshtml/persist.c | 2 +- 3 files changed, 9 insertions(+), 1 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 79ac281..5f6bece 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -27,6 +27,9 @@ #endif #include "nsiface.h" +#define GENERATE_MSHTML_NS_FAILURE(code) \ + ((nsresult) ((PRUint32)(1<<31) | ((PRUint32)(0x45+6)<<16) | (PRUint32)(code))) + #define NS_OK ((nsresult)0x00000000L) #define NS_ERROR_FAILURE ((nsresult)0x80004005L) #define NS_NOINTERFACE ((nsresult)0x80004002L) @@ -35,6 +38,8 @@ #define NS_ERROR_INVALID_ARG ((nsre #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL) #define NS_ERROR_UNKNOWN_PROTOCOL ((nsresult)0x804b0012L) +#define WINE_NS_LOAD_FROM_MONIKER GENERATE_MSHTML_NS_FAILURE(0) + #define NS_FAILED(res) ((res) & 0x80000000) #define NS_SUCCEEDED(res) (!NS_FAILED(res)) diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 8a1c9d3..fb578c4 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -596,6 +596,9 @@ static nsresult NSAPI nsChannel_AsyncOpe } nsIWebBrowserChrome_Release(NSWBCHROME(container)); + + if(!This->channel) + return WINE_NS_LOAD_FROM_MONIKER; }else { BOOL cont = before_async_open(This, container); nsIWebBrowserChrome_Release(NSWBCHROME(container)); diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 9c34c4a..d935aaf 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -237,7 +237,7 @@ static HRESULT WINAPI PersistMoniker_Loa IBindStatusCallback_Release(STATUSCLB(bscallback)); CoTaskMemFree(url); return S_OK; - }else { + }else if(nsres != WINE_NS_LOAD_FROM_MONIKER) { WARN("LoadURI failed: %08lx\n", nsres); } }
1
0
0
0
Jacek Caban : shdocvw: Return DIID_DWebBrowserEvents in GetGUID for WebBrowser_V1.
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: 84d93d1981ff5977b62bb2c8812b050092befe80 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=84d93d1981ff5977b62bb2c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Aug 9 16:31:31 2006 +0200 shdocvw: Return DIID_DWebBrowserEvents in GetGUID for WebBrowser_V1. --- dlls/shdocvw/classinfo.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/shdocvw/classinfo.c b/dlls/shdocvw/classinfo.c index 5eb9c8b..fd12cba 100644 --- a/dlls/shdocvw/classinfo.c +++ b/dlls/shdocvw/classinfo.c @@ -76,7 +76,8 @@ static HRESULT WINAPI ProvideClassInfo_G return E_FAIL; } - memcpy(pGUID, &DIID_DWebBrowserEvents2, sizeof(GUID)); + memcpy(pGUID, This->version == 1 ? &DIID_DWebBrowserEvents : &DIID_DWebBrowserEvents2, + sizeof(GUID)); return S_OK; }
1
0
0
0
Huw Davies : shlwapi: Add tests for PathUnquoteSpaces.
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: 0476397387714f6ed8e0829a66e372f7ff0c46de URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=0476397387714f6ed8e0829…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Aug 9 14:46:20 2006 +0100 shlwapi: Add tests for PathUnquoteSpaces. --- dlls/shlwapi/tests/path.c | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c index d55d19d..3d90ada 100644 --- a/dlls/shlwapi/tests/path.c +++ b/dlls/shlwapi/tests/path.c @@ -306,6 +306,22 @@ struct { { "file:partial", FALSE, TRUE } }; +struct { + const char *path; + const char *result; +} TEST_PATH_UNQUOTE_SPACES[] = { + { "abcdef", "abcdef" }, + { "\"abcdef\"", "abcdef" }, + { "\"abcdef", "\"abcdef" }, + { "abcdef\"", "abcdef\"" }, + { "\"\"abcdef\"\"", "\"abcdef\"" }, + { "abc\"def", "abc\"def" }, + { "\"abc\"def", "\"abc\"def" }, + { "\"abc\"def\"", "abc\"def" }, + { "\'abcdef\'", "\'abcdef\'" }, + { "\"\"", "" }, + { "\"", "" } +}; static LPWSTR GetWideString(const char* szString) { @@ -321,6 +337,15 @@ static void FreeWideString(LPWSTR wszStr HeapFree(GetProcessHeap(), 0, wszString); } +static LPSTR strdupA(LPCSTR p) +{ + LPSTR ret; + DWORD len = (strlen(p) + 1); + ret = HeapAlloc(GetProcessHeap(), 0, len); + memcpy(ret, p, len); + return ret; +} + static void hash_url(const char* szUrl) { LPCSTR szTestUrl = szUrl; @@ -1757,6 +1782,29 @@ static void test_PathCommonPrefixA(void) ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError()); } +static void test_PathUnquoteSpaces(void) +{ + int i; + for(i = 0; i < sizeof(TEST_PATH_UNQUOTE_SPACES) / sizeof(TEST_PATH_UNQUOTE_SPACES[0]); i++) + { + char *path = strdupA(TEST_PATH_UNQUOTE_SPACES[i].path); + WCHAR *pathW = GetWideString(TEST_PATH_UNQUOTE_SPACES[i].path); + WCHAR *resultW = GetWideString(TEST_PATH_UNQUOTE_SPACES[i].result); + + PathUnquoteSpacesA(path); + ok(!strcmp(path, TEST_PATH_UNQUOTE_SPACES[i].result), "%s (A): got %s expected %s\n", + TEST_PATH_UNQUOTE_SPACES[i].path, path, + TEST_PATH_UNQUOTE_SPACES[i].result); + + PathUnquoteSpacesW(pathW); + ok(!lstrcmpW(pathW, resultW), "%s (W): strings differ\n", + TEST_PATH_UNQUOTE_SPACES[i].path); + FreeWideString(pathW); + FreeWideString(resultW); + HeapFree(GetProcessHeap(), 0, path); + } +} + START_TEST(path) { hShlwapi = LoadLibraryA("shlwapi.dll"); @@ -1801,4 +1849,5 @@ START_TEST(path) test_PathFindExtensionA(); test_PathBuildRootA(); test_PathCommonPrefixA(); + test_PathUnquoteSpaces(); }
1
0
0
0
Kai Blin : secur32: Make ntlm tests run on both WinXP and Win2k.
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: d2989cc32db217b9918b84a8927db76c73148dab URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=d2989cc32db217b9918b84a…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Wed Aug 9 14:31:53 2006 +0200 secur32: Make ntlm tests run on both WinXP and Win2k. --- dlls/secur32/ntlm.c | 2 +- dlls/secur32/tests/ntlm.c | 22 +++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index 1b33ddb..d8962a5 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -963,7 +963,7 @@ #define _x(x) case (x) : FIXME(#x" stub\ PSecPkgContext_Sizes spcs = (PSecPkgContext_Sizes)pBuffer; spcs->cbMaxToken = NTLM_MAX_BUF; spcs->cbMaxSignature = 16; - spcs->cbBlockSize = 1; + spcs->cbBlockSize = 0; spcs->cbSecurityTrailer = 16; return SEC_E_OK; } diff --git a/dlls/secur32/tests/ntlm.c b/dlls/secur32/tests/ntlm.c index ba3fc73..b8099f8 100644 --- a/dlls/secur32/tests/ntlm.c +++ b/dlls/secur32/tests/ntlm.c @@ -67,12 +67,6 @@ typedef struct _SspiData { ULONG max_token; } SspiData; -static BYTE client_req[] = - {0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x07, 0x82, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00}; - static BYTE network_challenge[] = {0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x30, 0x00, 0x00, 0x00, @@ -596,14 +590,8 @@ static void testAuth(ULONG data_rep, BOO "Running the client returned %s, more tests will fail.\n", getSecError(client_stat)); - if(first) - todo_wine{ - ok(!memcmp(client.out_buf->pBuffers[0].pvBuffer, client_req, - sizeof(client_req)), "Client gave an invalid reply!\n"); - } - communicate(&client, &server); - + if(fake) server_stat = runFakeServer(&server, first, data_rep); else @@ -619,7 +607,7 @@ static void testAuth(ULONG data_rep, BOO first = FALSE; } - if(!strcmp(sec_pkg_name, "NTLM")) + if(client_stat == SEC_E_OK) { sec_status = pQueryContextAttributesA(client.ctxt, SECPKG_ATTR_SIZES, &ctxt_sizes); @@ -636,12 +624,12 @@ static void testAuth(ULONG data_rep, BOO ok(ctxt_sizes.cbSecurityTrailer == 16, "cbSecurityTrailer should be 16 but is %lu\n", ctxt_sizes.cbSecurityTrailer); - ok(ctxt_sizes.cbBlockSize == 1, - "cbBlockSize should be 1 but is %lu\n", + ok(ctxt_sizes.cbBlockSize == 0, + "cbBlockSize should be 0 but is %lu\n", ctxt_sizes.cbBlockSize); } else - trace("Unknown sec package %s\n", sec_pkg_name); + trace("Authentication failed, skipping test.\n"); cleanupBuffers(&client); cleanupBuffers(&server);
1
0
0
0
Kai Blin : secur32: Add tests for MakeSignature, VerifySignature, EncryptMessage and DecryptMessage.
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: a71cf8446f1055d4bc327c6096d83183d16dbe3d URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=a71cf8446f1055d4bc327c6…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Wed Aug 9 14:31:44 2006 +0200 secur32: Add tests for MakeSignature, VerifySignature, EncryptMessage and DecryptMessage. --- dlls/secur32/tests/ntlm.c | 202 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 201 insertions(+), 1 deletions(-) diff --git a/dlls/secur32/tests/ntlm.c b/dlls/secur32/tests/ntlm.c index fc45874..ba3fc73 100644 --- a/dlls/secur32/tests/ntlm.c +++ b/dlls/secur32/tests/ntlm.c @@ -49,6 +49,14 @@ static SECURITY_STATUS (SEC_ENTRY * pAcc static SECURITY_STATUS (SEC_ENTRY * pFreeCredentialsHandle)(PCredHandle); static SECURITY_STATUS (SEC_ENTRY * pDeleteSecurityContext)(PCtxtHandle); static SECURITY_STATUS (SEC_ENTRY * pQueryContextAttributesA)(PCtxtHandle, ULONG, PVOID); +static SECURITY_STATUS (SEC_ENTRY * pMakeSignature)(PCtxtHandle, ULONG, + PSecBufferDesc, ULONG); +static SECURITY_STATUS (SEC_ENTRY * pVerifySignature)(PCtxtHandle, PSecBufferDesc, + ULONG, PULONG); +static SECURITY_STATUS (SEC_ENTRY * pEncryptMessage)(PCtxtHandle, ULONG, + PSecBufferDesc, ULONG); +static SECURITY_STATUS (SEC_ENTRY * pDecryptMessage)(PCtxtHandle, PSecBufferDesc, + ULONG, PULONG); typedef struct _SspiData { PCredHandle cred; @@ -99,6 +107,32 @@ static BYTE native_challenge[] = 0x61, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6f, 0x00, 0x30, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00}; +static BYTE message_signature[] = + {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +static BYTE message_binary[] = + {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x77, 0x6f, 0x72, + 0x6c, 0x64, 0x21}; + +static char message[] = "Hello, world!"; + +static BYTE crypt_trailer_client[] = + {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xc7, + 0xaa, 0x26, 0x16, 0x39, 0x07, 0x4e}; + +static BYTE crypt_message_client[] = + {0x86, 0x9c, 0x5a, 0x10, 0x78, 0xb3, 0x30, 0x98, 0x46, 0x15, + 0xa0, 0x31, 0xd9}; + +static BYTE crypt_trailer_server[] = + {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x46, + 0x2e, 0x77, 0xeb, 0xf0, 0xf6, 0x9e}; + +static BYTE crypt_message_server[] = + {0xf6, 0xb7, 0x92, 0x0c, 0xac, 0xea, 0x98, 0xe6, 0xef, 0xa0, + 0x29, 0x66, 0xfd}; + static void InitFunctionPtrs(void) { secdll = LoadLibraryA("secur32.dll"); @@ -116,6 +150,10 @@ static void InitFunctionPtrs(void) pFreeCredentialsHandle = (PVOID)GetProcAddress(secdll, "FreeCredentialsHandle"); pDeleteSecurityContext = (PVOID)GetProcAddress(secdll, "DeleteSecurityContext"); pQueryContextAttributesA = (PVOID)GetProcAddress(secdll, "QueryContextAttributesA"); + pMakeSignature = (PVOID)GetProcAddress(secdll, "MakeSignature"); + pVerifySignature = (PVOID)GetProcAddress(secdll, "VerifySignature"); + pEncryptMessage = (PVOID)GetProcAddress(secdll, "EncryptMessage"); + pDecryptMessage = (PVOID)GetProcAddress(secdll, "DecryptMessage"); } } @@ -636,6 +674,165 @@ static void testAuth(ULONG data_rep, BOO } } +static void testSignSeal() +{ + SECURITY_STATUS client_stat = SEC_I_CONTINUE_NEEDED; + SECURITY_STATUS server_stat = SEC_I_CONTINUE_NEEDED; + SECURITY_STATUS sec_status; + PSecPkgInfo pkg_info = NULL; + BOOL first = TRUE; + SspiData client, server; + SEC_WINNT_AUTH_IDENTITY id; + static char sec_pkg_name[] = "NTLM"; + PSecBufferDesc crypt = NULL; + PSecBuffer data = NULL; + ULONG qop = 0; + SecPkgContext_Sizes ctxt_sizes; + + /**************************************************************** + * This is basically the same as in testAuth with a fake server, + * as we need a valid, authenticated context. + */ + if(pQuerySecurityPackageInfoA( sec_pkg_name, &pkg_info)== SEC_E_OK) + { + pFreeContextBuffer(pkg_info); + id.User = (unsigned char*) "testuser"; + id.UserLength = strlen((char *) id.User); + id.Domain = (unsigned char *) "WORKGROUP"; + id.DomainLength = strlen((char *) id.Domain); + id.Password = (unsigned char*) "testpass"; + id.PasswordLength = strlen((char *) id.Password); + id.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; + + client.id = &id; + + sec_status = setupClient(&client, sec_pkg_name); + + if(sec_status != SEC_E_OK) + { + trace("Error: Setting up the client returned %s, exiting test!\n", + getSecError(sec_status)); + pFreeCredentialsHandle(client.cred); + return; + } + + sec_status = setupFakeServer(&server, sec_pkg_name); + + while(client_stat == SEC_I_CONTINUE_NEEDED && server_stat == SEC_I_CONTINUE_NEEDED) + { + client_stat = runClient(&client, first, SECURITY_NETWORK_DREP); + + communicate(&client, &server); + + server_stat = runFakeServer(&server, first, SECURITY_NETWORK_DREP); + + communicate(&server, &client); + trace("Looping\n"); + first = FALSE; + } + + /******************************************** + * Now start with the actual testing * + ********************************************/ + + if(pQueryContextAttributesA(client.ctxt, SECPKG_ATTR_SIZES, + &ctxt_sizes) != SEC_E_OK) + { + trace("Failed to get context sizes, aborting test.\n"); + goto end; + } + + if((crypt = HeapAlloc(GetProcessHeap(), 0, sizeof(SecBufferDesc))) == NULL) + { + trace("Failed to allocate the crypto buffer, aborting test.\n"); + goto end; + } + + crypt->ulVersion = SECBUFFER_VERSION; + crypt->cBuffers = 2; + + if((data = HeapAlloc(GetProcessHeap(), 0, sizeof(SecBuffer) * 2)) == NULL) + { + trace("Failed to allocate the crypto buffer, aborting test.\n"); + goto end; + } + + crypt->pBuffers = data; + + data[0].BufferType = SECBUFFER_TOKEN; + data[0].cbBuffer = ctxt_sizes.cbSecurityTrailer; + data[0].pvBuffer = HeapAlloc(GetProcessHeap(), 0, data[0].cbBuffer); + + data[1].BufferType = SECBUFFER_DATA; + data[1].cbBuffer = lstrlen(message); + data[1].pvBuffer = HeapAlloc(GetProcessHeap(), 0, data[1].cbBuffer); + memcpy(data[1].pvBuffer, message, data[1].cbBuffer); + + /* As we forced NTLM to fall back to a password-derived session key, + * we should get the same signature for our data, no matter if + * it is sent by the client or the server + */ + sec_status = pMakeSignature(client.ctxt, 0, crypt, 0); + todo_wine { + ok(sec_status == SEC_E_OK, "MakeSignature returned %s, not SEC_E_OK.\n", + getSecError(sec_status)); + ok(!memcmp(crypt->pBuffers[0].pvBuffer, message_signature, + crypt->pBuffers[0].cbBuffer), "Signature is not as expected.\n"); + } + + data[0].cbBuffer = sizeof(message_signature); + memcpy(data[0].pvBuffer, message_signature, data[0].cbBuffer); + + sec_status = pVerifySignature(client.ctxt, crypt, 0, &qop); + todo_wine { + ok(sec_status == SEC_E_OK, "VerifySignature returned %s, not SEC_E_OK.\n", + getSecError(sec_status)); + } + + sec_status = pEncryptMessage(client.ctxt, 0, crypt, 0); + todo_wine{ + ok(sec_status == SEC_E_OK, "EncryptMessage returned %s, not SEC_E_OK.\n", + getSecError(sec_status)); + ok(!memcmp(crypt->pBuffers[0].pvBuffer, crypt_trailer_client, + crypt->pBuffers[0].cbBuffer), "Crypt trailer not as expected.\n"); + ok(!memcmp(crypt->pBuffers[1].pvBuffer, crypt_message_client, + crypt->pBuffers[1].cbBuffer), "Crypt message not as expected.\n"); + } + + data[0].cbBuffer = sizeof(crypt_trailer_server); + data[1].cbBuffer = sizeof(crypt_message_server); + memcpy(data[0].pvBuffer, crypt_trailer_server, data[0].cbBuffer); + memcpy(data[1].pvBuffer, crypt_message_server, data[1].cbBuffer); + + sec_status = pDecryptMessage(client.ctxt, crypt, 0, &qop); + todo_wine { + ok(sec_status == SEC_E_OK, "DecryptMessage returned %s, not SEC_E_OK.\n", + getSecError(sec_status)); + ok(!memcmp(crypt->pBuffers[1].pvBuffer, message_binary, + crypt->pBuffers[1].cbBuffer), + "Failed to decrypt message correctly.\n"); + } + +end: + cleanupBuffers(&client); + cleanupBuffers(&server); + + pDeleteSecurityContext(client.ctxt); + pFreeCredentialsHandle(client.cred); + if(data) + { + HeapFree(GetProcessHeap(), 0, data[0].pvBuffer); + HeapFree(GetProcessHeap(), 0, data[1].pvBuffer); + } + HeapFree(GetProcessHeap(), 0, data); + HeapFree(GetProcessHeap(), 0, crypt); + } + else + { + trace("Package not installed, skipping test.\n"); + } +} + START_TEST(ntlm) { InitFunctionPtrs(); @@ -652,8 +849,11 @@ START_TEST(ntlm) testAuth(SECURITY_NATIVE_DREP, FALSE); testAuth(SECURITY_NETWORK_DREP, FALSE); } + if(pMakeSignature && pVerifySignature && pEncryptMessage && + pDecryptMessage) + testSignSeal(); } - + if(secdll) FreeLibrary(secdll); }
1
0
0
0
Mike McCormack : shell32: IShellLink::SetPath removes quotes from the path.
by Alexandre Julliard
09 Aug '06
09 Aug '06
Module: wine Branch: refs/heads/master Commit: 4fa9f637615f467240ef03fea147853075bed114 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=4fa9f637615f467240ef03f…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Wed Aug 9 20:38:51 2006 +0900 shell32: IShellLink::SetPath removes quotes from the path. --- dlls/shell32/shelllink.c | 17 ++++++++++++++++- dlls/shell32/tests/shelllink.c | 23 +++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletions(-) diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c index 751aa2e..550f3a0 100644 --- a/dlls/shell32/shelllink.c +++ b/dlls/shell32/shelllink.c @@ -2156,11 +2156,25 @@ static HRESULT WINAPI IShellLinkW_fnSetP { IShellLinkImpl *This = impl_from_IShellLinkW(iface); WCHAR buffer[MAX_PATH]; - LPWSTR fname; + LPWSTR fname, unquoted = NULL; HRESULT hr = S_OK; + UINT len; TRACE("(%p)->(path=%s)\n",This, debugstr_w(pszFile)); + /* quotes at the ends of the string are stripped */ + len = lstrlenW(pszFile); + if (pszFile[0] == '"' && pszFile[len-1] == '"') + { + unquoted = strdupW(pszFile); + PathUnquoteSpacesW(unquoted); + pszFile = unquoted; + } + + /* any other quote marks are invalid */ + if (strchrW(pszFile, '"')) + return S_FALSE; + HeapFree(GetProcessHeap(), 0, This->sPath); This->sPath = NULL; @@ -2191,6 +2205,7 @@ static HRESULT WINAPI IShellLinkW_fnSetP lstrcpyW(This->sPath, buffer); } This->bDirty = TRUE; + HeapFree(GetProcessHeap(), 0, unquoted); return hr; } diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index a6cba36..aaf0283 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -216,6 +216,29 @@ static void test_get_set(void) ok(lstrcmpi(buffer, mypath)==0, "GetPath returned '%s'\n", buffer); } + /* test path with quotes */ + r = IShellLinkA_SetPath(sl, "\"c:\\nonexistent\\file\""); + ok(r==S_FALSE, "SetPath failed (0x%08lx)\n", r); + + r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); + ok(r==S_OK, "GetPath failed (0x%08lx)\n", r); + ok(!lstrcmp(buffer, "C:\\nonexistent\\file"), "case doesn't match\n"); + + r = IShellLinkA_SetPath(sl, "\"c:\\foo"); + ok(r==S_FALSE, "SetPath failed (0x%08lx)\n", r); + + r = IShellLinkA_SetPath(sl, "\"\"c:\\foo"); + ok(r==S_FALSE, "SetPath failed (0x%08lx)\n", r); + + r = IShellLinkA_SetPath(sl, "c:\\foo\""); + ok(r==S_FALSE, "SetPath failed (0x%08lx)\n", r); + + r = IShellLinkA_SetPath(sl, "\"\"c:\\foo\""); + ok(r==S_FALSE, "SetPath failed (0x%08lx)\n", r); + + r = IShellLinkA_SetPath(sl, "\"\"c:\\foo\"\""); + ok(r==S_FALSE, "SetPath failed (0x%08lx)\n", r); + /* Test Getting / Setting the arguments */ strcpy(buffer,"garbage"); r = IShellLinkA_GetArguments(sl, buffer, sizeof(buffer));
1
0
0
0
← Newer
1
...
49
50
51
52
53
54
55
...
75
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Results per page:
10
25
50
100
200