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
March 2010
----- 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
3 participants
919 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Moved asynchronous document binding to separated function.
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: 0bccfa873db617254ad77b064ce66520f6f27170 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0bccfa873db617254ad77b064…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 3 14:53:32 2010 +0100 mshtml: Moved asynchronous document binding to separated function. --- dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/navigate.c | 30 ++++++++++++++++++++++++++++++ dlls/mshtml/nsio.c | 21 ++------------------- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index f2ef1af..8f91d38 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -740,6 +740,7 @@ void add_nsevent_listener(HTMLDocumentNode*,LPCWSTR); void set_window_bscallback(HTMLWindow*,nsChannelBSC*); void set_current_mon(HTMLWindow*,IMoniker*); HRESULT start_binding(HTMLWindow*,HTMLDocumentNode*,BSCallback*,IBindCtx*); +HRESULT async_start_doc_binding(HTMLWindow*,nsChannelBSC*); void abort_document_bindings(HTMLDocumentNode*); HRESULT bind_mon_to_buffer(HTMLDocumentNode*,IMoniker*,void**,DWORD*); diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index f660c98..b3ca1b0 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -1148,6 +1148,36 @@ void set_window_bscallback(HTMLWindow *window, nsChannelBSC *callback) } } +typedef struct { + task_t header; + HTMLWindow *window; + nsChannelBSC *bscallback; +} start_doc_binding_task_t; + +static void start_doc_binding_proc(task_t *_task) +{ + start_doc_binding_task_t *task = (start_doc_binding_task_t*)_task; + + start_binding(task->window, NULL, (BSCallback*)task->bscallback, NULL); + IBindStatusCallback_Release(STATUSCLB(&task->bscallback->bsc)); +} + +HRESULT async_start_doc_binding(HTMLWindow *window, nsChannelBSC *bscallback) +{ + start_doc_binding_task_t *task; + + task = heap_alloc(sizeof(start_doc_binding_task_t)); + if(!task) + return E_OUTOFMEMORY; + + task->window = window; + task->bscallback = bscallback; + IBindStatusCallback_AddRef(STATUSCLB(&bscallback->bsc)); + + push_task(&task->header, start_doc_binding_proc, window->task_magic); + return S_OK; +} + void abort_document_bindings(HTMLDocumentNode *doc) { BSCallback *iter; diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index fde132a..3a5c4fe 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -808,19 +808,7 @@ static void start_binding_proc(task_t *_task) start_binding_task_t *task = (start_binding_task_t*)_task; start_binding(NULL, task->doc, (BSCallback*)task->bscallback, NULL); -} - -typedef struct { - task_t header; - HTMLWindow *window; - nsChannelBSC *bscallback; -} start_doc_binding_task_t; -static void start_doc_binding_proc(task_t *_task) -{ - start_doc_binding_task_t *task = (start_doc_binding_task_t*)_task; - - start_binding(task->window, NULL, (BSCallback*)task->bscallback, NULL); IUnknown_Release((IUnknown*)task->bscallback); } @@ -844,14 +832,9 @@ static nsresult async_open(nsChannel *This, HTMLWindow *window, BOOL is_doc_chan channelbsc_set_channel(bscallback, This, listener, context); if(is_doc_channel) { - start_doc_binding_task_t *task; - set_window_bscallback(window, bscallback); - - task = heap_alloc(sizeof(start_doc_binding_task_t)); - task->window = window; - task->bscallback = bscallback; - push_task(&task->header, start_doc_binding_proc, window->task_magic); + async_start_doc_binding(window, bscallback); + IUnknown_Release((IUnknown*)bscallback); }else { start_binding_task_t *task = heap_alloc(sizeof(start_binding_task_t));
1
0
0
0
Jacek Caban : mshtml: Added IHTMLPrivateWindow stub implementation.
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: 6938378be3c065730d8e1b6a373c3252a9958065 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6938378be3c065730d8e1b6a3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 3 14:53:03 2010 +0100 mshtml: Added IHTMLPrivateWindow stub implementation. --- dlls/mshtml/htmlwindow.c | 88 +++++++++++++++++++++++++++++++++++++++++- dlls/mshtml/mshtml_private.h | 1 + 2 files changed, 88 insertions(+), 1 deletions(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 58d5f7b..1df97b9 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -27,7 +27,6 @@ #include "mshtmdid.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "mshtml_private.h" #include "htmlevent.h" @@ -35,6 +34,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); +#define HTMLPRIVWINDOW(x) ((IHTMLPrivateWindow*) &(x)->lpIHTMLPrivateWindowVtbl) + static struct list window_list = LIST_INIT(window_list); static void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node) @@ -166,6 +167,9 @@ static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID rii }else if(IsEqualGUID(&IID_IHTMLWindow4, riid)) { TRACE("(%p)->(IID_IHTMLWindow4 %p)\n", This, ppv); *ppv = HTMLWINDOW4(This); + }else if(IsEqualGUID(&IID_IHTMLPrivateWindow, riid)) { + TRACE("(%p)->(IID_IHTMLPrivateWindow %p)\n", This, ppv); + *ppv = HTMLPRIVWINDOW(This); }else if(dispex_query_interface(&This->dispex, riid, ppv)) { return *ppv ? S_OK : E_NOINTERFACE; } @@ -1641,6 +1645,87 @@ static const IHTMLWindow4Vtbl HTMLWindow4Vtbl = { HTMLWindow4_get_frameElement }; +#define HTMLPRIVWINDOW_THIS(iface) DEFINE_THIS(HTMLWindow, IHTMLPrivateWindow, iface) + +static HRESULT WINAPI HTMLPrivateWindow_QueryInterface(IHTMLPrivateWindow *iface, REFIID riid, void **ppv) +{ + HTMLWindow *This = HTMLPRIVWINDOW_THIS(iface); + + return IHTMLWindow2_QueryInterface(HTMLWINDOW2(This), riid, ppv); +} + +static ULONG WINAPI HTMLPrivateWindow_AddRef(IHTMLPrivateWindow *iface) +{ + HTMLWindow *This = HTMLPRIVWINDOW_THIS(iface); + + return IHTMLWindow2_AddRef(HTMLWINDOW2(This)); +} + +static ULONG WINAPI HTMLPrivateWindow_Release(IHTMLPrivateWindow *iface) +{ + HTMLWindow *This = HTMLPRIVWINDOW_THIS(iface); + + return IHTMLWindow2_Release(HTMLWINDOW2(This)); +} + +static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface, BSTR url, BSTR arg2, BSTR arg3, + BSTR arg4, VARIANT *post_data_var, VARIANT *headers_var, ULONG flags) +{ + HTMLWindow *This = HTMLPRIVWINDOW_THIS(iface); + FIXME("(%p)->(%s %s %s %s %s %s %x)\n", This, debugstr_w(url), debugstr_w(arg2), debugstr_w(arg3), + debugstr_w(arg4), debugstr_variant(post_data_var), debugstr_variant(headers_var), flags); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLPrivateWindow_GetPendingUrl(IHTMLPrivateWindow *iface, BSTR *url) +{ + HTMLWindow *This = HTMLPRIVWINDOW_THIS(iface); + FIXME("(%p)->(%p)\n", This, url); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLPrivateWindow_SetPICSTarget(IHTMLPrivateWindow *iface, IOleCommandTarget *cmdtrg) +{ + HTMLWindow *This = HTMLPRIVWINDOW_THIS(iface); + FIXME("(%p)->(%p)\n", This, cmdtrg); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLPrivateWindow_PICSComplete(IHTMLPrivateWindow *iface, int arg) +{ + HTMLWindow *This = HTMLPRIVWINDOW_THIS(iface); + FIXME("(%p)->(%x)\n", This, arg); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLPrivateWindow_FindWindowByName(IHTMLPrivateWindow *iface, LPCWSTR name, IHTMLWindow2 **ret) +{ + HTMLWindow *This = HTMLPRIVWINDOW_THIS(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_w(name), ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLPrivateWindow_GetAddressBar(IHTMLPrivateWindow *iface, BSTR *url) +{ + HTMLWindow *This = HTMLPRIVWINDOW_THIS(iface); + FIXME("(%p)->(%p)\n", This, url); + return E_NOTIMPL; +} + +#undef HTMLPRIVWINDOW_THIS + +static const IHTMLPrivateWindowVtbl HTMLPrivateWindowVtbl = { + HTMLPrivateWindow_QueryInterface, + HTMLPrivateWindow_AddRef, + HTMLPrivateWindow_Release, + HTMLPrivateWindow_SuperNavigate, + HTMLPrivateWindow_GetPendingUrl, + HTMLPrivateWindow_SetPICSTarget, + HTMLPrivateWindow_PICSComplete, + HTMLPrivateWindow_FindWindowByName, + HTMLPrivateWindow_GetAddressBar +}; + #define DISPEX_THIS(iface) DEFINE_THIS(HTMLWindow, IDispatchEx, iface) static HRESULT WINAPI WindowDispEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) @@ -1954,6 +2039,7 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML window->lpHTMLWindow2Vtbl = &HTMLWindow2Vtbl; window->lpHTMLWindow3Vtbl = &HTMLWindow3Vtbl; window->lpHTMLWindow4Vtbl = &HTMLWindow4Vtbl; + window->lpIHTMLPrivateWindowVtbl = &HTMLPrivateWindowVtbl; window->lpIDispatchExVtbl = &WindowDispExVtbl; window->ref = 1; window->doc_obj = doc_obj; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 778f290..f2ef1af 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -235,6 +235,7 @@ struct HTMLWindow { const IHTMLWindow2Vtbl *lpHTMLWindow2Vtbl; const IHTMLWindow3Vtbl *lpHTMLWindow3Vtbl; const IHTMLWindow4Vtbl *lpHTMLWindow4Vtbl; + const IHTMLPrivateWindowVtbl *lpIHTMLPrivateWindowVtbl; const IDispatchExVtbl *lpIDispatchExVtbl; LONG ref;
1
0
0
0
Jacek Caban : include: Added IHTMLPrivateWindow declaration.
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: 73a581370619edc652686d83e984d947d448aa27 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=73a581370619edc652686d83e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 3 14:52:32 2010 +0100 include: Added IHTMLPrivateWindow declaration. --- include/mshtml.idl | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/include/mshtml.idl b/include/mshtml.idl index 98edbbc..1941b92 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -15407,3 +15407,23 @@ interface IElementBehaviorFactory : IUnknown } } /* library MSHTML */ + +interface IOleCommandTarget; + +/***************************************************************************** + * IHTMLPrivateWindow interface + */ +[ + object, + uuid(3050f6dc-98b5-11cf-bb82-00aa00bdce0b), + local +] +interface IHTMLPrivateWindow : IUnknown +{ + HRESULT SuperNavigate(BSTR url, BSTR arg2, BSTR arg3, BSTR arg4, VARIANT *post_data, VARIANT *headers, ULONG flags); + HRESULT GetPendingUrl(BSTR *url); + HRESULT SetPICSTarget(IOleCommandTarget *cmdtrg); + HRESULT PICSComplete(int arg); + HRESULT FindWindowByName(LPCWSTR name, IHTMLWindow2 **ret); + HRESULT GetAddressBarUrl(BSTR *url); +}
1
0
0
0
Hans Leidekker : msi: Add tests for removing environment strings.
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: aaf5ffb2b526db0362792cb31fc07b608c0b11d1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aaf5ffb2b526db0362792cb31…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Mar 3 14:38:32 2010 +0100 msi: Add tests for removing environment strings. --- dlls/msi/tests/install.c | 180 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 180 insertions(+), 0 deletions(-) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 722e427..62d1ef6 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -1649,6 +1649,53 @@ static const CHAR riv_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "PublishProduct\t\t5200\n" "InstallFinalize\t\t6000\n"; +static const CHAR res_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "envvar.txt\tenvvar\tenvvar.txt\t1000\t\t\t8192\t1\n"; + +static const CHAR res_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "envvar\t\t\tenvvar feature\t1\t2\tMSITESTDIR\t0\n"; + +static const CHAR res_feature_comp_dat[] = "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "envvar\tenvvar\n"; + +static const CHAR res_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "envvar\t{45EE9AF4-E5D1-445F-8BB7-B22D4EEBD29E}\tMSITESTDIR\t0\t\tenvvar.txt\n"; + +static const CHAR res_environment_dat[] = "Environment\tName\tValue\tComponent_\n" + "s72\tl255\tL255\ts72\n" + "Environment\tEnvironment\n" + "var1\t=-MSITESTVAR1\t1\tenvvar\n" + "var2\t=+-MSITESTVAR2\t1\tenvvar\n" + "var3\t=MSITESTVAR3\t1\tenvvar\n" + "var4\t=-MSITESTVAR4\t\tenvvar\n" + "var5\t=MSITESTVAR5\t\tenvvar\n"; + +static const CHAR res_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "LaunchConditions\t\t100\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "ProcessComponents\t\t1600\n" + "RemoveFiles\t\t1700\n" + "InstallFiles\t\t2000\n" + "RemoveEnvironmentStrings\t\t3000\n" + "RegisterProduct\t\t5000\n" + "PublishFeatures\t\t5100\n" + "PublishProduct\t\t5200\n" + "InstallFinalize\t\t6000\n"; + typedef struct _msi_table { const CHAR *filename; @@ -2554,6 +2601,19 @@ static const msi_table riv_tables[] = ADD_TABLE(property) }; +static const msi_table res_tables[] = +{ + ADD_TABLE(directory), + ADD_TABLE(res_component), + ADD_TABLE(res_feature), + ADD_TABLE(res_feature_comp), + ADD_TABLE(res_file), + ADD_TABLE(res_environment), + ADD_TABLE(res_install_exec_seq), + ADD_TABLE(media), + ADD_TABLE(property) +}; + /* cabinet definitions */ /* make the max size large so there is only one cab file */ @@ -8704,6 +8764,125 @@ static void test_remove_ini_values(void) delete_test_files(); } +static void test_remove_env_strings(void) +{ + UINT r; + LONG res; + HKEY key; + DWORD type, size; + char buffer[0x10]; + + if (on_win9x) + { + win_skip("Environment variables are handled differently on win9x and winme\n"); + return; + } + + create_test_files(); + create_file("msitest\\envvar.txt", 1000); + create_database(msifile, res_tables, sizeof(res_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); + ok(!res, "failed to open environment key %d\n", res); + + RegSetValueExA(key, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"1", 2); + RegSetValueExA(key, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"1", 2); + RegSetValueExA(key, "MSITESTVAR3", 0, REG_SZ, (const BYTE *)"1", 2); + RegSetValueExA(key, "MSITESTVAR4", 0, REG_SZ, (const BYTE *)"1", 2); + RegSetValueExA(key, "MSITESTVAR5", 0, REG_SZ, (const BYTE *)"1", 2); + + RegCloseKey(key); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); + ok(!res, "failed to open environment key %d\n", res); + + type = REG_NONE; + buffer[0] = 0; + size = sizeof(buffer); + res = RegQueryValueExA(key, "MSITESTVAR1", NULL, &type, (LPBYTE)buffer, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); + ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); + + type = REG_NONE; + buffer[0] = 0; + size = sizeof(buffer); + res = RegQueryValueExA(key, "MSITESTVAR2", NULL, &type, (LPBYTE)buffer, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); + ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); + + type = REG_NONE; + buffer[0] = 0; + size = sizeof(buffer); + res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); + ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); + + type = REG_NONE; + buffer[0] = 0; + size = sizeof(buffer); + res = RegQueryValueExA(key, "MSITESTVAR4", NULL, &type, (LPBYTE)buffer, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); + ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); + + type = REG_NONE; + buffer[0] = 0; + size = sizeof(buffer); + res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); + ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); + + RegCloseKey(key); + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key); + ok(!res, "failed to open environment key %d\n", res); + + res = RegQueryValueExA(key, "MSITESTVAR1", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + + res = RegQueryValueExA(key, "MSITESTVAR2", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + + type = REG_NONE; + buffer[0] = 0; + size = sizeof(buffer); + res = RegQueryValueExA(key, "MSITESTVAR3", NULL, &type, (LPBYTE)buffer, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); + ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); + RegDeleteValueA(key, "MSITESTVAR3"); + + res = RegQueryValueExA(key, "MSITESTVAR4", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + + type = REG_NONE; + buffer[0] = 0; + size = sizeof(buffer); + res = RegQueryValueExA(key, "MSITESTVAR5", NULL, &type, (LPBYTE)buffer, &size); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + ok(type == REG_SZ, "expected REG_SZ, got %u\n", type); + ok(!lstrcmp(buffer, "1"), "expected \"1\", got \"%s\"\n", buffer); + RegDeleteValueA(key, "MSITESTVAR5"); + + RegCloseKey(key); + + ok(!delete_pf("msitest\\envvar.txt", TRUE), "file not removed\n"); + ok(!delete_pf("msitest", FALSE), "directory not removed\n"); + delete_test_files(); +} + START_TEST(install) { DWORD len; @@ -8810,6 +8989,7 @@ START_TEST(install) test_remove_registry_values(); test_find_related_products(); test_remove_ini_values(); + test_remove_env_strings(); DeleteFileA(log_file);
1
0
0
0
Hans Leidekker : msi: Implement the RemoveEnvironmentStrings standard action.
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: f62211198a67e4efcf4b62e01b65025eda44b536 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f62211198a67e4efcf4b62e01…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Mar 3 14:38:06 2010 +0100 msi: Implement the RemoveEnvironmentStrings standard action. --- dlls/msi/action.c | 195 +++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 159 insertions(+), 36 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 4441030..08cf975 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -5810,7 +5810,7 @@ static UINT ACTION_RemoveODBC( MSIPACKAGE *package ) #define check_flag_combo(x, y) ((x) & ~(y)) == (y) -static LONG env_set_flags( LPCWSTR *name, LPCWSTR *value, DWORD *flags ) +static UINT env_parse_flags( LPCWSTR *name, LPCWSTR *value, DWORD *flags ) { LPCWSTR cptr = *name; @@ -5891,18 +5891,8 @@ static LONG env_set_flags( LPCWSTR *name, LPCWSTR *value, DWORD *flags ) return ERROR_SUCCESS; } -static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) +static UINT open_env_key( DWORD flags, HKEY *key ) { - MSIPACKAGE *package = param; - LPCWSTR name, value, component; - LPWSTR data = NULL, newval = NULL; - LPWSTR deformatted = NULL, ptr; - DWORD flags, type, size; - LONG res; - HKEY env = NULL, root; - LPCWSTR environment; - MSICOMPONENT *comp; - static const WCHAR user_env[] = {'E','n','v','i','r','o','n','m','e','n','t',0}; static const WCHAR machine_env[] = @@ -5911,6 +5901,42 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) 'C','o','n','t','r','o','l','\\', 'S','e','s','s','i','o','n',' ','M','a','n','a','g','e','r','\\', 'E','n','v','i','r','o','n','m','e','n','t',0}; + const WCHAR *env; + HKEY root; + LONG res; + + if (flags & ENV_MOD_MACHINE) + { + env = machine_env; + root = HKEY_LOCAL_MACHINE; + } + else + { + env = user_env; + root = HKEY_CURRENT_USER; + } + + res = RegOpenKeyExW( root, env, 0, KEY_ALL_ACCESS, key ); + if (res != ERROR_SUCCESS) + { + WARN("Failed to open key %s (%d)\n", debugstr_w(env), res); + return ERROR_FUNCTION_FAILED; + } + + return ERROR_SUCCESS; +} + +static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPCWSTR name, value, component; + LPWSTR data = NULL, newval = NULL, deformatted = NULL, ptr; + DWORD flags, type, size; + UINT res; + HKEY env; + MSICOMPONENT *comp; + MSIRECORD *uirow; + int action = 0; component = MSI_RecordGetString(rec, 4); comp = get_loaded_component(package, component); @@ -5930,7 +5956,7 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) TRACE("name %s value %s\n", debugstr_w(name), debugstr_w(value)); - res = env_set_flags(&name, &value, &flags); + res = env_parse_flags(&name, &value, &flags); if (res != ERROR_SUCCESS || !value) goto done; @@ -5942,24 +5968,12 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) value = deformatted; - if (flags & ENV_MOD_MACHINE) - { - environment = machine_env; - root = HKEY_LOCAL_MACHINE; - } - else - { - environment = user_env; - root = HKEY_CURRENT_USER; - } - - res = RegCreateKeyExW(root, environment, 0, NULL, 0, - KEY_ALL_ACCESS, NULL, &env, NULL); + res = open_env_key( flags, &env ); if (res != ERROR_SUCCESS) goto done; - if (flags & ENV_ACT_REMOVE) - FIXME("Not removing environment variable on uninstall!\n"); + if (flags & ENV_MOD_MACHINE) + action |= 0x20000000; size = 0; type = REG_SZ; @@ -5970,6 +5984,8 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) if ((res == ERROR_FILE_NOT_FOUND || !(flags & ENV_MOD_MASK))) { + action = 0x2; + /* Nothing to do. */ if (!value) { @@ -5990,6 +6006,8 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) } else { + action = 0x1; + /* Contrary to MSDN, +-variable to [~];path works */ if (flags & ENV_ACT_SETABSENT && !(flags & ENV_MOD_MASK)) { @@ -6010,7 +6028,10 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) if (flags & ENV_ACT_REMOVEMATCH && (!value || !lstrcmpW(data, value))) { - res = RegDeleteKeyW(env, name); + action = 0x4; + res = RegDeleteValueW(env, name); + if (res != ERROR_SUCCESS) + WARN("Failed to remove value %s (%d)\n", debugstr_w(name), res); goto done; } @@ -6037,6 +6058,7 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) { lstrcpyW(newval, value); ptr = newval + lstrlenW(value); + action |= 0x80000000; } lstrcpyW(ptr, data); @@ -6044,12 +6066,24 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) if (flags & ENV_MOD_APPEND) { lstrcatW(newval, value); + action |= 0x40000000; } } TRACE("setting %s to %s\n", debugstr_w(name), debugstr_w(newval)); res = RegSetValueExW(env, name, 0, type, (LPVOID)newval, size); + if (res) + { + WARN("Failed to set %s to %s (%d)\n", debugstr_w(name), debugstr_w(newval), res); + } done: + uirow = MSI_CreateRecord( 3 ); + MSI_RecordSetStringW( uirow, 1, name ); + MSI_RecordSetStringW( uirow, 2, newval ); + MSI_RecordSetInteger( uirow, 3, action ); + ui_actiondata( package, szWriteEnvironmentStrings, uirow ); + msiobj_release( &uirow->hdr ); + if (env) RegCloseKey(env); msi_free(deformatted); msi_free(data); @@ -6074,6 +6108,102 @@ static UINT ACTION_WriteEnvironmentStrings( MSIPACKAGE *package ) return rc; } +static UINT ITERATE_RemoveEnvironmentString( MSIRECORD *rec, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPCWSTR name, value, component; + LPWSTR deformatted = NULL; + DWORD flags; + HKEY env; + MSICOMPONENT *comp; + MSIRECORD *uirow; + int action = 0; + LONG res; + UINT r; + + component = MSI_RecordGetString( rec, 4 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; + + name = MSI_RecordGetString( rec, 2 ); + value = MSI_RecordGetString( rec, 3 ); + + TRACE("name %s value %s\n", debugstr_w(name), debugstr_w(value)); + + r = env_parse_flags( &name, &value, &flags ); + if (r != ERROR_SUCCESS) + return r; + + if (!(flags & ENV_ACT_REMOVE)) + { + TRACE("Environment variable %s not marked for removal\n", debugstr_w(name)); + return ERROR_SUCCESS; + } + + if (value && !deformat_string( package, value, &deformatted )) + return ERROR_OUTOFMEMORY; + + value = deformatted; + + r = open_env_key( flags, &env ); + if (r != ERROR_SUCCESS) + { + r = ERROR_SUCCESS; + goto done; + } + + if (flags & ENV_MOD_MACHINE) + action |= 0x20000000; + + TRACE("Removing %s\n", debugstr_w(name)); + + res = RegDeleteValueW( env, name ); + if (res != ERROR_SUCCESS) + { + WARN("Failed to delete value %s (%d)\n", debugstr_w(name), res); + r = ERROR_SUCCESS; + } + +done: + uirow = MSI_CreateRecord( 3 ); + MSI_RecordSetStringW( uirow, 1, name ); + MSI_RecordSetStringW( uirow, 2, value ); + MSI_RecordSetInteger( uirow, 3, action ); + ui_actiondata( package, szRemoveEnvironmentStrings, uirow ); + msiobj_release( &uirow->hdr ); + + if (env) RegCloseKey( env ); + msi_free( deformatted ); + return r; +} + +static UINT ACTION_RemoveEnvironmentStrings( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + static const WCHAR query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','E','n','v','i','r','o','n','m','e','n','t','`',0}; + + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveEnvironmentString, package ); + msiobj_release( &view->hdr ); + + return rc; +} + #define is_dot_dir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0)))) typedef struct @@ -6972,13 +7102,6 @@ static UINT ACTION_MigrateFeatureStates( MSIPACKAGE *package ) return msi_unimplemented_action_stub( package, "MigrateFeatureStates", table ); } -static UINT ACTION_RemoveEnvironmentStrings( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { - 'E','n','v','i','r','o','n','m','e','n','t',0 }; - return msi_unimplemented_action_stub( package, "RemoveEnvironmentStrings", table ); -} - static UINT ACTION_MsiUnpublishAssemblies( MSIPACKAGE *package ) { static const WCHAR table[] = {
1
0
0
0
Hans Leidekker : msi: Strip leading text style label from control text before lookup in binary table .
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: 7b6858546c7a1ed05e4ea85a6f1a387b75f3bb73 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7b6858546c7a1ed05e4ea85a6…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Mar 3 14:37:39 2010 +0100 msi: Strip leading text style label from control text before lookup in binary table. --- dlls/msi/dialog.c | 61 ++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 44 insertions(+), 17 deletions(-) diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 5fd4bbd..ac2e95a 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -801,11 +801,31 @@ static UINT msi_dialog_text_control( msi_dialog *dialog, MSIRECORD *rec ) return ERROR_SUCCESS; } +/* strip any leading text style label from text field */ +static WCHAR *msi_get_binary_name( MSIPACKAGE *package, MSIRECORD *rec ) +{ + WCHAR *p, *text; + + text = msi_get_deformatted_field( package, rec, 10 ); + if (!text) + return NULL; + + p = text; + while (*p && *p != '{') p++; + if (!*p++) return text; + + while (*p && *p != '}') p++; + if (!*p++) return text; + + p = strdupW( p ); + msi_free( text ); + return p; +} + static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; UINT attributes, style; - LPWSTR text; TRACE("%p %p\n", dialog, rec); @@ -820,12 +840,19 @@ static UINT msi_dialog_button_control( msi_dialog *dialog, MSIRECORD *rec ) control->handler = msi_dialog_button_handler; - /* set the icon */ - text = msi_get_deformatted_field( dialog->package, rec, 10 ); - control->hIcon = msi_load_icon( dialog->package->db, text, attributes ); - if( attributes & msidbControlAttributesIcon ) - SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) control->hIcon ); - msi_free( text ); + if (attributes & msidbControlAttributesIcon) + { + /* set the icon */ + LPWSTR name = msi_get_binary_name( dialog->package, rec ); + control->hIcon = msi_load_icon( dialog->package->db, name, attributes ); + if (control->hIcon) + { + SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) control->hIcon ); + } + else + ERR("Failed to load icon %s\n", debugstr_w(name)); + msi_free( name ); + } return ERROR_SUCCESS; } @@ -1142,7 +1169,7 @@ static UINT msi_dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec ) { UINT cx, cy, flags, style, attributes; msi_control *control; - LPWSTR text; + LPWSTR name; flags = LR_LOADFROMFILE; style = SS_BITMAP | SS_LEFT | WS_GROUP; @@ -1160,15 +1187,15 @@ static UINT msi_dialog_bitmap_control( msi_dialog *dialog, MSIRECORD *rec ) cx = msi_dialog_scale_unit( dialog, cx ); cy = msi_dialog_scale_unit( dialog, cy ); - text = msi_get_deformatted_field( dialog->package, rec, 10 ); - control->hBitmap = msi_load_picture( dialog->package->db, text, cx, cy, flags ); + name = msi_get_binary_name( dialog->package, rec ); + control->hBitmap = msi_load_picture( dialog->package->db, name, cx, cy, flags ); if( control->hBitmap ) SendMessageW( control->hwnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) control->hBitmap ); else - ERR("Failed to load bitmap %s\n", debugstr_w(text)); + ERR("Failed to load bitmap %s\n", debugstr_w(name)); - msi_free( text ); + msi_free( name ); return ERROR_SUCCESS; } @@ -1177,7 +1204,7 @@ static UINT msi_dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec ) { msi_control *control; DWORD attributes; - LPWSTR text; + LPWSTR name; TRACE("\n"); @@ -1185,13 +1212,13 @@ static UINT msi_dialog_icon_control( msi_dialog *dialog, MSIRECORD *rec ) SS_ICON | SS_CENTERIMAGE | WS_GROUP ); attributes = MSI_RecordGetInteger( rec, 8 ); - text = msi_get_deformatted_field( dialog->package, rec, 10 ); - control->hIcon = msi_load_icon( dialog->package->db, text, attributes ); + name = msi_get_binary_name( dialog->package, rec ); + control->hIcon = msi_load_icon( dialog->package->db, name, attributes ); if( control->hIcon ) SendMessageW( control->hwnd, STM_SETICON, (WPARAM) control->hIcon, 0 ); else - ERR("Failed to load bitmap %s\n", debugstr_w(text)); - msi_free( text ); + ERR("Failed to load bitmap %s\n", debugstr_w(name)); + msi_free( name ); return ERROR_SUCCESS; }
1
0
0
0
Hans Leidekker : setupapi: Destination directory defaults to system directory.
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: 1b8ba2537111f0d691d2592bb4ffb6bc4fe4f20e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1b8ba2537111f0d691d2592bb…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Mar 3 14:37:17 2010 +0100 setupapi: Destination directory defaults to system directory. --- dlls/setupapi/queue.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index 6a2b8d6..d302924 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -338,10 +338,17 @@ static WCHAR *get_destination_dir( HINF hinf, const WCHAR *section ) static const WCHAR Dest[] = {'D','e','s','t','i','n','a','t','i','o','n','D','i','r','s',0}; static const WCHAR Def[] = {'D','e','f','a','u','l','t','D','e','s','t','D','i','r',0}; INFCONTEXT context; + WCHAR systemdir[MAX_PATH], *dir; + BOOL ret; - if (!SetupFindFirstLineW( hinf, Dest, section, &context ) && - !SetupFindFirstLineW( hinf, Dest, Def, &context )) return NULL; - return PARSER_get_dest_dir( &context ); + if (!(ret = SetupFindFirstLineW( hinf, Dest, section, &context ))) + ret = SetupFindFirstLineW( hinf, Dest, Def, &context ); + + if (ret && (dir = PARSER_get_dest_dir( &context ))) + return dir; + + GetSystemDirectoryW( systemdir, MAX_PATH ); + return strdupW( systemdir ); }
1
0
0
0
Nikolay Sivov : shell32: Remove WINAPI where it's not needed.
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: ab0e037ee09716be92886601d94ca2c9e3d0da91 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ab0e037ee09716be92886601d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Mar 3 05:16:49 2010 +0300 shell32: Remove WINAPI where it's not needed. --- dlls/shell32/pidl.c | 8 ++++---- dlls/shell32/pidl.h | 2 +- dlls/shell32/undocshell.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 0774fde..ecda891 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -92,7 +92,7 @@ static BOOL ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR pat return ret; } -BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type) +BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type) { LPSHELLFOLDER psfParent, lsf = psf; HRESULT ret = NO_ERROR; @@ -393,7 +393,7 @@ static HRESULT SHILCreateFromPathA(LPCSTR path, LPITEMIDLIST * ppidl, DWORD * at return SHILCreateFromPathW(lpszDisplayName, ppidl, attributes); } -HRESULT WINAPI SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST * ppidl, DWORD * attributes) +HRESULT SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST * ppidl, DWORD * attributes) { LPSHELLFOLDER sf; DWORD pchEaten; @@ -1050,7 +1050,7 @@ static HRESULT _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile, * exists on disk. * exported by ordinal. */ -LPITEMIDLIST WINAPI SHSimpleIDListFromPathA(LPCSTR lpszPath) +LPITEMIDLIST SHSimpleIDListFromPathA(LPCSTR lpszPath) { LPITEMIDLIST pidl = NULL; LPWSTR wPath = NULL; @@ -1072,7 +1072,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathA(LPCSTR lpszPath) return pidl; } -LPITEMIDLIST WINAPI SHSimpleIDListFromPathW(LPCWSTR lpszPath) +LPITEMIDLIST SHSimpleIDListFromPathW(LPCWSTR lpszPath) { LPITEMIDLIST pidl = NULL; diff --git a/dlls/shell32/pidl.h b/dlls/shell32/pidl.h index 73bc3fb..3dbfaa6 100644 --- a/dlls/shell32/pidl.h +++ b/dlls/shell32/pidl.h @@ -271,6 +271,6 @@ void _ILFreeaPidl(LPITEMIDLIST * apidl, UINT cidl); LPITEMIDLIST * _ILCopyaPidl(const LPCITEMIDLIST * apidlsrc, UINT cidl); LPITEMIDLIST * _ILCopyCidaToaPidl(LPITEMIDLIST* pidl, const CIDA * cida); -BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type); +BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type); #endif diff --git a/dlls/shell32/undocshell.h b/dlls/shell32/undocshell.h index f8a1b70..513006d 100644 --- a/dlls/shell32/undocshell.h +++ b/dlls/shell32/undocshell.h @@ -52,10 +52,10 @@ BOOL WINAPI ILGetDisplayNameEx( LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl); void WINAPI ILGlobalFree(LPITEMIDLIST pidl); -LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); -LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath); +LPITEMIDLIST SHSimpleIDListFromPathA (LPCSTR lpszPath); +LPITEMIDLIST SHSimpleIDListFromPathW (LPCWSTR lpszPath); -HRESULT WINAPI SHILCreateFromPathW ( +HRESULT SHILCreateFromPathW ( LPCWSTR path, LPITEMIDLIST * ppidl, DWORD *attributes);
1
0
0
0
Nikolay Sivov : shell32: Implement SHParseDisplayName with basic tests.
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: 500c78505382955e307b525a9750a1e0a87adb8f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=500c78505382955e307b525a9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Mar 3 04:56:20 2010 +0300 shell32: Implement SHParseDisplayName with basic tests. --- dlls/shell32/pidl.c | 21 +++++++++-- dlls/shell32/shfldr_desktop.c | 6 ++-- dlls/shell32/tests/shlfolder.c | 78 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 98 insertions(+), 7 deletions(-) diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 3e61144..0774fde 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -1326,9 +1326,24 @@ HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCI HRESULT WINAPI SHParseDisplayName(LPCWSTR name, IBindCtx *bindctx, LPITEMIDLIST *pidlist, SFGAOF attr_in, SFGAOF *attr_out) { - FIXME("%s %p %p %d %p stub!\n", debugstr_w(name), bindctx, pidlist, attr_in, attr_out); - if(pidlist) *pidlist = NULL; - return E_NOTIMPL; + IShellFolder *desktop; + HRESULT hr; + + TRACE("%s %p %p %d %p\n", debugstr_w(name), bindctx, pidlist, attr_in, attr_out); + + *pidlist = NULL; + + if (!name) return E_OUTOFMEMORY; + + hr = SHGetDesktopFolder(&desktop); + if (hr != S_OK) return hr; + + hr = IShellFolder_ParseDisplayName(desktop, NULL, bindctx, (LPWSTR)name, NULL, pidlist, &attr_in); + if (attr_out) *attr_out = attr_in; + + IShellFolder_Release(desktop); + + return hr; } /************************************************************************** diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c index a08bb41..d6ccb72 100644 --- a/dlls/shell32/shfldr_desktop.c +++ b/dlls/shell32/shfldr_desktop.c @@ -151,11 +151,11 @@ static HRESULT WINAPI ISF_Desktop_fnParseDisplayName (IShellFolder2 * iface, This, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName), pchEaten, ppidl, pdwAttributes); - if (!lpszDisplayName || !ppidl) - return E_INVALIDARG; - + if (!ppidl) return E_INVALIDARG; *ppidl = 0; + if (!lpszDisplayName) return E_INVALIDARG; + if (pchEaten) *pchEaten = 0; /* strange but like the original */ diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 27c6ee8..9b19471 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -54,7 +54,7 @@ static void (WINAPI *pILFree)(LPITEMIDLIST); static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST); static HRESULT (WINAPI *pSHCreateShellItem)(LPCITEMIDLIST,IShellFolder*,LPCITEMIDLIST,IShellItem**); static LPITEMIDLIST (WINAPI *pILCombine)(LPCITEMIDLIST,LPCITEMIDLIST); - +static HRESULT (WINAPI *pSHParseDisplayName)(LPCWSTR,IBindCtx*,LPITEMIDLIST*,SFGAOF,SFGAOF*); static void init_function_pointers(void) { @@ -71,6 +71,7 @@ static void init_function_pointers(void) MAKEFUNC(SHGetPathFromIDListW); MAKEFUNC(SHGetSpecialFolderPathA); MAKEFUNC(SHGetSpecialFolderPathW); + MAKEFUNC(SHParseDisplayName); #undef MAKEFUNC #define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord))) @@ -103,6 +104,18 @@ static void test_ParseDisplayName(void) hr = SHGetDesktopFolder(&IDesktopFolder); if(hr != S_OK) return; + /* null name and pidl */ + hr = IShellFolder_ParseDisplayName(IDesktopFolder, + NULL, NULL, NULL, NULL, NULL, 0); + ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); + + /* null name */ + newPIDL = (ITEMIDLIST*)0xdeadbeef; + hr = IShellFolder_ParseDisplayName(IDesktopFolder, + NULL, NULL, NULL, NULL, &newPIDL, 0); + ok(newPIDL == 0, "expected null, got %p\n", newPIDL); + ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); + MultiByteToWideChar(CP_ACP, 0, cInetTestA, -1, cTestDirW, MAX_PATH); hr = IShellFolder_ParseDisplayName(IDesktopFolder, NULL, NULL, cTestDirW, NULL, &newPIDL, 0); @@ -1962,6 +1975,68 @@ static void test_SHCreateShellItem(void) IShellFolder_Release(desktopfolder); } +static void test_SHParseDisplayName(void) +{ + static const WCHAR prefixW[] = {'w','t',0}; + LPITEMIDLIST pidl1, pidl2; + IShellFolder *desktop; + WCHAR dirW[MAX_PATH]; + WCHAR nameW[10]; + HRESULT hr; + BOOL ret; + + if (!pSHParseDisplayName) + { + win_skip("SHParseDisplayName isn't available\n"); + return; + } + +if (0) +{ + /* crashes on native */ + hr = pSHParseDisplayName(NULL, NULL, NULL, 0, NULL); + nameW[0] = 0; + hr = pSHParseDisplayName(nameW, NULL, NULL, 0, NULL); +} + + pidl1 = (LPITEMIDLIST)0xdeadbeef; + hr = pSHParseDisplayName(NULL, NULL, &pidl1, 0, NULL); + ok(hr == E_OUTOFMEMORY, "failed %08x\n", hr); + ok(pidl1 == 0, "expected null ptr, got %p\n", pidl1); + + /* dummy name */ + nameW[0] = 0; + hr = pSHParseDisplayName(nameW, NULL, &pidl1, 0, NULL); + ok(hr == S_OK, "failed %08x\n", hr); + hr = SHGetDesktopFolder(&desktop); + ok(hr == S_OK, "failed %08x\n", hr); + hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, nameW, NULL, &pidl2, NULL); + ok(hr == S_OK, "failed %08x\n", hr); + ret = pILIsEqual(pidl1, pidl2); + ok(ret == TRUE, "expected equal idls\n"); + pILFree(pidl1); + pILFree(pidl2); + + /* with path */ + GetTempPathW(sizeof(dirW)/sizeof(WCHAR), dirW); + GetTempFileNameW(dirW, prefixW, 0, dirW); + CreateFileW(dirW, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + + hr = pSHParseDisplayName(dirW, NULL, &pidl1, 0, NULL); + ok(hr == S_OK, "failed %08x\n", hr); + hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, dirW, NULL, &pidl2, NULL); + ok(hr == S_OK, "failed %08x\n", hr); + + ret = pILIsEqual(pidl1, pidl2); + ok(ret == TRUE, "expected equal idls\n"); + pILFree(pidl1); + pILFree(pidl2); + + DeleteFileW(dirW); + + IShellFolder_Release(desktop); +} + START_TEST(shlfolder) { init_function_pointers(); @@ -1970,6 +2045,7 @@ START_TEST(shlfolder) OleInitialize(NULL); test_ParseDisplayName(); + test_SHParseDisplayName(); test_BindToObject(); test_EnumObjects_and_CompareIDs(); test_GetDisplayName();
1
0
0
0
Nikolay Sivov : shell32/tests: Minor test file cleanup.
by Alexandre Julliard
03 Mar '10
03 Mar '10
Module: wine Branch: master Commit: 721be7135f827e7a09525294d2286c8e847bb9c3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=721be7135f827e7a09525294d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Mar 3 00:00:52 2010 +0300 shell32/tests: Minor test file cleanup. --- dlls/shell32/tests/shlfolder.c | 66 ++++++++++++++++++++++++---------------- 1 files changed, 40 insertions(+), 26 deletions(-) diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index 31ae05a..27c6ee8 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -62,17 +62,23 @@ static void init_function_pointers(void) HRESULT hr; hmod = GetModuleHandleA("shell32.dll"); - pSHBindToParent = (void*)GetProcAddress(hmod, "SHBindToParent"); - pSHGetFolderPathA = (void*)GetProcAddress(hmod, "SHGetFolderPathA"); - pSHGetFolderPathAndSubDirA = (void*)GetProcAddress(hmod, "SHGetFolderPathAndSubDirA"); - pSHGetPathFromIDListW = (void*)GetProcAddress(hmod, "SHGetPathFromIDListW"); - pSHGetSpecialFolderPathA = (void*)GetProcAddress(hmod, "SHGetSpecialFolderPathA"); - pSHGetSpecialFolderPathW = (void*)GetProcAddress(hmod, "SHGetSpecialFolderPathW"); - pILFindLastID = (void *)GetProcAddress(hmod, (LPCSTR)16); - pILFree = (void*)GetProcAddress(hmod, (LPSTR)155); - pILIsEqual = (void*)GetProcAddress(hmod, (LPSTR)21); - pSHCreateShellItem = (void*)GetProcAddress(hmod, "SHCreateShellItem"); - pILCombine = (void*)GetProcAddress(hmod, (LPSTR)25); + +#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f)) + MAKEFUNC(SHBindToParent); + MAKEFUNC(SHCreateShellItem); + MAKEFUNC(SHGetFolderPathA); + MAKEFUNC(SHGetFolderPathAndSubDirA); + MAKEFUNC(SHGetPathFromIDListW); + MAKEFUNC(SHGetSpecialFolderPathA); + MAKEFUNC(SHGetSpecialFolderPathW); +#undef MAKEFUNC + +#define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord))) + MAKEFUNC_ORD(ILFindLastID, 16); + MAKEFUNC_ORD(ILIsEqual, 21); + MAKEFUNC_ORD(ILCombine, 25); + MAKEFUNC_ORD(ILFree, 155); +#undef MAKEFUNC_ORD hmod = GetModuleHandleA("shlwapi.dll"); pStrRetToBufW = (void*)GetProcAddress(hmod, "StrRetToBufW"); @@ -331,11 +337,12 @@ static void test_BindToObject(void) hr = IShellFolder_BindToObject(psfMyComputer, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild); ok (hr == E_INVALIDARG, "MyComputers's BindToObject should fail, when called with empty pidl! hr = %08x\n", hr); -#if 0 +if (0) +{ /* this call segfaults on 98SE */ hr = IShellFolder_BindToObject(psfMyComputer, NULL, NULL, &IID_IShellFolder, (LPVOID*)&psfChild); ok (hr == E_INVALIDARG, "MyComputers's BindToObject should fail, when called with NULL pidl! hr = %08x\n", hr); -#endif +} cChars = GetSystemDirectoryA(szSystemDir, MAX_PATH); ok (cChars > 0 && cChars < MAX_PATH, "GetSystemDirectoryA failed! LastError: %u\n", GetLastError()); @@ -361,13 +368,14 @@ static void test_BindToObject(void) hr = IShellFolder_BindToObject(psfSystemDir, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild); ok (hr == E_INVALIDARG, "FileSystem ShellFolder's BindToObject should fail, when called with empty pidl! hr = %08x\n", hr); - -#if 0 + +if (0) +{ /* this call segfaults on 98SE */ hr = IShellFolder_BindToObject(psfSystemDir, NULL, NULL, &IID_IShellFolder, (LPVOID*)&psfChild); - ok (hr == E_INVALIDARG, + ok (hr == E_INVALIDARG, "FileSystem ShellFolder's BindToObject should fail, when called with NULL pidl! hr = %08x\n", hr); -#endif +} IShellFolder_Release(psfSystemDir); } @@ -1564,7 +1572,7 @@ static void test_ITEMIDLIST_format(void) { IShellFolder_Release(psfPersonal); } -static void testSHGetFolderPathAndSubDirA(void) +static void test_SHGetFolderPathAndSubDirA(void) { HRESULT ret; BOOL delret; @@ -1576,6 +1584,12 @@ static void testSHGetFolderPathAndSubDirA(void) static char testpath[MAX_PATH]; static char toolongpath[MAX_PATH+1]; + if(!pSHGetFolderPathAndSubDirA) + { + win_skip("SHGetFolderPathAndSubDirA not present!\n"); + return; + } + if(!pSHGetFolderPathA) { win_skip("SHGetFolderPathA not present!\n"); return; @@ -1797,6 +1811,12 @@ static void test_SHCreateShellItem(void) GetCurrentDirectoryA(MAX_PATH, curdirA); + if (!pSHCreateShellItem) + { + win_skip("SHCreateShellItem isn't available\n"); + return; + } + if (!lstrlenA(curdirA)) { win_skip("GetCurrentDirectoryA returned empty string, skipping test_SHCreateShellItem\n"); @@ -1958,15 +1978,9 @@ START_TEST(shlfolder) test_CallForAttributes(); test_FolderShortcut(); test_ITEMIDLIST_format(); - if(pSHGetFolderPathAndSubDirA) - testSHGetFolderPathAndSubDirA(); - else - win_skip("SHGetFolderPathAndSubDirA not present\n"); + test_SHGetFolderPathAndSubDirA(); test_LocalizedNames(); - if(pSHCreateShellItem) - test_SHCreateShellItem(); - else - win_skip("SHCreateShellItem not present\n"); + test_SHCreateShellItem(); OleUninitialize(); }
1
0
0
0
← Newer
1
...
79
80
81
82
83
84
85
...
92
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200