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 2018
----- 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
951 discussions
Start a n
N
ew thread
Nikolay Sivov : shell32: Forward process reference calls to shcore.
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: 444b1cb34eed7c117d7b290b3a6906770f9792ed URL:
https://source.winehq.org/git/wine.git/?a=commit;h=444b1cb34eed7c117d7b290b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Nov 27 11:55:48 2018 +0300 shell32: Forward process reference calls to shcore. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shcore/tests/shcore.c | 2 -- dlls/shell32/shell32.spec | 4 ++-- dlls/shell32/shellord.c | 28 ---------------------------- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/dlls/shcore/tests/shcore.c b/dlls/shcore/tests/shcore.c index de6a921..904d826 100644 --- a/dlls/shcore/tests/shcore.c +++ b/dlls/shcore/tests/shcore.c @@ -117,12 +117,10 @@ static void test_process_reference(void) pSHGetInstanceExplorer = (void *)GetProcAddress(hmod, "SHGetInstanceExplorer"); hr = pSHGetInstanceExplorer(&obj); -todo_wine { ok(hr == S_OK, "Failed to get reference, hr %#x.\n", hr); ok(obj == &test_unk2.IUnknown_iface, "Unexpected pointer.\n"); ok(test_unk2.refcount == 3, "Unexpected refcount %u.\n", test_unk2.refcount); } -} START_TEST(shcore) { diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 23243e1..bf8b512 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -165,7 +165,7 @@ 173 stdcall -ordinal SHValidateUNC(long wstr long) 174 stdcall -ordinal SHCreateShellFolderViewEx(ptr ptr) 175 stdcall -noname SHGetSpecialFolderPath(long long long long) SHGetSpecialFolderPathAW - 176 stdcall -ordinal SHSetInstanceExplorer(ptr) + 176 stdcall -ordinal SHSetInstanceExplorer(ptr) shcore.SetProcessReference 177 stub DAD_SetDragImageFromListView 178 stdcall -ordinal SHObjectProperties(long long wstr wstr) 179 stdcall -ordinal SHGetNewLinkInfoA(str str ptr ptr long) @@ -380,7 +380,7 @@ @ stdcall SHGetIconOverlayIndexA(str long) @ stdcall SHGetIconOverlayIndexW(wstr long) @ stdcall SHGetIDListFromObject(ptr ptr) -@ stdcall SHGetInstanceExplorer(ptr) +@ stdcall SHGetInstanceExplorer(ptr) shcore.GetProcessReference @ stdcall SHGetItemFromDataObject(ptr long ptr ptr) @ stdcall SHGetItemFromObject(ptr ptr ptr) @ stdcall SHGetKnownFolderIDList(ptr long ptr ptr) diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index 6fc49dc..6ed0c90 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -1103,34 +1103,6 @@ BOOL WINAPI SHRunControlPanel (LPCWSTR commandLine, HWND parent) return FALSE; } -static LPUNKNOWN SHELL32_IExplorerInterface=0; -/************************************************************************* - * SHSetInstanceExplorer [SHELL32.176] - * - * NOTES - * Sets the interface - */ -VOID WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown) -{ TRACE("%p\n", lpUnknown); - SHELL32_IExplorerInterface = lpUnknown; -} -/************************************************************************* - * SHGetInstanceExplorer [SHELL32.@] - * - * NOTES - * gets the interface pointer of the explorer and a reference - */ -HRESULT WINAPI SHGetInstanceExplorer (IUnknown **lpUnknown) -{ TRACE("%p\n", lpUnknown); - - *lpUnknown = SHELL32_IExplorerInterface; - - if (!SHELL32_IExplorerInterface) - return E_FAIL; - - IUnknown_AddRef(SHELL32_IExplorerInterface); - return S_OK; -} /************************************************************************* * SHFreeUnusedLibraries [SHELL32.123] *
1
0
0
0
Nikolay Sivov : shcore: Add process reference API.
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: 4e22ba2627cd634805dca3b16552df9491b34548 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4e22ba2627cd634805dca3b1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Nov 27 11:55:47 2018 +0300 shcore: Add process reference API. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 + configure.ac | 1 + .../api-ms-win-shcore-thread-l1-1-0.spec | 4 +- dlls/shcore/main.c | 29 +++++ dlls/shcore/shcore.spec | 4 +- dlls/shcore/tests/Makefile.in | 4 + dlls/shcore/tests/shcore.c | 140 +++++++++++++++++++++ 7 files changed, 179 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 7236d8b..d405d67 100755 --- a/configure +++ b/configure @@ -19792,6 +19792,7 @@ wine_fn_config_makefile dlls/setupx.dll16 enable_win16 wine_fn_config_makefile dlls/sfc enable_sfc wine_fn_config_makefile dlls/sfc_os enable_sfc_os wine_fn_config_makefile dlls/shcore enable_shcore +wine_fn_config_makefile dlls/shcore/tests enable_tests wine_fn_config_makefile dlls/shdoclc enable_shdoclc wine_fn_config_makefile dlls/shdocvw enable_shdocvw wine_fn_config_makefile dlls/shdocvw/tests enable_tests diff --git a/configure.ac b/configure.ac index 5d02058..cd1bf44 100644 --- a/configure.ac +++ b/configure.ac @@ -3655,6 +3655,7 @@ WINE_CONFIG_MAKEFILE(dlls/setupx.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/sfc) WINE_CONFIG_MAKEFILE(dlls/sfc_os) WINE_CONFIG_MAKEFILE(dlls/shcore) +WINE_CONFIG_MAKEFILE(dlls/shcore/tests) WINE_CONFIG_MAKEFILE(dlls/shdoclc) WINE_CONFIG_MAKEFILE(dlls/shdocvw) WINE_CONFIG_MAKEFILE(dlls/shdocvw/tests) diff --git a/dlls/api-ms-win-shcore-thread-l1-1-0/api-ms-win-shcore-thread-l1-1-0.spec b/dlls/api-ms-win-shcore-thread-l1-1-0/api-ms-win-shcore-thread-l1-1-0.spec index 1533005..0cbacc8 100644 --- a/dlls/api-ms-win-shcore-thread-l1-1-0/api-ms-win-shcore-thread-l1-1-0.spec +++ b/dlls/api-ms-win-shcore-thread-l1-1-0/api-ms-win-shcore-thread-l1-1-0.spec @@ -1,8 +1,8 @@ -@ stub GetProcessReference +@ stdcall GetProcessReference(ptr) shcore.GetProcessReference @ stdcall SHCreateThread(ptr ptr long ptr) shcore.SHCreateThread @ stdcall SHCreateThreadRef(ptr ptr) shcore.SHCreateThreadRef @ stub SHCreateThreadWithHandle @ stdcall SHGetThreadRef(ptr) shcore.SHGetThreadRef @ stdcall SHReleaseThreadRef() shcore.SHReleaseThreadRef @ stdcall SHSetThreadRef(ptr) shcore.SHSetThreadRef -@ stub SetProcessReference +@ stdcall SetProcessReference(ptr) shcore.SetProcessReference diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c index 7f423c1..488e78e 100644 --- a/dlls/shcore/main.c +++ b/dlls/shcore/main.c @@ -36,6 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shcore); static DWORD shcore_tls; +static IUnknown *process_ref; BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { @@ -1261,3 +1262,31 @@ HRESULT WINAPI SHReleaseThreadRef(void) FIXME("() - stub!\n"); return S_OK; } + +/************************************************************************* + * GetProcessReference [SHCORE.@] + */ +HRESULT WINAPI GetProcessReference(IUnknown **obj) +{ + TRACE("(%p)\n", obj); + + *obj = process_ref; + + if (!process_ref) + return E_FAIL; + + if (*obj) + IUnknown_AddRef(*obj); + + return S_OK; +} + +/************************************************************************* + * SetProcessReference [SHCORE.@] + */ +void WINAPI SetProcessReference(IUnknown *obj) +{ + TRACE("(%p)\n", obj); + + process_ref = obj; +} diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec index 568cb20..c98f2db 100644 --- a/dlls/shcore/shcore.spec +++ b/dlls/shcore/shcore.spec @@ -10,7 +10,7 @@ @ stdcall GetDpiForMonitor(long long ptr ptr) @ stub GetDpiForShellUIComponent @ stdcall GetProcessDpiAwareness(long ptr) -@ stub GetProcessReference +@ stdcall GetProcessReference(ptr) @ stub GetScaleFactorForDevice @ stub GetScaleFactorForMonitor @ stub IStream_Copy @@ -79,7 +79,7 @@ @ stdcall SHUnicodeToUnicode(wstr ptr long) shlwapi.SHUnicodeToUnicode @ stdcall SetCurrentProcessExplicitAppUserModelID(wstr) @ stdcall SetProcessDpiAwareness(long) -@ stub SetProcessReference +@ stdcall SetProcessReference(ptr) @ stub UnregisterScaleChangeEvent 100 stub @ diff --git a/dlls/shcore/tests/Makefile.in b/dlls/shcore/tests/Makefile.in new file mode 100644 index 0000000..0ea769a --- /dev/null +++ b/dlls/shcore/tests/Makefile.in @@ -0,0 +1,4 @@ +TESTDLL = shcore.dll + +C_SRCS = \ + shcore.c diff --git a/dlls/shcore/tests/shcore.c b/dlls/shcore/tests/shcore.c new file mode 100644 index 0000000..de6a921 --- /dev/null +++ b/dlls/shcore/tests/shcore.c @@ -0,0 +1,140 @@ +/* + * Copyright 2018 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include <stdarg.h> + +#include <windows.h> +#include "initguid.h" +#include "objidl.h" + +#include "wine/test.h" + +static HRESULT (WINAPI *pGetProcessReference)(IUnknown **); +static void (WINAPI *pSetProcessReference)(IUnknown *); +static HRESULT (WINAPI *pSHGetInstanceExplorer)(IUnknown **); + +static void init(HMODULE hshcore) +{ +#define X(f) p##f = (void*)GetProcAddress(hshcore, #f) + X(GetProcessReference); + X(SetProcessReference); +#undef X +} + +static HRESULT WINAPI unk_QI(IUnknown *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IUnknown_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +struct test_unk +{ + IUnknown IUnknown_iface; + LONG refcount; +}; + +static struct test_unk *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, struct test_unk, IUnknown_iface); +} + +static ULONG WINAPI unk_AddRef(IUnknown *iface) +{ + struct test_unk *obj = impl_from_IUnknown(iface); + return InterlockedIncrement(&obj->refcount); +} + +static ULONG WINAPI unk_Release(IUnknown *iface) +{ + struct test_unk *obj = impl_from_IUnknown(iface); + return InterlockedDecrement(&obj->refcount); +} + +static const IUnknownVtbl testunkvtbl = +{ + unk_QI, + unk_AddRef, + unk_Release, +}; + +static void test_unk_init(struct test_unk *testunk) +{ + testunk->IUnknown_iface.lpVtbl = &testunkvtbl; + testunk->refcount = 1; +} + +static void test_process_reference(void) +{ + struct test_unk test_unk, test_unk2; + IUnknown *obj; + HMODULE hmod; + HRESULT hr; + + obj = (void *)0xdeadbeef; + hr = pGetProcessReference(&obj); + ok(hr == E_FAIL, "Unexpected hr %#x.\n", hr); + ok(obj == NULL, "Unexpected pointer.\n"); + + test_unk_init(&test_unk); + test_unk_init(&test_unk2); + + pSetProcessReference(&test_unk.IUnknown_iface); + ok(test_unk.refcount == 1, "Unexpected refcount %u.\n", test_unk.refcount); + pSetProcessReference(&test_unk2.IUnknown_iface); + ok(test_unk.refcount == 1, "Unexpected refcount %u.\n", test_unk.refcount); + ok(test_unk2.refcount == 1, "Unexpected refcount %u.\n", test_unk2.refcount); + + hr = pGetProcessReference(&obj); + ok(hr == S_OK, "Failed to get reference, hr %#x.\n", hr); + ok(obj == &test_unk2.IUnknown_iface, "Unexpected pointer.\n"); + ok(test_unk2.refcount == 2, "Unexpected refcount %u.\n", test_unk2.refcount); + + hmod = LoadLibraryA("shell32.dll"); + + pSHGetInstanceExplorer = (void *)GetProcAddress(hmod, "SHGetInstanceExplorer"); + hr = pSHGetInstanceExplorer(&obj); +todo_wine { + ok(hr == S_OK, "Failed to get reference, hr %#x.\n", hr); + ok(obj == &test_unk2.IUnknown_iface, "Unexpected pointer.\n"); + ok(test_unk2.refcount == 3, "Unexpected refcount %u.\n", test_unk2.refcount); +} +} + +START_TEST(shcore) +{ + HMODULE hshcore = LoadLibraryA("shcore.dll"); + + if (!hshcore) + { + win_skip("Shcore.dll is not available.\n"); + return; + } + + init(hshcore); + + test_process_reference(); +}
1
0
0
0
Nikolay Sivov : shcore: Add ThreadRef functions.
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: e74a36f5c89294c194fd8b58b93fba0dad296b2b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e74a36f5c89294c194fd8b58…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Nov 27 11:55:46 2018 +0300 shcore: Add ThreadRef functions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shcore/main.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++++ dlls/shcore/shcore.spec | 8 +-- 2 files changed, 142 insertions(+), 4 deletions(-) diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c index f99479d..7f423c1 100644 --- a/dlls/shcore/main.c +++ b/dlls/shcore/main.c @@ -35,6 +35,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(shcore); +static DWORD shcore_tls; + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) { TRACE("(%p, %u, %p)\n", instance, reason, reserved); @@ -45,6 +47,12 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(instance); + shcore_tls = TlsAlloc(); + break; + case DLL_PROCESS_DETACH: + if (reserved) break; + if (shcore_tls != TLS_OUT_OF_INDEXES) + TlsFree(shcore_tls); break; } @@ -1123,3 +1131,133 @@ HRESULT WINAPI SHCreateStreamOnFileA(const char *path, DWORD mode, IStream **str return hr; } + +struct threadref +{ + IUnknown IUnknown_iface; + LONG *refcount; +}; + +static inline struct threadref *threadref_impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, struct threadref, IUnknown_iface); +} + +static HRESULT WINAPI threadref_QueryInterface(IUnknown *iface, REFIID riid, void **out) +{ + struct threadref *threadref = threadref_impl_from_IUnknown(iface); + + TRACE("(%p, %s, %p)\n", threadref, debugstr_guid(riid), out); + + if (out == NULL) + return E_POINTER; + + if (IsEqualGUID(&IID_IUnknown, riid)) + { + *out = iface; + IUnknown_AddRef(iface); + return S_OK; + } + + *out = NULL; + WARN("Interface %s not supported.\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI threadref_AddRef(IUnknown *iface) +{ + struct threadref *threadref = threadref_impl_from_IUnknown(iface); + LONG refcount = InterlockedIncrement(threadref->refcount); + + TRACE("(%p, %d)\n", threadref, refcount); + + return refcount; +} + +static ULONG WINAPI threadref_Release(IUnknown *iface) +{ + struct threadref *threadref = threadref_impl_from_IUnknown(iface); + LONG refcount = InterlockedDecrement(threadref->refcount); + + TRACE("(%p, %d)\n", threadref, refcount); + + if (!refcount) + heap_free(threadref); + + return refcount; +} + +static const IUnknownVtbl threadrefvtbl = +{ + threadref_QueryInterface, + threadref_AddRef, + threadref_Release, +}; + +/************************************************************************* + * SHCreateThreadRef [SHCORE.@] + */ +HRESULT WINAPI SHCreateThreadRef(LONG *refcount, IUnknown **out) +{ + struct threadref *threadref; + + TRACE("(%p, %p)\n", refcount, out); + + if (!refcount || !out) + return E_INVALIDARG; + + *out = NULL; + + threadref = heap_alloc(sizeof(*threadref)); + if (!threadref) + return E_OUTOFMEMORY; + threadref->IUnknown_iface.lpVtbl = &threadrefvtbl; + threadref->refcount = refcount; + + *refcount = 1; + *out = &threadref->IUnknown_iface; + + TRACE("Created %p.\n", threadref); + return S_OK; +} + +/************************************************************************* + * SHGetThreadRef [SHCORE.@] + */ +HRESULT WINAPI SHGetThreadRef(IUnknown **out) +{ + TRACE("(%p)\n", out); + + if (shcore_tls == TLS_OUT_OF_INDEXES) + return E_NOINTERFACE; + + *out = TlsGetValue(shcore_tls); + if (!*out) + return E_NOINTERFACE; + + IUnknown_AddRef(*out); + return S_OK; +} + +/************************************************************************* + * SHSetThreadRef [SHCORE.@] + */ +HRESULT WINAPI SHSetThreadRef(IUnknown *obj) +{ + TRACE("(%p)\n", obj); + + if (shcore_tls == TLS_OUT_OF_INDEXES) + return E_NOINTERFACE; + + TlsSetValue(shcore_tls, obj); + return S_OK; +} + +/************************************************************************* + * SHReleaseThreadRef [SHCORE.@] + */ +HRESULT WINAPI SHReleaseThreadRef(void) +{ + FIXME("() - stub!\n"); + return S_OK; +} diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec index c3bb8d2..568cb20 100644 --- a/dlls/shcore/shcore.spec +++ b/dlls/shcore/shcore.spec @@ -38,7 +38,7 @@ @ stdcall SHCreateStreamOnFileEx(wstr long long long ptr ptr) @ stdcall SHCreateStreamOnFileW(wstr long ptr) @ stdcall SHCreateThread(ptr ptr long ptr) shlwapi.SHCreateThread -@ stdcall SHCreateThreadRef(ptr ptr) shlwapi.SHCreateThreadRef +@ stdcall SHCreateThreadRef(ptr ptr) @ stub SHCreateThreadWithHandle @ stdcall SHDeleteEmptyKeyA(long ptr) shlwapi.SHDeleteEmptyKeyA @ stdcall SHDeleteEmptyKeyW(long ptr) shlwapi.SHDeleteEmptyKeyW @@ -50,7 +50,7 @@ @ stdcall SHEnumKeyExW(long long wstr ptr) shlwapi.SHEnumKeyExW @ stdcall SHEnumValueA(long long str ptr ptr ptr ptr) shlwapi.SHEnumValueA @ stdcall SHEnumValueW(long long wstr ptr ptr ptr ptr) shlwapi.SHEnumValueW -@ stdcall SHGetThreadRef(ptr) shlwapi.SHGetThreadRef +@ stdcall SHGetThreadRef(ptr) @ stdcall SHGetValueA( long str str ptr ptr ptr ) shlwapi.SHGetValueA @ stdcall SHGetValueW( long wstr wstr ptr ptr ptr ) shlwapi.SHGetValueW @ stdcall SHOpenRegStream2A(long str str long) shlwapi.SHOpenRegStream2A @@ -69,8 +69,8 @@ @ stdcall SHRegGetValueW( long wstr wstr long ptr ptr ptr ) shlwapi.SHRegGetValueW @ stdcall SHRegSetPathA(long str str str long) shlwapi.SHRegSetPathA @ stdcall SHRegSetPathW(long wstr wstr wstr long) shlwapi.SHRegSetPathW -@ stdcall SHReleaseThreadRef() shlwapi.SHReleaseThreadRef -@ stdcall SHSetThreadRef(ptr) shlwapi.SHSetThreadRef +@ stdcall SHReleaseThreadRef() +@ stdcall SHSetThreadRef(ptr) @ stdcall SHSetValueA(long str str long ptr long) shlwapi.SHSetValueA @ stdcall SHSetValueW(long wstr wstr long ptr long) shlwapi.SHSetValueW @ stdcall SHStrDupA(str ptr) shlwapi.SHStrDupA
1
0
0
0
Nikolay Sivov : shcore: Add file-based stream.
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: dd4bb9470635bd7cc2ee50472953a26d68dae455 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dd4bb9470635bd7cc2ee5047…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Nov 27 11:55:45 2018 +0300 shcore: Add file-based stream. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shcore/Makefile.in | 2 +- dlls/shcore/main.c | 327 +++++++++++++++++++++++++++++++++++++++++++++++- dlls/shcore/shcore.spec | 6 +- 3 files changed, 329 insertions(+), 6 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=dd4bb9470635bd7cc2ee…
1
0
0
0
Nikolay Sivov : shcore: Implement SHCreateMemStream().
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: b54d72ef0b5254dc290792faaaf3c97e20a56dd7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b54d72ef0b5254dc290792fa…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Nov 27 11:55:44 2018 +0300 shcore: Implement SHCreateMemStream(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shcore/main.c | 308 ++++++++++++++++++++++++++++++++++++++++++++++++ dlls/shcore/shcore.spec | 2 +- 2 files changed, 309 insertions(+), 1 deletion(-) diff --git a/dlls/shcore/main.c b/dlls/shcore/main.c index 8f674a2..792f7c8 100644 --- a/dlls/shcore/main.c +++ b/dlls/shcore/main.c @@ -28,7 +28,9 @@ #include "initguid.h" #include "ocidl.h" #include "shellscalingapi.h" + #include "wine/debug.h" +#include "wine/heap.h" #include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(shcore); @@ -492,3 +494,309 @@ WCHAR** WINAPI CommandLineToArgvW(const WCHAR *cmdline, int *numargs) return argv; } + +struct shstream +{ + IStream IStream_iface; + LONG refcount; + + union + { + struct + { + BYTE *buffer; + DWORD length; + DWORD position; + } mem; + } u; +}; + +static inline struct shstream *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, struct shstream, IStream_iface); +} + +static HRESULT WINAPI shstream_QueryInterface(IStream *iface, REFIID riid, void **out) +{ + struct shstream *stream = impl_from_IStream(iface); + + TRACE("(%p)->(%s, %p)\n", stream, debugstr_guid(riid), out); + + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IStream)) + { + *out = iface; + IStream_AddRef(iface); + return S_OK; + } + + *out = NULL; + WARN("Unsupported interface %s.\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI shstream_AddRef(IStream *iface) +{ + struct shstream *stream = impl_from_IStream(iface); + ULONG refcount = InterlockedIncrement(&stream->refcount); + + TRACE("(%p)->(%u)\n", stream, refcount); + + return refcount; +} + +static ULONG WINAPI memstream_Release(IStream *iface) +{ + struct shstream *stream = impl_from_IStream(iface); + ULONG refcount = InterlockedDecrement(&stream->refcount); + + TRACE("(%p)->(%u)\n", stream, refcount); + + if (!refcount) + { + heap_free(stream->u.mem.buffer); + heap_free(stream); + } + + return refcount; +} + +static HRESULT WINAPI memstream_Read(IStream *iface, void *buff, ULONG buff_size, ULONG *read_len) +{ + struct shstream *stream = impl_from_IStream(iface); + DWORD length; + + TRACE("(%p)->(%p, %u, %p)\n", stream, buff, buff_size, read_len); + + if (stream->u.mem.position >= stream->u.mem.length) + length = 0; + else + length = stream->u.mem.length - stream->u.mem.position; + + length = buff_size > length ? length : buff_size; + if (length != 0) /* not at end of buffer and we want to read something */ + { + memmove(buff, stream->u.mem.buffer + stream->u.mem.position, length); + stream->u.mem.position += length; /* adjust pointer */ + } + + if (read_len) + *read_len = length; + + return S_OK; +} + +static HRESULT WINAPI memstream_Write(IStream *iface, const void *buff, ULONG buff_size, ULONG *written) +{ + struct shstream *stream = impl_from_IStream(iface); + DWORD length = stream->u.mem.position + buff_size; + + TRACE("(%p)->(%p, %u, %p)\n", stream, buff, buff_size, written); + + if (length < stream->u.mem.position) /* overflow */ + return STG_E_INSUFFICIENTMEMORY; + + if (length > stream->u.mem.length) + { + BYTE *buffer = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, stream->u.mem.buffer, length); + if (!buffer) + return STG_E_INSUFFICIENTMEMORY; + + stream->u.mem.length = length; + stream->u.mem.buffer = buffer; + } + memmove(stream->u.mem.buffer + stream->u.mem.position, buff, buff_size); + stream->u.mem.position += buff_size; /* adjust pointer */ + + if (written) + *written = buff_size; + + return S_OK; +} + +static HRESULT WINAPI memstream_Seek(IStream *iface, LARGE_INTEGER move, DWORD origin, ULARGE_INTEGER*new_pos) +{ + struct shstream *stream = impl_from_IStream(iface); + LARGE_INTEGER tmp; + + TRACE("(%p)->(%s, %d, %p)\n", stream, wine_dbgstr_longlong(move.QuadPart), origin, new_pos); + + if (origin == STREAM_SEEK_SET) + tmp = move; + else if (origin == STREAM_SEEK_CUR) + tmp.QuadPart = stream->u.mem.position + move.QuadPart; + else if (origin == STREAM_SEEK_END) + tmp.QuadPart = stream->u.mem.length + move.QuadPart; + else + return STG_E_INVALIDPARAMETER; + + if (tmp.QuadPart < 0) + return STG_E_INVALIDFUNCTION; + + /* we cut off the high part here */ + stream->u.mem.position = tmp.u.LowPart; + + if (new_pos) + new_pos->QuadPart = stream->u.mem.position; + return S_OK; +} + +static HRESULT WINAPI memstream_SetSize(IStream *iface, ULARGE_INTEGER new_size) +{ + struct shstream *stream = impl_from_IStream(iface); + DWORD length; + BYTE *buffer; + + TRACE("(%p, %s)\n", stream, wine_dbgstr_longlong(new_size.QuadPart)); + + /* we cut off the high part here */ + length = new_size.u.LowPart; + buffer = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, stream->u.mem.buffer, length); + if (!buffer) + return STG_E_INSUFFICIENTMEMORY; + + stream->u.mem.buffer = buffer; + stream->u.mem.length = length; + + return S_OK; +} + +static HRESULT WINAPI shstream_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER size, ULARGE_INTEGER *read_len, ULARGE_INTEGER *written) +{ + struct shstream *stream = impl_from_IStream(iface); + + TRACE("(%p)\n", stream); + + if (read_len) + read_len->QuadPart = 0; + + if (written) + written->QuadPart = 0; + + /* TODO implement */ + return E_NOTIMPL; +} + +static HRESULT WINAPI shstream_Commit(IStream *iface, DWORD flags) +{ + struct shstream *stream = impl_from_IStream(iface); + + TRACE("(%p, %#x)\n", stream, flags); + + /* Commit is not supported by this stream */ + return E_NOTIMPL; +} + +static HRESULT WINAPI shstream_Revert(IStream *iface) +{ + struct shstream *stream = impl_from_IStream(iface); + + TRACE("(%p)\n", stream); + + /* revert not supported by this stream */ + return E_NOTIMPL; +} + +static HRESULT WINAPI shstream_LockRegion(IStream *iface, ULARGE_INTEGER offset, ULARGE_INTEGER size, DWORD lock_type) +{ + struct shstream *stream = impl_from_IStream(iface); + + TRACE("(%p)\n", stream); + + /* lock/unlock not supported by this stream */ + return E_NOTIMPL; +} + +static HRESULT WINAPI shstream_UnlockRegion(IStream *iface, ULARGE_INTEGER offset, ULARGE_INTEGER size, DWORD lock_type) +{ + struct shstream *stream = impl_from_IStream(iface); + + TRACE("(%p)\n", stream); + + /* lock/unlock not supported by this stream */ + return E_NOTIMPL; +} + +static HRESULT WINAPI memstream_Stat(IStream *iface, STATSTG *statstg, DWORD flags) +{ + struct shstream *stream = impl_from_IStream(iface); + + TRACE("(%p, %p, %#x)\n", stream, statstg, flags); + + memset(statstg, 0, sizeof(*statstg)); + statstg->type = STGTY_STREAM; + statstg->cbSize.QuadPart = stream->u.mem.length; + statstg->grfMode = STGM_READWRITE; + + return S_OK; +} + +static HRESULT WINAPI shstream_Clone(IStream *iface, IStream **dest) +{ + struct shstream *stream = impl_from_IStream(iface); + + TRACE("(%p, %p)\n", stream, dest); + + *dest = NULL; + + /* clone not supported by this stream */ + return E_NOTIMPL; +} + +static const IStreamVtbl shstreamvtbl = +{ + shstream_QueryInterface, + shstream_AddRef, + memstream_Release, + memstream_Read, + memstream_Write, + memstream_Seek, + memstream_SetSize, + shstream_CopyTo, + shstream_Commit, + shstream_Revert, + shstream_LockRegion, + shstream_UnlockRegion, + memstream_Stat, + shstream_Clone, +}; + +/************************************************************************* + * SHCreateMemStream [SHCORE.@] + * + * Create an IStream object on a block of memory. + * + * PARAMS + * data [I] Memory block to create the IStream object on + * data_len [I] Length of data block + * + * RETURNS + * Success: A pointer to the IStream object. + * Failure: NULL, if any parameters are invalid or an error occurs. + * + * NOTES + * A copy of the memory block is made, it's freed when the stream is released. + */ +IStream * WINAPI SHCreateMemStream(const BYTE *data, UINT data_len) +{ + struct shstream *stream; + + TRACE("(%p, %u)\n", data, data_len); + + if (!data) + data_len = 0; + + stream = heap_alloc(sizeof(*stream)); + stream->IStream_iface.lpVtbl = &shstreamvtbl; + stream->refcount = 1; + stream->u.mem.buffer = heap_alloc(data_len); + if (!stream->u.mem.buffer) + { + heap_free(stream); + return NULL; + } + memcpy(stream->u.mem.buffer, data, data_len); + stream->u.mem.length = data_len; + stream->u.mem.position = 0; + + return &stream->IStream_iface; +} diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec index 1266a02..e8643d8 100644 --- a/dlls/shcore/shcore.spec +++ b/dlls/shcore/shcore.spec @@ -33,7 +33,7 @@ @ stdcall SHAnsiToUnicode(str ptr long) shlwapi.SHAnsiToUnicode @ stdcall SHCopyKeyA(long str long long) shlwapi.SHCopyKeyA @ stdcall SHCopyKeyW(long wstr long long) shlwapi.SHCopyKeyW -@ stdcall SHCreateMemStream(ptr long) shlwapi.SHCreateMemStream +@ stdcall SHCreateMemStream(ptr long) @ stdcall SHCreateStreamOnFileA(str long ptr) shlwapi.SHCreateStreamOnFileA @ stdcall SHCreateStreamOnFileEx(wstr long long long ptr ptr) shlwapi.SHCreateStreamOnFileEx @ stdcall SHCreateStreamOnFileW(wstr long ptr) shlwapi.SHCreateStreamOnFileW
1
0
0
0
Alexandre Julliard : makefiles: Support specifying installed files in the top-level makefile.
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: d84de4ca001fa361652c7fdef00f624b03649eca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d84de4ca001fa361652c7fde…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 27 13:16:52 2018 +0100 makefiles: Support specifying installed files in the top-level makefile. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- Makefile.in | 6 ++--- configure | 53 ++++++++++++++++++++++---------------- configure.ac | 38 +++++++++++++++++++-------- libs/wine/Makefile.in | 2 -- loader/Makefile.in | 2 +- programs/msiexec/Makefile.in | 2 -- programs/notepad/Makefile.in | 2 -- programs/regedit/Makefile.in | 2 -- programs/regsvr32/Makefile.in | 2 -- programs/wineboot/Makefile.in | 2 -- programs/winecfg/Makefile.in | 2 -- programs/wineconsole/Makefile.in | 2 -- programs/winedbg/Makefile.in | 2 -- programs/winefile/Makefile.in | 2 -- programs/winemine/Makefile.in | 2 -- programs/winepath/Makefile.in | 2 -- server/Makefile.in | 2 -- tools/makedep.c | 55 ++++++++++++++++++---------------------- 18 files changed, 87 insertions(+), 93 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d84de4ca001fa361652c…
1
0
0
0
Dmitry Timoshkov : user32: Add support for navigating a group of radio buttons using a keyboard.
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: b1b8fb77be5dd9a8754b04b2ef9f703bbe393d59 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b1b8fb77be5dd9a8754b04b2…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Nov 27 09:11:17 2018 +0300 user32: Add support for navigating a group of radio buttons using a keyboard. The patch approximates the behaviour observed in the message tests but still doesn't make the message tests pass without failures. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/dialog.c | 12 ++++++++++-- dlls/user32/tests/msg.c | 7 ------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index c5c646e..c47bd57 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -1237,8 +1237,16 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg ) if (!(dlgCode & DLGC_WANTARROWS)) { BOOL fPrevious = (msg->wParam == VK_LEFT || msg->wParam == VK_UP); - HWND hwndNext = GetNextDlgGroupItem (hwndDlg, GetFocus(), fPrevious ); - SendMessageW( hwndDlg, WM_NEXTDLGCTL, (WPARAM)hwndNext, 1 ); + HWND hwndNext = GetNextDlgGroupItem( hwndDlg, msg->hwnd, fPrevious ); + if (hwndNext && SendMessageW( hwndNext, WM_GETDLGCODE, msg->wParam, (LPARAM)msg ) == (DLGC_BUTTON | DLGC_RADIOBUTTON)) + { + SetFocus( hwndNext ); + if ((GetWindowLongW( hwndNext, GWL_STYLE ) & BS_TYPEMASK) == BS_AUTORADIOBUTTON && + SendMessageW( hwndNext, BM_GETCHECK, 0, 0 ) != BST_CHECKED) + SendMessageW( hwndNext, BM_CLICK, 1, 0 ); + } + else + SendMessageW( hwndDlg, WM_NEXTDLGCTL, (WPARAM)hwndNext, 1 ); return TRUE; } break; diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 6e62873..f78858f 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -7057,11 +7057,9 @@ if (0) /* actual message sequence is different on every run in some Windows setu while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(auto_radio_button_VK_DOWN_dialog, "IsDialogMessage(VK_DOWN)", TRUE); -todo_wine test_radio(radio1, 1, radio2, 0, radio3, 0); hwnd = GetFocus(); -todo_wine ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd); GetWindowRect(radio1, &rc); @@ -7076,11 +7074,9 @@ todo_wine while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(auto_radio_button_VK_DOWN_radio3, "down to radio3", TRUE); -todo_wine test_radio(radio1, 1, radio2, 0, radio3, 0); hwnd = GetFocus(); -todo_wine ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd); flush_events(); @@ -7097,11 +7093,9 @@ todo_wine while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(auto_radio_button_VK_UP_radio1, "up to radio1", TRUE); -todo_wine test_radio(radio1, 1, radio2, 0, radio3, 0); hwnd = GetFocus(); -todo_wine ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd); flush_events(); @@ -7119,7 +7113,6 @@ todo_wine if (0) /* actual message sequence is different on every run in some Windows setups */ ok_sequence(auto_radio_button_VK_UP_dialog, "IsDialogMessage(VK_UP) #3", FALSE); /* what really matters is that nothing has changed */ -todo_wine test_radio(radio1, 1, radio2, 0, radio3, 0); log_all_parent_messages--;
1
0
0
0
Dmitry Timoshkov : user32/tests: Add a test for navigating a group of buttons using keyboard events.
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: bf55f167b9c9714dcb03e90cc4cea3093e15ceb7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bf55f167b9c9714dcb03e90c…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Nov 27 09:11:13 2018 +0300 user32/tests: Add a test for navigating a group of buttons using keyboard events. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 316 ++++++++++++++++++++++++++++++++++++++++++ dlls/user32/tests/resource.rc | 11 ++ 2 files changed, 327 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=bf55f167b9c9714dcb03…
1
0
0
0
Dmitry Timoshkov : user32/tests: Simplify the test for BM_CLICK on autoradio button by using a dialog.
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: d57fcb41135f8686f343c3b02da81cb9e44fd670 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d57fcb41135f8686f343c3b0…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Nov 27 09:11:04 2018 +0300 user32/tests: Simplify the test for BM_CLICK on autoradio button by using a dialog. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 78 ++++++++++++++++++++++++++----------------- dlls/user32/tests/resource.rc | 11 ++++++ 2 files changed, 59 insertions(+), 30 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index b39d0b2..baa8fe5 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -123,6 +123,8 @@ static DWORD cbt_hook_thread_id; static const WCHAR testWindowClassW[] = { 'T','e','s','t','W','i','n','d','o','w','C','l','a','s','s','W',0 }; +static LRESULT WINAPI ParentMsgCheckProcA(HWND, UINT, WPARAM, LPARAM); + /* FIXME: add tests for these Window Edge Styles (Win31/Win95/98 look), in order of precedence: @@ -6188,7 +6190,24 @@ static LRESULT CALLBACK button_hook_proc(HWND hwnd, UINT message, WPARAM wParam, case BM_SETSTATE: if (GetCapture()) ok(GetCapture() == hwnd, "GetCapture() = %p\n", GetCapture()); + + lParam = (ULONG_PTR)GetMenu(hwnd); + goto log_it; + + case WM_GETDLGCODE: + if (lParam) + { + MSG *msg = (MSG *)lParam; + lParam = MAKELPARAM(msg->message, msg->wParam); + } + wParam = (ULONG_PTR)GetMenu(hwnd); + goto log_it; + + case BM_SETCHECK: + case BM_GETCHECK: + lParam = (ULONG_PTR)GetMenu(hwnd); /* fall through */ +log_it: default: msg.hwnd = hwnd; msg.message = message; @@ -6670,32 +6689,34 @@ static void test_button_bm_get_set_image(void) ReleaseDC(0, hdc); } -#define ID_RADIO1 0x00e1 -#define ID_RADIO2 0x00e2 +#define ID_RADIO1 501 +#define ID_RADIO2 502 +#define ID_RADIO3 503 +#define ID_TEXT 504 -static const struct message auto_radio_button_WM_CLICK[] = +static const struct message auto_radio_button_BM_CLICK[] = { { BM_CLICK, sent|wparam|lparam, 0, 0 }, { WM_LBUTTONDOWN, sent|wparam|lparam|defwinproc, 0, 0 }, { EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 }, - { BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_CHECKED, 0 }, + { BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_CHECKED, ID_RADIO2 }, { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, { WM_LBUTTONUP, sent|wparam|lparam|defwinproc, 0, 0 }, - { BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_UNCHECKED, 0 }, + { BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_UNCHECKED, ID_RADIO2 }, { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, 0, 0 }, - { BM_SETCHECK, sent|wparam|lparam|defwinproc, BST_CHECKED, 0 }, - { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, 0, 0 }, - { BM_SETCHECK, sent|wparam|lparam|defwinproc, 0, 0 }, + { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_RADIO2, 0 }, + { BM_SETCHECK, sent|wparam|lparam|defwinproc, BST_CHECKED, ID_RADIO2 }, + { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_RADIO1, 0 }, + { BM_SETCHECK, sent|wparam|lparam|defwinproc, 0, ID_RADIO1 }, { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, 0, 0 }, - { BM_SETCHECK, sent|wparam|lparam|defwinproc, 0, 0 }, + { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_RADIO3, 0 }, + { BM_SETCHECK, sent|wparam|lparam|defwinproc, 0, ID_RADIO3 }, { WM_CTLCOLORSTATIC, sent|parent }, { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, 0, 0 }, + { WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_TEXT, 0 }, { EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 }, { WM_CAPTURECHANGED, sent|wparam|lparam|defwinproc, 0, 0 }, { WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_RADIO2, BN_CLICKED) }, @@ -6705,30 +6726,27 @@ static const struct message auto_radio_button_WM_CLICK[] = { 0 } }; -static void test_autoradio_messages(void) +static INT_PTR WINAPI radio_test_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { - HWND parent, radio1, radio2, radio3, child; + ParentMsgCheckProcA(hwnd, msg, wp, lp); + return 1; +} + +static void test_autoradio_BM_CLICK(void) +{ + HWND parent, radio1, radio2, radio3; RECT rc; MSG msg; DWORD ret; subclass_button(); - parent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE, - 100, 100, 200, 200, 0, 0, 0, NULL); + parent = CreateDialogParamA(0, "AUTORADIO_TEST_DIALOG_1", 0, radio_test_dlg_proc, 0); ok(parent != 0, "failed to create parent window\n"); - radio1 = CreateWindowExA(0, "my_button_class", "radio1", WS_VISIBLE | WS_CHILD | WS_GROUP | BS_AUTORADIOBUTTON | BS_NOTIFY, - 0, 0, 70, 18, parent, (HMENU)ID_RADIO1, 0, NULL); - ok(radio1 != 0, "failed to create child window\n"); - radio3 = CreateWindowExA(0, "my_button_class", "radio3", WS_VISIBLE | WS_CHILD | BS_RADIOBUTTON | BS_NOTIFY, - 0, 25, 70, 18, parent, (HMENU)-1, 0, NULL); - ok(radio3 != 0, "failed to create child window\n"); - child = CreateWindowExA(0, "my_button_class", "text", WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | BS_NOTIFY, - 0, 50, 70, 18, parent, (HMENU)-1, 0, NULL); - ok(child != 0, "failed to create child window\n"); - radio2 = CreateWindowExA(0, "my_button_class", "radio2", WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_NOTIFY, - 0, 75, 70, 18, parent, (HMENU)ID_RADIO2, 0, NULL); - ok(radio2 != 0, "failed to create child window\n"); + + radio1 = GetDlgItem(parent, ID_RADIO1); + radio2 = GetDlgItem(parent, ID_RADIO2); + radio3 = GetDlgItem(parent, ID_RADIO3); /* this avoids focus messages in the generated sequence */ SetFocus(radio2); @@ -6780,7 +6798,7 @@ static void test_autoradio_messages(void) SendMessageA(radio2, BM_CLICK, 0, 0); while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); - ok_sequence(auto_radio_button_WM_CLICK, "BM_CLICK on auto-radio button", FALSE); + ok_sequence(auto_radio_button_BM_CLICK, "BM_CLICK on auto-radio button", FALSE); log_all_parent_messages--; @@ -17254,7 +17272,7 @@ START_TEST(msg) test_mdi_messages(); test_button_messages(); test_button_bm_get_set_image(); - test_autoradio_messages(); + test_autoradio_BM_CLICK(); test_static_messages(); test_listbox_messages(); test_combobox_messages(); diff --git a/dlls/user32/tests/resource.rc b/dlls/user32/tests/resource.rc index a9e45e9..1557291 100644 --- a/dlls/user32/tests/resource.rc +++ b/dlls/user32/tests/resource.rc @@ -75,6 +75,17 @@ FONT 8, "MS Shell Dlg" PUSHBUTTON "Cancel", IDCANCEL,109,20,50,14, WS_TABSTOP | WS_GROUP } +AUTORADIO_TEST_DIALOG_1 DIALOGEX 0, 0, 200, 200 +STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | WS_VISIBLE +CAPTION "Radio Button Test Dialog" +FONT 8, "MS Shell Dlg" +{ + CONTROL "Radio1",501,"my_button_class",WS_VISIBLE | WS_CHILD | WS_GROUP | BS_AUTORADIOBUTTON | BS_NOTIFY | WS_TABSTOP,10,10,70,18 + CONTROL "Radio3",503,"my_button_class",WS_VISIBLE | WS_CHILD | BS_RADIOBUTTON | BS_NOTIFY | WS_TABSTOP,10,35,70,18 + CONTROL "Text",504,"my_button_class",WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | BS_NOTIFY | WS_TABSTOP,10,60,70,18 + CONTROL "Radio2",502,"my_button_class",WS_VISIBLE | WS_CHILD | BS_AUTORADIOBUTTON | BS_NOTIFY | WS_TABSTOP,10,85,70,18 +} + CLASS_TEST_DIALOG DIALOG 0, 0, 91, 28 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "CreateDialogParams Test"
1
0
0
0
Zebediah Figura : setupapi: Store the class and reference string keys in the device_iface structure.
by Alexandre Julliard
27 Nov '18
27 Nov '18
Module: wine Branch: master Commit: 72c5f3b57d1d71dae50a83182f767fe7586ee023 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=72c5f3b57d1d71dae50a8318…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Nov 26 19:26:43 2018 -0600 setupapi: Store the class and reference string keys in the device_iface structure. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/devinst.c | 62 ++++++++++++------------------------------------- 1 file changed, 15 insertions(+), 47 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 1f020b9..64c0413 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -93,6 +93,7 @@ static const WCHAR Phantom[] = {'P','h','a','n','t','o','m',0}; static const WCHAR SymbolicLink[] = {'S','y','m','b','o','l','i','c','L','i','n','k',0}; static const WCHAR Control[] = {'C','o','n','t','r','o','l',0}; static const WCHAR Linked[] = {'L','i','n','k','e','d',0}; +static const WCHAR emptyW[] = {0}; /* is used to identify if a DeviceInfoSet pointer is valid or not */ @@ -126,6 +127,8 @@ struct device_iface struct device *device; GUID class; DWORD flags; + HKEY class_key; + HKEY refstr_key; struct list entry; }; @@ -377,7 +380,7 @@ static struct device_iface *SETUPDI_CreateDeviceInterface(struct device *device, { struct device_iface *iface = NULL; WCHAR *refstr2 = NULL, *symlink = NULL, *path = NULL; - HKEY key = NULL; + HKEY key; LONG ret; TRACE("%p %s %s\n", device, debugstr_guid(class), debugstr_w(refstr)); @@ -422,9 +425,10 @@ static struct device_iface *SETUPDI_CreateDeviceInterface(struct device *device, } RegSetValueExW(key, DeviceInstance, 0, REG_SZ, (BYTE *)device->instanceId, lstrlenW(device->instanceId) * sizeof(WCHAR)); - RegCloseKey(key); heap_free(path); + iface->class_key = key; + if (!(path = get_refstr_key_path(iface))) { SetLastError(ERROR_OUTOFMEMORY); @@ -442,9 +446,10 @@ static struct device_iface *SETUPDI_CreateDeviceInterface(struct device *device, if (is_linked(key)) iface->flags |= SPINT_ACTIVE; - RegCloseKey(key); heap_free(path); + iface->refstr_key = key; + list_add_tail(&device->interfaces, &iface->entry); return iface; @@ -554,7 +559,6 @@ static BOOL SETUPDI_SetDeviceRegistryPropertyW(struct device *device, static void SETUPDI_RemoveDevice(struct device *device) { struct device_iface *iface, *next; - WCHAR *path; if (device->key != INVALID_HANDLE_VALUE) RegCloseKey(device->key); @@ -576,11 +580,10 @@ static void SETUPDI_RemoveDevice(struct device *device) struct device_iface, entry) { list_remove(&iface->entry); - if (device->phantom && (path = get_refstr_key_path(iface))) - { - RegDeleteKeyW(HKEY_LOCAL_MACHINE, path); - heap_free(path); - } + if (device->phantom) + RegDeleteKeyW(iface->refstr_key, emptyW); + RegCloseKey(iface->refstr_key); + RegCloseKey(iface->class_key); heap_free(iface->refstr); heap_free(iface->symlink); heap_free(iface); @@ -2486,8 +2489,7 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(HDEVINFO devinfo, HINF hinf, const WCHAR *section) { struct device_iface *iface; - HKEY refstr_key, params_key; - WCHAR *path; + HKEY params_key; LONG ret; TRACE("devinfo %p, iface_data %p, reserved %d, access %#x, hinf %p, section %s.\n", @@ -2501,24 +2503,8 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(HDEVINFO devinfo, return INVALID_HANDLE_VALUE; } - if (!(path = get_refstr_key_path(iface))) - { - SetLastError(ERROR_OUTOFMEMORY); - return INVALID_HANDLE_VALUE; - } - - ret = RegCreateKeyExW(HKEY_LOCAL_MACHINE, path, 0, NULL, 0, 0, NULL, - &refstr_key, NULL); - heap_free(path); - if (ret) - { - SetLastError(ret); - return INVALID_HANDLE_VALUE; - } - - ret = RegCreateKeyExW(refstr_key, DeviceParameters, 0, NULL, 0, access, + ret = RegCreateKeyExW(iface->refstr_key, DeviceParameters, 0, NULL, 0, access, NULL, ¶ms_key, NULL); - RegCloseKey(refstr_key); if (ret) { SetLastError(ret); @@ -2535,8 +2521,6 @@ BOOL WINAPI SetupDiDeleteDeviceInterfaceRegKey(HDEVINFO devinfo, SP_DEVICE_INTERFACE_DATA *iface_data, DWORD reserved) { struct device_iface *iface; - HKEY refstr_key; - WCHAR *path; LONG ret; TRACE("devinfo %p, iface_data %p, reserved %d.\n", devinfo, iface_data, reserved); @@ -2544,23 +2528,7 @@ BOOL WINAPI SetupDiDeleteDeviceInterfaceRegKey(HDEVINFO devinfo, if (!(iface = get_device_iface(devinfo, iface_data))) return FALSE; - if (!(path = get_refstr_key_path(iface))) - { - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; - } - - ret = RegCreateKeyExW(HKEY_LOCAL_MACHINE, path, 0, NULL, 0, 0, NULL, - &refstr_key, NULL); - heap_free(path); - if (ret) - { - SetLastError(ret); - return FALSE; - } - - ret = RegDeleteKeyW(refstr_key, DeviceParameters); - RegCloseKey(refstr_key); + ret = RegDeleteKeyW(iface->refstr_key, DeviceParameters); if (ret) { SetLastError(ret);
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
96
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
93
94
95
96
Results per page:
10
25
50
100
200