ReactOS.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
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
List overview
Download
Ros-diffs
March 2018
----- 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
ros-diffs@reactos.org
25 participants
436 discussions
Start a n
N
ew thread
01/01: [MSI] fix some defines CORE-14501
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8aff426af021eb18acaf3…
commit 8aff426af021eb18acaf387a9ec1ce24a1c07518 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat Mar 24 18:38:01 2018 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sat Mar 24 18:55:57 2018 +0100 [MSI] fix some defines CORE-14501 --- dll/win32/msi/suminfo.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dll/win32/msi/suminfo.c b/dll/win32/msi/suminfo.c index c929fa574f..5312de9a85 100644 --- a/dll/win32/msi/suminfo.c +++ b/dll/win32/msi/suminfo.c @@ -104,11 +104,21 @@ static void MSI_CloseSummaryInfo( MSIOBJECTHDR *arg ) IStorage_Release( si->storage ); } +#ifdef __REACTOS__ +#define PID_DICTIONARY_MSI 0 +#define PID_CODEPAGE_MSI 1 +#define PID_SECURITY_MSI 19 +#endif + static UINT get_type( UINT uiProperty ) { switch( uiProperty ) { +#ifdef __REACTOS__ + case PID_CODEPAGE_MSI: +#else case PID_CODEPAGE: +#endif return VT_I2; case PID_SUBJECT: @@ -129,7 +139,11 @@ static UINT get_type( UINT uiProperty ) case PID_WORDCOUNT: case PID_CHARCOUNT: +#ifdef __REACTOS__ + case PID_SECURITY_MSI: +#else case PID_SECURITY: +#endif case PID_PAGECOUNT: return VT_I4; } @@ -940,10 +954,18 @@ static UINT parse_prop( LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value, *pid = atoiW( prop ); switch (*pid) { +#ifdef __REACTOS__ + case PID_CODEPAGE_MSI: +#else case PID_CODEPAGE: +#endif case PID_WORDCOUNT: case PID_CHARCOUNT: +#ifdef __REACTOS__ + case PID_SECURITY_MSI: +#else case PID_SECURITY: +#endif case PID_PAGECOUNT: *int_value = atoiW( value ); break;
6 years, 9 months
1
0
0
0
01/01: [WMVCORE] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6b5e74cbab6b88c28cb9c…
commit 6b5e74cbab6b88c28cb9cf2b2aea8ea047e05d4c Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Mar 24 13:22:32 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Mar 24 13:22:32 2018 +0100 [WMVCORE] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/wmvcore/CMakeLists.txt | 2 +- dll/win32/wmvcore/{wmvcore.h => version.rc} | 26 ++++++++------------------ dll/win32/wmvcore/wmvcore.h | 10 ---------- dll/win32/wmvcore/wmvcore_main.c | 1 + dll/win32/wmvcore/writer.c | 1 + media/doc/README.WINE | 2 +- 6 files changed, 12 insertions(+), 30 deletions(-) diff --git a/dll/win32/wmvcore/CMakeLists.txt b/dll/win32/wmvcore/CMakeLists.txt index 094ded5ecb..d22c8c42b7 100644 --- a/dll/win32/wmvcore/CMakeLists.txt +++ b/dll/win32/wmvcore/CMakeLists.txt @@ -9,7 +9,7 @@ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/wmvcore_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/wmvcore.def) -add_library(wmvcore SHARED ${SOURCE}) +add_library(wmvcore SHARED ${SOURCE} version.rc) set_module_type(wmvcore win32dll) target_link_libraries(wmvcore wine) add_importlibs(wmvcore msvcrt kernel32 ntdll) diff --git a/dll/win32/wmvcore/wmvcore.h b/dll/win32/wmvcore/version.rc similarity index 66% copy from dll/win32/wmvcore/wmvcore.h copy to dll/win32/wmvcore/version.rc index ca06e0a4a6..445a399099 100644 --- a/dll/win32/wmvcore/wmvcore.h +++ b/dll/win32/wmvcore/version.rc @@ -1,5 +1,5 @@ /* - * Copyright 2015 Jacek Caban for CodeWeavers + * Copyright 2017 Louis Lenders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,21 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <stdarg.h> +#define WINE_FILEDESCRIPTION_STR "Wine Media Playback dll" +#define WINE_FILENAME_STR "wmvcore.dll" +#define WINE_FILEVERSION 12,0,7601,17514 +#define WINE_FILEVERSION_STR "12.0.7601.17514" +#define WINE_PRODUCTVERSION 12,0,7601,17514 +#define WINE_PRODUCTVERSION_STR "12.0.7601.17514" -#define COBJMACROS - -#define EXTERN_GUID DEFINE_GUID - -#include "windef.h" -#include "winbase.h" - -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) -{ - return HeapAlloc(GetProcessHeap(), 0, size); -} - -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} +#include "wine/wine_common_ver.rc" diff --git a/dll/win32/wmvcore/wmvcore.h b/dll/win32/wmvcore/wmvcore.h index ca06e0a4a6..e17547052d 100644 --- a/dll/win32/wmvcore/wmvcore.h +++ b/dll/win32/wmvcore/wmvcore.h @@ -24,13 +24,3 @@ #include "windef.h" #include "winbase.h" - -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) -{ - return HeapAlloc(GetProcessHeap(), 0, size); -} - -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} diff --git a/dll/win32/wmvcore/wmvcore_main.c b/dll/win32/wmvcore/wmvcore_main.c index ae8b486532..1b452884f1 100644 --- a/dll/win32/wmvcore/wmvcore_main.c +++ b/dll/win32/wmvcore/wmvcore_main.c @@ -21,6 +21,7 @@ #include "initguid.h" #include "wmsdk.h" #include "wine/debug.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); diff --git a/dll/win32/wmvcore/writer.c b/dll/win32/wmvcore/writer.c index c1c30be895..717984db1a 100644 --- a/dll/win32/wmvcore/writer.c +++ b/dll/win32/wmvcore/writer.c @@ -20,6 +20,7 @@ #include "wmsdkidl.h" #include "wine/debug.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index a91fb1aaca..650765d74f 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -210,7 +210,7 @@ reactos/dll/win32/wintrust # Synced to WineStaging-3.3 reactos/dll/win32/wldap32 # Synced to WineStaging-3.3 reactos/dll/win32/wmi # Synced to WineStaging-2.9 reactos/dll/win32/wmiutils # Synced to WineStaging-3.3 -reactos/dll/win32/wmvcore # Synced to Wine-3.0 +reactos/dll/win32/wmvcore # Synced to WineStaging-3.3 reactos/dll/win32/wshom.ocx # Synced to Wine-3.0 reactos/dll/win32/wtsapi32 # Synced to Wine-3.0 reactos/dll/win32/wuapi # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
01/01: [WMIUTILS] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f6c122569e0c477936de8…
commit f6c122569e0c477936de8dff4fafa37fcf8566fd Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Mar 24 13:21:41 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Mar 24 13:21:41 2018 +0100 [WMIUTILS] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/wmiutils/wmiutils_private.h | 21 +-------------------- media/doc/README.WINE | 2 +- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/dll/win32/wmiutils/wmiutils_private.h b/dll/win32/wmiutils/wmiutils_private.h index 6782bd85cc..6195f2133d 100644 --- a/dll/win32/wmiutils/wmiutils_private.h +++ b/dll/win32/wmiutils/wmiutils_private.h @@ -16,31 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "wine/heap.h" #include "wine/unicode.h" HRESULT WbemPath_create(LPVOID *) DECLSPEC_HIDDEN; HRESULT WbemStatusCodeText_create(LPVOID *) DECLSPEC_HIDDEN; -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) -{ - return HeapAlloc(GetProcessHeap(), 0, size); -} - -static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size) -{ - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); -} - -static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t size) -{ - return HeapReAlloc(GetProcessHeap(), 0, mem, size); -} - -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} - static inline WCHAR *strdupW( const WCHAR *src ) { WCHAR *dst; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 81a0f38d33..a91fb1aaca 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -209,7 +209,7 @@ reactos/dll/win32/winscard # Synced to WineStaging-3.3 reactos/dll/win32/wintrust # Synced to WineStaging-3.3 reactos/dll/win32/wldap32 # Synced to WineStaging-3.3 reactos/dll/win32/wmi # Synced to WineStaging-2.9 -reactos/dll/win32/wmiutils # Synced to WineStaging-2.9 +reactos/dll/win32/wmiutils # Synced to WineStaging-3.3 reactos/dll/win32/wmvcore # Synced to Wine-3.0 reactos/dll/win32/wshom.ocx # Synced to Wine-3.0 reactos/dll/win32/wtsapi32 # Synced to Wine-3.0
6 years, 9 months
1
0
0
0
01/01: [WLDAP32] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e6368408c2ca4204ee77f…
commit e6368408c2ca4204ee77f36725b6b729605c7954 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Mar 24 13:20:30 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Mar 24 13:20:30 2018 +0100 [WLDAP32] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/wldap32/CMakeLists.txt | 4 +- dll/win32/wldap32/add.c | 16 ++++ dll/win32/wldap32/ber.c | 11 +-- dll/win32/wldap32/bind.c | 16 ++++ dll/win32/wldap32/compare.c | 16 ++++ dll/win32/wldap32/control.c | 19 +++- dll/win32/wldap32/delete.c | 16 ++++ dll/win32/wldap32/dn.c | 16 ++++ dll/win32/wldap32/error.c | 17 +++- dll/win32/wldap32/extended.c | 16 ++++ dll/win32/wldap32/init.c | 36 +++++--- dll/win32/wldap32/main.c | 10 +- dll/win32/wldap32/misc.c | 17 +++- dll/win32/wldap32/modify.c | 16 ++++ dll/win32/wldap32/modrdn.c | 16 ++++ dll/win32/wldap32/option.c | 16 ++++ dll/win32/wldap32/page.c | 25 +++-- dll/win32/wldap32/parse.c | 16 ++++ dll/win32/wldap32/precomp.h | 25 +++++ dll/win32/wldap32/rename.c | 16 ++++ dll/win32/wldap32/search.c | 16 ++++ dll/win32/wldap32/value.c | 26 ++++-- dll/win32/wldap32/winldap_private.h | 26 +----- dll/win32/wldap32/wldap32.h | 177 ++++++++++++++---------------------- dll/win32/wldap32/wldap32.rc | 2 +- media/doc/README.WINE | 2 +- 26 files changed, 415 insertions(+), 174 deletions(-) diff --git a/dll/win32/wldap32/CMakeLists.txt b/dll/win32/wldap32/CMakeLists.txt index 0b7ef75c52..2f1375099f 100644 --- a/dll/win32/wldap32/CMakeLists.txt +++ b/dll/win32/wldap32/CMakeLists.txt @@ -23,7 +23,7 @@ list(APPEND SOURCE rename.c search.c value.c - winldap_private.h + precomp.h ${CMAKE_CURRENT_BINARY_DIR}/wldap32_stubs.c) add_library(wldap32 SHARED @@ -35,5 +35,5 @@ add_library(wldap32 SHARED set_module_type(wldap32 win32dll) target_link_libraries(wldap32 wine) add_importlibs(wldap32 user32 msvcrt kernel32 ntdll) -add_pch(wldap32 winldap_private.h SOURCE) +add_pch(wldap32 precomp.h SOURCE) add_cd_file(TARGET wldap32 DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wldap32/add.c b/dll/win32/wldap32/add.c index 34bc186fe9..0a24d95f32 100644 --- a/dll/win32/wldap32/add.c +++ b/dll/win32/wldap32/add.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); #ifdef HAVE_LDAP static LDAPMod *nullattrs[] = { NULL }; diff --git a/dll/win32/wldap32/ber.c b/dll/win32/wldap32/ber.c index 6687fe11ed..c2c6f26949 100644 --- a/dll/win32/wldap32/ber.c +++ b/dll/win32/wldap32/ber.c @@ -18,15 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <config.h> +#include "config.h" #include <stdarg.h> +#include "windef.h" +#include "winbase.h" +#include "winldap.h" +#include "wine/debug.h" -#include <windef.h> -#include <winbase.h> -#include <winldap.h> - -#include <wine/debug.h> WINE_DEFAULT_DEBUG_CHANNEL(wldap32); #ifndef LBER_ERROR diff --git a/dll/win32/wldap32/bind.c b/dll/win32/wldap32/bind.c index 057661b7fd..0e9404ec50 100644 --- a/dll/win32/wldap32/bind.c +++ b/dll/win32/wldap32/bind.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_bindA (WLDAP32.@) diff --git a/dll/win32/wldap32/compare.c b/dll/win32/wldap32/compare.c index c7df577c6d..7cadc2a970 100644 --- a/dll/win32/wldap32/compare.c +++ b/dll/win32/wldap32/compare.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_compareA (WLDAP32.@) diff --git a/dll/win32/wldap32/control.c b/dll/win32/wldap32/control.c index dfe7986302..c661f5e901 100644 --- a/dll/win32/wldap32/control.c +++ b/dll/win32/wldap32/control.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_control_freeA (WLDAP32.@) @@ -260,8 +276,7 @@ INT CDECL ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, static inline void bv_val_dup( const struct WLDAP32_berval *src, struct WLDAP32_berval *dst ) { - dst->bv_val = HeapAlloc( GetProcessHeap(), 0, src->bv_len ); - if (dst->bv_val) + if ((dst->bv_val = heap_alloc( src->bv_len ))) { memcpy( dst->bv_val, src->bv_val, src->bv_len ); dst->bv_len = src->bv_len; diff --git a/dll/win32/wldap32/delete.c b/dll/win32/wldap32/delete.c index 2665455e55..47e1cb4f2c 100644 --- a/dll/win32/wldap32/delete.c +++ b/dll/win32/wldap32/delete.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_deleteA (WLDAP32.@) diff --git a/dll/win32/wldap32/dn.c b/dll/win32/wldap32/dn.c index 49b766d9c7..fbe1a0c091 100644 --- a/dll/win32/wldap32/dn.c +++ b/dll/win32/wldap32/dn.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_dn2ufnA (WLDAP32.@) diff --git a/dll/win32/wldap32/error.c b/dll/win32/wldap32/error.c index 39b0a64869..2e09e9e399 100644 --- a/dll/win32/wldap32/error.c +++ b/dll/win32/wldap32/error.c @@ -18,9 +18,24 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" -#include <winuser.h> +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ULONG map_error( int error ) { diff --git a/dll/win32/wldap32/extended.c b/dll/win32/wldap32/extended.c index 839d17118d..b05c3c5f1a 100644 --- a/dll/win32/wldap32/extended.c +++ b/dll/win32/wldap32/extended.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_close_extended_op (WLDAP32.@) diff --git a/dll/win32/wldap32/init.c b/dll/win32/wldap32/init.c index 7b3e467ec8..fdb79084b5 100644 --- a/dll/win32/wldap32/init.c +++ b/dll/win32/wldap32/init.c @@ -18,7 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdio.h> +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" #ifdef HAVE_LDAP /* Should eventually be determined by the algorithm documented on MSDN. */ @@ -47,10 +62,9 @@ static char **split_hostnames( const char *hostnames ) p++; } - res = HeapAlloc( GetProcessHeap(), 0, (i + 1) * sizeof(char *) ); - if (!res) + if (!(res = heap_alloc( (i + 1) * sizeof(char *) ))) { - HeapFree( GetProcessHeap(), 0, str ); + heap_free( str ); return NULL; } @@ -59,7 +73,7 @@ static char **split_hostnames( const char *hostnames ) q = p; i = 0; - + while (*p) { if (p[1] != '\0') @@ -70,7 +84,7 @@ static char **split_hostnames( const char *hostnames ) res[i] = strdupU( q ); if (!res[i]) goto oom; i++; - + while (isspace( *p )) p++; q = p; } @@ -85,14 +99,14 @@ static char **split_hostnames( const char *hostnames ) } res[i] = NULL; - HeapFree( GetProcessHeap(), 0, str ); + heap_free( str ); return res; oom: while (i > 0) strfreeU( res[--i] ); - HeapFree( GetProcessHeap(), 0, res ); - HeapFree( GetProcessHeap(), 0, str ); + heap_free( res ); + heap_free( str ); return NULL; } @@ -139,9 +153,7 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum } size += (i - 1) * strlen( sep ); - - res = HeapAlloc( GetProcessHeap(), 0, size + 1 ); - if (!res) return NULL; + if (!(res = heap_alloc( size + 1 ))) return NULL; p = res; for (v = hostnames; *v; v++) @@ -189,6 +201,8 @@ static char *urlify_hostnames( const char *scheme, char *hostnames, ULONG port ) } #endif +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); + #ifdef HAVE_LDAP static LDAP *create_context( const char *url ) { diff --git a/dll/win32/wldap32/main.c b/dll/win32/wldap32/main.c index ccd2a9b181..ce9e60367b 100644 --- a/dll/win32/wldap32/main.c +++ b/dll/win32/wldap32/main.c @@ -18,10 +18,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "winldap_private.h" +#include "config.h" + +#include "wine/debug.h" +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" HINSTANCE hwldap32; +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); + BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { TRACE( "(%p, %d, %p)\n", hinst, reason, reserved ); diff --git a/dll/win32/wldap32/misc.c b/dll/win32/wldap32/misc.c index fb998b76c0..9c421f9470 100644 --- a/dll/win32/wldap32/misc.c +++ b/dll/win32/wldap32/misc.c @@ -18,9 +18,24 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "winldap_private.h" +#include "config.h" +#include "wine/port.h" +#include <stdarg.h> #include <stdio.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + +#include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_abandon (WLDAP32.@) diff --git a/dll/win32/wldap32/modify.c b/dll/win32/wldap32/modify.c index 060ce59f61..292fa831a8 100644 --- a/dll/win32/wldap32/modify.c +++ b/dll/win32/wldap32/modify.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); #ifdef HAVE_LDAP static LDAPMod *nullmods[] = { NULL }; diff --git a/dll/win32/wldap32/modrdn.c b/dll/win32/wldap32/modrdn.c index 5daebd22be..3e2c867956 100644 --- a/dll/win32/wldap32/modrdn.c +++ b/dll/win32/wldap32/modrdn.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_modrdnA (WLDAP32.@) diff --git a/dll/win32/wldap32/option.c b/dll/win32/wldap32/option.c index 65caa75f56..ddc5ca4933 100644 --- a/dll/win32/wldap32/option.c +++ b/dll/win32/wldap32/option.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_get_optionA (WLDAP32.@) diff --git a/dll/win32/wldap32/page.c b/dll/win32/wldap32/page.c index fe92f8f938..7cf7d93245 100644 --- a/dll/win32/wldap32/page.c +++ b/dll/win32/wldap32/page.c @@ -18,12 +18,27 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "winldap_private.h" +#include "config.h" +#include "wine/port.h" +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif #ifndef LDAP_MAXINT #define LDAP_MAXINT 2147483647 #endif +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + +#include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); + /*********************************************************************** * ldap_create_page_controlA (WLDAP32.@) * @@ -84,17 +99,15 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie, return WLDAP32_LDAP_NO_MEMORY; /* copy the berval so it can be properly freed by the caller */ - val = HeapAlloc( GetProcessHeap(), 0, berval->bv_len ); - if (!val) return WLDAP32_LDAP_NO_MEMORY; + if (!(val = heap_alloc( berval->bv_len ))) return WLDAP32_LDAP_NO_MEMORY; len = berval->bv_len; memcpy( val, berval->bv_val, len ); ber_bvfree( berval ); - ctrl = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) ); - if (!ctrl) + if (!(ctrl = heap_alloc( sizeof(LDAPControlW) ))) { - HeapFree( GetProcessHeap(), 0, val ); + heap_free( val ); return WLDAP32_LDAP_NO_MEMORY; } diff --git a/dll/win32/wldap32/parse.c b/dll/win32/wldap32/parse.c index 4594b2a04e..62ffdbab0d 100644 --- a/dll/win32/wldap32/parse.c +++ b/dll/win32/wldap32/parse.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_parse_extended_resultA (WLDAP32.@) diff --git a/dll/win32/wldap32/precomp.h b/dll/win32/wldap32/precomp.h new file mode 100644 index 0000000000..5729a396f0 --- /dev/null +++ b/dll/win32/wldap32/precomp.h @@ -0,0 +1,25 @@ + +#ifndef _WINLDAP_PRECOMP_H_ +#define _WINLDAP_PRECOMP_H_ + +#include <wine/config.h> + +#include <stdarg.h> + +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#include <windef.h> +#include <winbase.h> + +#include <wine/debug.h> + +#include "winldap_private.h" +#include "wldap32.h" + +#endif /* !_WINLDAP_PRECOMP_H_ */ diff --git a/dll/win32/wldap32/rename.c b/dll/win32/wldap32/rename.c index cb25373664..2de50818b7 100644 --- a/dll/win32/wldap32/rename.c +++ b/dll/win32/wldap32/rename.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_rename_extA (WLDAP32.@) diff --git a/dll/win32/wldap32/search.c b/dll/win32/wldap32/search.c index 7680ac7b3c..7e774f6894 100644 --- a/dll/win32/wldap32/search.c +++ b/dll/win32/wldap32/search.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_searchA (WLDAP32.@) diff --git a/dll/win32/wldap32/value.c b/dll/win32/wldap32/value.c index 0a8a23e633..bcfa9a2f6b 100644 --- a/dll/win32/wldap32/value.c +++ b/dll/win32/wldap32/value.c @@ -18,7 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + +#include <stdarg.h> +#ifdef HAVE_LDAP_H +#include <ldap.h> +#endif + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" + #include "winldap_private.h" +#include "wldap32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wldap32); /*********************************************************************** * ldap_count_values_len (WLDAP32.@) @@ -140,8 +156,7 @@ static char *bv2str( struct berval *bv ) char *str = NULL; unsigned int len = bv->bv_len; - str = HeapAlloc( GetProcessHeap(), 0, len + 1 ); - if (str) + if ((str = heap_alloc( len + 1 ))) { memcpy( str, bv->bv_val, len ); str[len] = '\0'; @@ -160,8 +175,7 @@ static char **bv2str_array( struct berval **bv ) len++; p++; } - str = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(char *) ); - if (!str) return NULL; + if (!(str = heap_alloc( (len + 1) * sizeof(char *) ))) return NULL; p = bv; while (*p) @@ -169,8 +183,8 @@ static char **bv2str_array( struct berval **bv ) str[i] = bv2str( *p ); if (!str[i]) { - while (i > 0) HeapFree( GetProcessHeap(), 0, str[--i] ); - HeapFree( GetProcessHeap(), 0, str ); + while (i > 0) heap_free( str[--i] ); + heap_free( str ); return NULL; } i++; diff --git a/dll/win32/wldap32/winldap_private.h b/dll/win32/wldap32/winldap_private.h index 2da5611653..c0039eb0fd 100644 --- a/dll/win32/wldap32/winldap_private.h +++ b/dll/win32/wldap32/winldap_private.h @@ -22,29 +22,7 @@ * native headers. */ -#ifndef _WINLDAP_PRIVATE_H_ -#define _WINLDAP_PRIVATE_H_ - -#include <wine/config.h> - -#include <stdarg.h> - -#ifdef HAVE_LDAP_H -#include <ldap.h> -#endif - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#include <windef.h> -#include <winbase.h> -#include <winnls.h> - -#include <wine/debug.h> -WINE_DEFAULT_DEBUG_CHANNEL(wldap32); - -#include "wldap32.h" +#pragma once typedef enum { WLDAP32_LDAP_SUCCESS = 0x00, @@ -480,5 +458,3 @@ ULONG CDECL LdapGetLastError(void); ULONG CDECL LdapMapErrorToWin32(ULONG); int CDECL LdapUnicodeToUTF8(LPCWSTR,int,LPSTR,int); int CDECL LdapUTF8ToUnicode(LPCSTR,int,LPWSTR,int); - -#endif /* _WINLDAP_PRIVATE_H_ */ diff --git a/dll/win32/wldap32/wldap32.h b/dll/win32/wldap32/wldap32.h index 5a58fe8583..4b80b83ece 100644 --- a/dll/win32/wldap32/wldap32.h +++ b/dll/win32/wldap32/wldap32.h @@ -20,7 +20,8 @@ #pragma once -#include <wine/unicode.h> +#include "wine/heap.h" +#include "wine/unicode.h" extern HINSTANCE hwldap32 DECLSPEC_HIDDEN; @@ -33,22 +34,16 @@ ULONG map_error( int ) DECLSPEC_HIDDEN; static inline char *strdupU( const char *src ) { char *dst; - if (!src) return NULL; - dst = HeapAlloc( GetProcessHeap(), 0, (strlen( src ) + 1) * sizeof(char) ); - if (dst) - strcpy( dst, src ); + if ((dst = heap_alloc( (strlen( src ) + 1) * sizeof(char) ))) strcpy( dst, src ); return dst; } static inline WCHAR *strdupW( const WCHAR *src ) { WCHAR *dst; - if (!src) return NULL; - dst = HeapAlloc( GetProcessHeap(), 0, (strlenW( src ) + 1) * sizeof(WCHAR) ); - if (dst) - strcpyW( dst, src ); + if ((dst = heap_alloc( (strlenW( src ) + 1) * sizeof(WCHAR) ))) strcpyW( dst, src ); return dst; } @@ -58,7 +53,7 @@ static inline LPWSTR strAtoW( LPCSTR str ) if (str) { DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); - if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) + if ((ret = heap_alloc( len * sizeof(WCHAR) ))) MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len ); } return ret; @@ -70,7 +65,7 @@ static inline LPSTR strWtoA( LPCWSTR str ) if (str) { DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL ); - if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) + if ((ret = heap_alloc( len ))) WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL ); } return ret; @@ -82,7 +77,7 @@ static inline char *strWtoU( LPCWSTR str ) if (str) { DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL ); - if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) + if ((ret = heap_alloc( len ))) WideCharToMultiByte( CP_UTF8, 0, str, -1, ret, len, NULL, NULL ); } return ret; @@ -94,7 +89,7 @@ static inline LPWSTR strUtoW( char *str ) if (str) { DWORD len = MultiByteToWideChar( CP_UTF8, 0, str, -1, NULL, 0 ); - if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) + if ((ret = heap_alloc( len * sizeof(WCHAR) ))) MultiByteToWideChar( CP_UTF8, 0, str, -1, ret, len ); } return ret; @@ -102,17 +97,17 @@ static inline LPWSTR strUtoW( char *str ) static inline void strfreeA( LPSTR str ) { - HeapFree( GetProcessHeap(), 0, str ); + heap_free( str ); } static inline void strfreeW( LPWSTR str ) { - HeapFree( GetProcessHeap(), 0, str ); + heap_free( str ); } static inline void strfreeU( char *str ) { - HeapFree( GetProcessHeap(), 0, str ); + heap_free( str ); } static inline DWORD strarraylenA( LPSTR *strarray ) @@ -144,9 +139,7 @@ static inline LPWSTR *strarrayAtoW( LPSTR *strarray ) if (strarray) { size = sizeof(WCHAR*) * (strarraylenA( strarray ) + 1); - strarrayW = HeapAlloc( GetProcessHeap(), 0, size ); - - if (strarrayW) + if ((strarrayW = heap_alloc( size ))) { LPSTR *p = strarray; LPWSTR *q = strarrayW; @@ -166,9 +159,7 @@ static inline LPSTR *strarrayWtoA( LPWSTR *strarray ) if (strarray) { size = sizeof(LPSTR) * (strarraylenW( strarray ) + 1); - strarrayA = HeapAlloc( GetProcessHeap(), 0, size ); - - if (strarrayA) + if ((strarrayA = heap_alloc( size ))) { LPWSTR *p = strarray; LPSTR *q = strarrayA; @@ -188,9 +179,7 @@ static inline char **strarrayWtoU( LPWSTR *strarray ) if (strarray) { size = sizeof(char*) * (strarraylenW( strarray ) + 1); - strarrayU = HeapAlloc( GetProcessHeap(), 0, size ); - - if (strarrayU) + if ((strarrayU = heap_alloc( size ))) { LPWSTR *p = strarray; char **q = strarrayU; @@ -210,9 +199,7 @@ static inline LPWSTR *strarrayUtoW( char **strarray ) if (strarray) { size = sizeof(WCHAR*) * (strarraylenU( strarray ) + 1); - strarrayW = HeapAlloc( GetProcessHeap(), 0, size ); - - if (strarrayW) + if ((strarrayW = heap_alloc( size ))) { char **p = strarray; LPWSTR *q = strarrayW; @@ -230,7 +217,7 @@ static inline void strarrayfreeA( LPSTR *strarray ) { LPSTR *p = strarray; while (*p) strfreeA( *p++ ); - HeapFree( GetProcessHeap(), 0, strarray ); + heap_free( strarray ); } } @@ -240,7 +227,7 @@ static inline void strarrayfreeW( LPWSTR *strarray ) { LPWSTR *p = strarray; while (*p) strfreeW( *p++ ); - HeapFree( GetProcessHeap(), 0, strarray ); + heap_free( strarray ); } } @@ -250,7 +237,7 @@ static inline void strarrayfreeU( char **strarray ) { char **p = strarray; while (*p) strfreeU( *p++ ); - HeapFree( GetProcessHeap(), 0, strarray ); + heap_free( strarray ); } } @@ -261,8 +248,7 @@ static inline struct berval *bvdup( struct berval *bv ) struct berval *berval; DWORD size = sizeof(struct berval) + bv->bv_len; - berval = HeapAlloc( GetProcessHeap(), 0, size ); - if (berval) + if ((berval = heap_alloc( size ))) { char *val = (char *)berval + sizeof(struct berval); @@ -288,9 +274,7 @@ static inline struct berval **bvarraydup( struct berval **bv ) if (bv) { size = sizeof(struct berval *) * (bvarraylen( bv ) + 1); - berval = HeapAlloc( GetProcessHeap(), 0, size ); - - if (berval) + if ((berval = heap_alloc( size ))) { struct berval **p = bv; struct berval **q = berval; @@ -305,16 +289,15 @@ static inline struct berval **bvarraydup( struct berval **bv ) static inline void bvarrayfree( struct berval **bv ) { struct berval **p = bv; - while (*p) HeapFree( GetProcessHeap(), 0, *p++ ); - HeapFree( GetProcessHeap(), 0, bv ); + while (*p) heap_free( *p++ ); + heap_free( bv ); } static inline LDAPModW *modAtoW( LDAPModA *mod ) { LDAPModW *modW; - modW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPModW) ); - if (modW) + if ((modW = heap_alloc( sizeof(LDAPModW) ))) { modW->mod_op = mod->mod_op; modW->mod_type = strAtoW( mod->mod_type ); @@ -331,8 +314,7 @@ static inline LDAPMod *modWtoU( LDAPModW *mod ) { LDAPMod *modU; - modU = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPMod) ); - if (modU) + if ((modU = heap_alloc( sizeof(LDAPMod) ))) { modU->mod_op = mod->mod_op; modU->mod_type = strWtoU( mod->mod_type ); @@ -351,7 +333,7 @@ static inline void modfreeW( LDAPModW *mod ) bvarrayfree( mod->mod_vals.modv_bvals ); else strarrayfreeW( mod->mod_vals.modv_strvals ); - HeapFree( GetProcessHeap(), 0, mod ); + heap_free( mod ); } static inline void modfreeU( LDAPMod *mod ) @@ -360,7 +342,7 @@ static inline void modfreeU( LDAPMod *mod ) bvarrayfree( mod->mod_vals.modv_bvals ); else strarrayfreeU( mod->mod_vals.modv_strvals ); - HeapFree( GetProcessHeap(), 0, mod ); + heap_free( mod ); } static inline DWORD modarraylenA( LDAPModA **modarray ) @@ -385,9 +367,7 @@ static inline LDAPModW **modarrayAtoW( LDAPModA **modarray ) if (modarray) { size = sizeof(LDAPModW*) * (modarraylenA( modarray ) + 1); - modarrayW = HeapAlloc( GetProcessHeap(), 0, size ); - - if (modarrayW) + if ((modarrayW = heap_alloc( size ))) { LDAPModA **p = modarray; LDAPModW **q = modarrayW; @@ -407,9 +387,7 @@ static inline LDAPMod **modarrayWtoU( LDAPModW **modarray ) if (modarray) { size = sizeof(LDAPMod*) * (modarraylenW( modarray ) + 1); - modarrayU = HeapAlloc( GetProcessHeap(), 0, size ); - - if (modarrayU) + if ((modarrayU = heap_alloc( size ))) { LDAPModW **p = modarray; LDAPMod **q = modarrayU; @@ -427,7 +405,7 @@ static inline void modarrayfreeW( LDAPModW **modarray ) { LDAPModW **p = modarray; while (*p) modfreeW( *p++ ); - HeapFree( GetProcessHeap(), 0, modarray ); + heap_free( modarray ); } } @@ -437,7 +415,7 @@ static inline void modarrayfreeU( LDAPMod **modarray ) { LDAPMod **p = modarray; while (*p) modfreeU( *p++ ); - HeapFree( GetProcessHeap(), 0, modarray ); + heap_free( modarray ); } } @@ -449,15 +427,13 @@ static inline LDAPControlW *controlAtoW( LDAPControlA *control ) if (control->ldctl_value.bv_val) { - val = HeapAlloc( GetProcessHeap(), 0, len ); - if (!val) return NULL; + if (!(val = heap_alloc( len ))) return NULL; memcpy( val, control->ldctl_value.bv_val, len ); } - controlW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) ); - if (!controlW) + if (!(controlW = heap_alloc( sizeof(LDAPControlW) ))) { - HeapFree( GetProcessHeap(), 0, val ); + heap_free( val ); return NULL; } @@ -477,15 +453,13 @@ static inline LDAPControlA *controlWtoA( LDAPControlW *control ) if (control->ldctl_value.bv_val) { - val = HeapAlloc( GetProcessHeap(), 0, len ); - if (!val) return NULL; + if (!(val = heap_alloc( len ))) return NULL; memcpy( val, control->ldctl_value.bv_val, len ); } - controlA = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlA) ); - if (!controlA) + if (!(controlA = heap_alloc( sizeof(LDAPControlA) ))) { - HeapFree( GetProcessHeap(), 0, val ); + heap_free( val ); return NULL; } @@ -505,15 +479,13 @@ static inline LDAPControl *controlWtoU( LDAPControlW *control ) if (control->ldctl_value.bv_val) { - val = HeapAlloc( GetProcessHeap(), 0, len ); - if (!val) return NULL; + if (!(val = heap_alloc( len ))) return NULL; memcpy( val, control->ldctl_value.bv_val, len ); } - controlU = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControl) ); - if (!controlU) + if (!(controlU = heap_alloc( sizeof(LDAPControl) ))) { - HeapFree( GetProcessHeap(), 0, val ); + heap_free( val ); return NULL; } @@ -533,15 +505,13 @@ static inline LDAPControlW *controlUtoW( LDAPControl *control ) if (control->ldctl_value.bv_val) { - val = HeapAlloc( GetProcessHeap(), 0, len ); - if (!val) return NULL; + if (!(val = heap_alloc( len ))) return NULL; memcpy( val, control->ldctl_value.bv_val, len ); } - controlW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPControlW) ); - if (!controlW) + if (!(controlW = heap_alloc( sizeof(LDAPControlW) ))) { - HeapFree( GetProcessHeap(), 0, val ); + heap_free( val ); return NULL; } @@ -549,7 +519,7 @@ static inline LDAPControlW *controlUtoW( LDAPControl *control ) controlW->ldctl_value.bv_len = len; controlW->ldctl_value.bv_val = val; controlW->ldctl_iscritical = control->ldctl_iscritical; - + return controlW; } @@ -558,8 +528,8 @@ static inline void controlfreeA( LDAPControlA *control ) if (control) { strfreeA( control->ldctl_oid ); - HeapFree( GetProcessHeap(), 0, control->ldctl_value.bv_val ); - HeapFree( GetProcessHeap(), 0, control ); + heap_free( control->ldctl_value.bv_val ); + heap_free( control ); } } @@ -568,8 +538,8 @@ static inline void controlfreeW( LDAPControlW *control ) if (control) { strfreeW( control->ldctl_oid ); - HeapFree( GetProcessHeap(), 0, control->ldctl_value.bv_val ); - HeapFree( GetProcessHeap(), 0, control ); + heap_free( control->ldctl_value.bv_val ); + heap_free( control ); } } @@ -578,8 +548,8 @@ static inline void controlfreeU( LDAPControl *control ) if (control) { strfreeU( control->ldctl_oid ); - HeapFree( GetProcessHeap(), 0, control->ldctl_value.bv_val ); - HeapFree( GetProcessHeap(), 0, control ); + heap_free( control->ldctl_value.bv_val ); + heap_free( control ); } } @@ -612,9 +582,7 @@ static inline LDAPControlW **controlarrayAtoW( LDAPControlA **controlarray ) if (controlarray) { size = sizeof(LDAPControlW*) * (controlarraylenA( controlarray ) + 1); - controlarrayW = HeapAlloc( GetProcessHeap(), 0, size ); - - if (controlarrayW) + if ((controlarrayW = heap_alloc( size ))) { LDAPControlA **p = controlarray; LDAPControlW **q = controlarrayW; @@ -634,9 +602,7 @@ static inline LDAPControlA **controlarrayWtoA( LDAPControlW **controlarray ) if (controlarray) { size = sizeof(LDAPControl*) * (controlarraylenW( controlarray ) + 1); - controlarrayA = HeapAlloc( GetProcessHeap(), 0, size ); - - if (controlarrayA) + if ((controlarrayA = heap_alloc( size ))) { LDAPControlW **p = controlarray; LDAPControlA **q = controlarrayA; @@ -656,9 +622,7 @@ static inline LDAPControl **controlarrayWtoU( LDAPControlW **controlarray ) if (controlarray) { size = sizeof(LDAPControl*) * (controlarraylenW( controlarray ) + 1); - controlarrayU = HeapAlloc( GetProcessHeap(), 0, size ); - - if (controlarrayU) + if ((controlarrayU = heap_alloc( size ))) { LDAPControlW **p = controlarray; LDAPControl **q = controlarrayU; @@ -678,9 +642,7 @@ static inline LDAPControlW **controlarrayUtoW( LDAPControl **controlarray ) if (controlarray) { size = sizeof(LDAPControlW*) * (controlarraylenU( controlarray ) + 1); - controlarrayW = HeapAlloc( GetProcessHeap(), 0, size ); - - if (controlarrayW) + if ((controlarrayW = heap_alloc( size ))) { LDAPControl **p = controlarray; LDAPControlW **q = controlarrayW; @@ -698,7 +660,7 @@ static inline void controlarrayfreeA( LDAPControlA **controlarray ) { LDAPControlA **p = controlarray; while (*p) controlfreeA( *p++ ); - HeapFree( GetProcessHeap(), 0, controlarray ); + heap_free( controlarray ); } } @@ -708,7 +670,7 @@ static inline void controlarrayfreeW( LDAPControlW **controlarray ) { LDAPControlW **p = controlarray; while (*p) controlfreeW( *p++ ); - HeapFree( GetProcessHeap(), 0, controlarray ); + heap_free( controlarray ); } } @@ -718,7 +680,7 @@ static inline void controlarrayfreeU( LDAPControl **controlarray ) { LDAPControl **p = controlarray; while (*p) controlfreeU( *p++ ); - HeapFree( GetProcessHeap(), 0, controlarray ); + heap_free( controlarray ); } } @@ -726,8 +688,7 @@ static inline LDAPSortKeyW *sortkeyAtoW( LDAPSortKeyA *sortkey ) { LDAPSortKeyW *sortkeyW; - sortkeyW = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPSortKeyW) ); - if (sortkeyW) + if ((sortkeyW = heap_alloc( sizeof(LDAPSortKeyW) ))) { sortkeyW->sk_attrtype = strAtoW( sortkey->sk_attrtype ); sortkeyW->sk_matchruleoid = strAtoW( sortkey->sk_matchruleoid ); @@ -740,8 +701,7 @@ static inline LDAPSortKeyA *sortkeyWtoA( LDAPSortKeyW *sortkey ) { LDAPSortKeyA *sortkeyA; - sortkeyA = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPSortKeyA) ); - if (sortkeyA) + if ((sortkeyA = heap_alloc( sizeof(LDAPSortKeyA) ))) { sortkeyA->sk_attrtype = strWtoA( sortkey->sk_attrtype ); sortkeyA->sk_matchruleoid = strWtoA( sortkey->sk_matchruleoid ); @@ -754,8 +714,7 @@ static inline LDAPSortKey *sortkeyWtoU( LDAPSortKeyW *sortkey ) { LDAPSortKey *sortkeyU; - sortkeyU = HeapAlloc( GetProcessHeap(), 0, sizeof(LDAPSortKey) ); - if (sortkeyU) + if ((sortkeyU = heap_alloc( sizeof(LDAPSortKey) ))) { sortkeyU->attributeType = strWtoU( sortkey->sk_attrtype ); sortkeyU->orderingRule = strWtoU( sortkey->sk_matchruleoid ); @@ -770,7 +729,7 @@ static inline void sortkeyfreeA( LDAPSortKeyA *sortkey ) { strfreeA( sortkey->sk_attrtype ); strfreeA( sortkey->sk_matchruleoid ); - HeapFree( GetProcessHeap(), 0, sortkey ); + heap_free( sortkey ); } } @@ -780,7 +739,7 @@ static inline void sortkeyfreeW( LDAPSortKeyW *sortkey ) { strfreeW( sortkey->sk_attrtype ); strfreeW( sortkey->sk_matchruleoid ); - HeapFree( GetProcessHeap(), 0, sortkey ); + heap_free( sortkey ); } } @@ -790,7 +749,7 @@ static inline void sortkeyfreeU( LDAPSortKey *sortkey ) { strfreeU( sortkey->attributeType ); strfreeU( sortkey->orderingRule ); - HeapFree( GetProcessHeap(), 0, sortkey ); + heap_free( sortkey ); } } @@ -816,9 +775,7 @@ static inline LDAPSortKeyW **sortkeyarrayAtoW( LDAPSortKeyA **sortkeyarray ) if (sortkeyarray) { size = sizeof(LDAPSortKeyW*) * (sortkeyarraylenA( sortkeyarray ) + 1); - sortkeyarrayW = HeapAlloc( GetProcessHeap(), 0, size ); - - if (sortkeyarrayW) + if ((sortkeyarrayW = heap_alloc( size ))) { LDAPSortKeyA **p = sortkeyarray; LDAPSortKeyW **q = sortkeyarrayW; @@ -838,9 +795,7 @@ static inline LDAPSortKey **sortkeyarrayWtoU( LDAPSortKeyW **sortkeyarray ) if (sortkeyarray) { size = sizeof(LDAPSortKey*) * (sortkeyarraylenW( sortkeyarray ) + 1); - sortkeyarrayU = HeapAlloc( GetProcessHeap(), 0, size ); - - if (sortkeyarrayU) + if ((sortkeyarrayU = heap_alloc( size ))) { LDAPSortKeyW **p = sortkeyarray; LDAPSortKey **q = sortkeyarrayU; @@ -858,7 +813,7 @@ static inline void sortkeyarrayfreeW( LDAPSortKeyW **sortkeyarray ) { LDAPSortKeyW **p = sortkeyarray; while (*p) sortkeyfreeW( *p++ ); - HeapFree( GetProcessHeap(), 0, sortkeyarray ); + heap_free( sortkeyarray ); } } @@ -868,7 +823,7 @@ static inline void sortkeyarrayfreeU( LDAPSortKey **sortkeyarray ) { LDAPSortKey **p = sortkeyarray; while (*p) sortkeyfreeU( *p++ ); - HeapFree( GetProcessHeap(), 0, sortkeyarray ); + heap_free( sortkeyarray ); } } #endif /* HAVE_LDAP */ diff --git a/dll/win32/wldap32/wldap32.rc b/dll/win32/wldap32/wldap32.rc index a9c00c0277..1af4e8218b 100644 --- a/dll/win32/wldap32/wldap32.rc +++ b/dll/win32/wldap32/wldap32.rc @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <windef.h> +#include "windef.h" /* UTF-8 */ #pragma code_page(65001) diff --git a/media/doc/README.WINE b/media/doc/README.WINE index b66f8a0f2b..81a0f38d33 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -207,7 +207,7 @@ reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628 reactos/dll/win32/winscard # Synced to WineStaging-3.3 reactos/dll/win32/wintrust # Synced to WineStaging-3.3 -reactos/dll/win32/wldap32 # Synced to Wine-3.0 +reactos/dll/win32/wldap32 # Synced to WineStaging-3.3 reactos/dll/win32/wmi # Synced to WineStaging-2.9 reactos/dll/win32/wmiutils # Synced to WineStaging-2.9 reactos/dll/win32/wmvcore # Synced to Wine-3.0
6 years, 9 months
1
0
0
0
01/01: [WINTRUST_WINETEST] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7756e32bcb3218e0d3b20…
commit 7756e32bcb3218e0d3b20c06121e5d3e82ec2703 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Mar 24 13:19:42 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Mar 24 13:19:42 2018 +0100 [WINTRUST_WINETEST] Sync with Wine Staging 3.3. CORE-14434 --- modules/rostests/winetests/wintrust/register.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rostests/winetests/wintrust/register.c b/modules/rostests/winetests/wintrust/register.c index 42c5de68b3..32c8782749 100644 --- a/modules/rostests/winetests/wintrust/register.c +++ b/modules/rostests/winetests/wintrust/register.c @@ -224,7 +224,7 @@ static void test_AddDefaultForUsage(void) static void test_LoadFunctionPointers(void) { BOOL ret; - CRYPT_PROVIDER_FUNCTIONS funcs; + CRYPT_PROVIDER_FUNCTIONS funcs = {0}; GUID action = WINTRUST_ACTION_GENERIC_VERIFY_V2; if (!pWintrustLoadFunctionPointers)
6 years, 9 months
1
0
0
0
01/01: [WINTRUST] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=95d5c4bed3df75e55ec7d…
commit 95d5c4bed3df75e55ec7d61a5c7ecfb6f52ea506 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Mar 24 13:18:57 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Mar 24 13:18:57 2018 +0100 [WINTRUST] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/wintrust/CMakeLists.txt | 4 ++-- dll/win32/wintrust/asn.c | 17 ++++++++++++++--- dll/win32/wintrust/crypt.c | 15 ++++++++++++--- dll/win32/wintrust/precomp.h | 27 +++++++++++++++++++++++++++ dll/win32/wintrust/register.c | 15 +++++++++++++++ dll/win32/wintrust/softpub.c | 14 ++++++++++++-- dll/win32/wintrust/wintrust_main.c | 22 +++++++++++++++++++--- dll/win32/wintrust/wintrust_priv.h | 23 +---------------------- media/doc/README.WINE | 2 +- 9 files changed, 103 insertions(+), 36 deletions(-) diff --git a/dll/win32/wintrust/CMakeLists.txt b/dll/win32/wintrust/CMakeLists.txt index 87e9f32e8c..1e8d8bf535 100644 --- a/dll/win32/wintrust/CMakeLists.txt +++ b/dll/win32/wintrust/CMakeLists.txt @@ -9,7 +9,7 @@ list(APPEND SOURCE register.c softpub.c wintrust_main.c - wintrust_priv.h + precomp.h ${CMAKE_CURRENT_BINARY_DIR}/wintrust_stubs.c) add_library(wintrust SHARED @@ -23,5 +23,5 @@ target_link_libraries(wintrust wine ${PSEH_LIB}) #add_delay_importlibs(wintrust cryptui imagehlp) add_delay_importlibs(wintrust cryptui) add_importlibs(wintrust imagehlp crypt32 user32 advapi32 msvcrt kernel32 ntdll) -add_pch(wintrust wintrust_priv.h SOURCE) +add_pch(wintrust precomp.h SOURCE) add_cd_file(TARGET wintrust DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wintrust/asn.c b/dll/win32/wintrust/asn.c index 67dbf8be63..6406ba3428 100644 --- a/dll/win32/wintrust/asn.c +++ b/dll/win32/wintrust/asn.c @@ -18,11 +18,22 @@ * */ -#include "wintrust_priv.h" +#include "config.h" +#include "wine/port.h" +#include <stdarg.h> +#include <stdio.h> #include <assert.h> -#include <snmp.h> -#include <wine/exception.h> +#define NONAMELESSUNION +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "wincrypt.h" +#include "wintrust.h" +#include "snmp.h" +#include "winternl.h" +#include "wine/debug.h" +#include "wine/exception.h" WINE_DEFAULT_DEBUG_CHANNEL(cryptasn); diff --git a/dll/win32/wintrust/crypt.c b/dll/win32/wintrust/crypt.c index b59bfddedc..84188f881a 100644 --- a/dll/win32/wintrust/crypt.c +++ b/dll/win32/wintrust/crypt.c @@ -22,9 +22,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "wintrust_priv.h" - -#include <imagehlp.h> +#include <stdarg.h> +#include <stdio.h> +#include "windef.h" +#include "winbase.h" +#include "wintrust.h" +#include "mscat.h" +#include "mssip.h" +#include "imagehlp.h" +#include "winternl.h" + +#include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(wintrust); diff --git a/dll/win32/wintrust/precomp.h b/dll/win32/wintrust/precomp.h new file mode 100644 index 0000000000..049a53dac4 --- /dev/null +++ b/dll/win32/wintrust/precomp.h @@ -0,0 +1,27 @@ + +#ifndef _WINTRUST_PRECOMP_H +#define _WINTRUST_PRECOMP_H + +#include <wine/config.h> + +#include <stdio.h> + +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define NONAMELESSUNION + +#include <windef.h> +#include <winbase.h> +#include <winuser.h> +#include <winreg.h> +#include <winternl.h> +#include <softpub.h> +#include <mscat.h> + +#include <wine/debug.h> +#include <wine/unicode.h> + +#include "wintrust_priv.h" + +#endif /* !_WINTRUST_PRECOMP_H */ diff --git a/dll/win32/wintrust/register.c b/dll/win32/wintrust/register.c index 7bee6c86c7..effe9d18f2 100644 --- a/dll/win32/wintrust/register.c +++ b/dll/win32/wintrust/register.c @@ -18,7 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winuser.h" +#include "winreg.h" +#include "winnls.h" +#include "objbase.h" + +#include "guiddef.h" +#include "wintrust.h" +#include "softpub.h" +#include "mssip.h" #include "wintrust_priv.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wintrust); diff --git a/dll/win32/wintrust/softpub.c b/dll/win32/wintrust/softpub.c index c70a19f5d2..0c04001985 100644 --- a/dll/win32/wintrust/softpub.c +++ b/dll/win32/wintrust/softpub.c @@ -16,8 +16,18 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ - -#include "wintrust_priv.h" +#include <stdarg.h> + +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "wintrust.h" +#include "mssip.h" +#include "softpub.h" +#include "winnls.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wintrust); diff --git a/dll/win32/wintrust/wintrust_main.c b/dll/win32/wintrust/wintrust_main.c index 6977fa0ee2..58e3ac39c0 100644 --- a/dll/win32/wintrust/wintrust_main.c +++ b/dll/win32/wintrust/wintrust_main.c @@ -17,10 +17,26 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" + +#include <stdarg.h> + +#define NONAMELESSUNION + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winreg.h" +#include "guiddef.h" +#include "wintrust.h" +#include "softpub.h" +#include "mscat.h" +#include "objbase.h" +#include "winuser.h" +#include "cryptdlg.h" +#include "cryptuiapi.h" #include "wintrust_priv.h" - -#include <cryptdlg.h> -#include <cryptuiapi.h> +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wintrust); diff --git a/dll/win32/wintrust/wintrust_priv.h b/dll/win32/wintrust/wintrust_priv.h index ef8decb3d9..66c925ade5 100644 --- a/dll/win32/wintrust/wintrust_priv.h +++ b/dll/win32/wintrust/wintrust_priv.h @@ -15,30 +15,9 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ - #ifndef __WINTRUST_PRIV_H__ #define __WINTRUST_PRIV_H__ -#include <wine/config.h> - -#include <stdio.h> - -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define NONAMELESSUNION - -#include <windef.h> -#include <winbase.h> -#include <winuser.h> -#include <winreg.h> -#include <winternl.h> -#include <softpub.h> -#include <mscat.h> - -#include <wine/debug.h> -#include <wine/unicode.h> - void * WINAPI WINTRUST_Alloc(DWORD cb) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN; void WINAPI WINTRUST_Free(void *p) DECLSPEC_HIDDEN; BOOL WINAPI WINTRUST_AddStore(CRYPT_PROVIDER_DATA *data, HCERTSTORE store) DECLSPEC_HIDDEN; @@ -49,4 +28,4 @@ BOOL WINAPI WINTRUST_AddCert(CRYPT_PROVIDER_DATA *data, DWORD idxSigner, BOOL WINAPI WINTRUST_AddPrivData(CRYPT_PROVIDER_DATA *data, CRYPT_PROVIDER_PRIVDATA *pPrivData2Add) DECLSPEC_HIDDEN; -#endif /* __WINTRUST_PRIV_H__ */ +#endif /* ndef __WINTRUST_PRIV_H__ */ diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 9013bb9d4e..b66f8a0f2b 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -206,7 +206,7 @@ reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628 reactos/dll/win32/winscard # Synced to WineStaging-3.3 -reactos/dll/win32/wintrust # Synced to WineStaging-2.16 +reactos/dll/win32/wintrust # Synced to WineStaging-3.3 reactos/dll/win32/wldap32 # Synced to Wine-3.0 reactos/dll/win32/wmi # Synced to WineStaging-2.9 reactos/dll/win32/wmiutils # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
01/01: [WINSCARD] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ba5ae4df7d2a3adc30ea3…
commit ba5ae4df7d2a3adc30ea341d5d5cdd4eab51a424 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Mar 24 13:18:09 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Mar 24 13:18:09 2018 +0100 [WINSCARD] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/winscard/precomp.h | 4 ++-- dll/win32/winscard/stubs.c | 4 +++- dll/win32/winscard/winscard.c | 12 +++++++++--- media/doc/README.WINE | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dll/win32/winscard/precomp.h b/dll/win32/winscard/precomp.h index 0cbff0095f..6cce6bbc34 100644 --- a/dll/win32/winscard/precomp.h +++ b/dll/win32/winscard/precomp.h @@ -1,3 +1,4 @@ + #ifndef _WINSCARD_PCH_ #define _WINSCARD_PCH_ @@ -14,6 +15,5 @@ #include <winscard.h> #include <wine/debug.h> -WINE_DEFAULT_DEBUG_CHANNEL(winscard); -#endif /* _WINSCARD_PCH_ */ +#endif /* !_WINSCARD_PCH_ */ diff --git a/dll/win32/winscard/stubs.c b/dll/win32/winscard/stubs.c index 19d34e8bdb..3c502cf1f0 100644 --- a/dll/win32/winscard/stubs.c +++ b/dll/win32/winscard/stubs.c @@ -8,7 +8,9 @@ * 11/07/2004 Created */ -#include <precomp.h> +#include "precomp.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winscard); /* * @unimplemented diff --git a/dll/win32/winscard/winscard.c b/dll/win32/winscard/winscard.c index 4ad47fcb06..a8a1735c2b 100644 --- a/dll/win32/winscard/winscard.c +++ b/dll/win32/winscard/winscard.c @@ -16,9 +16,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <precomp.h> - -#include <winternl.h> +#include "config.h" +#include <stdarg.h> +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" +#include "winscard.h" +#include "winternl.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winscard); static HANDLE g_startedEvent = NULL; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 8864a5e8c0..9013bb9d4e 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -205,7 +205,7 @@ reactos/dll/win32/wininet # Synced to WineStaging-3.3 reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628 -reactos/dll/win32/winscard # Synced to WineStaging-2.9 +reactos/dll/win32/winscard # Synced to WineStaging-3.3 reactos/dll/win32/wintrust # Synced to WineStaging-2.16 reactos/dll/win32/wldap32 # Synced to Wine-3.0 reactos/dll/win32/wmi # Synced to WineStaging-2.9
6 years, 9 months
1
0
0
0
01/01: [WININET_WINETEST] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a5fc445e719ced3582c20…
commit a5fc445e719ced3582c20dcfa79b68b0e00dce3c Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Mar 24 13:17:33 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Mar 24 13:17:33 2018 +0100 [WININET_WINETEST] Sync with Wine Staging 3.3. CORE-14434 --- modules/rostests/winetests/wininet/ftp.c | 17 +- modules/rostests/winetests/wininet/generated.c | 8 +- modules/rostests/winetests/wininet/http.c | 362 +++++++++++++++++++++++-- modules/rostests/winetests/wininet/internet.c | 31 ++- modules/rostests/winetests/wininet/url.c | 22 +- modules/rostests/winetests/wininet/urlcache.c | 20 +- 6 files changed, 398 insertions(+), 62 deletions(-) diff --git a/modules/rostests/winetests/wininet/ftp.c b/modules/rostests/winetests/wininet/ftp.c index d6040d7edd..d2118faded 100644 --- a/modules/rostests/winetests/wininet/ftp.c +++ b/modules/rostests/winetests/wininet/ftp.c @@ -30,18 +30,15 @@ */ #include <stdarg.h> -//#include <stdio.h> -//#include <stdlib.h> +#include <stdio.h> +#include <stdlib.h> -#define WIN32_NO_STATUS -#define _INC_WINDOWS +#include "windef.h" +#include "winbase.h" +#include "wininet.h" +#include "winsock2.h" -#include <windef.h> -#include <winbase.h> -#include <wininet.h> -//#include "winsock.h" - -#include <wine/test.h> +#include "wine/test.h" static BOOL (WINAPI *pFtpCommandA)(HINTERNET,BOOL,DWORD,LPCSTR,DWORD_PTR,HINTERNET*); diff --git a/modules/rostests/winetests/wininet/generated.c b/modules/rostests/winetests/wininet/generated.c index e715fbe355..34369a8d53 100644 --- a/modules/rostests/winetests/wininet/generated.c +++ b/modules/rostests/winetests/wininet/generated.c @@ -14,12 +14,12 @@ #define WINE_NOWINSOCK #include <stdarg.h> -#include <windef.h> -#include <winbase.h> -#include <wininet.h> +#include "windef.h" +#include "winbase.h" +#include "wininet.h" #include "wininet_test.h" -#include <wine/test.h> +#include "wine/test.h" /*********************************************************************** * Compatibility macros diff --git a/modules/rostests/winetests/wininet/http.c b/modules/rostests/winetests/wininet/http.c index e74e31bbe1..6edb8ffe41 100644 --- a/modules/rostests/winetests/wininet/http.c +++ b/modules/rostests/winetests/wininet/http.c @@ -22,20 +22,15 @@ #include <stdarg.h> #include <stdio.h> -//#include <stdlib.h> +#include <stdlib.h> -#define WIN32_NO_STATUS -#define _INC_WINDOWS +#include "windef.h" +#include "winbase.h" +#include "wininet.h" +#include "winineti.h" +#include "winsock2.h" -#include <windef.h> -#include <winbase.h> -#include <winreg.h> -#include <winnls.h> -#include <wincrypt.h> -#include <wininet.h> -#include <winsock.h> - -#include <wine/test.h> +#include "wine/test.h" /* Undocumented security flags */ #define _SECURITY_FLAG_CERT_REV_FAILED 0x00800000 @@ -2057,6 +2052,22 @@ static const char okmsg2[] = "Set-Cookie: two\r\n" "\r\n"; +static const char okmsg_cookie_path[] = +"HTTP/1.1 200 OK\r\n" +"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" +"Server: winetest\r\n" +"Content-Length: 0\r\n" +"Set-Cookie: subcookie2=data; path=/test_cookie_set_path\r\n" +"\r\n"; + +static const char okmsg_cookie[] = +"HTTP/1.1 200 OK\r\n" +"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" +"Server: winetest\r\n" +"Content-Length: 0\r\n" +"Set-Cookie: testcookie=testvalue\r\n" +"\r\n"; + static const char notokmsg[] = "HTTP/1.1 400 Bad Request\r\n" "Server: winetest\r\n" @@ -2275,7 +2286,7 @@ static DWORD CALLBACK server_thread(LPVOID param) } if (strstr(buffer, "/testC")) { - if (strstr(buffer, "Cookie: cookie=biscuit")) + if (strstr(buffer, "cookie=biscuit")) send(c, okmsg, sizeof okmsg-1, 0); else send(c, notokmsg, sizeof notokmsg-1, 0); @@ -2420,6 +2431,51 @@ static DWORD CALLBACK server_thread(LPVOID param) else send(c, notokmsg, sizeof notokmsg-1, 0); } + if (strstr(buffer, "/test_cookie_path1")) + { + if (strstr(buffer, "subcookie=data")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } + if (strstr(buffer, "/test_cookie_path2")) + { + if (strstr(buffer, "subcookie2=data")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } + if (strstr(buffer, "/test_cookie_set_path")) + { + send(c, okmsg_cookie_path, sizeof okmsg_cookie_path-1, 0); + } + if (strstr(buffer, "/test_cookie_merge")) + { + if (strstr(buffer, "subcookie=data") && + !strstr(buffer, "manual_cookie=test")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } + if (strstr(buffer, "/test_cookie_set_host_override")) + { + send(c, okmsg_cookie, sizeof okmsg_cookie-1, 0); + } + if (strstr(buffer, "/test_cookie_check_host_override")) + { + if (strstr(buffer, "Cookie:") && strstr(buffer, "testcookie=testvalue")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } + if (strstr(buffer, "/test_cookie_check_different_host")) + { + if (!strstr(buffer, "foo") && + strstr(buffer, "cookie=biscuit")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } if (strstr(buffer, "/test_host_override")) { if (strstr(buffer, host_header_override)) @@ -2451,6 +2507,20 @@ static DWORD CALLBACK server_thread(LPVOID param) { send(c, okmsg, sizeof(okmsg)-1, 0); } + if (strstr(buffer, "HEAD /test_auth_host1")) + { + if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzcw==")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, noauthmsg, sizeof noauthmsg-1, 0); + } + if (strstr(buffer, "HEAD /test_auth_host2")) + { + if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzczI=")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, noauthmsg, sizeof noauthmsg-1, 0); + } shutdown(c, 2); closesocket(c); c = -1; @@ -3146,6 +3216,152 @@ static void test_header_override(int port) test_status_code(req, 400); } + InternetCloseHandle(req); + InternetSetCookieA("
http://localhost
", "cookie", "biscuit"); + req = HttpOpenRequestA(con, NULL, "/testC", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); + ok(ret, "HttpAddRequestHeaders failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_cookie_set_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); + ok(ret, "HttpAddRequestHeaders failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); + ok(ret, "HttpAddRequestHeaders failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + + InternetCloseHandle(req); + InternetSetCookieA("
http://test.local
", "foo", "bar"); + req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); + ok(ret, "HttpAddRequestHeaders failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + ok(ses != NULL, "InternetOpenA failed\n"); + + con = InternetConnectA(ses, "localhost", port, "test1", "pass", INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); + + req = HttpOpenRequestA( con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); + ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); + + test_status_code(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + ok(ses != NULL, "InternetOpenA failed\n"); + + con = InternetConnectA( ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); + + req = HttpOpenRequestA(con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); + ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); + ok(ret, "HttpAddRequestHeaders failed\n"); + + ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); + ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); + + test_status_code(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + ok(ses != NULL, "InternetOpenA failed\n"); + + con = InternetConnectA(ses, "localhost", port, "test1", "pass2", INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); + + req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); + ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); + + ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); + ok(ret, "HttpAddRequestHeaders failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); + + test_status_code(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + ok(ses != NULL, "InternetOpenA failed\n"); + + con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); + + req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); + ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); + + test_status_code(req, 200); + InternetCloseHandle(req); InternetCloseHandle(con); InternetCloseHandle(ses); @@ -3696,6 +3912,68 @@ static void test_cache_read_gzipped(int port) InternetCloseHandle(con); InternetCloseHandle(ses); + /* Decompression doesn't work while reading from cache */ + test_cache_gzip = 0; + sprintf(cache_url, cache_url_fmt, port, get_gzip); + DeleteUrlCacheEntryA(cache_url); + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + ok(ses != NULL,"InternetOpen failed with error %u\n", GetLastError()); + + ret = TRUE; + ret = InternetSetOptionA(ses, INTERNET_OPTION_HTTP_DECODING, &ret, sizeof(ret)); + ok(ret, "InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %d\n", GetLastError()); + + con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnect failed with error %u\n", GetLastError()); + + req = HttpOpenRequestA(con, NULL, get_gzip, NULL, NULL, NULL, 0, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, "Accept-Encoding: gzip", -1, NULL, 0); + ok(ret, "HttpSendRequest failed with error %u\n", GetLastError()); + size = 0; + while(InternetReadFile(req, buf+size, sizeof(buf)-1-size, &read) && read) + size += read; + ok(size == 10, "read %d bytes of data\n", size); + buf[size] = 0; + ok(!strncmp(buf, content, size), "incorrect page content: %s\n", buf); + InternetCloseHandle(req); + + InternetCloseHandle(con); + InternetCloseHandle(ses); + + /* Decompression doesn't work while reading from cache */ + test_cache_gzip = 0; + sprintf(cache_url, cache_url_fmt, port, get_gzip); + DeleteUrlCacheEntryA(cache_url); + + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); + ok(ses != NULL,"InternetOpen failed with error %u\n", GetLastError()); + + con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnect failed with error %u\n", GetLastError()); + + ret = TRUE; + ret = InternetSetOptionA(con, INTERNET_OPTION_HTTP_DECODING, &ret, sizeof(ret)); + ok(ret, "InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %d\n", GetLastError()); + + req = HttpOpenRequestA(con, NULL, get_gzip, NULL, NULL, NULL, 0, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, "Accept-Encoding: gzip", -1, NULL, 0); + ok(ret, "HttpSendRequest failed with error %u\n", GetLastError()); + size = 0; + while(InternetReadFile(req, buf+size, sizeof(buf)-1-size, &read) && read) + size += read; + ok(size == 10, "read %d bytes of data\n", size); + buf[size] = 0; + ok(!strncmp(buf, content, size), "incorrect page content: %s\n", buf); + InternetCloseHandle(req); + + InternetCloseHandle(con); + InternetCloseHandle(ses); + DeleteUrlCacheEntryA(cache_url); } @@ -3734,7 +4012,7 @@ static void test_cookie_header(int port) HINTERNET ses, con, req; DWORD size, error; BOOL ret; - char buffer[64]; + char buffer[256]; ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(ses != NULL, "InternetOpen failed\n"); @@ -3762,7 +4040,7 @@ static void test_cookie_header(int port) size = sizeof(buffer); ret = HttpQueryInfoA(req, HTTP_QUERY_COOKIE | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); ok(ret, "HttpQueryInfo failed: %u\n", GetLastError()); - ok(!strcmp(buffer, "cookie=not biscuit"), "got '%s' expected \'cookie=not biscuit\'\n", buffer); + ok(!!strstr(buffer, "cookie=not biscuit"), "got '%s' expected \'cookie=not biscuit\'\n", buffer); ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed: %u\n", GetLastError()); @@ -3773,9 +4051,61 @@ static void test_cookie_header(int port) size = sizeof(buffer); ret = HttpQueryInfoA(req, HTTP_QUERY_COOKIE | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); ok(ret, "HttpQueryInfo failed: %u\n", GetLastError()); - ok(!strcmp(buffer, "cookie=biscuit"), "got '%s' expected \'cookie=biscuit\'\n", buffer); + ok(!strstr(buffer, "cookie=not biscuit"), "'%s' should not contain \'cookie=not biscuit\'\n", buffer); + ok(!!strstr(buffer, "cookie=biscuit"), "'%s' should contain \'cookie=biscuit\'\n", buffer); + + InternetCloseHandle(req); + + InternetSetCookieA("
http://localhost/testCCCC
", "subcookie", "data"); + + req = HttpOpenRequestA(con, NULL, "/test_cookie_path1", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + InternetCloseHandle(req); + req = HttpOpenRequestA(con, NULL, "/test_cookie_path1/abc", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); InternetCloseHandle(req); + + req = HttpOpenRequestA(con, NULL, "/test_cookie_set_path", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + InternetCloseHandle(req); + + req = HttpOpenRequestA(con, NULL, "/test_cookie_path2", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 400); + InternetCloseHandle(req); + + req = HttpOpenRequestA(con, NULL, "/test_cookie_merge", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpAddRequestHeadersA(req, "Cookie: manual_cookie=test\r\n", ~0u, HTTP_ADDREQ_FLAG_ADD); + ok(ret, "HttpAddRequestHeaders failed: %u\n", GetLastError()); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + + test_status_code(req, 200); + InternetCloseHandle(req); + InternetCloseHandle(con); InternetCloseHandle(ses); } diff --git a/modules/rostests/winetests/wininet/internet.c b/modules/rostests/winetests/wininet/internet.c index a83583a8c1..b4bbe0f5f2 100644 --- a/modules/rostests/winetests/wininet/internet.c +++ b/modules/rostests/winetests/wininet/internet.c @@ -20,16 +20,15 @@ #include <stdarg.h> #include <stdio.h> -//#include <string.h> +#include <string.h> +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "wininet.h" +#include "winerror.h" +#include "winreg.h" -#include <windef.h> -#include <winbase.h> -#include <winuser.h> -#include <wininet.h> -//#include "winerror.h" -#include <winreg.h> - -#include <wine/test.h> +#include "wine/test.h" static BOOL (WINAPI *pCreateUrlCacheContainerA)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD); @@ -1166,6 +1165,20 @@ static void test_InternetSetOption(void) ok(ret == FALSE, "InternetSetOption should've failed\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError()); + ret = InternetSetOptionA(req, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + ret = InternetSetOptionA(ses, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + ret = InternetSetOptionA(ses, INTERNET_OPTION_REFRESH, NULL, 0); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + SetLastError(0xdeadbeef); + ret = InternetSetOptionA(req, INTERNET_OPTION_REFRESH, NULL, 0); + todo_wine ok(ret == FALSE, "InternetSetOption should've failed\n"); + todo_wine ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError()); + ret = InternetCloseHandle(req); ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError()); ret = InternetCloseHandle(con); diff --git a/modules/rostests/winetests/wininet/url.c b/modules/rostests/winetests/wininet/url.c index 8b167d939e..2024b158ff 100644 --- a/modules/rostests/winetests/wininet/url.c +++ b/modules/rostests/winetests/wininet/url.c @@ -21,16 +21,16 @@ */ #include <stdarg.h> -//#include <stdio.h> -//#include <stdlib.h> -//#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> -#include <windef.h> -#include <winbase.h> -#include <winnls.h> -#include <wininet.h> +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "wininet.h" -#include <wine/test.h> +#include "wine/test.h" #define TEST_URL "
http://www.winehq.org/site/about#hi
" #define TEST_URL3 "file:///C:/Program%20Files/Atmel/AVR%20Tools/STK500/STK500.xml" @@ -816,9 +816,9 @@ static void InternetCrackUrlW_test(void) comp.lpszUrlPath = urlpart; comp.dwUrlPathLength = sizeof(urlpart)/sizeof(urlpart[0]); r = InternetCrackUrlW(url3, 0, ICU_DECODE, &comp); - todo_wine ok(r, "InternetCrackUrlW failed unexpectedly\n"); - todo_wine ok(!strcmp_wa(host, "x.org"), "host is %s, should be x.org\n", wine_dbgstr_w(host)); - ok(urlpart[0] == 0, "urlpart should be empty\n"); + ok(r, "InternetCrackUrlW failed unexpectedly\n"); + ok(!strcmp_wa(host, "x.org"), "host is %s, should be x.org\n", wine_dbgstr_w(host)); + todo_wine ok(urlpart[0] == 0, "urlpart should be empty\n"); } static void fill_url_components(URL_COMPONENTSA *lpUrlComponents) diff --git a/modules/rostests/winetests/wininet/urlcache.c b/modules/rostests/winetests/wininet/urlcache.c index afeda9d269..310054b6a7 100644 --- a/modules/rostests/winetests/wininet/urlcache.c +++ b/modules/rostests/winetests/wininet/urlcache.c @@ -19,20 +19,16 @@ */ #include <stdarg.h> -//#include <stdio.h> -//#include <stdlib.h> +#include <stdio.h> +#include <stdlib.h> -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "wininet.h" +#include "winineti.h" -#include <windef.h> -#include <winbase.h> -#include <winnls.h> -#include <wininet.h> -#include <winineti.h> - -#include <wine/test.h> +#include "wine/test.h" static const char test_url[] = "
http://urlcachetest.winehq.org/index.html
"; static const WCHAR test_urlW[] = {'h','t','t','p',':','/','/','u','r','l','c','a','c','h','e','t','e','s','t','.',
6 years, 9 months
1
0
0
0
01/01: [WININET] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bc01cef03a10c7b705948…
commit bc01cef03a10c7b7059484790307cc5f16bdafbf Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Mar 24 13:17:01 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Mar 24 13:17:01 2018 +0100 [WININET] Sync with Wine Staging 3.3. CORE-14434 --- dll/win32/wininet/CMakeLists.txt | 4 +- dll/win32/wininet/cookie.c | 20 +++- dll/win32/wininet/dialogs.c | 32 ++++- dll/win32/wininet/ftp.c | 23 ++++ dll/win32/wininet/gopher.c | 12 +- dll/win32/wininet/http.c | 240 ++++++++++++++++++++++---------------- dll/win32/wininet/internet.c | 86 ++++++++++++-- dll/win32/wininet/internet.h | 92 ++------------- dll/win32/wininet/netconnection.c | 31 +++-- dll/win32/wininet/precomp.h | 64 ++++++++++ dll/win32/wininet/resource.h | 3 + dll/win32/wininet/rsrc.rc | 3 - dll/win32/wininet/urlcache.c | 27 ++++- dll/win32/wininet/utility.c | 19 ++- dll/win32/wininet/version.rc | 2 +- dll/win32/wininet/wininet.spec | 2 +- media/doc/README.WINE | 2 +- 17 files changed, 440 insertions(+), 222 deletions(-) diff --git a/dll/win32/wininet/CMakeLists.txt b/dll/win32/wininet/CMakeLists.txt index 4508528adf..fc12adf7e5 100644 --- a/dll/win32/wininet/CMakeLists.txt +++ b/dll/win32/wininet/CMakeLists.txt @@ -22,7 +22,7 @@ list(APPEND SOURCE netconnection.c urlcache.c utility.c - internet.h) + precomp.h) add_library(wininet SHARED ${SOURCE} @@ -34,5 +34,5 @@ set_module_type(wininet win32dll) target_link_libraries(wininet wine ${PSEH_LIB} zlib) add_delay_importlibs(wininet secur32 crypt32 cryptui) add_importlibs(wininet mpr shlwapi shell32 user32 advapi32 ws2_32 normaliz kernel32_vista msvcrt kernel32 ntdll) -add_pch(wininet internet.h SOURCE) +add_pch(wininet precomp.h SOURCE) add_cd_file(TARGET wininet DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/wininet/cookie.c b/dll/win32/wininet/cookie.c index d06e0217dc..60b8335639 100644 --- a/dll/win32/wininet/cookie.c +++ b/dll/win32/wininet/cookie.c @@ -20,12 +20,28 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "internet.h" +#include "ws2tcpip.h" + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> + +#include "windef.h" +#include "winbase.h" +#include "wininet.h" +#include "lmcons.h" +#include "winerror.h" -#include <lmcons.h> +#include "wine/debug.h" +#include "internet.h" #define RESPONSE_TIMEOUT 30 /* FROM internet.c */ + +WINE_DEFAULT_DEBUG_CHANNEL(wininet); + /* FIXME * Cookies could use A LOT OF MEMORY. We need some kind of memory management here! */ diff --git a/dll/win32/wininet/dialogs.c b/dll/win32/wininet/dialogs.c index 913a4ceaf5..b13b566a8e 100644 --- a/dll/win32/wininet/dialogs.c +++ b/dll/win32/wininet/dialogs.c @@ -18,13 +18,32 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "ws2tcpip.h" + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" +#include "wininet.h" +#include "winnetwk.h" +#include "wine/debug.h" +#include "winerror.h" +#define NO_SHLWAPI_STREAM +#include "shlwapi.h" +#include "cryptuiapi.h" + #include "internet.h" -#include <winnetwk.h> -#include <cryptuiapi.h> +#include "wine/unicode.h" + +#include "resource.h" #define MAX_STRING_LEN 1024 +WINE_DEFAULT_DEBUG_CHANNEL(wininet); + struct WININET_ErrorDlgParams { http_request_t *req; @@ -554,6 +573,15 @@ BOOL WINAPI InternetShowSecurityInfoByURLW(LPCWSTR url, HWND window) return FALSE; } +/*********************************************************************** + * ParseX509EncodedCertificateForListBoxEntry (@) + */ +DWORD WINAPI ParseX509EncodedCertificateForListBoxEntry(LPBYTE cert, DWORD len, LPSTR szlistbox, LPDWORD listbox) +{ + FIXME("stub: %p %d %s %p\n", cert, len, debugstr_a(szlistbox), listbox); + return ERROR_CALL_NOT_IMPLEMENTED; +} + /*********************************************************************** * ShowX509EncodedCertificate (@) */ diff --git a/dll/win32/wininet/ftp.c b/dll/win32/wininet/ftp.c index 7d8e40ae4f..e12e494160 100644 --- a/dll/win32/wininet/ftp.c +++ b/dll/win32/wininet/ftp.c @@ -27,8 +27,31 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "ws2tcpip.h" + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <assert.h> + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "wininet.h" +#include "winnls.h" +#include "winerror.h" +#include "winreg.h" +#include "winternl.h" +#include "shlwapi.h" + +#include "wine/debug.h" #include "internet.h" +WINE_DEFAULT_DEBUG_CHANNEL(wininet); + #define RESPONSE_TIMEOUT 30 typedef struct _ftp_session_t ftp_session_t; diff --git a/dll/win32/wininet/gopher.c b/dll/win32/wininet/gopher.c index 784beab58f..6688ce7a94 100644 --- a/dll/win32/wininet/gopher.c +++ b/dll/win32/wininet/gopher.c @@ -18,7 +18,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "internet.h" +#include "config.h" + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wininet.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wininet); /*********************************************************************** * GopherCreateLocatorA (WININET.@) diff --git a/dll/win32/wininet/http.c b/dll/win32/wininet/http.c index f9694ca454..06aac4bbea 100644 --- a/dll/win32/wininet/http.c +++ b/dll/win32/wininet/http.c @@ -27,15 +27,42 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "internet.h" +#include "config.h" + +#include <stdlib.h> #ifdef HAVE_ZLIB # include <zlib.h> #endif -#include <winternl.h> +#include "winsock2.h" +#include "ws2ipdef.h" + +#include <stdarg.h> +#include <stdio.h> +#include <time.h> +#include <assert.h> + +#include "windef.h" +#include "winbase.h" +#include "wininet.h" +#include "winerror.h" +#include "winternl.h" +#define NO_SHLWAPI_STREAM +#define NO_SHLWAPI_REG +#define NO_SHLWAPI_STRFCNS +#define NO_SHLWAPI_GDI +#include "shlwapi.h" +#include "sspi.h" +#include "wincrypt.h" +#include "winuser.h" + +#include "internet.h" +#include "wine/debug.h" +#include "wine/exception.h" +#include "wine/unicode.h" -#include <wine/exception.h> +WINE_DEFAULT_DEBUG_CHANNEL(wininet); static const WCHAR g_szHttp1_0[] = {'H','T','T','P','/','1','.','0',0}; static const WCHAR g_szHttp1_1[] = {'H','T','T','P','/','1','.','1',0}; @@ -742,10 +769,18 @@ static void HTTP_ProcessCookies( http_request_t *request ) int HeaderIndex; int numCookies = 0; LPHTTPHEADERW setCookieHeader; + WCHAR *path, *tmp; if(request->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES) return; + path = heap_strdupW(request->path); + if (!path) + return; + + tmp = strrchrW(path, '/'); + if (tmp && tmp[1]) tmp[1] = 0; + EnterCriticalSection( &request->headers_section ); while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1) @@ -764,10 +799,11 @@ static void HTTP_ProcessCookies( http_request_t *request ) name = substr(setCookieHeader->lpszValue, data - setCookieHeader->lpszValue); data++; - set_cookie(substrz(request->server->name), substrz(request->path), name, substrz(data), INTERNET_COOKIE_HTTPONLY); + set_cookie(substrz(request->server->name), substrz(path), name, substrz(data), INTERNET_COOKIE_HTTPONLY); } LeaveCriticalSection( &request->headers_section ); + heap_free(path); } static void strip_spaces(LPWSTR start) @@ -2326,11 +2362,6 @@ static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer, if (!(req->session->appInfo->proxyPassword = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY; return ERROR_SUCCESS; - case INTERNET_OPTION_HTTP_DECODING: - if(size != sizeof(BOOL)) - return ERROR_INVALID_PARAMETER; - req->decoding = *(BOOL*)buffer; - return ERROR_SUCCESS; } return INET_SetOption(hdr, option, buffer, size); @@ -2900,7 +2931,7 @@ static DWORD set_content_length(http_request_t *request) request->contentLength = ~0u; } - if(request->decoding) { + if(request->hdr.decoding) { int encoding_idx; static const WCHAR deflateW[] = {'d','e','f','l','a','t','e',0}; @@ -3286,6 +3317,7 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, request->hdr.htype = WH_HHTTPREQ; request->hdr.dwFlags = dwFlags; request->hdr.dwContext = dwContext; + request->hdr.decoding = session->hdr.decoding; request->contentLength = ~0u; request->netconn_stream.data_stream.vtbl = &netconn_stream_vtbl; @@ -5032,7 +5064,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, res = set_content_length(request); if(res != ERROR_SUCCESS) goto lend; - if(!request->contentLength) + if(!request->contentLength && !secure_proxy_connect) http_release_netconn(request, TRUE); if (!(request->hdr.dwFlags & INTERNET_FLAG_NO_AUTO_REDIRECT) && responseLen) @@ -5793,6 +5825,7 @@ DWORD HTTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName, session->hdr.dwFlags = dwFlags; session->hdr.dwContext = dwContext; session->hdr.dwInternalFlags |= dwInternalFlags; + session->hdr.decoding = hIC->hdr.decoding; WININET_AddRef( &hIC->hdr ); session->appInfo = hIC; @@ -6050,127 +6083,128 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer) static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR value, DWORD dwModifier) { - LPHTTPHEADERW lphttpHdr = NULL; + LPHTTPHEADERW lphttpHdr; INT index; BOOL request_only = !!(dwModifier & HTTP_ADDHDR_FLAG_REQ); - DWORD res = ERROR_HTTP_INVALID_HEADER; + DWORD res = ERROR_SUCCESS; TRACE("--> %s: %s - 0x%08x\n", debugstr_w(field), debugstr_w(value), dwModifier); EnterCriticalSection( &request->headers_section ); - /* REPLACE wins out over ADD */ - if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) - dwModifier &= ~HTTP_ADDHDR_FLAG_ADD; - - if (dwModifier & HTTP_ADDHDR_FLAG_ADD) - index = -1; - else - index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); - + index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); if (index >= 0) { - if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) - { - LeaveCriticalSection( &request->headers_section ); - return ERROR_HTTP_INVALID_HEADER; - } lphttpHdr = &request->custHeaders[index]; - } - else if (value) - { - HTTPHEADERW hdr; - hdr.lpszField = (LPWSTR)field; - hdr.lpszValue = (LPWSTR)value; - hdr.wFlags = hdr.wCount = 0; + /* replace existing header if FLAG_REPLACE is given */ + if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) + { + HTTP_DeleteCustomHeader( request, index ); - if (dwModifier & HTTP_ADDHDR_FLAG_REQ) - hdr.wFlags |= HDR_ISREQUEST; + if (value && value[0]) + { + HTTPHEADERW hdr; - res = HTTP_InsertCustomHeader(request, &hdr); - LeaveCriticalSection( &request->headers_section ); - return res; - } - /* no value to delete */ - else - { - LeaveCriticalSection( &request->headers_section ); - return ERROR_SUCCESS; - } + hdr.lpszField = (LPWSTR)field; + hdr.lpszValue = (LPWSTR)value; + hdr.wFlags = hdr.wCount = 0; - if (dwModifier & HTTP_ADDHDR_FLAG_REQ) - lphttpHdr->wFlags |= HDR_ISREQUEST; - else - lphttpHdr->wFlags &= ~HDR_ISREQUEST; + if (dwModifier & HTTP_ADDHDR_FLAG_REQ) + hdr.wFlags |= HDR_ISREQUEST; - if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) - { - HTTP_DeleteCustomHeader( request, index ); + res = HTTP_InsertCustomHeader( request, &hdr ); + } - if (value && value[0]) + goto out; + } + + /* do not add new header if FLAG_ADD_IF_NEW is set */ + if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) { - HTTPHEADERW hdr; + res = ERROR_HTTP_INVALID_HEADER; /* FIXME */ + goto out; + } - hdr.lpszField = (LPWSTR)field; - hdr.lpszValue = (LPWSTR)value; - hdr.wFlags = hdr.wCount = 0; + /* handle appending to existing header */ + if (dwModifier & COALESCEFLAGS) + { + LPWSTR lpsztmp; + WCHAR ch = 0; + INT len = 0; + INT origlen = strlenW(lphttpHdr->lpszValue); + INT valuelen = strlenW(value); + /* FIXME: Should it really clear HDR_ISREQUEST? */ if (dwModifier & HTTP_ADDHDR_FLAG_REQ) - hdr.wFlags |= HDR_ISREQUEST; - - res = HTTP_InsertCustomHeader(request, &hdr); - LeaveCriticalSection( &request->headers_section ); - return res; - } + lphttpHdr->wFlags |= HDR_ISREQUEST; + else + lphttpHdr->wFlags &= ~HDR_ISREQUEST; - LeaveCriticalSection( &request->headers_section ); - return ERROR_SUCCESS; - } - else if (dwModifier & COALESCEFLAGS) - { - LPWSTR lpsztmp; - WCHAR ch = 0; - INT len = 0; - INT origlen = strlenW(lphttpHdr->lpszValue); - INT valuelen = strlenW(value); + if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) + { + ch = ','; + lphttpHdr->wFlags |= HDR_COMMADELIMITED; + } + else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) + { + ch = ';'; + lphttpHdr->wFlags |= HDR_COMMADELIMITED; + } - if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) - { - ch = ','; - lphttpHdr->wFlags |= HDR_COMMADELIMITED; - } - else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) - { - ch = ';'; - lphttpHdr->wFlags |= HDR_COMMADELIMITED; - } + len = origlen + valuelen + ((ch > 0) ? 2 : 0); - len = origlen + valuelen + ((ch > 0) ? 2 : 0); + lpsztmp = heap_realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR)); + if (lpsztmp) + { + lphttpHdr->lpszValue = lpsztmp; + /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ + if (ch > 0) + { + lphttpHdr->lpszValue[origlen] = ch; + origlen++; + lphttpHdr->lpszValue[origlen] = ' '; + origlen++; + } - lpsztmp = heap_realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR)); - if (lpsztmp) - { - lphttpHdr->lpszValue = lpsztmp; - /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ - if (ch > 0) + memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); + lphttpHdr->lpszValue[len] = '\0'; + } + else { - lphttpHdr->lpszValue[origlen] = ch; - origlen++; - lphttpHdr->lpszValue[origlen] = ' '; - origlen++; + WARN("heap_realloc (%d bytes) failed\n",len+1); + res = ERROR_OUTOFMEMORY; } - memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); - lphttpHdr->lpszValue[len] = '\0'; - res = ERROR_SUCCESS; - } - else - { - WARN("heap_realloc (%d bytes) failed\n",len+1); - res = ERROR_OUTOFMEMORY; + goto out; } } + + /* FIXME: What about other combinations? */ + if ((dwModifier & ~HTTP_ADDHDR_FLAG_REQ) == HTTP_ADDHDR_FLAG_REPLACE) + { + res = ERROR_HTTP_HEADER_NOT_FOUND; + goto out; + } + + /* FIXME: What if value == ""? */ + if (value) + { + HTTPHEADERW hdr; + + hdr.lpszField = (LPWSTR)field; + hdr.lpszValue = (LPWSTR)value; + hdr.wFlags = hdr.wCount = 0; + + if (dwModifier & HTTP_ADDHDR_FLAG_REQ) + hdr.wFlags |= HDR_ISREQUEST; + + res = HTTP_InsertCustomHeader( request, &hdr ); + goto out; + } + + /* FIXME: What if value == NULL? */ +out: TRACE("<-- %d\n", res); LeaveCriticalSection( &request->headers_section ); return res; diff --git a/dll/win32/wininet/internet.c b/dll/win32/wininet/internet.c index c3bf261572..6f8632a2f4 100644 --- a/dll/win32/wininet/internet.c +++ b/dll/win32/wininet/internet.c @@ -26,7 +26,46 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" + +#ifdef HAVE_CORESERVICES_CORESERVICES_H +#define GetCurrentThread MacGetCurrentThread +#define LoadResource MacLoadResource +#include <CoreServices/CoreServices.h> +#undef GetCurrentThread +#undef LoadResource +#undef DPRINTF +#endif + +#include "winsock2.h" +#include "ws2ipdef.h" + +#include <string.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> +#include <assert.h> + +#include "windef.h" +#include "winbase.h" +#include "winreg.h" +#include "winuser.h" +#include "wininet.h" +#include "winnls.h" +#include "wine/debug.h" +#include "winerror.h" +#define NO_SHLWAPI_STREAM +#include "shlwapi.h" + +#include "wine/exception.h" + #include "internet.h" +#include "resource.h" + +#include "wine/unicode.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wininet); typedef struct { @@ -1625,7 +1664,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF if (dwFlags & ICU_DECODE) { - WCHAR *url_tmp; + WCHAR *url_tmp, *buffer; DWORD len = dwUrlLength + 1; BOOL ret; @@ -1634,9 +1673,24 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF SetLastError(ERROR_OUTOFMEMORY); return FALSE; } - ret = InternetCanonicalizeUrlW(url_tmp, url_tmp, &len, ICU_DECODE | ICU_NO_ENCODE); + + buffer = url_tmp; + ret = InternetCanonicalizeUrlW(url_tmp, buffer, &len, ICU_DECODE | ICU_NO_ENCODE); + if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + buffer = heap_alloc(len * sizeof(WCHAR)); + if (!buffer) + { + SetLastError(ERROR_OUTOFMEMORY); + heap_free(url_tmp); + return FALSE; + } + ret = InternetCanonicalizeUrlW(url_tmp, buffer, &len, ICU_DECODE | ICU_NO_ENCODE); + } if (ret) - ret = InternetCrackUrlW(url_tmp, len, dwFlags & ~ICU_DECODE, lpUC); + ret = InternetCrackUrlW(buffer, len, dwFlags & ~ICU_DECODE, lpUC); + + if (buffer != url_tmp) heap_free(buffer); heap_free(url_tmp); return ret; } @@ -2271,7 +2325,8 @@ static WCHAR *get_proxy_autoconfig_url(void) CFRelease( settings ); return ret; #else - FIXME( "no support on this platform\n" ); + static int once; + if (!once++) FIXME( "no support on this platform\n" ); return NULL; #endif } @@ -2821,10 +2876,21 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, FIXME("Option INTERNET_OPTION_DISABLE_AUTODIAL; STUB\n"); break; case INTERNET_OPTION_HTTP_DECODING: - FIXME("INTERNET_OPTION_HTTP_DECODING; STUB\n"); - SetLastError(ERROR_INTERNET_INVALID_OPTION); - ret = FALSE; + { + if (!lpwhh) + { + SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); + return FALSE; + } + if (!lpBuffer || dwBufferLength != sizeof(BOOL)) + { + SetLastError(ERROR_INVALID_PARAMETER); + ret = FALSE; + } + else + lpwhh->decoding = *(BOOL *)lpBuffer; break; + } case INTERNET_OPTION_COOKIES_3RD_PARTY: FIXME("INTERNET_OPTION_COOKIES_3RD_PARTY; STUB\n"); SetLastError(ERROR_INTERNET_INVALID_OPTION); @@ -2911,6 +2977,12 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, ret = (res == ERROR_SUCCESS); break; } + case INTERNET_OPTION_SETTINGS_CHANGED: + FIXME("INTERNET_OPTION_SETTINGS_CHANGED; STUB\n"); + break; + case INTERNET_OPTION_REFRESH: + FIXME("INTERNET_OPTION_REFRESH; STUB\n"); + break; default: FIXME("Option %d STUB\n",dwOption); SetLastError(ERROR_INTERNET_INVALID_OPTION); diff --git a/dll/win32/wininet/internet.h b/dll/win32/wininet/internet.h index 23567364f4..e80f6036f0 100644 --- a/dll/win32/wininet/internet.h +++ b/dll/win32/wininet/internet.h @@ -23,69 +23,13 @@ #ifndef _WINE_INTERNET_H_ #define _WINE_INTERNET_H_ -#include <wine/config.h> - -#include <assert.h> -#include <stdio.h> - -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include <windef.h> -#include <winbase.h> -#include <winreg.h> -#include <winuser.h> -#include <wininet.h> -#define NO_SHLWAPI_STREAM -#define NO_SHLWAPI_REG -#define NO_SHLWAPI_GDI -#include <shlwapi.h> - -#include <wine/list.h> -#include <wine/debug.h> -#include <wine/unicode.h> - -#ifdef HAVE_ARPA_INET_H -# include <arpa/inet.h> -#endif -#ifdef HAVE_NETDB_H -# include <netdb.h> -#endif -#ifdef HAVE_NETINET_IN_H -# include <sys/types.h> -# include <netinet/in.h> -#endif -#ifdef HAVE_SYS_IOCTL_H -# include <sys/ioctl.h> -#endif -#ifdef HAVE_SYS_POLL_H -# include <sys/poll.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -# include <sys/socket.h> -#endif -#ifdef HAVE_SYS_TIME_H -# include <sys/time.h> -#endif -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif - -#if defined(__MINGW32__) || defined (_MSC_VER) -#include <ws2tcpip.h> -#else -#define closesocket close -#define ioctlsocket ioctl -#endif /* __MINGW32__ */ - -#include <winineti.h> - -#include "resource.h" - -WINE_DEFAULT_DEBUG_CHANNEL(wininet); +#include "wine/unicode.h" +#include "wine/heap.h" +#include "wine/list.h" + +#include <time.h> + +#include "winineti.h" extern HMODULE WININET_hModule DECLSPEC_HIDDEN; @@ -146,31 +90,11 @@ typedef struct BOOL is_valid_netconn(netconn_t *) DECLSPEC_HIDDEN; void close_netconn(netconn_t *) DECLSPEC_HIDDEN; -static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len) -{ - return HeapAlloc(GetProcessHeap(), 0, len); -} - -static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len) -{ - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); -} - -static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len) -{ - return HeapReAlloc(GetProcessHeap(), 0, mem, len); -} - static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len) { return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len); } -static inline BOOL heap_free(void *mem) -{ - return HeapFree(GetProcessHeap(), 0, mem); -} - static inline LPWSTR heap_strdupW(LPCWSTR str) { LPWSTR ret = NULL; @@ -357,6 +281,7 @@ struct _object_header_t ULONG ErrorMask; DWORD dwInternalFlags; LONG refs; + BOOL decoding; INTERNET_STATUS_CALLBACK lpfnStatusCB; struct list entry; struct list children; @@ -453,7 +378,6 @@ typedef struct DWORD read_size; /* valid data size in read_buf */ BYTE read_buf[READ_BUFFER_SIZE]; /* buffer for already read but not returned data */ - BOOL decoding; data_stream_t *data_stream; netconn_stream_t netconn_stream; } http_request_t; diff --git a/dll/win32/wininet/netconnection.c b/dll/win32/wininet/netconnection.c index 648abc8f7c..b91c6be8dc 100644 --- a/dll/win32/wininet/netconnection.c +++ b/dll/win32/wininet/netconnection.c @@ -21,20 +21,27 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define NONAMELESSUNION + +#include "ws2tcpip.h" + +#include <time.h> +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <assert.h> + +#include "wine/library.h" +#include "windef.h" +#include "winbase.h" +#include "wininet.h" +#include "winerror.h" + +#include "wine/debug.h" #include "internet.h" -#include <sys/types.h> -#ifdef HAVE_POLL_H -#include <poll.h> -#endif -#ifdef HAVE_SYS_FILIO_H -# include <sys/filio.h> -#endif -#ifdef HAVE_NETINET_TCP_H -# include <netinet/tcp.h> -#endif - -#include <errno.h> +WINE_DEFAULT_DEBUG_CHANNEL(wininet); static DWORD netconn_verify_cert(netconn_t *conn, PCCERT_CONTEXT cert, HCERTSTORE store) { diff --git a/dll/win32/wininet/precomp.h b/dll/win32/wininet/precomp.h new file mode 100644 index 0000000000..3e26831a16 --- /dev/null +++ b/dll/win32/wininet/precomp.h @@ -0,0 +1,64 @@ + +#ifndef _WININET_PRECOMP_H_ +#define _WININET_PRECOMP_H_ + +#include <wine/config.h> + +#include <assert.h> +#include <stdio.h> + +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include <windef.h> +#include <winbase.h> +#include <winreg.h> +#include <winuser.h> +#include <wininet.h> +#define NO_SHLWAPI_STREAM +#define NO_SHLWAPI_REG +#define NO_SHLWAPI_GDI +#include <shlwapi.h> + +#include <wine/debug.h> + +#ifdef HAVE_ARPA_INET_H +# include <arpa/inet.h> +#endif +#ifdef HAVE_NETDB_H +# include <netdb.h> +#endif +#ifdef HAVE_NETINET_IN_H +# include <sys/types.h> +# include <netinet/in.h> +#endif +#ifdef HAVE_SYS_IOCTL_H +# include <sys/ioctl.h> +#endif +#ifdef HAVE_SYS_POLL_H +# include <sys/poll.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#endif +#ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +#if defined(__MINGW32__) || defined (_MSC_VER) +#include <ws2tcpip.h> +#else +#define closesocket close +#define ioctlsocket ioctl +#endif /* __MINGW32__ */ + +#include "internet.h" +#include "resource.h" + +#endif /* !_WININET_PRECOMP_H_ */ diff --git a/dll/win32/wininet/resource.h b/dll/win32/wininet/resource.h index cf1ace7bf1..d1fa2fbcee 100644 --- a/dll/win32/wininet/resource.h +++ b/dll/win32/wininet/resource.h @@ -20,6 +20,9 @@ #pragma once +#include <windef.h> +#include <winuser.h> + #define IDD_INVCERTDLG 0x398 #define IDD_AUTHDLG 0x399 #define IDD_PROXYDLG 0x400 diff --git a/dll/win32/wininet/rsrc.rc b/dll/win32/wininet/rsrc.rc index 8f6f7b6ff7..7dd7ab41f3 100644 --- a/dll/win32/wininet/rsrc.rc +++ b/dll/win32/wininet/rsrc.rc @@ -18,9 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <windef.h> -#include <winuser.h> - #include "resource.h" /* diff --git a/dll/win32/wininet/urlcache.c b/dll/win32/wininet/urlcache.c index 11c1329185..30a469a93a 100644 --- a/dll/win32/wininet/urlcache.c +++ b/dll/win32/wininet/urlcache.c @@ -22,10 +22,33 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define NONAMELESSUNION + +#include "ws2tcpip.h" + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "wininet.h" +#include "winineti.h" +#include "winerror.h" +#include "winreg.h" +#include "shlwapi.h" +#include "shlobj.h" +#include "shellapi.h" + #include "internet.h" -#include <shlobj.h> -#include <shellapi.h> +#include "wine/unicode.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wininet); static const char urlcache_ver_prefix[] = "WINE URLCache Ver "; static const char urlcache_ver[] = "0.2012001"; diff --git a/dll/win32/wininet/utility.c b/dll/win32/wininet/utility.c index ca7a7687ac..0e67da98db 100644 --- a/dll/win32/wininet/utility.c +++ b/dll/win32/wininet/utility.c @@ -22,10 +22,27 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "ws2tcpip.h" + +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +#include "windef.h" +#include "winbase.h" +#include "wininet.h" +#include "winnls.h" + +#include "wine/debug.h" #include "internet.h" -// ReactOS +#ifdef __REACTOS__ +#include <stdio.h> #include "inet_ntop.c" +#endif + +WINE_DEFAULT_DEBUG_CHANNEL(wininet); #define TIME_STRING_LEN 30 diff --git a/dll/win32/wininet/version.rc b/dll/win32/wininet/version.rc index d5d9ea3a34..1d3212abd5 100644 --- a/dll/win32/wininet/version.rc +++ b/dll/win32/wininet/version.rc @@ -25,4 +25,4 @@ #define WINE_PRODUCTVERSION 8,00,7601,17601 #define WINE_PRODUCTVERSION_STR "8.00.7601.17601" -#include <wine/wine_common_ver.rc> +#include "wine/wine_common_ver.rc" diff --git a/dll/win32/wininet/wininet.spec b/dll/win32/wininet/wininet.spec index 38fd03b770..7ef28d6777 100644 --- a/dll/win32/wininet/wininet.spec +++ b/dll/win32/wininet/wininet.spec @@ -216,7 +216,7 @@ @ stdcall IsUrlCacheEntryExpiredA(str long ptr) @ stdcall IsUrlCacheEntryExpiredW(wstr long ptr) @ stdcall LoadUrlCacheContent() -@ stdcall -stub ParseX509EncodedCertificateForListBoxEntry(ptr long str ptr) +@ stdcall ParseX509EncodedCertificateForListBoxEntry(ptr long str ptr) @ stdcall PrivacyGetZonePreferenceW(long long ptr ptr ptr) @ stdcall PrivacySetZonePreferenceW(long long long wstr) @ stdcall ReadUrlCacheEntryStream(ptr long ptr ptr long) diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 15c38ec55e..8864a5e8c0 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -201,7 +201,7 @@ reactos/dll/win32/windowscodecsext # Synced to WineStaging-2.9 reactos/dll/win32/winemp3.acm # Synced to WineStaging-3.3 reactos/dll/win32/wing32 # Synced to WineStaging-3.3 reactos/dll/win32/winhttp # Synced to WineStaging-3.3 -reactos/dll/win32/wininet # Synced to Wine-3.0 +reactos/dll/win32/wininet # Synced to WineStaging-3.3 reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628
6 years, 9 months
1
0
0
0
01/01: [WINHTTP_WINETEST] Sync with Wine Staging 3.3. CORE-14434
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=13ce1b5f170f4adb75f7e…
commit 13ce1b5f170f4adb75f7e84a77296860156ce2cf Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Mar 24 13:16:16 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Mar 24 13:16:16 2018 +0100 [WINHTTP_WINETEST] Sync with Wine Staging 3.3. CORE-14434 --- modules/rostests/winetests/winhttp/winhttp.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/rostests/winetests/winhttp/winhttp.c b/modules/rostests/winetests/winhttp/winhttp.c index d9024dfb7d..eb2fb1b5fa 100644 --- a/modules/rostests/winetests/winhttp/winhttp.c +++ b/modules/rostests/winetests/winhttp/winhttp.c @@ -19,27 +19,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - #define COBJMACROS #include <stdarg.h> #include <windef.h> -#include <winbase.h> -#include <winnls.h> -#include <ole2.h> #include <winsock2.h> -//#include <ws2tcpip.h> +#include <ws2tcpip.h> #include <winhttp.h> #include <wincrypt.h> #include <winreg.h> #include <stdio.h> -//#include "initguid.h" +#include <initguid.h> #include <httprequest.h> #include <httprequestid.h> -#include <wine/test.h> +#include "wine/test.h" DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
6 years, 9 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
44
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Results per page:
10
25
50
100
200