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
November 2017
----- 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
2 participants
436 discussions
Start a n
N
ew thread
Hans Leidekker : taskschd: Implement ITaskDefinition_get_Actions.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: c0858ec0cb004f0c9019bba6e50937dfe822d4b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c0858ec0cb004f0c9019bba6e…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 30 09:37:07 2017 +0100 taskschd: Implement ITaskDefinition_get_Actions. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/taskschd/task.c | 203 ++++++++++++++++++++++++++++++++++++++-- dlls/taskschd/tests/scheduler.c | 10 +- 2 files changed, 204 insertions(+), 9 deletions(-) diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 6828c98..166e587 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -1636,6 +1636,182 @@ static HRESULT Principal_create(IPrincipal **obj) typedef struct { + IActionCollection IActionCollection_iface; + LONG ref; +} Actions; + +static inline Actions *impl_from_IActionCollection(IActionCollection *iface) +{ + return CONTAINING_RECORD(iface, Actions, IActionCollection_iface); +} + +static ULONG WINAPI Actions_AddRef(IActionCollection *iface) +{ + Actions *actions = impl_from_IActionCollection(iface); + return InterlockedIncrement(&actions->ref); +} + +static ULONG WINAPI Actions_Release(IActionCollection *iface) +{ + Actions *actions = impl_from_IActionCollection(iface); + LONG ref = InterlockedDecrement(&actions->ref); + + if (!ref) + { + TRACE("destroying %p\n", iface); + heap_free(actions); + } + + return ref; +} + +static HRESULT WINAPI Actions_QueryInterface(IActionCollection *iface, REFIID riid, void **obj) +{ + if (!riid || !obj) return E_INVALIDARG; + + TRACE("%p,%s,%p\n", iface, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IActionCollection) || + IsEqualGUID(riid, &IID_IDispatch) || + IsEqualGUID(riid, &IID_IUnknown)) + { + IActionCollection_AddRef(iface); + *obj = iface; + return S_OK; + } + + FIXME("interface %s is not implemented\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static HRESULT WINAPI Actions_GetTypeInfoCount(IActionCollection *iface, UINT *count) +{ + FIXME("%p,%p: stub\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_GetTypeInfo(IActionCollection *iface, UINT index, LCID lcid, ITypeInfo **info) +{ + FIXME("%p,%u,%u,%p: stub\n", iface, index, lcid, info); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_GetIDsOfNames(IActionCollection *iface, REFIID riid, LPOLESTR *names, + UINT count, LCID lcid, DISPID *dispid) +{ + FIXME("%p,%s,%p,%u,%u,%p: stub\n", iface, debugstr_guid(riid), names, count, lcid, dispid); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_Invoke(IActionCollection *iface, DISPID dispid, REFIID riid, LCID lcid, WORD flags, + DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *argerr) +{ + FIXME("%p,%d,%s,%04x,%04x,%p,%p,%p,%p: stub\n", iface, dispid, debugstr_guid(riid), lcid, flags, + params, result, excepinfo, argerr); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_get_Count(IActionCollection *iface, LONG *count) +{ + FIXME("%p,%p: stub\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_get_Item(IActionCollection *iface, LONG index, IAction **action) +{ + FIXME("%p,%d,%p: stub\n", iface, index, action); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_get__NewEnum(IActionCollection *iface, IUnknown **penum) +{ + FIXME("%p,%p: stub\n", iface, penum); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_get_XmlText(IActionCollection *iface, BSTR *xml) +{ + FIXME("%p,%p: stub\n", iface, xml); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_put_XmlText(IActionCollection *iface, BSTR xml) +{ + FIXME("%p,%s: stub\n", iface, debugstr_w(xml)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_Create(IActionCollection *iface, TASK_ACTION_TYPE type, IAction **action) +{ + FIXME("%p,%u,%p: stub\n", iface, type, action); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_Remove(IActionCollection *iface, VARIANT index) +{ + FIXME("%p,%s: stub\n", iface, debugstr_variant(&index)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_Clear(IActionCollection *iface) +{ + FIXME("%p: stub\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_get_Context(IActionCollection *iface, BSTR *ctx) +{ + FIXME("%p,%p: stub\n", iface, ctx); + return E_NOTIMPL; +} + +static HRESULT WINAPI Actions_put_Context(IActionCollection *iface, BSTR ctx) +{ + FIXME("%p,%s: stub\n", iface, debugstr_w(ctx)); + return S_OK; +} + +static const IActionCollectionVtbl Actions_vtbl = +{ + Actions_QueryInterface, + Actions_AddRef, + Actions_Release, + Actions_GetTypeInfoCount, + Actions_GetTypeInfo, + Actions_GetIDsOfNames, + Actions_Invoke, + Actions_get_Count, + Actions_get_Item, + Actions_get__NewEnum, + Actions_get_XmlText, + Actions_put_XmlText, + Actions_Create, + Actions_Remove, + Actions_Clear, + Actions_get_Context, + Actions_put_Context +}; + +static HRESULT Actions_create(IActionCollection **obj) +{ + Actions *actions; + + actions = heap_alloc(sizeof(*actions)); + if (!actions) return E_OUTOFMEMORY; + + actions->IActionCollection_iface.lpVtbl = &Actions_vtbl; + actions->ref = 1; + + *obj = &actions->IActionCollection_iface; + + TRACE("created %p\n", *obj); + + return S_OK; +} + +typedef struct +{ ITaskDefinition ITaskDefinition_iface; LONG ref; IRegistrationInfo *reginfo; @@ -1896,8 +2072,23 @@ static HRESULT WINAPI TaskDefinition_put_Principal(ITaskDefinition *iface, IPrin static HRESULT WINAPI TaskDefinition_get_Actions(ITaskDefinition *iface, IActionCollection **actions) { - FIXME("%p,%p: stub\n", iface, actions); - return E_NOTIMPL; + TaskDefinition *taskdef = impl_from_ITaskDefinition(iface); + HRESULT hr; + + TRACE("%p,%p\n", iface, actions); + + if (!actions) return E_POINTER; + + if (!taskdef->actions) + { + hr = Actions_create(&taskdef->actions); + if (hr != S_OK) return hr; + } + + IActionCollection_AddRef(taskdef->actions); + *actions = taskdef->actions; + + return S_OK; } static HRESULT WINAPI TaskDefinition_put_Actions(ITaskDefinition *iface, IActionCollection *actions) @@ -1938,7 +2129,7 @@ static const WCHAR S4U[] = {'S','4','U',0}; static const WCHAR InteractiveToken[] = {'I','n','t','e','r','a','c','t','i','v','e','T','o','k','e','n',0}; static const WCHAR RunLevel[] = {'R','u','n','L','e','v','e','l',0}; static const WCHAR LeastPrivilege[] = {'L','e','a','s','t','P','r','i','v','i','l','e','g','e',0}; -static const WCHAR Actions[] = {'A','c','t','i','o','n','s',0}; +static const WCHAR actionsW[] = {'A','c','t','i','o','n','s',0}; static const WCHAR Exec[] = {'E','x','e','c',0}; static const WCHAR MultipleInstancesPolicy[] = {'M','u','l','t','i','p','l','e','I','n','s','t','a','n','c','e','s','P','o','l','i','c','y',0}; static const WCHAR IgnoreNew[] = {'I','g','n','o','r','e','N','e','w',0}; @@ -2298,11 +2489,11 @@ static HRESULT write_actions(IStream *stream, IActionCollection *actions) { if (!actions) { - write_element(stream, Actions); + write_element(stream, actionsW); push_indent(); write_empty_element(stream, Exec); pop_indent(); - return write_element_end(stream, Actions); + return write_element_end(stream, actionsW); } FIXME("stub\n"); @@ -2958,7 +3149,7 @@ static HRESULT read_task(IXmlReader *reader, ITaskDefinition *taskdef) hr = read_triggers(reader, taskdef); else if (!lstrcmpW(name, Principals)) hr = read_principals(reader, taskdef); - else if (!lstrcmpW(name, Actions)) + else if (!lstrcmpW(name, actionsW)) hr = read_actions(reader, taskdef); else FIXME("unhandled Task element %s\n", debugstr_w(name)); diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 244c28d..3d1d18e 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1227,13 +1227,17 @@ static void create_action(ITaskDefinition *taskdef) IExecAction *exec_action; hr = ITaskDefinition_get_Actions(taskdef, &actions); -todo_wine ok(hr == S_OK, "get_Actions error %#x\n", hr); - /* FIXME: Remove once implemented */ - if (hr != S_OK) return; hr = IActionCollection_Create(actions, TASK_ACTION_EXEC, &action); +todo_wine ok(hr == S_OK, "Create action error %#x\n", hr); + /* FIXME: Remove once implemented */ + if (hr != S_OK) + { + IActionCollection_Release(actions); + return; + } hr = IAction_QueryInterface(action, &IID_IExecAction, (void **)&exec_action); ok(hr == S_OK, "QueryInterface error %#x\n", hr);
1
0
0
0
Hans Leidekker : taskschd: Implement ITaskDefinition_put_Principal.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: acacbbcb86515127cd8d15b2dc8d767c3d846359 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=acacbbcb86515127cd8d15b2d…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 30 09:37:06 2017 +0100 taskschd: Implement ITaskDefinition_put_Principal. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/taskschd/task.c | 15 +++++++++++++-- dlls/taskschd/tests/scheduler.c | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 185f5c2..6828c98 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -1879,8 +1879,19 @@ static HRESULT WINAPI TaskDefinition_get_Principal(ITaskDefinition *iface, IPrin static HRESULT WINAPI TaskDefinition_put_Principal(ITaskDefinition *iface, IPrincipal *principal) { - FIXME("%p,%p: stub\n", iface, principal); - return E_NOTIMPL; + TaskDefinition *taskdef = impl_from_ITaskDefinition(iface); + + TRACE("%p,%p\n", iface, principal); + + if (!principal) return E_POINTER; + + if (taskdef->principal) + IPrincipal_Release(taskdef->principal); + + IPrincipal_AddRef(principal); + taskdef->principal = principal; + + return S_OK; } static HRESULT WINAPI TaskDefinition_get_Actions(ITaskDefinition *iface, IActionCollection **actions) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index ad07556..244c28d 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1173,6 +1173,9 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) hr = ITaskDefinition_get_Principal(taskdef, &principal); ok(hr == S_OK, "expected S_OK, got %#x\n", hr); ok(principal != NULL, "principal not set\n"); + + hr = ITaskDefinition_put_Principal(taskdef, principal); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); if (principal) IPrincipal_Release(principal); /* FIXME: set IIdleSettings and INetworkSettings */
1
0
0
0
Hans Leidekker : taskschd: Implement ITaskDefinition_get_Principal.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: 4a0fa13f28c06995cc7188e9b90f4d8dfcf1e107 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a0fa13f28c06995cc7188e9b…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 30 09:37:05 2017 +0100 taskschd: Implement ITaskDefinition_get_Principal. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/taskschd/task.c | 221 ++++++++++++++++++++++++++++++++++++++-- dlls/taskschd/tests/scheduler.c | 7 ++ 2 files changed, 220 insertions(+), 8 deletions(-) diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index d4e0d56..185f5c2 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -1446,6 +1446,196 @@ static HRESULT TaskSettings_create(ITaskSettings **obj) typedef struct { + IPrincipal IPrincipal_iface; + LONG ref; +} Principal; + +static inline Principal *impl_from_IPrincipal(IPrincipal *iface) +{ + return CONTAINING_RECORD(iface, Principal, IPrincipal_iface); +} + +static ULONG WINAPI Principal_AddRef(IPrincipal *iface) +{ + Principal *principal = impl_from_IPrincipal(iface); + return InterlockedIncrement(&principal->ref); +} + +static ULONG WINAPI Principal_Release(IPrincipal *iface) +{ + Principal *principal = impl_from_IPrincipal(iface); + LONG ref = InterlockedDecrement(&principal->ref); + + if (!ref) + { + TRACE("destroying %p\n", iface); + heap_free(principal); + } + + return ref; +} + +static HRESULT WINAPI Principal_QueryInterface(IPrincipal *iface, REFIID riid, void **obj) +{ + if (!riid || !obj) return E_INVALIDARG; + + TRACE("%p,%s,%p\n", iface, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IPrincipal) || + IsEqualGUID(riid, &IID_IDispatch) || + IsEqualGUID(riid, &IID_IUnknown)) + { + IPrincipal_AddRef(iface); + *obj = iface; + return S_OK; + } + + FIXME("interface %s is not implemented\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static HRESULT WINAPI Principal_GetTypeInfoCount(IPrincipal *iface, UINT *count) +{ + FIXME("%p,%p: stub\n", iface, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_GetTypeInfo(IPrincipal *iface, UINT index, LCID lcid, ITypeInfo **info) +{ + FIXME("%p,%u,%u,%p: stub\n", iface, index, lcid, info); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_GetIDsOfNames(IPrincipal *iface, REFIID riid, LPOLESTR *names, + UINT count, LCID lcid, DISPID *dispid) +{ + FIXME("%p,%s,%p,%u,%u,%p: stub\n", iface, debugstr_guid(riid), names, count, lcid, dispid); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_Invoke(IPrincipal *iface, DISPID dispid, REFIID riid, LCID lcid, WORD flags, + DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *argerr) +{ + FIXME("%p,%d,%s,%04x,%04x,%p,%p,%p,%p: stub\n", iface, dispid, debugstr_guid(riid), lcid, flags, + params, result, excepinfo, argerr); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_get_Id(IPrincipal *iface, BSTR *id) +{ + FIXME("%p,%p: stub\n", iface, id); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_put_Id(IPrincipal *iface, BSTR id) +{ + FIXME("%p,%s: stub\n", iface, debugstr_w(id)); + return S_OK; +} + +static HRESULT WINAPI Principal_get_DisplayName(IPrincipal *iface, BSTR *name) +{ + FIXME("%p,%p: stub\n", iface, name); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_put_DisplayName(IPrincipal *iface, BSTR name) +{ + FIXME("%p,%s: stub\n", iface, debugstr_w(name)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_get_UserId(IPrincipal *iface, BSTR *user_id) +{ + FIXME("%p,%p: stub\n", iface, user_id); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_put_UserId(IPrincipal *iface, BSTR user_id) +{ + FIXME("%p,%s: stub\n", iface, debugstr_w(user_id)); + return S_OK; +} + +static HRESULT WINAPI Principal_get_LogonType(IPrincipal *iface, TASK_LOGON_TYPE *logon_type) +{ + FIXME("%p,%p: stub\n", iface, logon_type); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_put_LogonType(IPrincipal *iface, TASK_LOGON_TYPE logon_type) +{ + FIXME("%p,%u: stub\n", iface, logon_type); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_get_GroupId(IPrincipal *iface, BSTR *group_id) +{ + FIXME("%p,%p: stub\n", iface, group_id); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_put_GroupId(IPrincipal *iface, BSTR group_id) +{ + FIXME("%p,%s: stub\n", iface, debugstr_w(group_id)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_get_RunLevel(IPrincipal *iface, TASK_RUNLEVEL_TYPE *run_level) +{ + FIXME("%p,%p: stub\n", iface, run_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI Principal_put_RunLevel(IPrincipal *iface, TASK_RUNLEVEL_TYPE run_level) +{ + FIXME("%p,%u: stub\n", iface, run_level); + return E_NOTIMPL; +} + +static const IPrincipalVtbl Principal_vtbl = +{ + Principal_QueryInterface, + Principal_AddRef, + Principal_Release, + Principal_GetTypeInfoCount, + Principal_GetTypeInfo, + Principal_GetIDsOfNames, + Principal_Invoke, + Principal_get_Id, + Principal_put_Id, + Principal_get_DisplayName, + Principal_put_DisplayName, + Principal_get_UserId, + Principal_put_UserId, + Principal_get_LogonType, + Principal_put_LogonType, + Principal_get_GroupId, + Principal_put_GroupId, + Principal_get_RunLevel, + Principal_put_RunLevel +}; + +static HRESULT Principal_create(IPrincipal **obj) +{ + Principal *principal; + + principal = heap_alloc(sizeof(*principal)); + if (!principal) return E_OUTOFMEMORY; + + principal->IPrincipal_iface.lpVtbl = &Principal_vtbl; + principal->ref = 1; + + *obj = &principal->IPrincipal_iface; + + TRACE("created %p\n", *obj); + + return S_OK; +} + +typedef struct +{ ITaskDefinition ITaskDefinition_iface; LONG ref; IRegistrationInfo *reginfo; @@ -1668,8 +1858,23 @@ static HRESULT WINAPI TaskDefinition_put_Data(ITaskDefinition *iface, BSTR data) static HRESULT WINAPI TaskDefinition_get_Principal(ITaskDefinition *iface, IPrincipal **principal) { - FIXME("%p,%p: stub\n", iface, principal); - return E_NOTIMPL; + TaskDefinition *taskdef = impl_from_ITaskDefinition(iface); + HRESULT hr; + + TRACE("%p,%p\n", iface, principal); + + if (!principal) return E_POINTER; + + if (!taskdef->principal) + { + hr = Principal_create(&taskdef->principal); + if (hr != S_OK) return hr; + } + + IPrincipal_AddRef(taskdef->principal); + *principal = taskdef->principal; + + return S_OK; } static HRESULT WINAPI TaskDefinition_put_Principal(ITaskDefinition *iface, IPrincipal *principal) @@ -1710,7 +1915,7 @@ static const WCHAR SecurityDescriptor[] = {'S','e','c','u','r','i','t','y','D',' static const WCHAR Settings[] = {'S','e','t','t','i','n','g','s',0}; static const WCHAR Triggers[] = {'T','r','i','g','g','e','r','s',0}; static const WCHAR Principals[] = {'P','r','i','n','c','i','p','a','l','s',0}; -static const WCHAR Principal[] = {'P','r','i','n','c','i','p','a','l',0}; +static const WCHAR principalW[] = {'P','r','i','n','c','i','p','a','l',0}; static const WCHAR id[] = {'i','d',0}; static const WCHAR UserId[] = {'U','s','e','r','I','d',0}; static const WCHAR LogonType[] = {'L','o','g','o','n','T','y','p','e',0}; @@ -1964,7 +2169,7 @@ static HRESULT write_principal(IStream *stream, IPrincipal *principal) { write_indent(stream); write_stringW(stream, start_element); - write_stringW(stream, Principal); + write_stringW(stream, principalW); write_stringW(stream, spaceW); write_stringW(stream, id); write_stringW(stream, equalW); @@ -1976,7 +2181,7 @@ static HRESULT write_principal(IStream *stream, IPrincipal *principal) SysFreeString(bstr); } else - write_element(stream, Principal); + write_element(stream, principalW); push_indent(); @@ -2054,7 +2259,7 @@ static HRESULT write_principal(IStream *stream, IPrincipal *principal) } pop_indent(); - write_element_end(stream, Principal); + write_element_end(stream, principalW); pop_indent(); return write_element_end(stream, Principals); @@ -2275,7 +2480,7 @@ static HRESULT read_principal(IXmlReader *reader, IPrincipal *principal) TRACE("/%s\n", debugstr_w(name)); - if (!lstrcmpW(name, Principal)) + if (!lstrcmpW(name, principalW)) return S_OK; break; @@ -2374,7 +2579,7 @@ static HRESULT read_principals(IXmlReader *reader, ITaskDefinition *taskdef) TRACE("Element: %s\n", debugstr_w(name)); - if (!lstrcmpW(name, Principal)) + if (!lstrcmpW(name, principalW)) { IPrincipal *principal; diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index c58a507..ad07556 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1095,6 +1095,7 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) HRESULT hr; ITaskSettings *set; ITriggerCollection *triggers; + IPrincipal *principal; hr = ITaskDefinition_get_Settings(taskdef, &set); ok(hr == S_OK, "get_Settings error %#x\n", hr); @@ -1168,6 +1169,12 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) ok(hr == S_OK, "expected S_OK, got %#x\n", hr); if (triggers) ITriggerCollection_Release(triggers); + principal = NULL; + hr = ITaskDefinition_get_Principal(taskdef, &principal); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(principal != NULL, "principal not set\n"); + if (principal) IPrincipal_Release(principal); + /* FIXME: set IIdleSettings and INetworkSettings */ ITaskSettings_Release(set);
1
0
0
0
Hans Leidekker : taskschd: Implement ITaskDefinition_put_Triggers.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: 96cf60ecac7afc789e5e85b58655f79bf64cde6f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=96cf60ecac7afc789e5e85b58…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Nov 30 09:37:04 2017 +0100 taskschd: Implement ITaskDefinition_put_Triggers. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/taskschd/task.c | 15 +++++++++++++-- dlls/taskschd/tests/scheduler.c | 10 ++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/dlls/taskschd/task.c b/dlls/taskschd/task.c index 731c22d..d4e0d56 100644 --- a/dlls/taskschd/task.c +++ b/dlls/taskschd/task.c @@ -1601,8 +1601,19 @@ static HRESULT WINAPI TaskDefinition_get_Triggers(ITaskDefinition *iface, ITrigg static HRESULT WINAPI TaskDefinition_put_Triggers(ITaskDefinition *iface, ITriggerCollection *triggers) { - FIXME("%p,%p: stub\n", iface, triggers); - return E_NOTIMPL; + TaskDefinition *taskdef = impl_from_ITaskDefinition(iface); + + TRACE("%p,%p\n", iface, triggers); + + if (!triggers) return E_POINTER; + + if (taskdef->triggers) + ITriggerCollection_Release(taskdef->triggers); + + ITriggerCollection_AddRef(triggers); + taskdef->triggers = triggers; + + return S_OK; } static HRESULT WINAPI TaskDefinition_get_Settings(ITaskDefinition *iface, ITaskSettings **settings) diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 07083af..c58a507 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -1094,6 +1094,7 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) { HRESULT hr; ITaskSettings *set; + ITriggerCollection *triggers; hr = ITaskDefinition_get_Settings(taskdef, &set); ok(hr == S_OK, "get_Settings error %#x\n", hr); @@ -1158,6 +1159,15 @@ static void change_settings(ITaskDefinition *taskdef, struct settings *test) hr = ITaskSettings_put_AllowDemandStart(set, test->allow_on_demand_start); ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + triggers = NULL; + hr = ITaskDefinition_get_Triggers(taskdef, &triggers); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(triggers != NULL, "triggers not set\n"); + + hr = ITaskDefinition_put_Triggers(taskdef, triggers); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + if (triggers) ITriggerCollection_Release(triggers); + /* FIXME: set IIdleSettings and INetworkSettings */ ITaskSettings_Release(set);
1
0
0
0
Ziqing Hui : mlang: Fix font name of code page families.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: 5083f2a589930b8a67a396cbf03a266cf39b08cd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5083f2a589930b8a67a396cbf…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Thu Nov 30 12:23:52 2017 +0800 mlang: Fix font name of code page families. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mlang/mlang.c | 24 ++++++++++++------------ dlls/mlang/tests/mlang.c | 18 ++++++------------ 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c index aa644e2..bada104 100644 --- a/dlls/mlang/mlang.c +++ b/dlls/mlang/mlang.c @@ -495,35 +495,35 @@ static const struct mlang_data } mlang_data[] = { { "Arabic",1256,sizeof(arabic_cp)/sizeof(arabic_cp[0]),arabic_cp, - "Courier","Arial", sidArabic }, /* FIXME */ + "Simplified Arabic Fixed","Simplified Arabic", sidArabic }, { "Baltic",1257,sizeof(baltic_cp)/sizeof(baltic_cp[0]),baltic_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Chinese Simplified",936,sizeof(chinese_simplified_cp)/sizeof(chinese_simplified_cp[0]),chinese_simplified_cp, "Simsun","Simsun", sidHan }, { "Chinese Traditional",950,sizeof(chinese_traditional_cp)/sizeof(chinese_traditional_cp[0]),chinese_traditional_cp, "MingLiu","New MingLiu", sidBopomofo }, { "Central European",1250,sizeof(central_european_cp)/sizeof(central_european_cp[0]),central_european_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Cyrillic",1251,sizeof(cyrillic_cp)/sizeof(cyrillic_cp[0]),cyrillic_cp, - "Courier","Arial", sidCyrillic }, /* FIXME */ + "Courier New","Arial", sidCyrillic }, { "Greek",1253,sizeof(greek_cp)/sizeof(greek_cp[0]),greek_cp, - "Courier","Arial", sidGreek }, /* FIXME */ + "Courier New","Arial", sidGreek }, { "Hebrew",1255,sizeof(hebrew_cp)/sizeof(hebrew_cp[0]),hebrew_cp, - "Courier","Arial", sidHebrew }, /* FIXME */ + "Miriam Fixed","David", sidHebrew }, { "Japanese",932,sizeof(japanese_cp)/sizeof(japanese_cp[0]),japanese_cp, "MS Gothic","MS PGothic", sidKana }, { "Korean",949,sizeof(korean_cp)/sizeof(korean_cp[0]),korean_cp, - "Courier","Arial", sidHangul }, /* FIXME */ + "GulimChe","Gulim", sidHangul }, { "Thai",874,sizeof(thai_cp)/sizeof(thai_cp[0]),thai_cp, - "Courier","Arial", sidThai }, /* FIXME */ + "Tahoma","Tahoma", sidThai }, { "Turkish",1254,sizeof(turkish_cp)/sizeof(turkish_cp[0]),turkish_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Vietnamese",1258,sizeof(vietnamese_cp)/sizeof(vietnamese_cp[0]),vietnamese_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Western European",1252,sizeof(western_cp)/sizeof(western_cp[0]),western_cp, - "Courier","Arial", sidAsciiLatin }, /* FIXME */ + "Courier New","Arial", sidAsciiLatin }, { "Unicode",CP_UNICODE,sizeof(unicode_cp)/sizeof(unicode_cp[0]),unicode_cp, - "Courier","Arial" } /* FIXME */ + "Courier New","Arial" } }; struct font_list diff --git a/dlls/mlang/tests/mlang.c b/dlls/mlang/tests/mlang.c index 5100870..2e3b36b 100644 --- a/dlls/mlang/tests/mlang.c +++ b/dlls/mlang/tests/mlang.c @@ -362,7 +362,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'S','i','m','p','l','i','f','i','e','d',' ','A','r','a','b','i','c',' ','F','i','x','e','d',0}, {'S','i','m','p','l','i','f','i','e','d',' ','A','r','a','b','i','c',0}, 178 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE }, /* 9. Baltic (Windows) */ { @@ -377,7 +376,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}, {'A','r','i','a','l',0}, 186 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE }, /* 10. Central European (Windows) */ { @@ -392,7 +390,7 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}, {'A','r','i','a','l',0}, 238 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE }, /* 11. Cyrillic (Windows) */ { @@ -407,7 +405,7 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}, {'A','r','i','a','l',0}, 204 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE }, /* 12. Greek (Windows) */ { @@ -422,7 +420,7 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}, {'A','r','i','a','l',0}, 161 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE }, /* 13. Hebrew (Windows) */ { @@ -437,7 +435,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'M','i','r','i','a','m',' ','F','i','x','e','d',0}, {'D','a','v','i','d',0}, 177 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE }, /* 14. Japanese (Shift-JIS) */ { @@ -466,7 +463,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'G','u','l','i','m','C','h','e',0}, {'G','u','l','i','m',0}, 129 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE }, /* 16. Thai (Windows) */ { @@ -481,7 +477,7 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'T','a','h','o','m','a',0}, {'T','a','h','o','m','a',0}, 222 }, - FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE + FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE }, /* 17. Turkish (Windows) */ { @@ -496,7 +492,7 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}, {'A','r','i','a','l',0}, 162 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE }, /* 18. Vietnamese (Windows) */ { @@ -511,7 +507,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}, {'A','r','i','a','l',0}, 163 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE }, /* 19. Western European (Windows) */ { @@ -526,7 +521,7 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}, {'A','r','i','a','l',0}, 0 }, - FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE + FALSE, FALSE, FALSE, FALSE, TRUE, TRUE }, /* 20. Unicode */ { @@ -540,7 +535,6 @@ const static struct cpinfo_test_data iml2_cpinfo_data[] = {'C','o','u','r','i','e','r',' ','N','e','w',0}, {'A','r','i','a','l',0}, 1 }, - FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE } };
1
0
0
0
Ziqing Hui : mlang/tests: Add a test code page for each code page family.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: 8e7cac3882d27be8ca28ac64b1aca0eae2696d7b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8e7cac3882d27be8ca28ac64b…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Thu Nov 30 12:23:15 2017 +0800 mlang/tests: Add a test code page for each code page family. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mlang/tests/mlang.c | 193 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8e7cac3882d27be8ca28a…
1
0
0
0
Zebediah Figura : shell32: Implement the ShowGroup() command for Progman DDE.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: fd851064d84f986f36ffe7f2f909d344a289dc67 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fd851064d84f986f36ffe7f2f…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Nov 29 17:00:48 2017 -0600 shell32: Implement the ShowGroup() command for Progman DDE. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/dde.c | 15 +++++++++++++++ dlls/shell32/tests/progman_dde.c | 10 ++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/dlls/shell32/dde.c b/dlls/shell32/dde.c index a1aac15..36b5dfa 100644 --- a/dlls/shell32/dde.c +++ b/dlls/shell32/dde.c @@ -121,6 +121,7 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv) { static const WCHAR create_groupW[] = {'C','r','e','a','t','e','G','r','o','u','p',0}; static const WCHAR delete_groupW[] = {'D','e','l','e','t','e','G','r','o','u','p',0}; + static const WCHAR show_groupW[] = {'S','h','o','w','G','r','o','u','p',0}; if (!strcmpiW(command, create_groupW)) { @@ -160,6 +161,20 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv) if (ret || shfos.fAnyOperationsAborted) return DDE_FNOTPROCESSED; } + else if (!strcmpiW(command, show_groupW)) + { + WCHAR *path; + + /* Win32 requires the second parameter to be present but seems to + * ignore its actual value. */ + if (argc < 2) return DDE_FNOTPROCESSED; + + path = get_programs_path(argv[0]); + + ShellExecuteW(NULL, NULL, path, NULL, NULL, SW_SHOWNORMAL); + + HeapFree(GetProcessHeap(), 0, path); + } else { FIXME("unhandled command %s\n", debugstr_w(command)); diff --git a/dlls/shell32/tests/progman_dde.c b/dlls/shell32/tests/progman_dde.c index c5fd262..b54a72a 100644 --- a/dlls/shell32/tests/progman_dde.c +++ b/dlls/shell32/tests/progman_dde.c @@ -332,18 +332,12 @@ static void test_progman_dde(DWORD instance, HCONV hConv) ok(!check_exists("Group1/f3g1Name.lnk"), "link should not exist\n"); error = dde_execute(instance, hConv, "[ShowGroup(Startup, 0)]"); - todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); - if (error == DMLERR_NO_ERROR) - ok(check_window_exists(StartupTitle), "window not created\n"); - } + ok(check_window_exists(StartupTitle), "window not created\n"); error = dde_execute(instance, hConv, "[ShowGroup(Group1, 0)]"); - todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); - if (error == DMLERR_NO_ERROR) - ok(check_window_exists(Group1Title), "window not created\n"); - } + ok(check_window_exists(Group1Title), "window not created\n"); /* DeleteGroup Test */ error = dde_execute(instance, hConv, "[DeleteGroup(Group1)]");
1
0
0
0
Zebediah Figura : shell32: Implement the DeleteGroup() command for Progman DDE.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: 957da4ee07e8e8f163ee8ce0795cedf2b3b3dff7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=957da4ee07e8e8f163ee8ce07…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Nov 29 17:00:47 2017 -0600 shell32: Implement the DeleteGroup() command for Progman DDE. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/dde.c | 26 ++++++++++++++++++++++++++ dlls/shell32/tests/progman_dde.c | 6 ------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/dlls/shell32/dde.c b/dlls/shell32/dde.c index 3a18d3a..a1aac15 100644 --- a/dlls/shell32/dde.c +++ b/dlls/shell32/dde.c @@ -120,6 +120,7 @@ static WCHAR *get_programs_path(WCHAR *name) static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv) { static const WCHAR create_groupW[] = {'C','r','e','a','t','e','G','r','o','u','p',0}; + static const WCHAR delete_groupW[] = {'D','e','l','e','t','e','G','r','o','u','p',0}; if (!strcmpiW(command, create_groupW)) { @@ -134,6 +135,31 @@ static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv) HeapFree(GetProcessHeap(), 0, path); } + else if (!strcmpiW(command, delete_groupW)) + { + WCHAR *path, *path2; + SHFILEOPSTRUCTW shfos = {0}; + int ret; + + if (argc < 1) return DDE_FNOTPROCESSED; + + path = get_programs_path(argv[0]); + + path2 = HeapAlloc(GetProcessHeap(), 0, (strlenW(path) + 2) * sizeof(*path)); + strcpyW(path2, path); + path2[strlenW(path) + 1] = 0; + + shfos.wFunc = FO_DELETE; + shfos.pFrom = path2; + shfos.fFlags = FOF_NOCONFIRMATION; + + ret = SHFileOperationW(&shfos); + + HeapFree(GetProcessHeap(), 0, path2); + HeapFree(GetProcessHeap(), 0, path); + + if (ret || shfos.fAnyOperationsAborted) return DDE_FNOTPROCESSED; + } else { FIXME("unhandled command %s\n", debugstr_w(command)); diff --git a/dlls/shell32/tests/progman_dde.c b/dlls/shell32/tests/progman_dde.c index 73a79a8..c5fd262 100644 --- a/dlls/shell32/tests/progman_dde.c +++ b/dlls/shell32/tests/progman_dde.c @@ -347,10 +347,8 @@ static void test_progman_dde(DWORD instance, HCONV hConv) /* DeleteGroup Test */ error = dde_execute(instance, hConv, "[DeleteGroup(Group1)]"); - todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(!check_exists("Group1"), "directory should not exist\n"); - } /* Compound Execute String Command */ sprintf(comptext, "[CreateGroup(Group3)][AddItem(%s,f1g3Name)][AddItem(%s,f2g3Name)]", f1g3, f2g3); @@ -365,10 +363,8 @@ static void test_progman_dde(DWORD instance, HCONV hConv) } error = dde_execute(instance, hConv, "[DeleteGroup(Group3)]"); - todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(!check_exists("Group3"), "directory should not exist\n"); - } /* Full Parameters of Add Item */ /* AddItem(CmdLine[,Name[,IconPath[,IconIndex[,xPos,yPos[,DefDir[,HotKey[,fMinimize[fSeparateSpace]]]]]]]) */ @@ -392,10 +388,8 @@ static void test_progman_dde2(DWORD instance, HCONV hConv) ok(check_window_exists(Group2Title), "window not created\n"); error = dde_execute(instance, hConv, "[DeleteGroup(Group2)]"); - todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(!check_exists("Group2"), "directory should not exist\n"); - } } START_TEST(progman_dde)
1
0
0
0
Zebediah Figura : shell32: Implement the CreateGroup() command for Progman DDE.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: 83ca4e20cc7f2612bb8c05447e30adaf44a2cb68 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=83ca4e20cc7f2612bb8c05447…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Nov 29 17:00:46 2017 -0600 shell32: Implement the CreateGroup() command for Progman DDE. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/dde.c | 43 ++++++++++++++++++++++++++++++++++++++-- dlls/shell32/tests/progman_dde.c | 35 ++++++++++++-------------------- 2 files changed, 54 insertions(+), 24 deletions(-) diff --git a/dlls/shell32/dde.c b/dlls/shell32/dde.c index ae1143b..3a18d3a 100644 --- a/dlls/shell32/dde.c +++ b/dlls/shell32/dde.c @@ -97,10 +97,49 @@ static inline HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic, return NULL; } +/* Returned string must be freed by caller */ +static WCHAR *get_programs_path(WCHAR *name) +{ + static const WCHAR slashW[] = {'/',0}; + WCHAR *programs, *path; + int len; + + SHGetKnownFolderPath(&FOLDERID_Programs, 0, NULL, &programs); + + len = lstrlenW(programs) + 1 + lstrlenW(name); + path = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(*path)); + lstrcpyW(path, programs); + lstrcatW(path, slashW); + lstrcatW(path, name); + + CoTaskMemFree(programs); + + return path; +} + static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv) { - FIXME("unhandled command %s\n", debugstr_w(command)); - return DDE_FNOTPROCESSED; + static const WCHAR create_groupW[] = {'C','r','e','a','t','e','G','r','o','u','p',0}; + + if (!strcmpiW(command, create_groupW)) + { + WCHAR *path; + + if (argc < 1) return DDE_FNOTPROCESSED; + + path = get_programs_path(argv[0]); + + CreateDirectoryW(path, NULL); + ShellExecuteW(NULL, NULL, path, NULL, NULL, SW_SHOWNORMAL); + + HeapFree(GetProcessHeap(), 0, path); + } + else + { + FIXME("unhandled command %s\n", debugstr_w(command)); + return DDE_FNOTPROCESSED; + } + return DDE_FACK; } static DWORD parse_dde_command(HSZ hszTopic, WCHAR *command) diff --git a/dlls/shell32/tests/progman_dde.c b/dlls/shell32/tests/progman_dde.c index 35e4b0c..73a79a8 100644 --- a/dlls/shell32/tests/progman_dde.c +++ b/dlls/shell32/tests/progman_dde.c @@ -281,12 +281,9 @@ static void test_progman_dde(DWORD instance, HCONV hConv) /* CreateGroup Tests (including AddItem, DeleteItem) */ error = dde_execute(instance, hConv, "[CreateGroup(Group1)]"); - todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(check_exists("Group1"), "directory not created\n"); - if (error == DMLERR_NO_ERROR) - ok(check_window_exists(Group1Title), "window not created\n"); - } + ok(check_window_exists(Group1Title), "window not created\n"); sprintf(itemtext, "[AddItem(%s,f1g1Name)]", f1g1); error = dde_execute(instance, hConv, itemtext); @@ -315,21 +312,15 @@ static void test_progman_dde(DWORD instance, HCONV hConv) } error = dde_execute(instance, hConv, "[CreateGroup(Group2)]"); - todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(check_exists("Group2"), "directory not created\n"); - if (error == DMLERR_NO_ERROR) - ok(check_window_exists(Group2Title), "window not created\n"); - } + ok(check_window_exists(Group2Title), "window not created\n"); /* Create Group that already exists - same instance */ error = dde_execute(instance, hConv, "[CreateGroup(Group1)]"); - todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(check_exists("Group1"), "directory not created\n"); - if (error == DMLERR_NO_ERROR) - ok(check_window_exists(Group1Title), "window not created\n"); - } + ok(check_window_exists(Group1Title), "window not created\n"); /* ShowGroup Tests */ error = dde_execute(instance, hConv, "[ShowGroup(Group1)]"); @@ -356,26 +347,28 @@ static void test_progman_dde(DWORD instance, HCONV hConv) /* DeleteGroup Test */ error = dde_execute(instance, hConv, "[DeleteGroup(Group1)]"); - todo_wine + todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(!check_exists("Group1"), "directory should not exist\n"); + } /* Compound Execute String Command */ sprintf(comptext, "[CreateGroup(Group3)][AddItem(%s,f1g3Name)][AddItem(%s,f2g3Name)]", f1g3, f2g3); error = dde_execute(instance, hConv, comptext); - todo_wine { + todo_wine ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(check_exists("Group3"), "directory not created\n"); - if (error == DMLERR_NO_ERROR) - ok(check_window_exists(Group3Title), "window not created\n"); + ok(check_window_exists(Group3Title), "window not created\n"); + todo_wine { ok(check_exists("Group3/f1g3Name.lnk"), "link not created\n"); ok(check_exists("Group3/f2g3Name.lnk"), "link not created\n"); } error = dde_execute(instance, hConv, "[DeleteGroup(Group3)]"); - todo_wine + todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(!check_exists("Group3"), "directory should not exist\n"); + } /* Full Parameters of Add Item */ /* AddItem(CmdLine[,Name[,IconPath[,IconIndex[,xPos,yPos[,DefDir[,HotKey[,fMinimize[fSeparateSpace]]]]]]]) */ @@ -394,17 +387,15 @@ static void test_progman_dde2(DWORD instance, HCONV hConv) /* Create Group that already exists on a separate connection */ error = dde_execute(instance, hConv, "[CreateGroup(Group2)]"); - todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(check_exists("Group2"), "directory not created\n"); - if (error == DMLERR_NO_ERROR) - ok(check_window_exists(Group2Title), "window not created\n"); - } + ok(check_window_exists(Group2Title), "window not created\n"); error = dde_execute(instance, hConv, "[DeleteGroup(Group2)]"); - todo_wine + todo_wine { ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %u\n", error); ok(!check_exists("Group2"), "directory should not exist\n"); + } } START_TEST(progman_dde)
1
0
0
0
Zebediah Figura : shell32: Add a parser for DDE commands.
by Alexandre Julliard
30 Nov '17
30 Nov '17
Module: wine Branch: master Commit: 6778023999912e0b3f601188bcca9a7971d8193b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6778023999912e0b3f601188b…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Wed Nov 29 17:00:45 2017 -0600 shell32: Add a parser for DDE commands. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shell32/dde.c | 115 +++++++++++++++++++++++++++++++++++++++++--- dlls/shell32/shell32_main.h | 13 +++++ 2 files changed, 121 insertions(+), 7 deletions(-) diff --git a/dlls/shell32/dde.c b/dlls/shell32/dde.c index c44f05d..ae1143b 100644 --- a/dlls/shell32/dde.c +++ b/dlls/shell32/dde.c @@ -26,7 +26,10 @@ #include "ddeml.h" #include "shellapi.h" +#include "shell32_main.h" + #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -94,21 +97,119 @@ static inline HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic, return NULL; } -static inline DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) +static DWORD PROGMAN_OnExecute(WCHAR *command, int argc, WCHAR **argv) { - WCHAR * pszCommand; + FIXME("unhandled command %s\n", debugstr_w(command)); + return DDE_FNOTPROCESSED; +} + +static DWORD parse_dde_command(HSZ hszTopic, WCHAR *command) +{ + static const WCHAR opcode_end[] = {' ',',','(',')','[',']','"',0}; + static const WCHAR param_end[] = {',','(',')','[',']',0}; + + WCHAR *original = command; + WCHAR *opcode = NULL, **argv = NULL, *p; + int argc = 0, i; + DWORD ret = DDE_FACK; + + while (*command == ' ') command++; + + if (*command != '[') goto error; + while (*command == '[') + { + argc = 0; + argv = HeapAlloc(GetProcessHeap(), 0, sizeof(*argv)); + + command++; + while (*command == ' ') command++; + if (!(p = strpbrkW(command, opcode_end))) goto error; + + opcode = strndupW(command, p - command); + + command = p; + while (*command == ' ') command++; + if (*command == '(') + { + command++; + + while (*command != ')') + { + while (*command == ' ') command++; + if (*command == '"') + { + command++; + if (!(p = strchrW(command, '"'))) goto error; + } + else + { + if (!(p = strpbrkW(command, param_end))) goto error; + while (p[-1] == ' ') p--; + } - pszCommand = (WCHAR *)DdeAccessData(hdata, NULL); - if (!pszCommand) - return DDE_FNOTPROCESSED; + argc++; + argv = HeapReAlloc(GetProcessHeap(), 0, argv, argc * sizeof(*argv)); + argv[argc-1] = strndupW(command, p - command); - FIXME("stub: %s %s\n", debugstr_hsz(hszTopic), debugstr_w(pszCommand)); + command = p; + if (*command == '"') command++; + while (*command == ' ') command++; + if (*command == ',') command++; + else if (*command != ')') goto error; + } + command++; - DdeUnaccessData(hdata); + while (*command == ' ') command++; + } + if (*command != ']') goto error; + command++; + while (*command == ' ') command++; + + if (hszTopic == hszProgmanTopic) + ret = PROGMAN_OnExecute(opcode, argc, argv); + else + { + FIXME("unhandled topic %s, command %s\n", debugstr_hsz(hszTopic), debugstr_w(opcode)); + ret = DDE_FNOTPROCESSED; + } + + HeapFree(GetProcessHeap(), 0, opcode); + for (i = 0; i < argc; i++) HeapFree(GetProcessHeap(), 0, argv[i]); + HeapFree(GetProcessHeap(), 0, argv); + + if (ret == DDE_FNOTPROCESSED) break; + } + + return ret; + +error: + ERR("failed to parse command %s\n", debugstr_w(original)); + HeapFree(GetProcessHeap(), 0, opcode); + for (i = 0; i < argc; i++) HeapFree(GetProcessHeap(), 0, argv[i]); + HeapFree(GetProcessHeap(), 0, argv); return DDE_FNOTPROCESSED; } +static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) +{ + WCHAR *command; + DWORD len; + DWORD ret; + + len = DdeGetData(hdata, NULL, 0, 0); + if (!len) return DDE_FNOTPROCESSED; + command = HeapAlloc(GetProcessHeap(), 0, len); + DdeGetData(hdata, (BYTE *)command, len, 0); + + TRACE("conv=%p topic=%s data=%s\n", hconv, debugstr_hsz(hszTopic), debugstr_w(command)); + + ret = parse_dde_command(hszTopic, command); + + HeapFree(GetProcessHeap(), 0, command); + return ret; +} + static inline void Dde_OnDisconnect(HCONV hconv) { TRACE( "%p\n", hconv ); diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 368c0e0..b65141f 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -238,6 +238,19 @@ static inline WCHAR *strdupW(const WCHAR *src) return dest; } +static inline WCHAR *strndupW(const WCHAR *src, DWORD len) +{ + WCHAR *dest; + if (!src) return NULL; + dest = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(*dest)); + if (dest) + { + memcpy(dest, src, len * sizeof(WCHAR)); + dest[len] = '\0'; + } + return dest; +} + static inline WCHAR *strdupAtoW(const char *str) { WCHAR *ret;
1
0
0
0
← Newer
1
2
3
4
5
6
...
44
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
Results per page:
10
25
50
100
200