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
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2018
----- 2025 -----
June 2025
May 2025
April 2025
March 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
785 discussions
Start a n
N
ew thread
Alex Henrie : user32/tests: Drop broadcast test workaround for Windows NT4.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: 096deddb2ed7ff3233964018cab830eac43cec2b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=096deddb2ed7ff3233964018…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Mar 18 23:26:20 2018 -0600 user32/tests: Drop broadcast test workaround for Windows NT4. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/broadcast.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/dlls/user32/tests/broadcast.c b/dlls/user32/tests/broadcast.c index 5869119..afdb536 100644 --- a/dlls/user32/tests/broadcast.c +++ b/dlls/user32/tests/broadcast.c @@ -138,26 +138,21 @@ if (0) /* TODO: Check the hang flags */ SetLastError( 0xdeadbeef ); recips = BSM_APPLICATIONS; ret = broadcast( BSF_POSTMESSAGE|BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, 0 ); - if (ret) - { - ok(ret==1, "Returned: %d\n", ret); - ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n"); - PulseEvent(hevent); - - recips = BSM_APPLICATIONS; - ret = broadcast( BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY ); - ok(ret==1, "Returned: %d\n", ret); - ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); - PulseEvent(hevent); - - recips = BSM_APPLICATIONS; - ret = broadcast( BSF_SENDNOTIFYMESSAGE|BSF_QUERY, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY ); - ok(!ret, "Returned: %d\n", ret); - ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); - PulseEvent(hevent); - } - else /* BSF_SENDNOTIFYMESSAGE not supported on NT4 */ - ok( GetLastError() == ERROR_INVALID_PARAMETER, "failed with err %u\n", GetLastError() ); + ok(ret==1, "Returned: %d\n", ret); + ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n"); + PulseEvent(hevent); + + recips = BSM_APPLICATIONS; + ret = broadcast( BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY ); + ok(ret==1, "Returned: %d\n", ret); + ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); + PulseEvent(hevent); + + recips = BSM_APPLICATIONS; + ret = broadcast( BSF_SENDNOTIFYMESSAGE|BSF_QUERY, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY ); + ok(!ret, "Returned: %d\n", ret); + ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); + PulseEvent(hevent); recips = BSM_APPLICATIONS; ret = broadcast( 0, &recips, WM_NULL, 100, 0 );
1
0
0
0
Alistair Leslie-Hughes : avifil32: Register proxy interfaces.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: 168ca6ee7bcd1a64693bb86a79269ea911af0c94 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=168ca6ee7bcd1a64693bb86a…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Sat Mar 17 10:19:15 2018 +0000 avifil32: Register proxy interfaces. Based on a patch by Dmitry Timoshkov. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/avifil32/Makefile.in | 4 ++- dlls/avifil32/avifil32.idl | 78 ++++++++++++++++++++++++++++++++++++++++- dlls/avifil32/avifile_private.h | 1 + dlls/avifil32/factory.c | 8 ++++- 4 files changed, 88 insertions(+), 3 deletions(-) diff --git a/dlls/avifil32/Makefile.in b/dlls/avifil32/Makefile.in index 81d2ff8..4030514 100644 --- a/dlls/avifil32/Makefile.in +++ b/dlls/avifil32/Makefile.in @@ -1,6 +1,6 @@ MODULE = avifil32.dll IMPORTLIB = avifil32 -IMPORTS = uuid msacm32 msvfw32 winmm ole32 user32 advapi32 +IMPORTS = uuid msacm32 msvfw32 winmm ole32 user32 advapi32 rpcrt4 C_SRCS = \ acmstream.c \ @@ -17,3 +17,5 @@ C_SRCS = \ IDL_SRCS = avifil32.idl RC_SRCS = avifil32.rc + +dlldata_EXTRADEFS = -DENTRY_PREFIX=avifil32_ diff --git a/dlls/avifil32/avifil32.idl b/dlls/avifil32/avifil32.idl index 420cbb9..1e3f191 100644 --- a/dlls/avifil32/avifil32.idl +++ b/dlls/avifil32/avifil32.idl @@ -18,8 +18,84 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep proxy #pragma makedep register +import "wtypes.idl"; +import "unknwn.idl"; + +typedef struct _AVISTREAMINFOW +{ + DWORD fccType; + DWORD fccHandler; + DWORD dwFlags; + DWORD dwCaps; + WORD wPriority; + WORD wLanguage; + DWORD dwScale; + DWORD dwRate; + DWORD dwStart; + DWORD dwLength; + DWORD dwInitialFrames; + DWORD dwSuggestedBufferSize; + DWORD dwQuality; + DWORD dwSampleSize; + RECT rcFrame; + DWORD dwEditCount; + DWORD dwFormatChangeCount; + WCHAR szName[64]; +} AVISTREAMINFOW; + +[ + object, + uuid(00020021-0000-0000-c000-000000000046) +] +interface IAVIStream : IUnknown +{ + HRESULT Create(LPARAM lParam1, LPARAM lParam2); + HRESULT Info(AVISTREAMINFOW *psi, LONG lSize); + LONG FindSample(LONG lPos, LONG lFlags); + HRESULT ReadFormat(LONG lPos, [out,size_is(*lpcbFormat)] char *lpFormat, [in,out] LONG *lpcbFormat); + HRESULT SetFormat(LONG lPos, [in,size_is(cbFormat)] char *lpFormat, LONG cbFormat); + HRESULT Read(LONG lStart, LONG lSamples, [out,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer, LONG *plBytes, LONG *plSamples); + HRESULT Write(LONG lStart, LONG lSamples, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten); + HRESULT Delete(LONG lStart, LONG lSamples); + HRESULT ReadData(DWORD fcc, [out,size_is(*lpcbBuffer)] char *lpBuffer, [in,out] LONG *lpcbBuffer); + HRESULT WriteData(DWORD fcc, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer); + HRESULT SetInfo(AVISTREAMINFOW *plInfo, LONG cbInfo); +}; + +typedef struct _AVIFILEINFOW +{ + DWORD dwMaxBytesPerSec; + DWORD dwFlags; + DWORD dwCaps; + DWORD dwStreams; + DWORD dwSuggestedBufferSize; + DWORD dwWidth; + DWORD dwHeight; + DWORD dwScale; + DWORD dwRate; + DWORD dwLength; + DWORD dwEditCount; + WCHAR szFileType[64]; +} AVIFILEINFOW; + +[ + object, + uuid(00020020-0000-0000-c000-000000000046) +] +interface IAVIFile : IUnknown +{ + HRESULT Info(AVIFILEINFOW *pfi, LONG lSize); + HRESULT GetStream(IAVIStream **ppStream, DWORD fccType, LONG lParam); + HRESULT CreateStream(IAVIStream **ppStream, AVISTREAMINFOW *psi); + HRESULT WriteData(DWORD fcc, [in,size_is(cbBuffer)] char *lpBuffer, LONG cbBuffer); + HRESULT ReadData(DWORD fcc, [out,size_is(*lpcbBuffer)] char *lpBuffer, [in,out] LONG *lpcbBuffer); + HRESULT EndRecord(void); + HRESULT DeleteStream(DWORD fccType, LONG lParam); +}; + [ helpstring("Microsoft AVI Files"), threading(both), @@ -46,7 +122,7 @@ coclass WAVFile { interface IAVIFile; } threading(both), uuid(0002000d-0000-0000-c000-000000000046) ] -coclass AVIProxy { } +coclass PSFactoryBuffer { interface IFactoryBuffer; } [ helpstring("ACM Compressed Audio Stream"), diff --git a/dlls/avifil32/avifile_private.h b/dlls/avifil32/avifile_private.h index 16893d9..4bf11f4 100644 --- a/dlls/avifil32/avifile_private.h +++ b/dlls/avifil32/avifile_private.h @@ -66,5 +66,6 @@ extern PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pstream) DECLSPEC_HIDDEN; extern PAVIFILE AVIFILE_CreateAVITempFile(int nStreams, const PAVISTREAM *ppStreams) DECLSPEC_HIDDEN; extern LPCWSTR AVIFILE_BasenameW(LPCWSTR szFileName) DECLSPEC_HIDDEN; +extern HRESULT WINAPI avifil32_DllGetClassObject(REFCLSID pclsid, REFIID piid, LPVOID *ppv) DECLSPEC_HIDDEN; #endif diff --git a/dlls/avifil32/factory.c b/dlls/avifil32/factory.c index 98231e8..3775aa5 100644 --- a/dlls/avifil32/factory.c +++ b/dlls/avifil32/factory.c @@ -182,12 +182,18 @@ LPCWSTR AVIFILE_BasenameW(LPCWSTR szPath) */ HRESULT WINAPI DllGetClassObject(REFCLSID pclsid, REFIID piid, LPVOID *ppv) { + HRESULT hr; + TRACE("(%s,%s,%p)\n", debugstr_guid(pclsid), debugstr_guid(piid), ppv); if (pclsid == NULL || piid == NULL || ppv == NULL) return E_FAIL; - return AVIFILE_CreateClassFactory(pclsid,piid,ppv); + hr = AVIFILE_CreateClassFactory(pclsid,piid,ppv); + if (SUCCEEDED(hr)) + return hr; + + return avifil32_DllGetClassObject(pclsid,piid,ppv); } /*****************************************************************************
1
0
0
0
Dmitry Timoshkov : avifil32: Correct threading model on interfaces.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: 57a8a33a7cfdf9f52c03f6407a0831538a662cee URL:
https://source.winehq.org/git/wine.git/?a=commit;h=57a8a33a7cfdf9f52c03f640…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Sat Mar 17 10:19:14 2018 +0000 avifil32: Correct threading model on interfaces. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/avifil32/avifil32.idl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/avifil32/avifil32.idl b/dlls/avifil32/avifil32.idl index 1f50f15..420cbb9 100644 --- a/dlls/avifil32/avifil32.idl +++ b/dlls/avifil32/avifil32.idl @@ -22,35 +22,35 @@ [ helpstring("Microsoft AVI Files"), - threading(apartment), + threading(both), uuid(00020000-0000-0000-C000-000000000046) ] coclass AVIFile { interface IAVIFile; } [ helpstring("AVI Compressed Stream"), - threading(apartment), + threading(both), uuid(00020001-0000-0000-c000-000000000046) ] coclass ICMStream { interface IAVIStream; } [ helpstring("Microsoft Wave File"), - threading(apartment), + threading(both), uuid(00020003-0000-0000-c000-000000000046) ] coclass WAVFile { interface IAVIFile; } [ helpstring("IAVIStream & IAVIFile Proxy"), - threading(apartment), + threading(both), uuid(0002000d-0000-0000-c000-000000000046) ] coclass AVIProxy { } [ helpstring("ACM Compressed Audio Stream"), - threading(apartment), + threading(both), uuid(0002000f-0000-0000-c000-000000000046) ] coclass ACMStream { interface IAVIStream; }
1
0
0
0
Nikolay Sivov : user32: Add redirected class registration callback.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: 9b9f97e3f668c9d291b4f9fa2944ddb11509970f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9b9f97e3f668c9d291b4f9fa…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 20 10:44:01 2018 +0300 user32: Add redirected class registration callback. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/comctl32.spec | 1 + dlls/comctl32/commctrl.c | 42 ++++++++++++++++++++++++++++++------ dlls/user32/class.c | 52 ++++++++++++++++++++++++++++++++++++--------- dlls/user32/user_private.h | 3 ++- dlls/user32/win.c | 2 +- 5 files changed, 81 insertions(+), 19 deletions(-) diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec index 4e1aead..34d9e76 100644 --- a/dlls/comctl32/comctl32.spec +++ b/dlls/comctl32/comctl32.spec @@ -194,5 +194,6 @@ @ stdcall PropertySheet(ptr) PropertySheetA @ stdcall PropertySheetA(ptr) @ stdcall PropertySheetW(ptr) +@ stdcall RegisterClassNameW(wstr) @ stdcall UninitializeFlatSB(long) @ stdcall _TrackMouseEvent(ptr) diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 9356624..1117ec4 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -69,6 +69,7 @@ #include "shlwapi.h" #include "comctl32.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(commctrl); @@ -113,6 +114,40 @@ static void unregister_versioned_classes(void) #undef VERSION } +BOOL WINAPI RegisterClassNameW(const WCHAR *class) +{ + static const struct + { + const WCHAR nameW[16]; + void (*fn_register)(void); + } + classes[] = + { + { {'B','u','t','t','o','n',0}, BUTTON_Register }, + { {'C','o','m','b','o','B','o','x',0}, COMBO_Register }, + { {'C','o','m','b','o','L','B','o','x',0}, COMBOLBOX_Register }, + { {'E','d','i','t',0}, EDIT_Register }, + { {'L','i','s','t','B','o','x',0}, LISTBOX_Register }, + { {'S','t','a','t','i','c',0}, STATIC_Register }, + }; + + int min = 0, max = ARRAY_SIZE(classes) - 1; + + while (min <= max) + { + int res, pos = (min + max) / 2; + if (!(res = strcmpiW(class, classes[pos].nameW))) + { + classes[pos].fn_register(); + return TRUE; + } + if (res < 0) max = pos - 1; + else min = pos + 1; + } + + return FALSE; +} + /*********************************************************************** * DllMain [Internal] * @@ -172,13 +207,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) TREEVIEW_Register (); UPDOWN_Register (); - BUTTON_Register (); - COMBO_Register (); - COMBOLBOX_Register (); - EDIT_Register (); - LISTBOX_Register (); - STATIC_Register (); - /* subclass user32 controls */ THEMING_Initialize (); break; diff --git a/dlls/user32/class.c b/dlls/user32/class.c index e733cc2..a8b5a8f 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -320,7 +320,7 @@ static void CLASS_FreeClass( CLASS *classPtr ) USER_Unlock(); } -const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset ) +const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset, BOOL register_class ) { ACTCTX_SECTION_KEYED_DATA data; struct wndclass_redirect_data @@ -332,7 +332,8 @@ const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset ) ULONG module_len; ULONG module_offset; } *wndclass; - const WCHAR *module; + const WCHAR *module, *ret; + HMODULE hmod; if (basename_offset) *basename_offset = 0; @@ -352,10 +353,42 @@ const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset ) *basename_offset = wndclass->name_len / sizeof(WCHAR) - strlenW(name); module = (const WCHAR *)((BYTE *)data.lpSectionBase + wndclass->module_offset); - if (!GetModuleHandleW( module )) - LoadLibraryW( module ); + if (!(hmod = GetModuleHandleW( module ))) + hmod = LoadLibraryW( module ); - return (const WCHAR *)((BYTE *)wndclass + wndclass->name_offset); + ret = (const WCHAR *)((BYTE *)wndclass + wndclass->name_offset); + + if (register_class && hmod) + { + BOOL found = FALSE; + struct list *ptr; + + USER_Lock(); + + LIST_FOR_EACH( ptr, &class_list ) + { + CLASS *class = LIST_ENTRY( ptr, CLASS, entry ); + if (strcmpiW( class->name, ret )) continue; + if (!class->local || class->hInstance == hmod) + { + found = TRUE; + break; + } + } + + USER_Unlock(); + + if (!found) + { + BOOL (WINAPI *pRegisterClassNameW)(const WCHAR *class); + + pRegisterClassNameW = (void *)GetProcAddress(hmod, "RegisterClassNameW"); + if (pRegisterClassNameW) + pRegisterClassNameW(name); + } + } + + return ret; } /*********************************************************************** @@ -373,7 +406,7 @@ static CLASS *CLASS_FindClass( LPCWSTR name, HINSTANCE hinstance ) if (!name) return NULL; - name = CLASS_GetVersionedName( name, NULL ); + name = CLASS_GetVersionedName( name, NULL, TRUE ); for (;;) { @@ -409,7 +442,6 @@ static CLASS *CLASS_FindClass( LPCWSTR name, HINSTANCE hinstance ) return NULL; } - /*********************************************************************** * CLASS_RegisterClass * @@ -646,7 +678,7 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc ) { UINT basename_offset; if (!MultiByteToWideChar( CP_ACP, 0, wc->lpszClassName, -1, name, MAX_ATOM_LEN + 1 )) return 0; - classname = CLASS_GetVersionedName( name, &basename_offset ); + classname = CLASS_GetVersionedName( name, &basename_offset, FALSE ); classPtr = CLASS_RegisterClass( classname, basename_offset, instance, !(wc->style & CS_GLOBALCLASS), wc->style, wc->cbClsExtra, wc->cbWndExtra ); } @@ -700,7 +732,7 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc ) } if (!(instance = wc->hInstance)) instance = GetModuleHandleW( NULL ); - classname = CLASS_GetVersionedName( wc->lpszClassName, &basename_offset ); + classname = CLASS_GetVersionedName( wc->lpszClassName, &basename_offset, FALSE ); if (!(classPtr = CLASS_RegisterClass( classname, basename_offset, instance, !(wc->style & CS_GLOBALCLASS), wc->style, wc->cbClsExtra, wc->cbWndExtra ))) return 0; @@ -753,7 +785,7 @@ BOOL WINAPI UnregisterClassW( LPCWSTR className, HINSTANCE hInstance ) GetDesktopWindow(); /* create the desktop window to trigger builtin class registration */ - className = CLASS_GetVersionedName( className, NULL ); + className = CLASS_GetVersionedName( className, NULL, FALSE ); SERVER_START_REQ( destroy_class ) { req->instance = wine_server_client_ptr( hInstance ); diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index f1cc0a8..7e4f699 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -269,7 +269,8 @@ extern INT_PTR WINPROC_CallDlgProcW( DLGPROC func, HWND hwnd, UINT msg, WPARAM w extern BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *result, BOOL unicode, enum wm_char_mapping mapping ) DECLSPEC_HIDDEN; -extern const WCHAR *CLASS_GetVersionedName(const WCHAR *classname, UINT *basename_offset) DECLSPEC_HIDDEN; +extern const WCHAR *CLASS_GetVersionedName(const WCHAR *classname, UINT *basename_offset, + BOOL register_class) DECLSPEC_HIDDEN; /* message spy definitions */ diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 8c89768..3c497f8 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -1344,7 +1344,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, CBT_CREATEWNDW cbtc; CREATESTRUCTW cbcs; - className = CLASS_GetVersionedName(className, NULL); + className = CLASS_GetVersionedName(className, NULL, TRUE); TRACE("%s %s%s%s ex=%08x style=%08x %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n", unicode ? debugstr_w(cs->lpszName) : debugstr_a((LPCSTR)cs->lpszName),
1
0
0
0
Nikolay Sivov : comdlg32: Remove most of Combo macros.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: fe572072c3bf55814e7bb6edcff5a3701b600d00 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fe572072c3bf55814e7bb6ed…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 20 10:37:51 2018 +0300 comdlg32: Remove most of Combo macros. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/filedlg.c | 85 ++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 54 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index e721c08..a882f80 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -131,40 +131,9 @@ typedef struct tagLookInInfo */ /* Combo box macros */ -#define CBAddString(hwnd,str) \ - SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)(str)); - -#define CBInsertString(hwnd,str,pos) \ - SendMessageW(hwnd, CB_INSERTSTRING, (WPARAM)(pos), (LPARAM)(str)); - -#define CBDeleteString(hwnd,pos) \ - SendMessageW(hwnd, CB_DELETESTRING, (WPARAM)(pos), 0); - -#define CBSetItemDataPtr(hwnd,iItemId,dataPtr) \ - SendMessageW(hwnd, CB_SETITEMDATA, (WPARAM)(iItemId), (LPARAM)(dataPtr)); - #define CBGetItemDataPtr(hwnd,iItemId) \ SendMessageW(hwnd, CB_GETITEMDATA, (WPARAM)(iItemId), 0) -#define CBGetLBText(hwnd,iItemId,str) \ - SendMessageW(hwnd, CB_GETLBTEXT, (WPARAM)(iItemId), (LPARAM)(str)); - -#define CBGetCurSel(hwnd) \ - SendMessageW(hwnd, CB_GETCURSEL, 0, 0); - -#define CBSetCurSel(hwnd,pos) \ - SendMessageW(hwnd, CB_SETCURSEL, (WPARAM)(pos), 0); - -#define CBGetCount(hwnd) \ - SendMessageW(hwnd, CB_GETCOUNT, 0, 0); -#define CBShowDropDown(hwnd,show) \ - SendMessageW(hwnd, CB_SHOWDROPDOWN, (WPARAM)(show), 0); -#define CBSetItemHeight(hwnd,index,height) \ - SendMessageW(hwnd, CB_SETITEMHEIGHT, (WPARAM)(index), (LPARAM)(height)); - -#define CBSetExtendedUI(hwnd,flag) \ - SendMessageW(hwnd, CB_SETEXTENDEDUI, (WPARAM)(flag), 0) - static const char LookInInfosStr[] = "LookInInfos"; /* LOOKIN combo box property */ static SIZE MemDialogSize = { 0, 0}; /* keep size of the (resizable) dialog */ @@ -2575,7 +2544,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) /* set the filter cb to the extension when possible */ if(-1 < (iPos = FILEDLG95_FILETYPE_SearchExt(fodInfos->DlgInfos.hwndFileTypeCB, lpszTemp))) - CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, iPos); + SendMessageW(fodInfos->DlgInfos.hwndFileTypeCB, CB_SETCURSEL, iPos, 0); } /* fall through */ case ONOPEN_BROWSE: /* browse to the highest folder we could bind to */ @@ -3004,8 +2973,9 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) lstrcpyW(lpstrExt,lpstrPos); /* Add the item at the end of the combo */ - CBAddString(fodInfos->DlgInfos.hwndFileTypeCB, fodInfos->customfilter); - CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters, lpstrExt); + SendMessageW(fodInfos->DlgInfos.hwndFileTypeCB, CB_ADDSTRING, 0, (LPARAM)fodInfos->customfilter); + SendMessageW(fodInfos->DlgInfos.hwndFileTypeCB, CB_SETITEMDATA, nFilters, (LPARAM)lpstrExt); + nFilters++; } if(fodInfos->filter) @@ -3026,7 +2996,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) lpstrDisplay = lpstrPos; lpstrPos += lstrlenW(lpstrPos) + 1; - CBAddString(fodInfos->DlgInfos.hwndFileTypeCB, lpstrDisplay); + SendMessageW(fodInfos->DlgInfos.hwndFileTypeCB, CB_ADDSTRING, 0, (LPARAM)lpstrDisplay); nFilters++; @@ -3036,7 +3006,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) lpstrPos += lstrlenW(lpstrPos) + 1; /* Add the item at the end of the combo */ - CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters-1, lpstrExt); + SendMessageW(fodInfos->DlgInfos.hwndFileTypeCB, CB_SETITEMDATA, nFilters - 1, (LPARAM)lpstrExt); /* malformed filters are added anyway... */ if (!*lpstrExt) break; @@ -3066,7 +3036,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) nFilterIndexCB--; /* Set the current index selection. */ - CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, nFilterIndexCB); + SendMessageW(fodInfos->DlgInfos.hwndFileTypeCB, CB_SETCURSEL, nFilterIndexCB, 0); /* Get the corresponding text string from the combo box. */ lpstrFilter = (LPWSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, @@ -3105,7 +3075,7 @@ static BOOL FILEDLG95_FILETYPE_OnCommand(HWND hwnd, WORD wNotifyCode) LPWSTR lpstrFilter; /* Get the current item of the filetype combo box */ - int iItem = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB); + int iItem = SendMessageW(fodInfos->DlgInfos.hwndFileTypeCB, CB_GETCURSEL, 0, 0); /* set the current filter index */ fodInfos->ofnInfos->nFilterIndex = iItem + @@ -3141,7 +3111,9 @@ static BOOL FILEDLG95_FILETYPE_OnCommand(HWND hwnd, WORD wNotifyCode) */ static int FILEDLG95_FILETYPE_SearchExt(HWND hwnd,LPCWSTR lpstrExt) { - int i, iCount = CBGetCount(hwnd); + int i, iCount; + + iCount = SendMessageW(hwnd, CB_GETCOUNT, 0, 0); TRACE("%s\n", debugstr_w(lpstrExt)); @@ -3165,7 +3137,9 @@ static void FILEDLG95_FILETYPE_Clean(HWND hwnd) { FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwnd); int iPos; - int iCount = CBGetCount(fodInfos->DlgInfos.hwndFileTypeCB); + int iCount; + + iCount = SendMessageW(fodInfos->DlgInfos.hwndFileTypeCB, CB_GETCOUNT, 0, 0); TRACE("\n"); @@ -3175,7 +3149,7 @@ static void FILEDLG95_FILETYPE_Clean(HWND hwnd) for(iPos = iCount-1;iPos>=0;iPos--) { heap_free((void *)CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,iPos)); - CBDeleteString(fodInfos->DlgInfos.hwndFileTypeCB,iPos); + SendMessageW(fodInfos->DlgInfos.hwndFileTypeCB, CB_DELETESTRING, iPos, 0); } } /* Current filter */ @@ -3229,11 +3203,11 @@ static void FILEDLG95_LOOKIN_Init(HWND hwndCombo) ReleaseDC( hwndCombo, hdc ); /* set item height for both text field and listbox */ - CBSetItemHeight( hwndCombo, -1, max( tm.tmHeight, GetSystemMetrics(SM_CYSMICON) )); - CBSetItemHeight( hwndCombo, 0, max( tm.tmHeight, GetSystemMetrics(SM_CYSMICON) )); + SendMessageW(hwndCombo, CB_SETITEMHEIGHT, -1, max(tm.tmHeight, GetSystemMetrics(SM_CYSMICON))); + SendMessageW(hwndCombo, CB_SETITEMHEIGHT, 0, max(tm.tmHeight, GetSystemMetrics(SM_CYSMICON))); /* Turn on the extended UI for the combo box like Windows does */ - CBSetExtendedUI(hwndCombo, TRUE); + SendMessageW(hwndCombo, CB_SETEXTENDEDUI, TRUE, 0); /* Initialise data of Desktop folder */ SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp); @@ -3399,7 +3373,7 @@ static BOOL FILEDLG95_LOOKIN_OnCommand(HWND hwnd, WORD wNotifyCode) LPSFOLDER tmpFolder; int iItem; - iItem = CBGetCurSel(fodInfos->DlgInfos.hwndLookInCB); + iItem = SendMessageW(fodInfos->DlgInfos.hwndLookInCB, CB_GETCURSEL, 0, 0); if( iItem == CB_ERR) return FALSE; @@ -3477,15 +3451,15 @@ static int FILEDLG95_LOOKIN_AddItem(HWND hwnd,LPITEMIDLIST pidl, int iInsertId) /* Add the item at the end of the list */ if(iInsertId < 0) { - iItemID = CBAddString(hwnd,sfi.szDisplayName); + iItemID = SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)sfi.szDisplayName); } /* Insert the item at the iInsertId position*/ else { - iItemID = CBInsertString(hwnd,sfi.szDisplayName,iInsertId); + iItemID = SendMessageW(hwnd, CB_INSERTSTRING, iInsertId, (LPARAM)sfi.szDisplayName); } - CBSetItemDataPtr(hwnd,iItemID,tmpFolder); + SendMessageW(hwnd, CB_SETITEMDATA, iItemID, (LPARAM)tmpFolder); return iItemID; } @@ -3561,7 +3535,7 @@ int FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl) } } - CBSetCurSel(hwnd,iItemPos); + SendMessageW(hwnd, CB_SETCURSEL, iItemPos, 0); liInfos->uSelectedItem = iItemPos; return 0; @@ -3588,7 +3562,7 @@ static int FILEDLG95_LOOKIN_RemoveMostExpandedItem(HWND hwnd) SFOLDER *tmpFolder = (LPSFOLDER) CBGetItemDataPtr(hwnd,iItemPos); COMDLG32_SHFree(tmpFolder->pidlItem); heap_free(tmpFolder); - CBDeleteString(hwnd,iItemPos); + SendMessageW(hwnd, CB_DELETESTRING, iItemPos, 0); liInfos->iMaxIndentation--; return iItemPos; @@ -3606,7 +3580,9 @@ static int FILEDLG95_LOOKIN_RemoveMostExpandedItem(HWND hwnd) static int FILEDLG95_LOOKIN_SearchItem(HWND hwnd,WPARAM searchArg,int iSearchMethod) { int i = 0; - int iCount = CBGetCount(hwnd); + int iCount; + + iCount = SendMessageW(hwnd, CB_GETCOUNT, 0, 0); TRACE("0x%08lx 0x%x\n",searchArg, iSearchMethod); @@ -3635,8 +3611,9 @@ static void FILEDLG95_LOOKIN_Clean(HWND hwnd) { FileOpenDlgInfos *fodInfos = get_filedlg_infoptr(hwnd); LookInInfos *liInfos = GetPropA(fodInfos->DlgInfos.hwndLookInCB,LookInInfosStr); - int iPos; - int iCount = CBGetCount(fodInfos->DlgInfos.hwndLookInCB); + int iPos, iCount; + + iCount = SendMessageW(fodInfos->DlgInfos.hwndLookInCB, CB_GETCOUNT, 0, 0); TRACE("\n"); @@ -3648,7 +3625,7 @@ static void FILEDLG95_LOOKIN_Clean(HWND hwnd) SFOLDER *tmpFolder = (LPSFOLDER) CBGetItemDataPtr(fodInfos->DlgInfos.hwndLookInCB,iPos); COMDLG32_SHFree(tmpFolder->pidlItem); heap_free(tmpFolder); - CBDeleteString(fodInfos->DlgInfos.hwndLookInCB,iPos); + SendMessageW(fodInfos->DlgInfos.hwndLookInCB, CB_DELETESTRING, iPos, 0); } }
1
0
0
0
Nikolay Sivov : comdlg32: Add a helper to test if file dialog hook is enabled.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: 2118ce0fa9785ce301370738b12b8f38a23ca86b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2118ce0fa9785ce301370738…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 20 10:37:50 2018 +0300 comdlg32: Add a helper to test if file dialog hook is enabled. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/filedlg.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 81eaeca..e721c08 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -84,8 +84,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\ OFN_NOTESTFILECREATE /*| OFN_USEMONIKERS*/) -#define IsHooked(fodInfos) \ - ((fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos->lpfnHook) /*********************************************************************** * Data structure and global variables */ @@ -184,6 +182,11 @@ FileOpenDlgInfos *get_filedlg_infoptr(HWND hwnd) return GetPropW(hwnd, filedlg_info_propnameW); } +static BOOL is_dialog_hooked(const FileOpenDlgInfos *info) +{ + return (info->ofnInfos->Flags & OFN_ENABLEHOOK) && info->ofnInfos->lpfnHook; +} + /*********************************************************************** * Prototypes */ @@ -307,7 +310,7 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos) } /* old style hook messages */ - if (IsHooked(fodInfos)) + if (is_dialog_hooked(fodInfos)) { fodInfos->HookMsg.fileokstring = RegisterWindowMessageW(FILEOKSTRINGW); fodInfos->HookMsg.lbselchstring = RegisterWindowMessageW(LBSELCHSTRINGW); @@ -824,15 +827,15 @@ static HWND CreateTemplateDialog(FileOpenDlgInfos *fodInfos, HWND hwnd) } if (fodInfos->unicode) hChildDlg = CreateDialogIndirectParamW(hinst, template, hwnd, - IsHooked(fodInfos) ? (DLGPROC)fodInfos->ofnInfos->lpfnHook : FileOpenDlgProcUserTemplate, + is_dialog_hooked(fodInfos) ? (DLGPROC)fodInfos->ofnInfos->lpfnHook : FileOpenDlgProcUserTemplate, (LPARAM)fodInfos->ofnInfos); else hChildDlg = CreateDialogIndirectParamA(hinst, template, hwnd, - IsHooked(fodInfos) ? (DLGPROC)fodInfos->ofnInfos->lpfnHook : FileOpenDlgProcUserTemplate, + is_dialog_hooked(fodInfos) ? (DLGPROC)fodInfos->ofnInfos->lpfnHook : FileOpenDlgProcUserTemplate, (LPARAM)fodInfos->ofnInfos); return hChildDlg; } - else if( IsHooked(fodInfos)) + else if (is_dialog_hooked(fodInfos)) { RECT rectHwnd; struct { @@ -2014,7 +2017,7 @@ static LRESULT FILEDLG95_OnWMGetIShellBrowser(HWND hwnd) static BOOL FILEDLG95_SendFileOK( HWND hwnd, FileOpenDlgInfos *fodInfos ) { /* ask the hook if we can close */ - if(IsHooked(fodInfos)) + if (is_dialog_hooked(fodInfos)) { LRESULT retval = 0;
1
0
0
0
Nikolay Sivov : comdlg32: Use ARRAY_SIZE macro.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: 7514475c1cd23f72889e5620a88b09252eca8d3f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7514475c1cd23f72889e5620…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 20 10:37:49 2018 +0300 comdlg32: Use ARRAY_SIZE macro. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/cdlg.h | 2 ++ dlls/comdlg32/colordlg.c | 2 +- dlls/comdlg32/filedlg31.c | 11 +++++------ dlls/comdlg32/filedlgbrowser.c | 4 ++-- dlls/comdlg32/fontdlg.c | 20 ++++++++++---------- dlls/comdlg32/itemdlg.c | 6 +++--- dlls/comdlg32/printdlg.c | 26 +++++++++++++------------- 7 files changed, 36 insertions(+), 35 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=7514475c1cd23f72889e…
1
0
0
0
Nikolay Sivov : comdlg32: Detach file dialog data after child windows were destroyed.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: b8d1e929e7d9d847b898c05e95112be12292adf7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b8d1e929e7d9d847b898c05e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 20 10:37:48 2018 +0300 comdlg32: Detach file dialog data after child windows were destroyed. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/filedlg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index fa9ecfb..81eaeca 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -1331,9 +1331,13 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l SendDlgItemMessageW(hwnd, IDC_TOOLBARPLACES, TB_SETIMAGELIST, 0, 0); ImageList_Destroy(himl); } - RemovePropW(hwnd, filedlg_info_propnameW); return FALSE; } + + case WM_NCDESTROY: + RemovePropW(hwnd, filedlg_info_propnameW); + return 0; + case WM_NOTIFY: { LPNMHDR lpnmh = (LPNMHDR)lParam;
1
0
0
0
Nikolay Sivov : comdlg32: Use memory allocation helpers.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: 38898e939c77853499035c5a5afc5833b05eb4d9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=38898e939c77853499035c5a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Mar 20 10:37:47 2018 +0300 comdlg32: Use memory allocation helpers. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/cdlg32.c | 22 ++++---- dlls/comdlg32/colordlg.c | 17 +++--- dlls/comdlg32/filedlg.c | 140 ++++++++++++++++++++-------------------------- dlls/comdlg32/filedlg31.c | 55 +++++++++--------- dlls/comdlg32/finddlg.c | 5 +- dlls/comdlg32/fontdlg.c | 13 +++-- 6 files changed, 122 insertions(+), 130 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=38898e939c7785349903…
1
0
0
0
Owen Rudge : wsdapi: Store discovered namespaces and write xmlns attributes for them.
by Alexandre Julliard
20 Mar '18
20 Mar '18
Module: wine Branch: master Commit: 402fce157901e0c51bf109a2c4b98632b3f74e58 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=402fce157901e0c51bf109a2…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Mon Mar 19 21:46:38 2018 +0000 wsdapi: Store discovered namespaces and write xmlns attributes for them. Signed-off-by: Owen Rudge <orudge(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wsdapi/soap.c | 67 +++++++++++++++++++++++++++++++++++++++++-- dlls/wsdapi/tests/discovery.c | 8 ++++-- dlls/wsdapi/wsdapi_internal.h | 4 +++ dlls/wsdapi/xml.c | 2 +- 4 files changed, 74 insertions(+), 7 deletions(-) diff --git a/dlls/wsdapi/soap.c b/dlls/wsdapi/soap.c index abea33c..40edd15 100644 --- a/dlls/wsdapi/soap.c +++ b/dlls/wsdapi/soap.c @@ -71,6 +71,13 @@ static const WCHAR relatesToString[] = { 'R','e','l','a','t','e','s','T','o', 0 static const WCHAR appSequenceString[] = { 'A','p','p','S','e','q','u','e','n','c','e', 0 }; static const WCHAR emptyString[] = { 0 }; +struct discovered_namespace +{ + struct list entry; + LPCWSTR prefix; + LPCWSTR uri; +}; + static char *wide_to_utf8(LPCWSTR wide_string, int *length) { char *new_string = NULL; @@ -252,6 +259,31 @@ static void populate_soap_header(WSD_SOAP_HEADER *header, LPCWSTR to, LPCWSTR ac /* TODO: Implement RelatesTo, ReplyTo, From, FaultTo */ } +static BOOL add_discovered_namespace(struct list *namespaces, WSDXML_NAMESPACE *discovered_ns) +{ + struct discovered_namespace *ns; + + LIST_FOR_EACH_ENTRY(ns, namespaces, struct discovered_namespace, entry) + { + if (lstrcmpW(ns->uri, discovered_ns->Uri) == 0) + return TRUE; /* Already added */ + } + + ns = WSDAllocateLinkedMemory(namespaces, sizeof(struct discovered_namespace)); + + if (ns == NULL) + return FALSE; + + ns->prefix = duplicate_string(ns, discovered_ns->PreferredPrefix); + ns->uri = duplicate_string(ns, discovered_ns->Uri); + + if ((ns->prefix == NULL) || (ns->uri == NULL)) + return FALSE; + + list_add_tail(namespaces, &ns->entry); + return TRUE; +} + static WSDXML_ELEMENT *create_soap_header_xml_elements(IWSDXMLContext *xml_context, WSD_SOAP_HEADER *header) { WSDXML_ELEMENT *header_element = NULL, *app_sequence_element = NULL; @@ -309,9 +341,10 @@ cleanup: static HRESULT create_soap_envelope(IWSDXMLContext *xml_context, WSD_SOAP_HEADER *header, WSDXML_ELEMENT *body_element, WS_HEAP **heap, char **output_xml, ULONG *xml_length, struct list *discovered_namespaces) { - WS_XML_STRING *actual_envelope_prefix = NULL, *envelope_uri_xmlstr = NULL; + WS_XML_STRING *actual_envelope_prefix = NULL, *envelope_uri_xmlstr = NULL, *tmp_prefix = NULL, *tmp_uri = NULL; WSDXML_NAMESPACE *addressing_ns = NULL, *discovery_ns = NULL, *envelope_ns = NULL; WSDXML_ELEMENT *header_element = NULL; + struct discovered_namespace *ns; WS_XML_BUFFER *buffer = NULL; WS_XML_WRITER *writer = NULL; WS_XML_STRING envelope; @@ -320,10 +353,13 @@ static HRESULT create_soap_envelope(IWSDXMLContext *xml_context, WSD_SOAP_HEADER /* Create the necessary XML prefixes */ if (FAILED(IWSDXMLContext_AddNamespace(xml_context, addressingNsUri, addressingPrefix, &addressing_ns))) goto cleanup; + if (!add_discovered_namespace(discovered_namespaces, addressing_ns)) goto cleanup; if (FAILED(IWSDXMLContext_AddNamespace(xml_context, discoveryNsUri, discoveryPrefix, &discovery_ns))) goto cleanup; + if (!add_discovered_namespace(discovered_namespaces, discovery_ns)) goto cleanup; if (FAILED(IWSDXMLContext_AddNamespace(xml_context, envelopeNsUri, envelopePrefix, &envelope_ns))) goto cleanup; + if (!add_discovered_namespace(discovered_namespaces, envelope_ns)) goto cleanup; envelope.bytes = envelopeString; envelope.length = sizeof(envelopeString) - 1; @@ -356,6 +392,23 @@ static HRESULT create_soap_envelope(IWSDXMLContext *xml_context, WSD_SOAP_HEADER ret = WsWriteStartElement(writer, actual_envelope_prefix, &envelope, envelope_uri_xmlstr, NULL); if (FAILED(ret)) goto cleanup; + LIST_FOR_EACH_ENTRY(ns, discovered_namespaces, struct discovered_namespace, entry) + { + tmp_prefix = populate_xml_string(ns->prefix); + tmp_uri = populate_xml_string(ns->uri); + + if ((tmp_prefix == NULL) || (tmp_uri == NULL)) goto cleanup; + + ret = WsWriteXmlnsAttribute(writer, tmp_prefix, tmp_uri, FALSE, NULL); + if (FAILED(ret)) goto cleanup; + + free_xml_string(tmp_prefix); + free_xml_string(tmp_uri); + } + + tmp_prefix = NULL; + tmp_uri = NULL; + /* Write the header */ if (!write_xml_element(header_element, writer)) goto cleanup; @@ -401,7 +454,7 @@ static HRESULT write_and_send_message(IWSDiscoveryPublisherImpl *impl, WSD_SOAP_ char *full_xml; HRESULT ret; - ret = create_soap_envelope(impl->xmlContext, header, NULL, &heap, &xml, &xml_length, NULL); + ret = create_soap_envelope(impl->xmlContext, header, NULL, &heap, &xml, &xml_length, discovered_namespaces); if (ret != S_OK) return ret; /* Prefix the XML header */ @@ -439,6 +492,7 @@ HRESULT send_hello_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR id, ULONGLON const WSD_URI_LIST *xaddrs_list, const WSDXML_ELEMENT *hdr_any, const WSDXML_ELEMENT *ref_param_any, const WSDXML_ELEMENT *endpoint_ref_any, const WSDXML_ELEMENT *any) { + struct list *discoveredNamespaces = NULL; WSD_SOAP_HEADER soapHeader; WSD_APP_SEQUENCE sequence; WCHAR message_id[64]; @@ -450,13 +504,20 @@ HRESULT send_hello_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR id, ULONGLON if (!create_guid(message_id)) goto cleanup; + discoveredNamespaces = WSDAllocateLinkedMemory(NULL, sizeof(struct list)); + if (!discoveredNamespaces) goto cleanup; + + list_init(discoveredNamespaces); + populate_soap_header(&soapHeader, discoveryTo, actionHello, message_id, &sequence, hdr_any); /* TODO: Populate message body */ /* Write and send the message */ - ret = write_and_send_message(impl, &soapHeader, NULL, NULL, NULL, APP_MAX_DELAY); + ret = write_and_send_message(impl, &soapHeader, NULL, discoveredNamespaces, NULL, APP_MAX_DELAY); cleanup: + WSDFreeLinkedMemory(discoveredNamespaces); + return ret; } diff --git a/dlls/wsdapi/tests/discovery.c b/dlls/wsdapi/tests/discovery.c index d81dcdc..563c33c 100644 --- a/dlls/wsdapi/tests/discovery.c +++ b/dlls/wsdapi/tests/discovery.c @@ -506,6 +506,7 @@ static void Publish_tests(void) messageStorage *msgStorage; WSADATA wsaData; BOOL messageOK; + BOOL hello_message_seen = FALSE; int ret, i; HRESULT rc; ULONG ref; @@ -595,8 +596,8 @@ static void Publish_tests(void) msg = msgStorage->messages[i]; messageOK = FALSE; - messageOK = (strstr(msg, "<wsa:Action>
http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello
</wsa:Action>") != NULL); - messageOK = messageOK && (strstr(msg, endpointReferenceString) != NULL); + hello_message_seen = (strstr(msg, "<wsa:Action>
http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello
</wsa:Action>") != NULL); + messageOK = hello_message_seen && (strstr(msg, endpointReferenceString) != NULL); messageOK = messageOK && (strstr(msg, "<wsd:AppSequence InstanceId=\"1\" MessageNumber=\"1\"></wsd:AppSequence>") != NULL); messageOK = messageOK && (strstr(msg, "<wsd:MetadataVersion>1</wsd:MetadataVersion>") != NULL); @@ -610,7 +611,8 @@ static void Publish_tests(void) heap_free(msgStorage); - todo_wine ok(messageOK == TRUE, "Hello message not received\n"); + ok(hello_message_seen == TRUE, "Hello message not received\n"); + todo_wine ok(messageOK == TRUE, "Hello message metadata not received\n"); after_publish_test: diff --git a/dlls/wsdapi/wsdapi_internal.h b/dlls/wsdapi/wsdapi_internal.h index 417eed9..47dde6b 100644 --- a/dlls/wsdapi/wsdapi_internal.h +++ b/dlls/wsdapi/wsdapi_internal.h @@ -62,4 +62,8 @@ HRESULT send_hello_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR id, ULONGLON const WSD_URI_LIST *xaddrs_list, const WSDXML_ELEMENT *hdr_any, const WSDXML_ELEMENT *ref_param_any, const WSDXML_ELEMENT *endpoint_ref_any, const WSDXML_ELEMENT *any); +/* xml.c */ + +LPWSTR duplicate_string(void *parentMemoryBlock, LPCWSTR value); + #endif diff --git a/dlls/wsdapi/xml.c b/dlls/wsdapi/xml.c index 4d6319c..fc02d8b 100644 --- a/dlls/wsdapi/xml.c +++ b/dlls/wsdapi/xml.c @@ -27,7 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wsdapi); -static LPWSTR duplicate_string(void *parentMemoryBlock, LPCWSTR value) +LPWSTR duplicate_string(void *parentMemoryBlock, LPCWSTR value) { int valueLen; LPWSTR dup;
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
79
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
Results per page:
10
25
50
100
200