From 341a75bff38d75db7479af03ac108bfd2597e80a Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 2 Nov 2019 18:38:56 +0100 Subject: [PATCH] [JSPROXY] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/jsproxy/main.c | 45 +++++++++------------------------------- media/doc/README.WINE | 2 +- 2 files changed, 11 insertions(+), 36 deletions(-) diff --git a/dll/win32/jsproxy/main.c b/dll/win32/jsproxy/main.c index e58553f4fcd..54cb1be8753 100644 --- a/dll/win32/jsproxy/main.c +++ b/dll/win32/jsproxy/main.c @@ -16,37 +16,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include -#include -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_NETDB_H -# include -#endif #ifdef __REACTOS__ +#include #define COBJMACROS #endif -#if defined(__MINGW32__) || defined (_MSC_VER) -# include -#else -# define closesocket close -# define ioctlsocket ioctl -#endif +#include #include "windef.h" #include "winbase.h" -#ifndef __MINGW32__ -#define USE_WS_PREFIX -#endif #include "winsock2.h" #include "ws2ipdef.h" +#include "ws2tcpip.h" #include "winnls.h" #include "wininet.h" #ifndef __REACTOS__ @@ -57,7 +38,6 @@ #include "activscp.h" #include "wine/debug.h" #include "wine/heap.h" -#include "wine/unicode.h" static HINSTANCE instance; @@ -297,7 +277,7 @@ static HRESULT WINAPI dispex_GetNameSpaceParent( static HRESULT WINAPI dispex_GetDispID( IDispatchEx *iface, BSTR name, DWORD flags, DISPID *id ) { - if (!strcmpW( name, dns_resolveW )) + if (!lstrcmpW( name, dns_resolveW )) { *id = DISPID_GLOBAL_DNSRESOLVE; return S_OK; @@ -321,9 +301,9 @@ static char *get_computer_name( COMPUTER_NAME_FORMAT format ) return ret; } -static void printf_addr( const WCHAR *fmt, WCHAR *buf, struct sockaddr_in *addr ) +static void printf_addr( const WCHAR *fmt, WCHAR *buf, SIZE_T size, struct sockaddr_in *addr ) { - sprintfW( buf, fmt, + swprintf( buf, fmt, (unsigned int)(ntohl( addr->sin_addr.s_addr ) >> 24 & 0xff), (unsigned int)(ntohl( addr->sin_addr.s_addr ) >> 16 & 0xff), (unsigned int)(ntohl( addr->sin_addr.s_addr ) >> 8 & 0xff), @@ -332,7 +312,6 @@ static void printf_addr( const WCHAR *fmt, WCHAR *buf, struct sockaddr_in *addr static HRESULT dns_resolve( const WCHAR *hostname, VARIANT *result ) { -#ifdef HAVE_GETADDRINFO static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0}; WCHAR addr[16]; struct addrinfo *ai, *elem; @@ -356,15 +335,11 @@ static HRESULT dns_resolve( const WCHAR *hostname, VARIANT *result ) freeaddrinfo( ai ); return S_FALSE; } - printf_addr( fmtW, addr, (struct sockaddr_in *)elem->ai_addr ); + printf_addr( fmtW, addr, ARRAY_SIZE(addr), (struct sockaddr_in *)elem->ai_addr ); freeaddrinfo( ai ); V_VT( result ) = VT_BSTR; V_BSTR( result ) = SysAllocString( addr ); return S_OK; -#else - FIXME("getaddrinfo not found at build time\n"); - return S_FALSE; -#endif } static HRESULT WINAPI dispex_InvokeEx( @@ -439,7 +414,7 @@ static HRESULT WINAPI site_GetItemInfo( IActiveScriptSite *iface, LPCOLESTR name, DWORD mask, IUnknown **item, ITypeInfo **type_info ) { - if (!strcmpW( name, global_funcsW ) && mask == SCRIPTINFO_IUNKNOWN) + if (!lstrcmpW( name, global_funcsW ) && mask == SCRIPTINFO_IUNKNOWN) { *item = (IUnknown *)&global_dispex; return S_OK; @@ -515,9 +490,9 @@ static BSTR include_pac_utils( const WCHAR *script ) data = LoadResource( hmod, rsrc ); len = MultiByteToWideChar( CP_ACP, 0, data, size, NULL, 0 ); - if (!(ret = SysAllocStringLen( NULL, len + strlenW( script ) + 1 ))) return NULL; + if (!(ret = SysAllocStringLen( NULL, len + lstrlenW( script ) + 1 ))) return NULL; MultiByteToWideChar( CP_ACP, 0, data, size, ret, len ); - strcpyW( ret + len, script ); + lstrcpyW( ret + len, script ); return ret; } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 8c3f6b16d3d..6feca8d0c67 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -87,7 +87,7 @@ dll/win32/iphlpapi # Out of sync dll/win32/itircl # Synced to WineStaging-4.18 dll/win32/itss # Synced to WineStaging-4.18 dll/win32/jscript # Synced to WineStaging-4.18 -dll/win32/jsproxy # Synced to WineStaging-4.0 +dll/win32/jsproxy # Synced to WineStaging-4.18 dll/win32/loadperf # Synced to WineStaging-3.3 dll/win32/lz32 # Synced to WineStaging-3.3 dll/win32/mapi32 # Synced to WineStaging-4.0