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
June 2012
----- 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
11 participants
120 discussions
Start a n
N
ew thread
[tfaber] 56765: [NTDSAPI][PRINTUI] - Don't ignore DllMain
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jun 20 22:54:30 2012 New Revision: 56765 URL:
http://svn.reactos.org/svn/reactos?rev=56765&view=rev
Log: [NTDSAPI][PRINTUI] - Don't ignore DllMain Modified: trunk/reactos/dll/win32/ntdsapi/CMakeLists.txt trunk/reactos/dll/win32/printui/CMakeLists.txt Modified: trunk/reactos/dll/win32/ntdsapi/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntdsapi/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/ntdsapi/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ntdsapi/CMakeLists.txt [iso-8859-1] Wed Jun 20 22:54:30 2012 @@ -10,11 +10,11 @@ ${CMAKE_CURRENT_BINARY_DIR}/ntdsapi.def) add_library(ntdsapi SHARED ${SOURCE}) -set_module_type(ntdsapi win32dll ENTRYPOINT 0 ) +set_module_type(ntdsapi win32dll) target_link_libraries(ntdsapi wine) -add_importlibs(ntdsapi user32 kernel32 ntdll) +add_importlibs(ntdsapi user32 msvcrt kernel32 ntdll) add_dependencies(ntdsapi psdk) add_cd_file(TARGET ntdsapi DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/printui/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/printui/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/printui/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/printui/CMakeLists.txt [iso-8859-1] Wed Jun 20 22:54:30 2012 @@ -2,7 +2,6 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) add_definitions(-D__WINESRC__) -set_rc_compiler() spec2def(printui.dll printui.spec) list(APPEND SOURCE @@ -12,10 +11,10 @@ ${CMAKE_CURRENT_BINARY_DIR}/printui.def) add_library(printui SHARED ${SOURCE}) -set_module_type(printui win32dll ENTRYPOINT 0 ) +set_module_type(printui win32dll) target_link_libraries(printui wine) -add_importlibs(printui shell32 kernel32 ntdll) +add_importlibs(printui shell32 msvcrt kernel32 ntdll) add_dependencies(printui psdk) add_cd_file(TARGET printui DESTINATION reactos/system32 FOR all)
12 years, 6 months
1
0
0
0
[spetreolle] 56764: [WINED3D] Fix wined3d entrypoint. Should fix directdraw 7, 8, 9 apps.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Wed Jun 20 21:45:57 2012 New Revision: 56764 URL:
http://svn.reactos.org/svn/reactos?rev=56764&view=rev
Log: [WINED3D] Fix wined3d entrypoint. Should fix directdraw 7,8,9 apps. Modified: trunk/reactos/dll/directx/wine/wined3d/CMakeLists.txt Modified: trunk/reactos/dll/directx/wine/wined3d/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/C…
============================================================================== --- trunk/reactos/dll/directx/wine/wined3d/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/wined3d/CMakeLists.txt [iso-8859-1] Wed Jun 20 21:45:57 2012 @@ -40,7 +40,7 @@ add_library(wined3d SHARED ${SOURCE} version.rc) -set_module_type(wined3d win32dll ENTRYPOINT 0) +set_module_type(wined3d win32dll) target_link_libraries(wined3d wine)
12 years, 6 months
1
0
0
0
[tkreuzer] 56762: [PSDK] intsafe.h: add some more definitions
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jun 20 19:16:44 2012 New Revision: 56762 URL:
http://svn.reactos.org/svn/reactos?rev=56762&view=rev
Log: [PSDK] intsafe.h: add some more definitions Modified: trunk/reactos/include/psdk/intsafe.h Modified: trunk/reactos/include/psdk/intsafe.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/intsafe.h?rev…
============================================================================== --- trunk/reactos/include/psdk/intsafe.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/intsafe.h [iso-8859-1] Wed Jun 20 19:16:44 2012 @@ -313,8 +313,19 @@ DEFINE_SAFE_CONVERT_UTOX(UIntPtrToLong, UINT_PTR, LONG) DEFINE_SAFE_CONVERT_UTOX(UIntPtrToIntPtr, UINT_PTR, INT_PTR) DEFINE_SAFE_CONVERT_UTOX(UIntPtrToLongPtr, UINT_PTR, LONG_PTR) +DEFINE_SAFE_CONVERT_UTOX(ULongToUChar, ULONG, UCHAR) +DEFINE_SAFE_CONVERT_UTOX(ULongToUInt8, ULONG, UINT8) +DEFINE_SAFE_CONVERT_UTOX(ULongToShort, ULONG, SHORT) +DEFINE_SAFE_CONVERT_UTOX(ULongToUShort, ULONG, USHORT) +DEFINE_SAFE_CONVERT_UTOX(ULongToInt, ULONG, INT) +DEFINE_SAFE_CONVERT_UTOX(ULongToUInt, ULONG, UINT) +DEFINE_SAFE_CONVERT_UTOX(ULongToIntPtr, ULONG, INT_PTR) +DEFINE_SAFE_CONVERT_UTOX(ULongToUIntPtr, ULONG, UINT_PTR) +DEFINE_SAFE_CONVERT_UTOX(ULongToLongPtr, ULONG, LONG_PTR) +DEFINE_SAFE_CONVERT_UTOX(ULongPtrToULong, ULONG_PTR, ULONGLONG) DEFINE_SAFE_CONVERT_UTOX(ULongLongToUInt, ULONGLONG, UINT) DEFINE_SAFE_CONVERT_UTOX(ULongLongToULong, ULONGLONG, ULONG) +DEFINE_SAFE_CONVERT_UTOX(ULongLongToULongPtr, ULONGLONG, ULONG_PTR) #define DEFINE_SAFE_CONVERT_ITOU(_Name, _TypeFrom, _TypeTo) \ @@ -450,12 +461,17 @@ #define RtlInt8ToSizeT RtlInt8ToUIntPtr #define RtlInt8ToSIZET RtlInt8ToULongPtr #define RtlIntToSizeT RtlIntToUIntPtr +#define RtlIntToSIZET RtlIntToULongPtr +#define RtlULongToByte RtlULongToUInt8 #define RtlULongLongToInt64 RtlULongLongToLongLong #define RtlULongLongToLong64 RtlULongLongToLongLong #define RtlULongLongToPtrdiffT RtlULongLongToIntPtr #define RtlULongLongToSizeT RtlULongLongToUIntPtr #define RtlULongLongToSSIZET RtlULongLongToLongPtr #define RtlULongLongToSIZET RtlULongLongToULongPtr +#define RtlSIZETToULong RtlULongPtrToULong +#define RtlSSIZETToULongLong RtlLongPtrToULongLong +#define RtlSSIZETToULong RtlLongPtrToULong #ifdef _WIN64 #define RtlIntToUIntPtr RtlIntToULongLong #define RtlULongLongToIntPtr RtlULongLongToLongLong @@ -481,12 +497,17 @@ #define Int8ToSizeT Int8ToUIntPtr #define Int8ToSIZET Int8ToULongPtr #define IntToSizeT IntToUIntPtr +#define IntToSIZET IntToULongPtr +#define ULongToByte ULongToUInt8 #define ULongLongToInt64 ULongLongToLongLong #define ULongLongToLong64 ULongLongToLongLong #define ULongLongToPtrdiffT ULongLongToIntPtr #define ULongLongToSizeT ULongLongToUIntPtr #define ULongLongToSSIZET ULongLongToLongPtr #define ULongLongToSIZET ULongLongToULongPtr +#define SIZETToULong ULongPtrToULong +#define SSIZETToULongLong LongPtrToULongLong +#define SSIZETToULong LongPtrToULong #ifdef _WIN64 #define IntToUIntPtr IntToULongLong #define ULongLongToIntPtr ULongLongToLongLong
12 years, 6 months
1
0
0
0
[tfaber] 56761: [WININET] - Fix sock_namelen type in FTP_Connect. Already sent to Wine. - Fix warnings
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jun 20 15:10:50 2012 New Revision: 56761 URL:
http://svn.reactos.org/svn/reactos?rev=56761&view=rev
Log: [WININET] - Fix sock_namelen type in FTP_Connect. Already sent to Wine. - Fix warnings Modified: trunk/reactos/dll/win32/wininet/CMakeLists.txt trunk/reactos/dll/win32/wininet/ftp.c trunk/reactos/dll/win32/wininet/http.c trunk/reactos/dll/win32/wininet/inet_ntop.c trunk/reactos/dll/win32/wininet/internet.h trunk/reactos/dll/win32/wininet/wininet_ros.diff Modified: trunk/reactos/dll/win32/wininet/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/wininet/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/CMakeLists.txt [iso-8859-1] Wed Jun 20 15:10:50 2012 @@ -20,22 +20,15 @@ urlcache.c utility.c wininet_main.c + rsrc.rc + version.rc ${CMAKE_CURRENT_BINARY_DIR}/wininet_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/wininet.def) -add_library(wininet SHARED - ${SOURCE} - rsrc.rc - version.rc) +add_library(wininet SHARED ${SOURCE}) 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 msvcrt kernel32 ntdll) add_cd_file(TARGET wininet DESTINATION reactos/system32 FOR all) - -if(NOT MSVC) - # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
- #allow_warnings(wininet) - set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error") -endif() Modified: trunk/reactos/dll/win32/wininet/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/ftp.c?re…
============================================================================== --- trunk/reactos/dll/win32/wininet/ftp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/ftp.c [iso-8859-1] Wed Jun 20 15:10:50 2012 @@ -2433,7 +2433,7 @@ static const WCHAR szEmpty[] = {'\0'}; struct sockaddr_in socketAddr; INT nsocket = -1; - UINT sock_namelen; + socklen_t sock_namelen; BOOL bSuccess = FALSE; ftp_session_t *lpwfs = NULL; char szaddr[INET_ADDRSTRLEN]; Modified: trunk/reactos/dll/win32/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
============================================================================== --- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Wed Jun 20 15:10:50 2012 @@ -1901,6 +1901,9 @@ } return; } +#else + // silence unused function warning + (void)collect_connections_proc; #endif INTERNET_SendCallback(&req->hdr, req->hdr.dwContext, Modified: trunk/reactos/dll/win32/wininet/inet_ntop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/inet_nto…
============================================================================== --- trunk/reactos/dll/win32/wininet/inet_ntop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/inet_ntop.c [iso-8859-1] Wed Jun 20 15:10:50 2012 @@ -27,7 +27,7 @@ #ifdef SPRINTF_CHAR # define SPRINTF(x) strlen(sprintf/**/x) #else -# define SPRINTF(x) ((size_t)sprintf x) +# define SPRINTF(x) ((socklen_t)sprintf x) #endif /* @@ -35,10 +35,10 @@ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ -static const char *inet_ntop4(const u_char *src, char *dst, size_t size); +static const char *inet_ntop4(const u_char *src, char *dst, socklen_t size); #ifdef INET6 -static const char *inet_ntop6(const u_char *src, char *dst, size_t size); +static const char *inet_ntop6(const u_char *src, char *dst, socklen_t size); #endif /* char * @@ -50,7 +50,7 @@ * Paul Vixie, 1996. */ const char * -inet_ntop(int af, const void *src, char *dst, size_t size) +inet_ntop(int af, const void *src, char *dst, socklen_t size) { switch (af) { @@ -79,7 +79,7 @@ * Paul Vixie, 1996. */ static const char * -inet_ntop4(const u_char *src, char *dst, size_t size) +inet_ntop4(const u_char *src, char *dst, socklen_t size) { static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; @@ -100,7 +100,7 @@ * Paul Vixie, 1996. */ static const char * -inet_ntop6(const u_char *src, char *dst, size_t size) +inet_ntop6(const u_char *src, char *dst, socklen_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough @@ -178,7 +178,7 @@ /* * Check for overflow, copy, and we're done. */ - if ((size_t)(tp - tmp) > size) { + if ((socklen_t)(tp - tmp) > size) { WSASetLastError(WSAEINVAL); return (NULL); } Modified: trunk/reactos/dll/win32/wininet/internet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
============================================================================== --- trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] Wed Jun 20 15:10:50 2012 @@ -540,6 +540,25 @@ int sock_get_error(int) DECLSPEC_HIDDEN; #else #define sock_get_error(x) WSAGetLastError() +const char *inet_ntop(int, const void *, char *, socklen_t); + +static inline long unix_recv(int socket, void *buffer, size_t length, int flags) +{ + return recv(socket, buffer, length, flags); +} +#define recv unix_recv + +static inline int unix_ioctl(int filedes, long request, void *arg) +{ + return ioctlsocket(filedes, request, arg); +} +#define ioctlsocket unix_ioctl + +static inline int unix_getsockopt(int socket, int level, int option_name, void *option_value, socklen_t *option_len) +{ + return getsockopt(socket, level, option_name, option_value, option_len); +} +#define getsockopt unix_getsockopt #endif extern void URLCacheContainers_CreateDefaults(void) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/wininet/wininet_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet_…
============================================================================== --- trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] Wed Jun 20 15:10:50 2012 @@ -1,6 +1,6 @@ ---- wine-1.5.4/Wine/dlls/wininet/internet.h 2012-06-20 14:38:39 +0200 -+++ dll/win32/wininet/internet.h 2012-06-20 14:51:41 +0200 -@@ -536,7 +536,11 @@ BOOL NETCON_is_alive(netconn_t*) DECLSPE +--- wine-1.5.4/dlls/wininet/internet.h 2012-06-20 14:38:39 +0200 ++++ dll/win32/wininet/internet.h 2012-06-20 16:49:05 +0200 +@@ -536,7 +536,30 @@ BOOL NETCON_is_alive(netconn_t*) DECLSPE LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN; int NETCON_GetCipherStrength(netconn_t*) DECLSPEC_HIDDEN; DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, DWORD value) DECLSPEC_HIDDEN; @@ -8,12 +8,31 @@ int sock_get_error(int) DECLSPEC_HIDDEN; +#else +#define sock_get_error(x) WSAGetLastError() ++const char *inet_ntop(int, const void *, char *, socklen_t); ++ ++static inline long unix_recv(int socket, void *buffer, size_t length, int flags) ++{ ++ return recv(socket, buffer, length, flags); ++} ++#define recv unix_recv ++ ++static inline int unix_ioctl(int filedes, long request, void *arg) ++{ ++ return ioctlsocket(filedes, request, arg); ++} ++#define ioctlsocket unix_ioctl ++ ++static inline int unix_getsockopt(int socket, int level, int option_name, void *option_value, socklen_t *option_len) ++{ ++ return getsockopt(socket, level, option_name, option_value, option_len); ++} ++#define getsockopt unix_getsockopt +#endif extern void URLCacheContainers_CreateDefaults(void) DECLSPEC_HIDDEN; extern void URLCacheContainers_DeleteAll(void) DECLSPEC_HIDDEN; ---- wine-1.5.4/Wine/dlls/wininet/netconnection.c 2012-06-20 14:38:39 +0200 -+++ dll/win32/wininet/netconnection.c 2012-06-20 14:52:22 +0200 +--- wine-1.5.4/dlls/wininet/netconnection.c 2012-06-20 14:38:39 +0200 ++++ dll/win32/wininet/netconnection.c 2012-06-20 15:50:06 +0200 @@ -523,12 +523,16 @@ DWORD create_netconn(BOOL useSSL, server if(result == -1) { @@ -51,8 +70,8 @@ /****************************************************************************** * NETCON_secure_connect ---- wine-1.5.4/Wine/dlls/wininet/internet.c 2012-06-20 14:38:38 +0200 -+++ dll/win32/wininet/internet.c 2012-06-20 14:58:51 +0200 +--- wine-1.5.4/dlls/wininet/internet.c 2012-06-20 14:38:38 +0200 ++++ dll/win32/wininet/internet.c 2012-06-20 15:50:05 +0200 @@ -292,7 +292,9 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES) return FALSE; @@ -91,10 +110,8 @@ { if (recv(nSocket, &lpszBuffer[nRecv], 1, 0) <= 0) { -Index: dll/win32/wininet/urlcache.c -=================================================================== ---- wine-1.5.4/Wine/dlls/wininet/urlcache.c 2012-06-20 14:30:41 +0200 -+++ dll/win32/wininet/urlcache.c 2012-06-20 14:54:06 +0200 +--- wine-1.5.4/dlls/wininet/urlcache.c 2012-06-20 14:30:41 +0200 ++++ dll/win32/wininet/urlcache.c 2012-06-20 15:50:06 +0200 @@ -189,6 +189,8 @@ typedef struct _URLCACHECONTAINER /* List of all containers available */ @@ -160,10 +177,8 @@ LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry) { /* The URL cache has prefix L"" (unlike Cookies and History) */ -Index: dll/win32/wininet/http.c -=================================================================== ---- wine-1.5.4/Wine/dlls/wininet/http.c 2012-06-20 14:38:38 +0200 -+++ dll/win32/wininet/http.c 2012-06-20 14:49:11 +0200 +--- wine-1.5.4/dlls/wininet/http.c 2012-06-20 15:19:57 +0200 ++++ dll/win32/wininet/http.c 2012-06-20 16:24:11 +0200 @@ -73,6 +73,9 @@ #include "wine/exception.h" #include "wine/unicode.h" @@ -218,10 +233,13 @@ req->netconn = NULL; run_collector = !collector_running; -@@ -1888,6 +1901,7 @@ static void http_release_netconn(http_re +@@ -1888,6 +1901,10 @@ static void http_release_netconn(http_re } return; } ++#else ++ // silence unused function warning ++ (void)collect_connections_proc; +#endif INTERNET_SendCallback(&req->hdr, req->hdr.dwContext,
12 years, 6 months
1
0
0
0
[tfaber] 56760: [WININET] - Sync to Wine 1.5.4. Resource files left untouched. - Fix INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT if SSL support unavailable (already applied upstream) See issue #711...
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jun 20 13:50:00 2012 New Revision: 56760 URL:
http://svn.reactos.org/svn/reactos?rev=56760&view=rev
Log: [WININET] - Sync to Wine 1.5.4. Resource files left untouched. - Fix INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT if SSL support unavailable (already applied upstream) See issue #7117 for more details. Modified: trunk/reactos/dll/win32/wininet/CMakeLists.txt trunk/reactos/dll/win32/wininet/cookie.c trunk/reactos/dll/win32/wininet/dialogs.c trunk/reactos/dll/win32/wininet/ftp.c trunk/reactos/dll/win32/wininet/http.c trunk/reactos/dll/win32/wininet/internet.c trunk/reactos/dll/win32/wininet/internet.h trunk/reactos/dll/win32/wininet/netconnection.c trunk/reactos/dll/win32/wininet/urlcache.c trunk/reactos/dll/win32/wininet/utility.c trunk/reactos/dll/win32/wininet/wininet.spec trunk/reactos/dll/win32/wininet/wininet_ros.diff trunk/reactos/include/psdk/winineti.h trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/wininet/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/CMakeLis…
Modified: trunk/reactos/dll/win32/wininet/cookie.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/cookie.c…
Modified: trunk/reactos/dll/win32/wininet/dialogs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/dialogs.…
Modified: trunk/reactos/dll/win32/wininet/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/ftp.c?re…
Modified: trunk/reactos/dll/win32/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
Modified: trunk/reactos/dll/win32/wininet/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
Modified: trunk/reactos/dll/win32/wininet/internet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
Modified: trunk/reactos/dll/win32/wininet/netconnection.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/netconne…
Modified: trunk/reactos/dll/win32/wininet/urlcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/urlcache…
Modified: trunk/reactos/dll/win32/wininet/utility.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/utility.…
Modified: trunk/reactos/dll/win32/wininet/wininet.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet.…
Modified: trunk/reactos/dll/win32/wininet/wininet_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet_…
Modified: trunk/reactos/include/psdk/winineti.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winineti.h?re…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
12 years, 6 months
1
0
0
0
[tfaber] 56759: [WININET_WINETEST] - Sync to Wine 1.5.4
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jun 20 13:13:51 2012 New Revision: 56759 URL:
http://svn.reactos.org/svn/reactos?rev=56759&view=rev
Log: [WININET_WINETEST] - Sync to Wine 1.5.4 Modified: trunk/rostests/winetests/wininet/CMakeLists.txt trunk/rostests/winetests/wininet/ftp.c trunk/rostests/winetests/wininet/http.c trunk/rostests/winetests/wininet/internet.c trunk/rostests/winetests/wininet/urlcache.c Modified: trunk/rostests/winetests/wininet/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/CMakeLi…
============================================================================== --- trunk/rostests/winetests/wininet/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/CMakeLists.txt [iso-8859-1] Wed Jun 20 13:13:51 2012 @@ -2,8 +2,7 @@ remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) add_definitions( - -D__ROS_LONG64__ - -D_DLL -D__USE_CRTIMP) + -D__ROS_LONG64__) list(APPEND SOURCE ftp.c Modified: trunk/rostests/winetests/wininet/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/ftp.c?r…
============================================================================== --- trunk/rostests/winetests/wininet/ftp.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/ftp.c [iso-8859-1] Wed Jun 20 13:13:51 2012 @@ -726,8 +726,7 @@ { TRUE, ERROR_SUCCESS, "SIZE\t/welcome.msg" }, { TRUE, ERROR_SUCCESS, "SIZE /welcome.msg" }, { FALSE, ERROR_INTERNET_EXTENDED_ERROR, "PWD /welcome.msg" }, - { TRUE, ERROR_SUCCESS, "PWD" }, - { TRUE, ERROR_SUCCESS, "PWD\r\n" } + { TRUE, ERROR_SUCCESS, "PWD" } }; if (!pFtpCommandA) Modified: trunk/rostests/winetests/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/http.c?…
============================================================================== --- trunk/rostests/winetests/wininet/http.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/http.c [iso-8859-1] Wed Jun 20 13:13:51 2012 @@ -103,11 +103,11 @@ static const char *status_string[MAX_INTERNET_STATUS]; static HANDLE hCompleteEvent, conn_close_event; +static DWORD req_error; #define TESTF_REDIRECT 0x01 #define TESTF_COMPRESSED 0x02 -#define TESTF_ALLOW_COOKIE 0x04 -#define TESTF_CHUNKED 0x08 +#define TESTF_CHUNKED 0x04 typedef struct { const char *url; @@ -143,7 +143,7 @@ "
www.codeweavers.com
", "", "Accept-Encoding: gzip, deflate", - TESTF_COMPRESSED|TESTF_ALLOW_COOKIE + TESTF_COMPRESSED }, { "
http://test.winehq.org/tests/post.php
", @@ -176,6 +176,48 @@ RegCloseKey(internet_settings); return proxy_enable != 0; +} + +#define test_status_code(a,b) _test_status_code(__LINE__,a,b) +static void _test_status_code(unsigned line, HINTERNET req, DWORD excode) +{ + DWORD code, size, index; + char exbuf[10], bufa[10]; + BOOL res; + + code = 0xdeadbeef; + size = sizeof(code); + res = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, &code, &size, NULL); + ok_(__FILE__,line)(res, "HttpQueryInfo(HTTP_QUERY_STATUS_CODE|number) failed: %u\n", GetLastError()); + ok_(__FILE__,line)(code == excode, "code = %d, expected %d\n", code, excode); + + code = 0xdeadbeef; + index = 0; + size = sizeof(code); + res = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, &code, &size, &index); + ok_(__FILE__,line)(res, "HttpQueryInfo(HTTP_QUERY_STATUS_CODE|number index) failed: %u\n", GetLastError()); + ok_(__FILE__,line)(code == excode, "code = %d, expected %d\n", code, excode); + ok_(__FILE__,line)(!index, "index = %d, expected 0\n", code); + + sprintf(exbuf, "%u", excode); + + size = sizeof(bufa); + res = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE, bufa, &size, NULL); + ok_(__FILE__,line)(res, "HttpQueryInfo(HTTP_QUERY_STATUS_CODE) failed: %u\n", GetLastError()); + ok_(__FILE__,line)(!strcmp(bufa, exbuf), "unexpected status code %s, expected %s", bufa, exbuf); + + code = 0xdeadbeef; + index = 1; + size = sizeof(code); + res = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE||HTTP_QUERY_FLAG_NUMBER, &code, &size, &index); + ok_(__FILE__,line)(!res && GetLastError() == ERROR_HTTP_HEADER_NOT_FOUND, + "HttpQueryInfo failed: %x(%d)\n", res, GetLastError()); + + code = 0xdeadbeef; + size = sizeof(code); + res = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE||HTTP_QUERY_FLAG_REQUEST_HEADERS, &code, &size, NULL); + ok_(__FILE__,line)(!res && GetLastError() == ERROR_HTTP_HEADER_NOT_FOUND, + "HttpQueryInfo failed: %x(%d)\n", res, GetLastError()); } static int close_handle_cnt; @@ -287,9 +329,11 @@ ok(dwStatusInformationLength == sizeof(INTERNET_ASYNC_RESULT), "info length should be sizeof(INTERNET_ASYNC_RESULT) instead of %d\n", dwStatusInformationLength); + ok(iar->dwResult == 1 || iar->dwResult == 0, "iar->dwResult = %ld\n", iar->dwResult); trace("%04x:Callback %p 0x%lx INTERNET_STATUS_REQUEST_COMPLETE {%ld,%d} %d\n", GetCurrentThreadId(), hInternet, dwContext, iar->dwResult,iar->dwError,dwStatusInformationLength); + req_error = iar->dwError; SetEvent(hCompleteEvent); break; } @@ -396,10 +440,8 @@ CHECK_NOTIFIED(INTERNET_STATUS_HANDLE_CREATED); CHECK_NOT_NOTIFIED(INTERNET_STATUS_RESOLVING_NAME); CHECK_NOT_NOTIFIED(INTERNET_STATUS_NAME_RESOLVED); - if(test->flags & TESTF_ALLOW_COOKIE) { - SET_OPTIONAL(INTERNET_STATUS_COOKIE_SENT); - SET_OPTIONAL(INTERNET_STATUS_COOKIE_RECEIVED); - } + SET_OPTIONAL2(INTERNET_STATUS_COOKIE_SENT,2); + SET_OPTIONAL2(INTERNET_STATUS_COOKIE_RECEIVED,2); if (first_connection_to_test_url) { SET_EXPECT(INTERNET_STATUS_RESOLVING_NAME); @@ -431,6 +473,8 @@ goto abort; } + test_status_code(hor, 0); + trace("HttpSendRequestA -->\n"); if(test->post_data) { post_len = strlen(test->post_data); @@ -447,14 +491,14 @@ "Synchronous HttpSendRequest returning 0, error %u\n", GetLastError()); trace("HttpSendRequestA <--\n"); - if (flags & INTERNET_FLAG_ASYNC) + if (flags & INTERNET_FLAG_ASYNC) { WaitForSingleObject(hCompleteEvent, INFINITE); + ok(req_error == ERROR_SUCCESS, "req_error = %u\n", req_error); + } HeapFree(GetProcessHeap(), 0, post_data); - if(test->flags & TESTF_ALLOW_COOKIE) { - CLEAR_NOTIFIED(INTERNET_STATUS_COOKIE_SENT); - CLEAR_NOTIFIED(INTERNET_STATUS_COOKIE_RECEIVED); - } + CLEAR_NOTIFIED(INTERNET_STATUS_COOKIE_SENT); + CLEAR_NOTIFIED(INTERNET_STATUS_COOKIE_RECEIVED); if (first_connection_to_test_url) { if (! proxy_active()) @@ -549,6 +593,7 @@ ok(!length, "InternetQueryDataAvailable returned ERROR_IO_PENDING and %u length\n", length); WaitForSingleObject(hCompleteEvent, INFINITE); CHECK_NOTIFIED(INTERNET_STATUS_REQUEST_COMPLETE); + ok(req_error, "req_error = 0\n"); continue; }else { ok(0, "InternetQueryDataAvailable failed: %u\n", GetLastError()); @@ -760,6 +805,7 @@ SET_EXPECT(INTERNET_STATUS_RESOLVING_NAME); SET_EXPECT(INTERNET_STATUS_NAME_RESOLVED); } + SET_OPTIONAL2(INTERNET_STATUS_COOKIE_SENT, 2); SET_EXPECT(INTERNET_STATUS_CONNECTING_TO_SERVER); SET_EXPECT(INTERNET_STATUS_CONNECTED_TO_SERVER); SET_EXPECT2(INTERNET_STATUS_SENDING_REQUEST, 2); @@ -787,8 +833,10 @@ "Synchronous HttpSendRequest returning 0, error %u\n", GetLastError()); trace("HttpSendRequestA <--\n"); - if (!rc && (GetLastError() == ERROR_IO_PENDING)) + if (!rc && (GetLastError() == ERROR_IO_PENDING)) { WaitForSingleObject(hCompleteEvent, INFINITE); + ok(req_error == ERROR_SUCCESS, "req_error = %u\n", req_error); + } if (first_connection_to_test_url) { @@ -811,6 +859,7 @@ CHECK_NOTIFIED(INTERNET_STATUS_REQUEST_COMPLETE); else todo_wine CHECK_NOT_NOTIFIED(INTERNET_STATUS_REQUEST_COMPLETE); + CLEAR_NOTIFIED(INTERNET_STATUS_COOKIE_SENT); /* Sent on WinXP only if first_connection_to_test_url is TRUE, on Win98 always sent */ CLEAR_NOTIFIED(INTERNET_STATUS_CONNECTING_TO_SERVER); CLEAR_NOTIFIED(INTERNET_STATUS_CONNECTED_TO_SERVER); @@ -841,7 +890,7 @@ SET_EXPECT(INTERNET_STATUS_RESPONSE_RECEIVED); rc = InternetReadFileEx(hor, &inetbuffers, 0, 0xdeadcafe); ok(rc, "InternetReadFileEx failed with error %u\n", GetLastError()); - trace("read %i bytes\n", inetbuffers.dwBufferLength); + trace("read %i bytes\n", inetbuffers.dwBufferLength); todo_wine { CHECK_NOT_NOTIFIED(INTERNET_STATUS_RECEIVING_RESPONSE); @@ -879,6 +928,7 @@ WaitForSingleObject(hCompleteEvent, INFINITE); CHECK_NOTIFIED(INTERNET_STATUS_REQUEST_COMPLETE); CHECK_NOT_NOTIFIED(INTERNET_STATUS_RESPONSE_RECEIVED); + ok(req_error == ERROR_SUCCESS, "req_error = %u\n", req_error); } else { @@ -1842,7 +1892,7 @@ static void test_proxy_indirect(int port) { HINTERNET hi, hc, hr; - DWORD r, sz, val; + DWORD r, sz; char buffer[0x40]; hi = InternetOpen(NULL, 0, NULL, NULL, 0); @@ -1867,15 +1917,7 @@ } ok(!strcmp(buffer, "Basic realm=\"placebo\""), "proxy auth info wrong\n"); - sz = sizeof buffer; - r = HttpQueryInfo(hr, HTTP_QUERY_STATUS_CODE, buffer, &sz, NULL); - ok(r, "HttpQueryInfo failed\n"); - ok(!strcmp(buffer, "407"), "proxy code wrong\n"); - - sz = sizeof val; - r = HttpQueryInfo(hr, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, &val, &sz, NULL); - ok(r, "HttpQueryInfo failed\n"); - ok(val == 407, "proxy code wrong\n"); + test_status_code(hr, 407); sz = sizeof buffer; r = HttpQueryInfo(hr, HTTP_QUERY_STATUS_TEXT, buffer, &sz, NULL); @@ -1925,11 +1967,7 @@ r = HttpSendRequest(hr, NULL, 0, NULL, 0); ok(r, "HttpSendRequest failed\n"); - sz = sizeof buffer; - r = HttpQueryInfo(hr, HTTP_QUERY_STATUS_CODE, buffer, &sz, NULL); - ok(r, "HttpQueryInfo failed\n"); - ok(!strcmp(buffer, "407"), "proxy code wrong\n"); - + test_status_code(hr, 407); /* set the user + password then try again */ todo_wine { @@ -1980,11 +2018,7 @@ ret = HttpSendRequest(request, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed\n"); - status = 0; - size = sizeof(status); - ret = HttpQueryInfo( request, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL ); - ok(ret, "HttpQueryInfo failed\n"); - ok(status == 200, "request failed with status %u\n", status); + test_status_code(request, 200); InternetCloseHandle(request); @@ -2025,7 +2059,6 @@ static void test_connection_header(int port) { HINTERNET ses, con, req; - DWORD size, status; BOOL ret; ses = InternetOpen("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); @@ -2040,11 +2073,7 @@ ret = HttpSendRequest(req, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed\n"); - status = 0; - size = sizeof(status); - ret = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL); - ok(ret, "HttpQueryInfo failed\n"); - ok(status == 200, "request failed with status %u\n", status); + test_status_code(req, 200); InternetCloseHandle(req); @@ -2054,11 +2083,7 @@ ret = HttpSendRequest(req, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed\n"); - status = 0; - size = sizeof(status); - ret = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL); - ok(ret, "HttpQueryInfo failed\n"); - ok(status == 200, "request failed with status %u\n", status); + test_status_code(req, 200); InternetCloseHandle(req); @@ -2068,11 +2093,7 @@ ret = HttpSendRequest(req, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed\n"); - status = 0; - size = sizeof(status); - ret = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL); - ok(ret, "HttpQueryInfo failed\n"); - ok(status == 200, "request failed with status %u\n", status); + test_status_code(req, 200); InternetCloseHandle(req); @@ -2082,11 +2103,7 @@ ret = HttpSendRequest(req, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed\n"); - status = 0; - size = sizeof(status); - ret = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL); - ok(ret, "HttpQueryInfo failed\n"); - ok(status == 200, "request failed with status %u\n", status); + test_status_code(req, 200); InternetCloseHandle(req); InternetCloseHandle(con); @@ -2165,6 +2182,7 @@ ok(!res && (GetLastError() == ERROR_IO_PENDING), "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n"); WaitForSingleObject(hCompleteEvent, INFINITE); + ok(req_error == ERROR_SUCCESS, "req_error = %u\n", req_error); CLEAR_NOTIFIED(INTERNET_STATUS_COOKIE_SENT); CHECK_NOTIFIED(INTERNET_STATUS_CONNECTING_TO_SERVER); @@ -2222,6 +2240,7 @@ ok(!res && (GetLastError() == ERROR_IO_PENDING), "Asynchronous HttpSendRequest NOT returning 0 with error ERROR_IO_PENDING\n"); WaitForSingleObject(hCompleteEvent, INFINITE); + ok(req_error == ERROR_SUCCESS, "req_error = %u\n", req_error); CLEAR_NOTIFIED(INTERNET_STATUS_COOKIE_SENT); CHECK_NOTIFIED(INTERNET_STATUS_CONNECTING_TO_SERVER); @@ -2251,6 +2270,7 @@ SET_EXPECT(INTERNET_STATUS_REQUEST_COMPLETE); SetEvent(conn_close_event); WaitForSingleObject(hCompleteEvent, INFINITE); + ok(req_error == ERROR_SUCCESS, "req_error = %u\n", req_error); CHECK_NOTIFIED(INTERNET_STATUS_CLOSING_CONNECTION); CHECK_NOTIFIED(INTERNET_STATUS_CONNECTION_CLOSED); CHECK_NOTIFIED(INTERNET_STATUS_REQUEST_COMPLETE); @@ -2292,7 +2312,7 @@ static void test_cookie_header(int port) { HINTERNET ses, con, req; - DWORD size, status, error; + DWORD size, error; BOOL ret; char buffer[64]; @@ -2327,11 +2347,7 @@ ret = HttpSendRequest(req, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed: %u\n", GetLastError()); - status = 0; - size = sizeof(status); - ret = HttpQueryInfo(req, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL); - ok(ret, "HttpQueryInfo failed\n"); - ok(status == 200, "request failed with status %u\n", status); + test_status_code(req, 200); buffer[0] = 0; size = sizeof(buffer); @@ -2347,7 +2363,6 @@ static void test_basic_authentication(int port) { HINTERNET session, connect, request; - DWORD size, status; BOOL ret; session = InternetOpen("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); @@ -2362,11 +2377,7 @@ ret = HttpSendRequest(request, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed %u\n", GetLastError()); - status = 0; - size = sizeof(status); - ret = HttpQueryInfo( request, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL ); - ok(ret, "HttpQueryInfo failed\n"); - ok(status == 200, "request failed with status %u\n", status); + test_status_code(request, 200); InternetCloseHandle(request); InternetCloseHandle(connect); @@ -2376,7 +2387,7 @@ static void test_invalid_response_headers(int port) { HINTERNET session, connect, request; - DWORD size, status; + DWORD size; BOOL ret; char buffer[256]; @@ -2392,11 +2403,7 @@ ret = HttpSendRequest(request, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed %u\n", GetLastError()); - status = 0; - size = sizeof(status); - ret = HttpQueryInfo( request, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL ); - ok(ret, "HttpQueryInfo failed\n"); - ok(status == 401, "unexpected status %u\n", status); + test_status_code(request, 401); buffer[0] = 0; size = sizeof(buffer); @@ -2419,7 +2426,7 @@ static void test_response_without_headers(int port) { HINTERNET hi, hc, hr; - DWORD r, count, size, status; + DWORD r, count, size; char buffer[1024]; SetLastError(0xdeadbeef); @@ -2446,12 +2453,7 @@ todo_wine ok(count == sizeof page1 - 1, "count was wrong\n"); todo_wine ok(!memcmp(buffer, page1, sizeof page1), "http data wrong\n"); - status = 0; - size = sizeof(status); - SetLastError(0xdeadbeef); - r = HttpQueryInfo(hr, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL ); - todo_wine ok(r, "HttpQueryInfo failed %u\n", GetLastError()); - todo_wine ok(status == 200, "expected status 200 got %u\n", status); + test_status_code(hr, 200); buffer[0] = 0; size = sizeof(buffer); @@ -2536,17 +2538,7 @@ ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); ok(index == 0, "expected 0 got %u\n", index); - index = 0; - size = sizeof(buffer); - ret = HttpQueryInfo(hr, HTTP_QUERY_STATUS_CODE, buffer, &size, &index); - ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); - ok(index == 0, "expected 0 got %u\n", index); - - index = 0; - size = sizeof(buffer); - ret = HttpQueryInfo(hr, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, buffer, &size, &index); - ok(ret, "HttpQueryInfo failed %u\n", GetLastError()); - ok(index == 0, "expected 0 got %u\n", index); + test_status_code(hr, 200); index = 0xdeadbeef; size = sizeof(buffer); @@ -2684,6 +2676,27 @@ ret = InternetQueryOption(req, INTERNET_OPTION_CONTEXT_VALUE, &ctx, &size); ok(ret, "InternetQueryOption failed %u\n", GetLastError()); ok(ctx == 3, "expected 3 got %lu\n", ctx); + + /* INTERNET_OPTION_PROXY */ + SetLastError(0xdeadbeef); + ret = InternetQueryOptionA(ses, INTERNET_OPTION_PROXY, NULL, NULL); + error = GetLastError(); + ok(!ret, "InternetQueryOption succeeded\n"); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + + SetLastError(0xdeadbeef); + ret = InternetQueryOptionA(ses, INTERNET_OPTION_PROXY, &ctx, NULL); + error = GetLastError(); + ok(!ret, "InternetQueryOption succeeded\n"); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + + size = 0; + SetLastError(0xdeadbeef); + ret = InternetQueryOptionA(ses, INTERNET_OPTION_PROXY, NULL, &size); + error = GetLastError(); + ok(!ret, "InternetQueryOption succeeded\n"); + ok(error == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %u\n", error); + ok(size >= sizeof(INTERNET_PROXY_INFOA), "expected size to be greater or equal to the struct size\n"); InternetCloseHandle(req); InternetCloseHandle(con); @@ -3052,7 +3065,7 @@ { HINTERNET ses, con, req; static const char *types[] = { (const char *)6240, "*/*", "%p", "", (const char *)0xffffffff, "*/*", NULL }; - DWORD size; + DWORD size, error; char buffer[32]; BOOL ret; @@ -3064,11 +3077,14 @@ buffer[0] = 0; size = sizeof(buffer); + SetLastError(0xdeadbeef); ret = HttpQueryInfo(req, HTTP_QUERY_ACCEPT | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); - ok(ret, "HttpQueryInfo failed: %u\n", GetLastError()); - ok(!strcmp(buffer, ", */*, %p, , , */*") || /* IE6 */ - !strcmp(buffer, "*/*, %p, */*"), - "got '%s' expected '*/*, %%p, */*' or ', */*, %%p, , , */*'\n", buffer); + error = GetLastError(); + ok(!ret || broken(ret), "HttpQueryInfo succeeded\n"); + if (!ret) ok(error == ERROR_HTTP_HEADER_NOT_FOUND, "expected ERROR_HTTP_HEADER_NOT_FOUND, got %u\n", error); + ok(broken(!strcmp(buffer, ", */*, %p, , , */*")) /* IE6 */ || + broken(!strcmp(buffer, "*/*, %p, */*")) /* IE7/8 */ || + !strcmp(buffer, ""), "got '%s' expected ''\n", buffer); InternetCloseHandle(req); InternetCloseHandle(con); @@ -3185,6 +3201,8 @@ HANDLE wait; DWORD thread; unsigned int line; + DWORD expect_result; + BOOL is_aborted; }; static CRITICAL_SECTION notification_cs; @@ -3197,11 +3215,27 @@ EnterCriticalSection( ¬ification_cs ); + if(info->is_aborted) { + LeaveCriticalSection(¬ification_cs); + return; + } + if (status == INTERNET_STATUS_HANDLE_CREATED) { DWORD size = sizeof(struct info *); HttpQueryInfoA( handle, INTERNET_OPTION_CONTEXT_VALUE, &info, &size, 0 ); - } + }else if(status == INTERNET_STATUS_REQUEST_COMPLETE) { + INTERNET_ASYNC_RESULT *ar = (INTERNET_ASYNC_RESULT*)buffer; + + ok(buflen == sizeof(*ar), "unexpected buflen = %d\n", buflen); + if(info->expect_result == ERROR_SUCCESS) { + ok(ar->dwResult == 1, "ar->dwResult = %ld, expected 1\n", ar->dwResult); + }else { + ok(!ar->dwResult, "ar->dwResult = %ld, expected 1\n", ar->dwResult); + ok(ar->dwError == info->expect_result, "ar->dwError = %d, expected %d\n", ar->dwError, info->expect_result); + } + } + i = info->index; if (i >= info->count) { @@ -3209,7 +3243,8 @@ return; } - while (info->test[i].status != status && info->test[i].optional && + while (info->test[i].status != status && + (info->test[i].optional || info->test[i].todo) && i < info->count - 1 && info->test[i].function == info->test[i + 1].function) { @@ -3240,17 +3275,30 @@ LeaveCriticalSection( ¬ification_cs ); } -static void setup_test( struct info *info, enum api function, unsigned int line ) +static void setup_test( struct info *info, enum api function, unsigned int line, DWORD expect_result ) { info->function = function; info->line = line; -} + info->expect_result = expect_result; +} + +struct notification_data +{ + const struct notification *test; + const unsigned int count; + const char *method; + const char *host; + const char *path; + const char *data; + BOOL expect_conn_failure; +}; static const struct notification async_send_request_ex_test[] = { { internet_connect, INTERNET_STATUS_HANDLE_CREATED, 0 }, { http_open_request, INTERNET_STATUS_HANDLE_CREATED, 0 }, { http_send_request_ex, INTERNET_STATUS_DETECTING_PROXY, 1, 0, 1 }, + { http_send_request_ex, INTERNET_STATUS_COOKIE_SENT, 1, 0, 1 }, { http_send_request_ex, INTERNET_STATUS_RESOLVING_NAME, 1, 0, 1 }, { http_send_request_ex, INTERNET_STATUS_NAME_RESOLVED, 1, 0, 1 }, { http_send_request_ex, INTERNET_STATUS_CONNECTING_TO_SERVER, 1 }, @@ -3269,7 +3317,71 @@ { internet_close_handle, INTERNET_STATUS_HANDLE_CLOSING, 0, } }; -static void test_async_HttpSendRequestEx(void) +static const struct notification async_send_request_ex_test2[] = +{ + { internet_connect, INTERNET_STATUS_HANDLE_CREATED, 0 }, + { http_open_request, INTERNET_STATUS_HANDLE_CREATED, 0 }, + { http_send_request_ex, INTERNET_STATUS_DETECTING_PROXY, 1, 0, 1 }, + { http_send_request_ex, INTERNET_STATUS_COOKIE_SENT, 1, 0, 1 }, + { http_send_request_ex, INTERNET_STATUS_RESOLVING_NAME, 1, 0, 1 }, + { http_send_request_ex, INTERNET_STATUS_NAME_RESOLVED, 1, 0, 1 }, + { http_send_request_ex, INTERNET_STATUS_CONNECTING_TO_SERVER, 1, 1 }, + { http_send_request_ex, INTERNET_STATUS_CONNECTED_TO_SERVER, 1, 1 }, + { http_send_request_ex, INTERNET_STATUS_SENDING_REQUEST, 1 }, + { http_send_request_ex, INTERNET_STATUS_REQUEST_SENT, 1 }, + { http_send_request_ex, INTERNET_STATUS_REQUEST_COMPLETE, 1 }, + { http_end_request, INTERNET_STATUS_RECEIVING_RESPONSE, 1 }, + { http_end_request, INTERNET_STATUS_RESPONSE_RECEIVED, 1 }, + { http_end_request, INTERNET_STATUS_REQUEST_COMPLETE, 1 }, + { internet_close_handle, INTERNET_STATUS_CLOSING_CONNECTION, 0, 0, 1 }, + { internet_close_handle, INTERNET_STATUS_CONNECTION_CLOSED, 0, 0, 1 }, + { internet_close_handle, INTERNET_STATUS_HANDLE_CLOSING, 0, }, + { internet_close_handle, INTERNET_STATUS_HANDLE_CLOSING, 0, } +}; + +static const struct notification async_send_request_ex_resolve_failure_test[] = +{ + { internet_connect, INTERNET_STATUS_HANDLE_CREATED, 0 }, + { http_open_request, INTERNET_STATUS_HANDLE_CREATED, 0 }, + { http_send_request_ex, INTERNET_STATUS_DETECTING_PROXY, 1, 0, 1 }, + { http_send_request_ex, INTERNET_STATUS_RESOLVING_NAME, 1 }, + { http_send_request_ex, INTERNET_STATUS_DETECTING_PROXY, 1, 0, 1 }, + { http_send_request_ex, INTERNET_STATUS_REQUEST_COMPLETE, 1 }, + { http_end_request, INTERNET_STATUS_REQUEST_COMPLETE, 1 }, + { internet_close_handle, INTERNET_STATUS_CLOSING_CONNECTION, 0, 0, 1 }, + { internet_close_handle, INTERNET_STATUS_CONNECTION_CLOSED, 0, 0, 1 }, + { internet_close_handle, INTERNET_STATUS_HANDLE_CLOSING, 0, }, + { internet_close_handle, INTERNET_STATUS_HANDLE_CLOSING, 0, } +}; + +static const struct notification_data notification_data[] = { + { + async_send_request_ex_test, + sizeof(async_send_request_ex_test)/sizeof(async_send_request_ex_test[0]), + "POST", + "
test.winehq.org
", + "tests/posttest.php", + "Public ID=codeweavers" + }, + { + async_send_request_ex_test2, + sizeof(async_send_request_ex_test)/sizeof(async_send_request_ex_test[0]), + "POST", + "
test.winehq.org
", + "tests/posttest.php" + }, + { + async_send_request_ex_resolve_failure_test, + sizeof(async_send_request_ex_resolve_failure_test)/sizeof(async_send_request_ex_resolve_failure_test[0]), + "GET", + "brokenhost", + "index.html", + NULL, + TRUE + } +}; + +static void test_async_HttpSendRequestEx(const struct notification_data *nd) { BOOL ret; HINTERNET ses, req, con; @@ -3277,72 +3389,90 @@ DWORD size, written, error; INTERNET_BUFFERSA b; static const char *accept[2] = {"*/*", NULL}; - static char data[] = "Public ID=codeweavers"; char buffer[32]; + trace("Async HttpSendRequestEx test (%s %s)\n", nd->method, nd->host); + InitializeCriticalSection( ¬ification_cs ); - info.test = async_send_request_ex_test; - info.count = sizeof(async_send_request_ex_test)/sizeof(async_send_request_ex_test[0]); + info.test = nd->test; + info.count = nd->count; info.index = 0; info.wait = CreateEvent( NULL, FALSE, FALSE, NULL ); info.thread = GetCurrentThreadId(); + info.is_aborted = FALSE; ses = InternetOpen( "winetest", 0, NULL, NULL, INTERNET_FLAG_ASYNC ); ok( ses != NULL, "InternetOpen failed\n" ); pInternetSetStatusCallbackA( ses, check_notification ); - setup_test( &info, internet_connect, __LINE__ ); - con = InternetConnect( ses, "
crossover.codeweavers.com
", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, (DWORD_PTR)&info ); + setup_test( &info, internet_connect, __LINE__, ERROR_SUCCESS ); + con = InternetConnect( ses, nd->host, 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, (DWORD_PTR)&info ); ok( con != NULL, "InternetConnect failed %u\n", GetLastError() ); WaitForSingleObject( info.wait, 10000 ); - setup_test( &info, http_open_request, __LINE__ ); - req = HttpOpenRequest( con, "POST", "posttest.php", NULL, NULL, accept, 0, (DWORD_PTR)&info ); + setup_test( &info, http_open_request, __LINE__, ERROR_SUCCESS ); + req = HttpOpenRequest( con, nd->method, nd->path, NULL, NULL, accept, 0, (DWORD_PTR)&info ); ok( req != NULL, "HttpOpenRequest failed %u\n", GetLastError() ); WaitForSingleObject( info.wait, 10000 ); - memset( &b, 0, sizeof(INTERNET_BUFFERSA) ); - b.dwStructSize = sizeof(INTERNET_BUFFERSA); - b.lpcszHeader = "Content-Type: application/x-www-form-urlencoded"; - b.dwHeadersLength = strlen( b.lpcszHeader ); - b.dwBufferTotal = strlen( data ); - - setup_test( &info, http_send_request_ex, __LINE__ ); - ret = HttpSendRequestExA( req, &b, NULL, 0x28, 0 ); + if(nd->data) { + memset( &b, 0, sizeof(INTERNET_BUFFERSA) ); + b.dwStructSize = sizeof(INTERNET_BUFFERSA); + b.lpcszHeader = "Content-Type: application/x-www-form-urlencoded"; + b.dwHeadersLength = strlen( b.lpcszHeader ); + b.dwBufferTotal = nd->data ? strlen( nd->data ) : 0; + } + + setup_test( &info, http_send_request_ex, __LINE__, + nd->expect_conn_failure ? ERROR_INTERNET_NAME_NOT_RESOLVED : ERROR_SUCCESS ); + ret = HttpSendRequestExA( req, nd->data ? &b : NULL, NULL, 0x28, 0 ); ok( !ret && GetLastError() == ERROR_IO_PENDING, "HttpSendRequestExA failed %d %u\n", ret, GetLastError() ); - WaitForSingleObject( info.wait, 10000 ); + error = WaitForSingleObject( info.wait, 10000 ); + if(error != WAIT_OBJECT_0) { + skip("WaitForSingleObject returned %d, assuming DNS problem\n", error); + info.is_aborted = TRUE; + goto abort; + } size = sizeof(buffer); SetLastError( 0xdeadbeef ); ret = HttpQueryInfoA( req, HTTP_QUERY_CONTENT_ENCODING, buffer, &size, 0 ); error = GetLastError(); ok( !ret, "HttpQueryInfoA failed %u\n", GetLastError() ); - todo_wine - ok( error == ERROR_INTERNET_INCORRECT_HANDLE_STATE, - "expected ERROR_INTERNET_INCORRECT_HANDLE_STATE got %u\n", error ); - - written = 0; - size = strlen( data ); - setup_test( &info, internet_writefile, __LINE__ ); - ret = InternetWriteFile( req, data, size, &written ); - ok( ret, "InternetWriteFile failed %u\n", GetLastError() ); - ok( written == size, "expected %u got %u\n", written, size ); - - WaitForSingleObject( info.wait, 10000 ); + if(nd->expect_conn_failure) { + ok(error == ERROR_HTTP_HEADER_NOT_FOUND, "expected ERROR_HTTP_HEADER_NOT_FOUND got %u\n", error ); + }else { + todo_wine + ok(error == ERROR_INTERNET_INCORRECT_HANDLE_STATE, + "expected ERROR_INTERNET_INCORRECT_HANDLE_STATE got %u\n", error ); + } + + if (nd->data) + { + written = 0; + size = strlen( nd->data ); + setup_test( &info, internet_writefile, __LINE__, ERROR_SUCCESS ); + ret = InternetWriteFile( req, nd->data, size, &written ); + ok( ret, "InternetWriteFile failed %u\n", GetLastError() ); + ok( written == size, "expected %u got %u\n", written, size ); + + WaitForSingleObject( info.wait, 10000 ); + + SetLastError( 0xdeadbeef ); + ret = HttpEndRequestA( req, (void *)nd->data, 0x28, 0 ); + error = GetLastError(); + ok( !ret, "HttpEndRequestA succeeded\n" ); + ok( error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", error ); + } SetLastError( 0xdeadbeef ); - ret = HttpEndRequestA( req, (void *)data, 0x28, 0 ); - error = GetLastError(); - ok( !ret, "HttpEndRequestA succeeded\n" ); - ok( error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", error ); - - SetLastError( 0xdeadbeef ); - setup_test( &info, http_end_request, __LINE__ ); + setup_test( &info, http_end_request, __LINE__, + nd->expect_conn_failure ? ERROR_INTERNET_OPERATION_CANCELLED : ERROR_SUCCESS); ret = HttpEndRequestA( req, NULL, 0x28, 0 ); error = GetLastError(); ok( !ret, "HttpEndRequestA succeeded\n" ); @@ -3350,7 +3480,8 @@ WaitForSingleObject( info.wait, 10000 ); - setup_test( &info, internet_close_handle, __LINE__ ); + setup_test( &info, internet_close_handle, __LINE__, ERROR_SUCCESS ); + abort: InternetCloseHandle( req ); InternetCloseHandle( con ); InternetCloseHandle( ses ); @@ -3488,7 +3619,9 @@ InternetReadFile_test(0, &test_data[2]); InternetReadFileExA_test(INTERNET_FLAG_ASYNC); test_open_url_async(); - test_async_HttpSendRequestEx(); + test_async_HttpSendRequestEx(¬ification_data[0]); + test_async_HttpSendRequestEx(¬ification_data[1]); + test_async_HttpSendRequestEx(¬ification_data[2]); InternetOpenRequest_test(); test_http_cache(); InternetOpenUrlA_test(); Modified: trunk/rostests/winetests/wininet/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/interne…
============================================================================== --- trunk/rostests/winetests/wininet/internet.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/internet.c [iso-8859-1] Wed Jun 20 13:13:51 2012 @@ -41,16 +41,6 @@ static DWORD (WINAPI *pPrivacyGetZonePreferenceW)(DWORD, DWORD, LPDWORD, LPWSTR, LPDWORD); static DWORD (WINAPI *pPrivacySetZonePreferenceW)(DWORD, DWORD, DWORD, LPCWSTR); -/* Win9x and WinMe don't have lstrcmpW */ -static int strcmp_ww(const WCHAR *str1, const WCHAR *str2) -{ - DWORD len1 = lstrlenW(str1); - DWORD len2 = lstrlenW(str2); - - if (len1 != len2) return 1; - return memcmp(str1, str2, len1 * sizeof(WCHAR)); -} - /* ############################### */ static void test_InternetCanonicalizeUrlA(void) @@ -169,6 +159,7 @@ static const char useragent[] = {"Wininet Test"}; char *buffer; int retval; + BOOL res; hinet = InternetOpenA(useragent,INTERNET_OPEN_TYPE_DIRECT,NULL,NULL, 0); ok((hinet != 0x0),"InternetOpen Failed\n"); @@ -247,20 +238,65 @@ ok(retval == 0,"Got wrong return value %d\n",retval); ok(err == ERROR_INSUFFICIENT_BUFFER, "Got wrong error code%d\n",err); + len = sizeof(val); + val = 0xdeadbeef; + res = InternetQueryOptionA(hinet, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, &len); + ok(!res, "InternetQueryOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n"); + ok(GetLastError() == ERROR_INTERNET_INVALID_OPERATION, "GetLastError() = %u\n", GetLastError()); + + val = 2; + res = InternetSetOptionA(hinet, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val)); + ok(!res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n"); + ok(GetLastError() == ERROR_INTERNET_INVALID_OPERATION, "GetLastError() = %u\n", GetLastError()); + InternetCloseHandle(hinet); - - len = sizeof(val); - retval = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, &len); - ok(retval == TRUE,"Got wrong return value %d\n", retval); - ok(len == sizeof(val), "got %d\n", len); - ok(val == 2, "got %d\n", val); - - len = sizeof(val); - retval = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER, &val, &len); - ok(retval == TRUE,"Got wrong return value %d\n", retval); - ok(len == sizeof(val), "got %d\n", len); - ok(val == 4, "got %d\n", val); - +} + +static void test_max_conns(void) +{ + DWORD len, val; + BOOL res; + + len = sizeof(val); + val = 0xdeadbeef; + res = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, &len); + ok(res,"Got wrong return value %x\n", res); + ok(len == sizeof(val), "got %d\n", len); + ok(val == 2, "got %d\n", val); + + len = sizeof(val); + val = 0xdeadbeef; + res = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER, &val, &len); + ok(res,"Got wrong return value %x\n", res); + ok(len == sizeof(val), "got %d\n", len); + ok(val == 4, "got %d\n", val); + + val = 3; + res = InternetSetOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val)); + ok(res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) failed: %x\n", res); + + len = sizeof(val); + val = 0xdeadbeef; + res = InternetQueryOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, &len); + ok(res,"Got wrong return value %x\n", res); + ok(len == sizeof(val), "got %d\n", len); + ok(val == 3, "got %d\n", val); + + val = 0; + res = InternetSetOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val)); + ok(!res || broken(res), /* <= w2k3 */ + "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER, 0) succeeded\n"); + if (!res) ok(GetLastError() == ERROR_BAD_ARGUMENTS, "GetLastError() = %u\n", GetLastError()); + + val = 2; + res = InternetSetOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val)-1); + ok(!res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n"); + ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %u\n", GetLastError()); + + val = 2; + res = InternetSetOptionA(NULL, INTERNET_OPTION_MAX_CONNS_PER_SERVER, &val, sizeof(val)+1); + ok(!res, "InternetSetOptionA(INTERNET_OPTION_MAX_CONNS_PER_SERVER) succeeded\n"); + ok(GetLastError() == ERROR_INTERNET_BAD_OPTION_LENGTH, "GetLastError() = %u\n", GetLastError()); } static void test_get_cookie(void) @@ -497,7 +533,7 @@ ok( sz == 1 + lstrlenW(buffer) || sz == lstrlenW(buffer), "sz wrong %d\n", sz); /* before XP SP2, buffer is "server; server" */ - ok( !strcmp_ww(szExpect, buffer) || !strcmp_ww(szServer, buffer), "cookie data wrong\n"); + ok( !lstrcmpW(szExpect, buffer) || !lstrcmpW(szServer, buffer), "cookie data wrong\n"); sz = sizeof(buffer); r = InternetQueryOptionA(NULL, INTERNET_OPTION_CONNECTED_STATE, buffer, &sz); @@ -995,7 +1031,7 @@ ret = InternetQueryOptionW(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, &size); ok(ret == TRUE, "InternetQueryOption should've succeeded\n"); - ok(!strcmp_ww(list.pOptions[0].Value.pszValue, proxy_srvW), + ok(!lstrcmpW(list.pOptions[0].Value.pszValue, proxy_srvW), "Retrieved proxy server should've been %s, was: %s\n", wine_dbgstr_w(proxy_srvW), wine_dbgstr_w(list.pOptions[0].Value.pszValue)); ok(list.pOptions[1].Value.dwValue == PROXY_TYPE_PROXY, @@ -1321,6 +1357,7 @@ test_Option_PerConnectionOption(); test_Option_PerConnectionOptionA(); test_InternetErrorDlg(); + test_max_conns(); if (!pInternetTimeFromSystemTimeA) win_skip("skipping the InternetTime tests\n"); Modified: trunk/rostests/winetests/wininet/urlcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/urlcach…
============================================================================== --- trunk/rostests/winetests/wininet/urlcache.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/urlcache.c [iso-8859-1] Wed Jun 20 13:13:51 2012 @@ -69,6 +69,7 @@ if (!strcmp(lpCacheEntryInfo->lpszSourceUrlName, TEST_URL)) { found = TRUE; + ret = TRUE; break; } SetLastError(0xdeadbeef); @@ -83,11 +84,11 @@ ret = FindNextUrlCacheEntry(hEnumHandle, lpCacheEntryInfo, &cbCacheEntryInfo); } } - ok(ret, "FindNextUrlCacheEntry failed with error %d\n", GetLastError()); if (!ret) break; } - ok(found, "committed url cache entry not found during enumeration\n"); + ok(ret, "FindNextUrlCacheEntry failed with error %d\n", GetLastError()); + ok(found, "Committed url cache entry not found during enumeration\n"); ret = FindCloseUrlCache(hEnumHandle); ok(ret, "FindCloseUrlCache failed with error %d\n", GetLastError()); @@ -133,7 +134,7 @@ ret = GetUrlCacheEntryInfoEx(TEST_URL, lpCacheEntryInfo, &cbCacheEntryInfo, NULL, NULL, NULL, 0); ok(ret, "GetUrlCacheEntryInfoEx failed with error %d\n", GetLastError()); - check_cache_entry_infoA("GetUrlCacheEntryInfoEx", lpCacheEntryInfo); + if (ret) check_cache_entry_infoA("GetUrlCacheEntryInfoEx", lpCacheEntryInfo); cbCacheEntryInfo = 100000; SetLastError(0xdeadbeef); @@ -146,10 +147,12 @@ /* Querying the redirect URL fails with ERROR_INVALID_PARAMETER */ SetLastError(0xdeadbeef); ret = GetUrlCacheEntryInfoEx(TEST_URL, NULL, NULL, NULL, &cbRedirectUrl, NULL, 0); + ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = GetUrlCacheEntryInfoEx(TEST_URL, NULL, &cbCacheEntryInfo, NULL, &cbRedirectUrl, NULL, 0); + ok(!ret, "GetUrlCacheEntryInfoEx should have failed\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); } @@ -234,6 +237,7 @@ "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); info = HeapAlloc(GetProcessHeap(), 0, size); ret = GetUrlCacheEntryInfo(TEST_URL, info, &size); + ok(ret, "GetUrlCacheEntryInfo failed: %d\n", GetLastError()); GetSystemTimeAsFileTime(&info->ExpireTime); exp_time.u.LowPart = info->ExpireTime.dwLowDateTime; exp_time.u.HighPart = info->ExpireTime.dwHighDateTime; @@ -344,6 +348,7 @@ HANDLE hFile; BYTE zero_byte = 0; LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo; + LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo2; DWORD cbCacheEntryInfo; static const FILETIME filetime_zero; FILETIME now; @@ -358,7 +363,7 @@ create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte)); - ret = CommitUrlCacheEntry(TEST_URL1, NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY, NULL, 0, NULL, NULL); + ret = CommitUrlCacheEntry(TEST_URL1, NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY, NULL, 0, "html", NULL); ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError()); cbCacheEntryInfo = 0; ret = GetUrlCacheEntryInfo(TEST_URL1, NULL, &cbCacheEntryInfo); @@ -378,9 +383,11 @@ lpCacheEntryInfo->CacheEntryType); ok(!U(*lpCacheEntryInfo).dwExemptDelta, "expected dwExemptDelta 0, got %d\n", U(*lpCacheEntryInfo).dwExemptDelta); - HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo); - - /* A subsequent commit with a different time/type doesn't change the type */ + + /* Make sure there is a notable change in timestamps */ + Sleep(1000); + + /* A subsequent commit with a different time/type doesn't change most of the entry */ GetSystemTimeAsFileTime(&now); ret = CommitUrlCacheEntry(TEST_URL1, NULL, now, now, NORMAL_CACHE_ENTRY, (LPBYTE)ok_header, strlen(ok_header), NULL, NULL); @@ -390,26 +397,41 @@ ok(!ret, "GetUrlCacheEntryInfo should have failed\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo); - ret = GetUrlCacheEntryInfo(TEST_URL1, lpCacheEntryInfo, &cbCacheEntryInfo); + lpCacheEntryInfo2 = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo); + ret = GetUrlCacheEntryInfo(TEST_URL1, lpCacheEntryInfo2, &cbCacheEntryInfo); ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError()); /* but it does change the time.. */ todo_wine - ok(memcmp(&lpCacheEntryInfo->ExpireTime, &filetime_zero, sizeof(FILETIME)), + ok(memcmp(&lpCacheEntryInfo2->ExpireTime, &filetime_zero, sizeof(FILETIME)), "expected positive ExpireTime\n"); todo_wine - ok(memcmp(&lpCacheEntryInfo->LastModifiedTime, &filetime_zero, sizeof(FILETIME)), + ok(memcmp(&lpCacheEntryInfo2->LastModifiedTime, &filetime_zero, sizeof(FILETIME)), "expected positive LastModifiedTime\n"); - ok(lpCacheEntryInfo->CacheEntryType == (NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY) || - broken(lpCacheEntryInfo->CacheEntryType == NORMAL_CACHE_ENTRY /* NT4/W2k */), + ok(lpCacheEntryInfo2->CacheEntryType == (NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY) || + broken(lpCacheEntryInfo2->CacheEntryType == NORMAL_CACHE_ENTRY /* NT4/W2k */), "expected type NORMAL_CACHE_ENTRY|URLHISTORY_CACHE_ENTRY, got %08x\n", - lpCacheEntryInfo->CacheEntryType); + lpCacheEntryInfo2->CacheEntryType); /* and set the headers. */ todo_wine - ok(lpCacheEntryInfo->dwHeaderInfoSize == 19, - "expected headers size 19, got %d\n", - lpCacheEntryInfo->dwHeaderInfoSize); + ok(lpCacheEntryInfo2->dwHeaderInfoSize == 19, + "expected headers size 19, got %d\n", + lpCacheEntryInfo2->dwHeaderInfoSize); + /* Hit rate gets incremented by 1 */ + todo_wine + ok((lpCacheEntryInfo->dwHitRate + 1) == lpCacheEntryInfo2->dwHitRate, + "HitRate not incremented by one on commit\n"); + /* Last access time should be updated */ + todo_wine + ok(!(lpCacheEntryInfo->LastAccessTime.dwHighDateTime == lpCacheEntryInfo2->LastAccessTime.dwHighDateTime && + lpCacheEntryInfo->LastAccessTime.dwLowDateTime == lpCacheEntryInfo2->LastAccessTime.dwLowDateTime), + "Last accessed time was not updated by commit\n"); + /* File extension should be unset */ + todo_wine + ok(lpCacheEntryInfo2->lpszFileExtension == NULL, + "Fileextension isn't unset: %s\n", + lpCacheEntryInfo2->lpszFileExtension); HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo); + HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo2); ret = CommitUrlCacheEntry(TEST_URL, filenameA, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL); ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError()); @@ -425,7 +447,7 @@ ret = RetrieveUrlCacheEntryFile(TEST_URL, lpCacheEntryInfo, &cbCacheEntryInfo, 0); ok(ret, "RetrieveUrlCacheEntryFile failed with error %d\n", GetLastError()); - check_cache_entry_infoA("RetrieveUrlCacheEntryFile", lpCacheEntryInfo); + if (ret) check_cache_entry_infoA("RetrieveUrlCacheEntryFile", lpCacheEntryInfo); HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo); @@ -491,7 +513,7 @@ cbCacheEntryInfo = 0; SetLastError(0xdeadbeef); ret = GetUrlCacheEntryInfo(TEST_URL, NULL, &cbCacheEntryInfo); - ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n"); + ok(!ret, "GetUrlCacheEntryInfo should have failed\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo); @@ -550,18 +572,25 @@ if (pDeleteUrlCacheEntryA) { ret = pDeleteUrlCacheEntryA(TEST_URL); - todo_wine ok(!ret, "Expected failure\n"); - todo_wine ok(GetLastError() == ERROR_SHARING_VIOLATION, "Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); check_file_exists(filenameA); } + + lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo); + memset(lpCacheEntryInfo, 0, cbCacheEntryInfo); + ret = GetUrlCacheEntryInfo(TEST_URL, lpCacheEntryInfo, &cbCacheEntryInfo); + ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError()); + ok(lpCacheEntryInfo->CacheEntryType & DELETED_CACHE_ENTRY, + "CacheEntryType hasn't DELETED_CACHE_ENTRY set, (flags %08x)\n", + lpCacheEntryInfo->CacheEntryType); + HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo); + if (pUnlockUrlCacheEntryFileA) { check_file_exists(filenameA); ret = pUnlockUrlCacheEntryFileA(TEST_URL, 0); - todo_wine ok(ret, "UnlockUrlCacheEntryFileA failed: %d\n", GetLastError()); /* By unlocking the already-deleted cache entry, the file associated * with it is deleted.. @@ -634,6 +663,7 @@ ok(!ret, "expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ret = CreateUrlCacheEntry(TEST_URL, 0, "html", filenameA, 0); ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError()); create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte)); @@ -644,7 +674,7 @@ cbCacheEntryInfo = 0; SetLastError(0xdeadbeef); ret = GetUrlCacheEntryInfo(TEST_URL, NULL, &cbCacheEntryInfo); - ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n"); + ok(!ret, "GetUrlCacheEntryInfo should have failed\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo); @@ -654,7 +684,7 @@ "expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %d (0x%08x)\n", lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType); ok(U(*lpCacheEntryInfo).dwExemptDelta == 86400, - "expected dwExemptDelta 864000, got %d\n", + "expected dwExemptDelta 86400, got %d\n", U(*lpCacheEntryInfo).dwExemptDelta); HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo); if (pDeleteUrlCacheEntryA) @@ -676,7 +706,7 @@ cbCacheEntryInfo = 0; SetLastError(0xdeadbeef); ret = GetUrlCacheEntryInfo(TEST_URL, NULL, &cbCacheEntryInfo); - ok(!ret, "RetrieveUrlCacheEntryFile should have failed\n"); + ok(!ret, "GetUrlCacheEntryInfo should have failed\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); lpCacheEntryInfo = HeapAlloc(GetProcessHeap(), 0, cbCacheEntryInfo); @@ -686,7 +716,7 @@ "expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %d (0x%08x)\n", lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType); ok(U(*lpCacheEntryInfo).dwExemptDelta == 86400, - "expected dwExemptDelta 864000, got %d\n", + "expected dwExemptDelta 86400, got %d\n", U(*lpCacheEntryInfo).dwExemptDelta); U(*lpCacheEntryInfo).dwExemptDelta = 0; ret = SetUrlCacheEntryInfoA(TEST_URL, lpCacheEntryInfo, @@ -702,7 +732,30 @@ ok(lpCacheEntryInfo->CacheEntryType & (NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY), "expected cache entry type NORMAL_CACHE_ENTRY | STICKY_CACHE_ENTRY, got %d (0x%08x)\n", lpCacheEntryInfo->CacheEntryType, lpCacheEntryInfo->CacheEntryType); + + /* Recommit of Url entry keeps dwExemptDelta */ + U(*lpCacheEntryInfo).dwExemptDelta = 8600; + ret = SetUrlCacheEntryInfoA(TEST_URL, lpCacheEntryInfo, + CACHE_ENTRY_EXEMPT_DELTA_FC); + ok(ret, "SetUrlCacheEntryInfo failed: %d\n", GetLastError()); + + ret = CreateUrlCacheEntry(TEST_URL, 0, "html", filenameA1, 0); + ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError()); + create_and_write_file(filenameA1, &zero_byte, sizeof(zero_byte)); + + ret = CommitUrlCacheEntry(TEST_URL, filenameA1, filetime_zero, filetime_zero, + NORMAL_CACHE_ENTRY|STICKY_CACHE_ENTRY, + (LPBYTE)ok_header, strlen(ok_header), "html", NULL); + ok(ret, "CommitUrlCacheEntry failed with error %d\n", GetLastError()); + + ret = GetUrlCacheEntryInfo(TEST_URL, lpCacheEntryInfo, &cbCacheEntryInfo); + ok(ret, "GetUrlCacheEntryInfo failed with error %d\n", GetLastError()); + ok(U(*lpCacheEntryInfo).dwExemptDelta == 8600, + "expected dwExemptDelta 8600, got %d\n", + U(*lpCacheEntryInfo).dwExemptDelta); + HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo); + if (pDeleteUrlCacheEntryA) { ret = pDeleteUrlCacheEntryA(TEST_URL);
12 years, 6 months
1
0
0
0
[tfaber] 56758: [WININET][PSDK] - Better mark ROS-specific changes - Make wininet_ros.diff sensible - Update wininet.h See issue #7117 for more details.
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jun 20 12:24:12 2012 New Revision: 56758 URL:
http://svn.reactos.org/svn/reactos?rev=56758&view=rev
Log: [WININET][PSDK] - Better mark ROS-specific changes - Make wininet_ros.diff sensible - Update wininet.h See issue #7117 for more details. Modified: trunk/reactos/dll/win32/wininet/http.c trunk/reactos/dll/win32/wininet/internet.c trunk/reactos/dll/win32/wininet/internet.h trunk/reactos/dll/win32/wininet/netconnection.c trunk/reactos/dll/win32/wininet/urlcache.c trunk/reactos/dll/win32/wininet/wininet_ros.diff trunk/reactos/include/psdk/wininet.h Modified: trunk/reactos/dll/win32/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
============================================================================== --- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Wed Jun 20 12:24:12 2012 @@ -71,6 +71,7 @@ #include "wine/exception.h" #include "wine/unicode.h" +// ReactOS #include "inet_ntop.c" WINE_DEFAULT_DEBUG_CHANNEL(wininet); Modified: trunk/reactos/dll/win32/wininet/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
============================================================================== --- trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] Wed Jun 20 12:24:12 2012 @@ -291,6 +291,10 @@ if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES) return FALSE; + +#ifndef __REACTOS__ + URLCacheContainers_CreateDefaults(); +#endif WININET_hModule = hinstDLL; @@ -3595,6 +3599,7 @@ LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen) { + // ReactOS: use select instead of poll fd_set infd; struct timeval tv; BOOL bSuccess = FALSE; Modified: trunk/reactos/dll/win32/wininet/internet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
============================================================================== --- trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] Wed Jun 20 12:24:12 2012 @@ -528,7 +528,11 @@ LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN; int NETCON_GetCipherStrength(netconn_t*) DECLSPEC_HIDDEN; DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, int value) DECLSPEC_HIDDEN; +#ifndef __REACTOS__ +int sock_get_error(int) DECLSPEC_HIDDEN; +#else #define sock_get_error(x) WSAGetLastError() +#endif extern void URLCacheContainers_CreateDefaults(void) DECLSPEC_HIDDEN; extern void URLCacheContainers_DeleteAll(void) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/wininet/netconnection.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/netconne…
============================================================================== --- trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] Wed Jun 20 12:24:12 2012 @@ -587,7 +587,7 @@ #endif } -#if 0 +#ifndef __REACTOS__ /* translate a unix error code into a winsock one */ int sock_get_error( int err ) { Modified: trunk/reactos/dll/win32/wininet/urlcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/urlcache…
============================================================================== --- trunk/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] Wed Jun 20 12:24:12 2012 @@ -182,6 +182,7 @@ /* List of all containers available */ static struct list UrlContainers = LIST_INIT(UrlContainers); +// ReactOS r54992 BOOL bDefaultContainersAdded = FALSE; static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash, HASH_CACHEFILE_ENTRY **ppHash); @@ -519,6 +520,7 @@ static const WCHAR HistoryPrefix[] = {'V','i','s','i','t','e','d',':',0}; static const WCHAR CookieSuffix[] = {0}; static const WCHAR CookiePrefix[] = {'C','o','o','k','i','e',':',0}; + // ReactOS r50916 static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0}; static const struct { @@ -533,6 +535,7 @@ }; DWORD i; + // ReactOS r50916 if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND) { TRACE("Environment variable 'USERPROFILE' does not exist!\n"); @@ -592,6 +595,7 @@ if(!lpwszUrl) return ERROR_INVALID_PARAMETER; + // ReactOS r54992 if (!bDefaultContainersAdded) URLCacheContainers_CreateDefaults(); @@ -633,6 +637,7 @@ if (lpwszSearchPattern && dwIndex > 0) return FALSE; + // ReactOS r54992 if (!bDefaultContainersAdded) URLCacheContainers_CreateDefaults(); @@ -1539,6 +1544,7 @@ return FALSE; } + // ReactOS r54992 if (!bDefaultContainersAdded) URLCacheContainers_CreateDefaults(); Modified: trunk/reactos/dll/win32/wininet/wininet_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet_…
============================================================================== --- trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] Wed Jun 20 12:24:12 2012 @@ -1,59 +1,53 @@ ---- wine-1.3.4/dlls/wininet/internet.h 2010-10-01 14:46:44.000000000 -0400 -+++ dll/win32/wininet/internet.h 2010-10-09 15:34:13.000000000 -0400 -@@ -462,7 +462,7 @@ - LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection); - int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection); - DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value); --int sock_get_error(int); +--- wine-1.3.21/dlls/wininet/internet.h 2012-06-20 13:23:07 +0200 ++++ dll/win32/wininet/internet.h 2012-06-20 13:58:16 +0200 +@@ -528,7 +528,11 @@ BOOL NETCON_is_alive(netconn_t*) DECLSPE + LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN; + int NETCON_GetCipherStrength(netconn_t*) DECLSPEC_HIDDEN; + DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, int value) DECLSPEC_HIDDEN; ++#ifndef __REACTOS__ + int sock_get_error(int) DECLSPEC_HIDDEN; ++#else +#define sock_get_error(x) WSAGetLastError() - - extern void URLCacheContainers_CreateDefaults(void); - extern void URLCacheContainers_DeleteAll(void); ---- wine-1.3.4/dlls/wininet/http.c 2010-10-01 14:46:44.000000000 -0400 -+++ dll/win32/wininet/http.c 2010-10-09 15:28:29.000000000 -0400 -@@ -69,6 +69,8 @@ - #include "wine/exception.h" - #include "wine/unicode.h" - -+#include "inet_ntop.c" -+ - WINE_DEFAULT_DEBUG_CHANNEL(wininet); - - static const WCHAR g_szHttp1_0[] = {'H','T','T','P','/','1','.','0',0}; ---- wine-1.3.4/dlls/wininet/netconnection.c 2010-10-01 14:46:44.000000000 -0400 -+++ dll/win32/wininet/netconnection.c 2010-10-09 15:33:53.000000000 -0400 -@@ -547,6 +547,7 @@ - return TRUE; ++#endif + + extern void URLCacheContainers_CreateDefaults(void) DECLSPEC_HIDDEN; + extern void URLCacheContainers_DeleteAll(void) DECLSPEC_HIDDEN; +--- wine-1.3.21/dlls/wininet/netconnection.c 2012-06-20 13:23:07 +0200 ++++ dll/win32/wininet/netconnection.c 2012-06-20 13:40:10 +0200 +@@ -587,6 +587,7 @@ void NETCON_unload(void) + #endif } -+#if 0 ++#ifndef __REACTOS__ /* translate a unix error code into a winsock one */ int sock_get_error( int err ) { -@@ -613,6 +614,7 @@ +@@ -653,6 +654,7 @@ int sock_get_error( int err ) #endif return err; } +#endif /****************************************************************************** - * NETCON_create ---- wine-1.3.4/dlls/wininet/internet.c 2010-10-01 14:46:44.000000000 -0400 -+++ dll/win32/wininet/internet.c 2010-10-09 15:33:04.000000000 -0400 -@@ -292,8 +292,6 @@ + * NETCON_secure_connect +--- wine-1.3.21/dlls/wininet/internet.c 2012-06-20 13:23:07 +0200 ++++ dll/win32/wininet/internet.c 2012-06-20 13:39:47 +0200 +@@ -292,7 +292,9 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES) return FALSE; -- URLCacheContainers_CreateDefaults(); -- ++#ifndef __REACTOS__ + URLCacheContainers_CreateDefaults(); ++#endif + WININET_hModule = hinstDLL; - case DLL_THREAD_ATTACH: -@@ -3569,19 +3567,22 @@ +@@ -3597,19 +3599,23 @@ LPSTR INTERNET_GetResponseBuffer(void) LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen) { - struct pollfd pfd; ++ // ReactOS: use select instead of poll + fd_set infd; + struct timeval tv; BOOL bSuccess = FALSE; @@ -78,28 +72,31 @@ { Index: dll/win32/wininet/urlcache.c =================================================================== ---- dll/win32/wininet/urlcache.c (revision 50814) -+++ dll/win32/wininet/urlcache.c (working copy) -@@ -182,6 +182,7 @@ +--- wine-1.3.21/dlls/wininet/urlcache.c 2012-06-20 13:23:07 +0200 ++++ dll/win32/wininet/urlcache.c 2012-06-20 13:41:43 +0200 +@@ -182,6 +182,8 @@ typedef struct _URLCACHECONTAINER /* List of all containers available */ static struct list UrlContainers = LIST_INIT(UrlContainers); ++// ReactOS r54992 +BOOL bDefaultContainersAdded = FALSE; static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash, HASH_CACHEFILE_ENTRY **ppHash); -@@ -527,6 +528,7 @@ +@@ -518,6 +520,8 @@ void URLCacheContainers_CreateDefaults(v static const WCHAR HistoryPrefix[] = {'V','i','s','i','t','e','d',':',0}; static const WCHAR CookieSuffix[] = {0}; static const WCHAR CookiePrefix[] = {'C','o','o','k','i','e',':',0}; ++ // ReactOS r50916 + static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0}; static const struct { int nFolder; /* CSIDL_* constant */ -@@ -540,6 +542,12 @@ +@@ -531,6 +535,13 @@ void URLCacheContainers_CreateDefaults(v }; DWORD i; ++ // ReactOS r50916 + if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND) + { + TRACE("Environment variable 'USERPROFILE' does not exist!\n"); @@ -109,30 +106,33 @@ for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++) { WCHAR wszCachePath[MAX_PATH]; -@@ -584,6 +592,9 @@ +@@ -584,6 +595,10 @@ static DWORD URLCacheContainers_FindCont if(!lpwszUrl) return ERROR_INVALID_PARAMETER; ++ // ReactOS r54992 + if (!bDefaultContainersAdded) + URLCacheContainers_CreateDefaults(); + LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry) { int prefix_len = strlenW(pContainer->cache_prefix); -@@ -622,6 +633,9 @@ +@@ -622,6 +637,10 @@ static BOOL URLCacheContainers_Enum(LPCW if (lpwszSearchPattern && dwIndex > 0) return FALSE; ++ // ReactOS r54992 + if (!bDefaultContainersAdded) + URLCacheContainers_CreateDefaults(); + LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry) { if (lpwszSearchPattern) -@@ -1525,6 +1539,9 @@ +@@ -1525,6 +1544,10 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR l return FALSE; } ++ // ReactOS r54992 + if (!bDefaultContainersAdded) + URLCacheContainers_CreateDefaults(); + @@ -141,15 +141,26 @@ /* The URL cache has prefix L"" (unlike Cookies and History) */ Index: dll/win32/wininet/http.c =================================================================== ---- dll/win32/wininet/http.c (revision 54234) -+++ dll/win32/wininet/http.c (working copy) -@@ -245,8 +245,17 @@ +--- wine-1.3.21/dlls/wininet/http.c 2012-06-20 13:37:39 +0200 ++++ dll/win32/wininet/http.c 2012-06-20 13:52:44 +0200 +@@ -71,6 +71,9 @@ + #include "wine/exception.h" + #include "wine/unicode.h" + ++// ReactOS ++#include "inet_ntop.c" ++ + WINE_DEFAULT_DEBUG_CHANNEL(wininet); + + static const WCHAR g_szHttp1_0[] = {'H','T','T','P','/','1','.','0',0}; +@@ -243,8 +246,17 @@ void server_release(server_t *server) if(InterlockedDecrement(&server->ref)) return; +#ifndef __REACTOS__ if(!server->ref) - server->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME; +- server->keep_until = GetTickCount64() + COLLECT_TIME; ++ server->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME; +#else + EnterCriticalSection(&connection_pool_cs); + list_remove(&server->entry); @@ -161,7 +172,16 @@ } static server_t *get_server(const WCHAR *name, INTERNET_PORT port) -@@ -1861,6 +1870,7 @@ +@@ -290,7 +302,7 @@ BOOL collect_connections(BOOL collect_al + BOOL remaining = FALSE; + DWORD64 now; + +- now = GetTickCount64(); ++ now = GetTickCount(); + + LIST_FOR_EACH_ENTRY_SAFE(server, server_safe, &connection_pool, server_t, entry) { + LIST_FOR_EACH_ENTRY_SAFE(netconn, netconn_safe, &server->conn_pool, netconn_t, pool_entry) { +@@ -1859,13 +1871,14 @@ static void http_release_netconn(http_re if(!req->netconn) return; @@ -169,7 +189,15 @@ if(reuse && req->netconn->keep_alive) { BOOL run_collector; -@@ -1893,6 +1903,7 @@ + EnterCriticalSection(&connection_pool_cs); + + list_add_head(&req->netconn->server->conn_pool, &req->netconn->pool_entry); +- req->netconn->keep_until = GetTickCount64() + COLLECT_TIME; ++ req->netconn->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME; + req->netconn = NULL; + + run_collector = !collector_running; +@@ -1893,6 +1906,7 @@ static void http_release_netconn(http_re } return; } Modified: trunk/reactos/include/psdk/wininet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wininet.h?rev…
============================================================================== --- trunk/reactos/include/psdk/wininet.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/wininet.h [iso-8859-1] Wed Jun 20 12:24:12 2012 @@ -687,7 +687,7 @@ #define INTERNET_STATE_IDLE 0x00000100 #define INTERNET_STATE_BUSY 0x00000200 -#define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1L)) +#define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1)) #define FTP_TRANSFER_TYPE_UNKNOWN 0x00000000 #define FTP_TRANSFER_TYPE_ASCII 0x00000001 @@ -1496,6 +1496,7 @@ #define EDITED_CACHE_ENTRY 0x00000008 #define COOKIE_CACHE_ENTRY 0x00100000 #define URLHISTORY_CACHE_ENTRY 0x00200000 +#define DELETED_CACHE_ENTRY 0x00400000 #define TRACK_OFFLINE_CACHE_ENTRY 0x00000010 #define TRACK_ONLINE_CACHE_ENTRY 0x00000020 #define SPARSE_CACHE_ENTRY 0x00010000
12 years, 6 months
1
0
0
0
[tfaber] 56757: [NTOSKRNL] - tcpip is called too often. Don't spam the debug log. See issue #7129 for more details.
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jun 20 08:32:35 2012 New Revision: 56757 URL:
http://svn.reactos.org/svn/reactos?rev=56757&view=rev
Log: [NTOSKRNL] - tcpip is called too often. Don't spam the debug log. See issue #7129 for more details. Modified: trunk/reactos/ntoskrnl/ke/wait.c Modified: trunk/reactos/ntoskrnl/ke/wait.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/wait.c?rev=567…
============================================================================== --- trunk/reactos/ntoskrnl/ke/wait.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/wait.c [iso-8859-1] Wed Jun 20 08:32:35 2012 @@ -596,8 +596,8 @@ (!Timeout || Timeout->QuadPart != 0)) { /* HACK: tcpip is broken and waits with spinlocks acquired (bug #7129) */ - DPRINT1("%s called at DISPATCH_LEVEL with non-zero timeout!\n", - __FUNCTION__); + DPRINT("%s called at DISPATCH_LEVEL with non-zero timeout!\n", + __FUNCTION__); } else ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
12 years, 6 months
1
0
0
0
[tfaber] 56756: [WS2_32] - Do not manually allocate an incompatible hostent structure in FindEntryInHosts. Use populate_hostent instead. Fixes buffer overflow in name resolution. See issue #7126 fo...
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jun 20 00:57:53 2012 New Revision: 56756 URL:
http://svn.reactos.org/svn/reactos?rev=56756&view=rev
Log: [WS2_32] - Do not manually allocate an incompatible hostent structure in FindEntryInHosts. Use populate_hostent instead. Fixes buffer overflow in name resolution. See issue #7126 for more details. Modified: trunk/reactos/dll/win32/ws2_32/include/ws2_32.h trunk/reactos/dll/win32/ws2_32/misc/ns.c Modified: trunk/reactos/dll/win32/ws2_32/include/ws2_32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/include/w…
============================================================================== --- trunk/reactos/dll/win32/ws2_32/include/ws2_32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ws2_32/include/ws2_32.h [iso-8859-1] Wed Jun 20 00:57:53 2012 @@ -76,7 +76,7 @@ /* ws2_32 internal Functions */ void check_hostent(struct hostent **he); -void populate_hostent(struct hostent *he, char* name, DNS_A_DATA addr); +void populate_hostent(struct hostent *he, char* name, IP4_ADDRESS addr); void free_hostent(struct hostent *he); void free_servent(struct servent* s); Modified: trunk/reactos/dll/win32/ws2_32/misc/ns.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/ns.c…
============================================================================== --- trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] Wed Jun 20 00:57:53 2012 @@ -529,7 +529,7 @@ } } -void populate_hostent(struct hostent *he, char* name, DNS_A_DATA addr) +void populate_hostent(struct hostent *he, char* name, IP4_ADDRESS addr) { ASSERT(he); @@ -561,8 +561,8 @@ WS_DbgPrint(MID_TRACE,("he->h_addr_list[0] %x\n", he->h_addr_list[0])); RtlCopyMemory(he->h_addr_list[0], - &addr.IpAddress, - sizeof(addr.IpAddress)); + &addr, + sizeof(addr)); he->h_addr_list[1] = NULL; } @@ -813,51 +813,12 @@ return NULL; } - if( !p->Hostent ) - { - p->Hostent = HeapAlloc(GlobalHeap, 0, sizeof(*p->Hostent)); - if( !p->Hostent ) - { - WSASetLastError( WSATRY_AGAIN ); - return NULL; - } - } - - p->Hostent->h_name = HeapAlloc(GlobalHeap, 0, strlen(DnsName)); - if( !p->Hostent->h_name ) - { - WSASetLastError( WSATRY_AGAIN ); - return NULL; - } - - RtlCopyMemory(p->Hostent->h_name, - DnsName, - strlen(DnsName)); - - p->Hostent->h_aliases = HeapAlloc(GlobalHeap, 0, sizeof(char *)); - if( !p->Hostent->h_aliases ) - { - WSASetLastError( WSATRY_AGAIN ); - return NULL; - } - - p->Hostent->h_aliases[0] = 0; - if (strstr(AddressStr, ":")) { DbgPrint("AF_INET6 NOT SUPPORTED!\n"); WSASetLastError(WSAEINVAL); return NULL; } - else - p->Hostent->h_addrtype = AF_INET; - - p->Hostent->h_addr_list = HeapAlloc(GlobalHeap, 0, sizeof(char *)); - if( !p->Hostent->h_addr_list ) - { - WSASetLastError( WSATRY_AGAIN ); - return NULL; - } Address = inet_addr(AddressStr); if (Address == INADDR_NONE) @@ -866,18 +827,7 @@ return NULL; } - p->Hostent->h_addr_list[0] = HeapAlloc(GlobalHeap, 0, sizeof(Address)); - if( !p->Hostent->h_addr_list[0] ) - { - WSASetLastError( WSATRY_AGAIN ); - return NULL; - } - - RtlCopyMemory(p->Hostent->h_addr_list[0], - &Address, - sizeof(Address)); - - p->Hostent->h_length = sizeof(Address); + populate_hostent(p->Hostent, DnsName, Address); return p->Hostent; } @@ -996,7 +946,9 @@ { WS_DbgPrint(MID_TRACE,("populating hostent\n")); WS_DbgPrint(MID_TRACE,("pName is (%s)\n", curr->pName)); - populate_hostent(p->Hostent, (PCHAR)curr->pName, curr->Data.A); + populate_hostent(p->Hostent, + (PCHAR)curr->pName, + curr->Data.A.IpAddress); DnsRecordListFree(dp, DnsFreeRecordList); return p->Hostent; }
12 years, 6 months
1
0
0
0
[tfaber] 56755: [WS2_32] - Rewrite completely broken free_hostent and free_servent functions - Readability improvements to check_hostent and populate_hostent
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Jun 19 23:51:28 2012 New Revision: 56755 URL:
http://svn.reactos.org/svn/reactos?rev=56755&view=rev
Log: [WS2_32] - Rewrite completely broken free_hostent and free_servent functions - Readability improvements to check_hostent and populate_hostent Modified: trunk/reactos/dll/win32/ws2_32/misc/ns.c Modified: trunk/reactos/dll/win32/ws2_32/misc/ns.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/ns.c…
============================================================================== --- trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] Tue Jun 19 23:51:28 2012 @@ -518,15 +518,13 @@ sizeof(struct hostent) + MAX_HOSTNAME_LEN + 1); new_he->h_name = (PCHAR)(new_he + 1); - new_he->h_aliases = 0; + new_he->h_aliases = NULL; new_he->h_addrtype = 0; // AF_INET new_he->h_length = 0; // sizeof(in_addr) new_he->h_addr_list = HeapAlloc(GlobalHeap, - 0, + HEAP_ZERO_MEMORY, sizeof(char *) * 2); - RtlZeroMemory(new_he->h_addr_list, - sizeof(char *) * 2); *he = new_he; } } @@ -544,7 +542,7 @@ if( !he->h_aliases ) { he->h_aliases = HeapAlloc(GlobalHeap, 0, sizeof(char *)); - he->h_aliases[0] = 0; + he->h_aliases[0] = NULL; } he->h_addrtype = AF_INET; he->h_length = sizeof(IN_ADDR); //sizeof(struct in_addr); @@ -563,33 +561,33 @@ WS_DbgPrint(MID_TRACE,("he->h_addr_list[0] %x\n", he->h_addr_list[0])); RtlCopyMemory(he->h_addr_list[0], - (char*)&addr.IpAddress, + &addr.IpAddress, sizeof(addr.IpAddress)); - he->h_addr_list[1] = 0; -} - - -#define HFREE(x) if(x) { HeapFree(GlobalHeap, 0, (x)); x=0; } + he->h_addr_list[1] = NULL; +} + void free_hostent(struct hostent *he) { - if(he) - { - char *next = 0; - HFREE(he->h_name); - if(he->h_aliases) - { - next = he->h_aliases[0]; - while(next) { HFREE(next); next++; } - } - if(he->h_addr_list) - { - next = he->h_addr_list[0]; - while(next) { HFREE(next); next++; } - } - HFREE(he->h_addr_list); - HFREE(he->h_aliases); - HFREE(he); + int i; + + if (he) + { + if (he->h_name) + HeapFree(GlobalHeap, 0, he->h_name); + if (he->h_aliases) + { + for (i = 0; he->h_aliases[i]; i++) + HeapFree(GlobalHeap, 0, he->h_aliases[i]); + HeapFree(GlobalHeap, 0, he->h_aliases); + } + if (he->h_addr_list) + { + for (i = 0; he->h_addr_list[i]; i++) + HeapFree(GlobalHeap, 0, he->h_addr_list[i]); + HeapFree(GlobalHeap, 0, he->h_addr_list); + } + HeapFree(GlobalHeap, 0, he); } } @@ -672,13 +670,22 @@ void free_servent(struct servent* s) { - char* next; - HFREE(s->s_name); - next = s->s_aliases[0]; - while(next) { HFREE(next); next++; } - s->s_port = 0; - HFREE(s->s_proto); - HFREE(s); + int i; + + if (s) + { + if (s->s_name) + HeapFree(GlobalHeap, 0, s->s_name); + if (s->s_aliases) + { + for (i = 0; s->s_aliases[i]; i++) + HeapFree(GlobalHeap, 0, s->s_aliases[i]); + HeapFree(GlobalHeap, 0, s->s_aliases); + } + if (s->s_proto) + HeapFree(GlobalHeap, 0, s->s_proto); + HeapFree(GlobalHeap, 0, s); + } } /* This function is far from perfect but it works enough */ @@ -1052,7 +1059,7 @@ * * @unimplemented */ - + static CHAR *no_aliases = 0; static PROTOENT protocols[] = { @@ -1061,7 +1068,7 @@ {"udp", &no_aliases, IPPROTO_UDP}, {NULL, NULL, 0} }; - + LPPROTOENT EXPORT getprotobyname(IN CONST CHAR FAR* name) @@ -1203,14 +1210,14 @@ WSASetLastError( WSANO_RECOVERY ); return NULL; } - + /* Scan the services file ... * * We will be share the buffer on the lines. If the line does not fit in * the buffer, then moving it to the beginning of the buffer and read * the remnants of line from file. */ - + /* Initial Read */ ReadFile(ServicesFile, ServiceDBData, @@ -1219,7 +1226,7 @@ ThisLine = NextLine = ServiceDBData; EndValid = ServiceDBData + ReadSize; ServiceDBData[sizeof(ServiceDBData) - 1] = '\0'; - + while(ReadSize) { for(; *NextLine != '\r' && *NextLine != '\n'; NextLine++) @@ -1227,7 +1234,7 @@ if(NextLine == EndValid) { int LineLen = NextLine - ThisLine; - + if(ThisLine == ServiceDBData) { WS_DbgPrint(MIN_TRACE,("Line too long")); @@ -1236,23 +1243,23 @@ } memmove(ServiceDBData, ThisLine, LineLen); - + ReadFile(ServicesFile, ServiceDBData + LineLen, sizeof( ServiceDBData )-1 - LineLen, &ReadSize, NULL ); - + EndValid = ServiceDBData + LineLen + ReadSize; NextLine = ServiceDBData + LineLen; ThisLine = ServiceDBData; - + if(!ReadSize) break; } } - + *NextLine = '\0'; Comment = strchr( ThisLine, '#' ); if( Comment ) *Comment = '\0'; /* Terminate at comment start */ - + if(DecodeServEntFromString(ThisLine, &ServiceName, &PortNumberStr, @@ -1644,7 +1651,7 @@ return WSAEINVAL; if (nodename == NULL && servname == NULL) return WSAHOST_NOT_FOUND; - + if (!WSAINITIALIZED) return WSANOTINITIALISED; @@ -1681,7 +1688,7 @@ /* Is it an IPv6 address? */ if (strstr(nodename, ":")) return WSAHOST_NOT_FOUND; - + /* Is it an IPv4 address? */ addr = inet_addr(nodename); if (addr != INADDR_NONE) @@ -1720,7 +1727,7 @@ { /* accept only A records */ if (currdns->wType != DNS_TYPE_A) continue; - + ai = new_addrinfo(ai); if (ret == NULL) ret = ai; @@ -1771,7 +1778,7 @@ if (ret == NULL) return WSAHOST_NOT_FOUND; - + if (hints && hints->ai_family != PF_UNSPEC && hints->ai_family != PF_INET) { freeaddrinfo(ret);
12 years, 6 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
12
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
Results per page:
10
25
50
100
200