webservices: Build with msvcrt.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-06-26 09:36:53 +02:00
parent ba24a243a0
commit 4da92b60b6
10 changed files with 25 additions and 64 deletions

View File

@ -2,6 +2,8 @@ MODULE = webservices.dll
IMPORTLIB = webservices
IMPORTS = winhttp rpcrt4 user32 ws2_32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
channel.c \
error.c \

View File

@ -27,7 +27,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "webservices_private.h"
#include "sock.h"
@ -253,11 +252,9 @@ static struct channel *alloc_channel(void)
InitializeCriticalSection( &ret->cs );
InitializeCriticalSection( &ret->send_q.cs );
InitializeCriticalSection( &ret->recv_q.cs );
#ifndef __MINGW32__
ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": channel.cs");
ret->send_q.cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": channel.send_q.cs");
ret->recv_q.cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": channel.recv_q.cs");
#endif
prop_init( channel_props, count, ret->prop, &ret[1] );
ret->prop_count = count;
@ -342,11 +339,9 @@ static void free_channel( struct channel *channel )
heap_free( channel->read_buf );
#ifndef __MINGW32__
channel->send_q.cs.DebugInfo->Spare[0] = 0;
channel->recv_q.cs.DebugInfo->Spare[0] = 0;
channel->cs.DebugInfo->Spare[0] = 0;
#endif
DeleteCriticalSection( &channel->send_q.cs );
DeleteCriticalSection( &channel->recv_q.cs );
DeleteCriticalSection( &channel->cs );
@ -836,8 +831,8 @@ static HRESULT connect_channel_http( struct channel *channel )
}
else
{
strcpyW( channel->u.http.path, uc.lpszUrlPath );
if (uc.dwExtraInfoLength) strcatW( channel->u.http.path, uc.lpszExtraInfo );
lstrcpyW( channel->u.http.path, uc.lpszUrlPath );
if (uc.dwExtraInfoLength) lstrcatW( channel->u.http.path, uc.lpszExtraInfo );
}
channel->u.http.flags = WINHTTP_FLAG_REFRESH;

View File

@ -57,9 +57,7 @@ static struct error *alloc_error(void)
ret->magic = ERROR_MAGIC;
InitializeCriticalSection( &ret->cs );
#ifndef __MINGW32__
ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": error.cs");
#endif
prop_init( error_props, count, ret->prop, &ret[1] );
ret->prop_count = count;
@ -68,9 +66,7 @@ static struct error *alloc_error(void)
static void free_error( struct error *error )
{
#ifndef __MINGW32__
error->cs.DebugInfo->Spare[0] = 0;
#endif
DeleteCriticalSection( &error->cs );
heap_free( error );
}

View File

@ -185,9 +185,7 @@ static struct heap *alloc_heap(void)
ret->magic = HEAP_MAGIC;
InitializeCriticalSection( &ret->cs );
#ifndef __MINGW32__
ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": heap.cs");
#endif
prop_init( heap_props, count, ret->prop, &ret[1] );
ret->prop_count = count;
@ -247,9 +245,7 @@ void WINAPI WsFreeHeap( WS_HEAP *handle )
LeaveCriticalSection( &heap->cs );
#ifndef __MINGW32__
heap->cs.DebugInfo->Spare[0] = 0;
#endif
DeleteCriticalSection( &heap->cs );
heap_free( heap );
}

View File

@ -25,7 +25,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "webservices_private.h"
#include "sock.h"
@ -139,9 +138,7 @@ static struct listener *alloc_listener(void)
return NULL;
}
InitializeCriticalSection( &ret->cs );
#ifndef __MINGW32__
ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": listener.cs");
#endif
prop_init( listener_props, count, ret->prop, &ret[1] );
ret->prop_count = count;
@ -177,9 +174,7 @@ static void free_listener( struct listener *listener )
CloseHandle( listener->wait );
CloseHandle( listener->cancel );
#ifndef __MINGW32__
listener->cs.DebugInfo->Spare[0] = 0;
#endif
DeleteCriticalSection( &listener->cs );
heap_free( listener );
}
@ -296,7 +291,7 @@ HRESULT resolve_hostname( const WCHAR *host, USHORT port, struct sockaddr *addr,
hints.ai_family = AF_INET;
*addr_len = 0;
sprintfW( service, fmtW, port );
swprintf( service, ARRAY_SIZE(service), fmtW, port );
if (GetAddrInfoW( host, service, &hints, &res )) return HRESULT_FROM_WIN32( WSAGetLastError() );
info = res;

View File

@ -27,7 +27,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "webservices_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(webservices);
@ -106,9 +105,7 @@ static struct msg *alloc_msg(void)
ret->header_size = HEADER_ARRAY_SIZE;
InitializeCriticalSection( &ret->cs );
#ifndef __MINGW32__
ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": msg.cs");
#endif
prop_init( msg_props, count, ret->prop, &ret[1] );
ret->prop_count = count;
@ -164,9 +161,7 @@ static void free_msg( struct msg *msg )
WsFreeHeap( msg->heap );
heap_free( msg->header );
#ifndef __MINGW32__
msg->cs.DebugInfo->Spare[0] = 0;
#endif
DeleteCriticalSection( &msg->cs );
heap_free( msg );
}
@ -1724,7 +1719,7 @@ HRESULT WINAPI WsRemoveCustomHeader( WS_MESSAGE *handle, const WS_XML_STRING *na
static WCHAR *build_http_header( const WCHAR *name, const WCHAR *value, ULONG *ret_len )
{
int len_name = strlenW( name ), len_value = strlenW( value );
int len_name = lstrlenW( name ), len_value = lstrlenW( value );
WCHAR *ret = heap_alloc( (len_name + len_value) * sizeof(WCHAR) );
if (!ret) return NULL;

View File

@ -63,9 +63,7 @@ static struct proxy *alloc_proxy(void)
ret->magic = PROXY_MAGIC;
InitializeCriticalSection( &ret->cs );
#ifndef __MINGW32__
ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": proxy.cs");
#endif
prop_init( proxy_props, count, ret->prop, &ret[1] );
ret->prop_count = count;
@ -83,9 +81,7 @@ static void free_proxy( struct proxy *proxy )
reset_proxy( proxy );
WsFreeChannel( proxy->channel );
#ifndef __MINGW32__
proxy->cs.DebugInfo->Spare[0] = 0;
#endif
DeleteCriticalSection( &proxy->cs );
heap_free( proxy );
}

View File

@ -421,9 +421,7 @@ static struct reader *alloc_reader(void)
ret->magic = READER_MAGIC;
InitializeCriticalSection( &ret->cs );
#ifndef __MINGW32__
ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": reader.cs");
#endif
prop_init( reader_props, count, ret->prop, &ret[1] );
ret->prop_count = count;
@ -520,9 +518,7 @@ static void free_reader( struct reader *reader )
heap_free( reader->prefixes );
heap_free( reader->stream_buf );
#ifndef __MINGW32__
reader->cs.DebugInfo->Spare[0] = 0;
#endif
DeleteCriticalSection( &reader->cs );
heap_free( reader );
}

View File

@ -20,13 +20,13 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winuser.h"
#include "webservices.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "webservices_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(webservices);
@ -39,19 +39,19 @@ static const WCHAR netpipe[] = {'n','e','t','.','p','i','p','e'};
static WS_URL_SCHEME_TYPE scheme_type( const WCHAR *str, ULONG len )
{
if (len == ARRAY_SIZE( http ) && !strncmpiW( str, http, ARRAY_SIZE( http )))
if (len == ARRAY_SIZE( http ) && !wcsnicmp( str, http, ARRAY_SIZE( http )))
return WS_URL_HTTP_SCHEME_TYPE;
if (len == ARRAY_SIZE( https ) && !strncmpiW( str, https, ARRAY_SIZE( https )))
if (len == ARRAY_SIZE( https ) && !wcsnicmp( str, https, ARRAY_SIZE( https )))
return WS_URL_HTTPS_SCHEME_TYPE;
if (len == ARRAY_SIZE( nettcp ) && !strncmpiW( str, nettcp, ARRAY_SIZE( nettcp )))
if (len == ARRAY_SIZE( nettcp ) && !wcsnicmp( str, nettcp, ARRAY_SIZE( nettcp )))
return WS_URL_NETTCP_SCHEME_TYPE;
if (len == ARRAY_SIZE( soapudp ) && !strncmpiW( str, soapudp, ARRAY_SIZE( soapudp )))
if (len == ARRAY_SIZE( soapudp ) && !wcsnicmp( str, soapudp, ARRAY_SIZE( soapudp )))
return WS_URL_SOAPUDP_SCHEME_TYPE;
if (len == ARRAY_SIZE( netpipe ) && !strncmpiW( str, netpipe, ARRAY_SIZE( netpipe )))
if (len == ARRAY_SIZE( netpipe ) && !wcsnicmp( str, netpipe, ARRAY_SIZE( netpipe )))
return WS_URL_NETPIPE_SCHEME_TYPE;
return ~0u;
@ -107,7 +107,7 @@ static WCHAR *url_decode( WCHAR *str, ULONG len, WS_HEAP *heap, ULONG *ret_len )
for (i = 0; i < len; i++, p++)
{
if ((len - i) < 3) break;
if (p[0] == '%' && isxdigitW( p[1] ) && isxdigitW( p[2] ))
if (p[0] == '%' && iswxdigit( p[1] ) && iswxdigit( p[2] ))
{
decode = TRUE;
if (url_decode_byte( p[1], p[2] ) > 159)
@ -125,7 +125,7 @@ static WCHAR *url_decode( WCHAR *str, ULONG len, WS_HEAP *heap, ULONG *ret_len )
p = str;
while (len)
{
if (len >= 3 && p[0] == '%' && isxdigitW( p[1] ) && isxdigitW( p[2] ))
if (len >= 3 && p[0] == '%' && iswxdigit( p[1] ) && iswxdigit( p[2] ))
{
*q++ = url_decode_byte( p[1], p[2] );
p += 3;
@ -214,7 +214,7 @@ HRESULT WINAPI WsDecodeUrl( const WS_STRING *str, ULONG flags, WS_HEAP *heap, WS
if (len && *q == ':')
{
p = ++q; len--;
while (len && isdigitW( *q ))
while (len && iswdigit( *q ))
{
if ((port = port * 10 + *q - '0') > 65535) goto done;
q++; len--;
@ -481,7 +481,7 @@ HRESULT WINAPI WsEncodeUrl( const WS_URL *base, ULONG flags, WS_HEAP *heap, WS_S
{
q = url->portAsString.chars;
len = url->portAsString.length;
while (len && isdigitW( *q ))
while (len && iswdigit( *q ))
{
if ((port = port * 10 + *q - '0') > 65535)
{
@ -501,7 +501,7 @@ HRESULT WINAPI WsEncodeUrl( const WS_URL *base, ULONG flags, WS_HEAP *heap, WS_S
if (port)
{
WCHAR buf[7];
len = sprintfW( buf, fmtW, port );
len = swprintf( buf, ARRAY_SIZE(buf), fmtW, port );
memcpy( p, buf, len * sizeof(WCHAR) );
p += len;
}

View File

@ -16,7 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
@ -24,13 +23,13 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winuser.h"
#include "webservices.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "webservices_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(webservices);
@ -110,9 +109,7 @@ static struct writer *alloc_writer(void)
ret->magic = WRITER_MAGIC;
InitializeCriticalSection( &ret->cs );
#ifndef __MINGW32__
ret->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": writer.cs");
#endif
prop_init( writer_props, count, ret->prop, &ret[1] );
ret->prop_count = count;
@ -126,9 +123,7 @@ static void free_writer( struct writer *writer )
WsFreeHeap( writer->output_heap );
heap_free( writer->stream_buf );
#ifndef __MINGW32__
writer->cs.DebugInfo->Spare[0] = 0;
#endif
DeleteCriticalSection( &writer->cs );
heap_free( writer );
}
@ -905,10 +900,9 @@ static ULONG format_uint64( const UINT64 *ptr, unsigned char *buf )
static ULONG format_double( const double *ptr, unsigned char *buf )
{
#ifdef HAVE_POWL
static const long double precision = 0.0000000000000001;
static const double precision = 0.0000000000000001;
unsigned char *p = buf;
long double val = *ptr;
double val = *ptr;
int neg, mag, mag2, use_exp;
if (isnan( val ))
@ -938,12 +932,12 @@ static ULONG format_double( const double *ptr, unsigned char *buf )
val = -val;
}
mag = log10l( val );
mag = log10( val );
use_exp = (mag >= 15 || (neg && mag >= 1) || mag <= -1);
if (use_exp)
{
if (mag < 0) mag -= 1;
val = val / powl( 10.0, mag );
val = val / pow( 10.0, mag );
mag2 = mag;
mag = 0;
}
@ -951,10 +945,10 @@ static ULONG format_double( const double *ptr, unsigned char *buf )
while (val > precision || mag >= 0)
{
long double weight = powl( 10.0, mag );
double weight = pow( 10.0, mag );
if (weight > 0 && !isinf( weight ))
{
int digit = floorl( val / weight );
int digit = floor( val / weight );
val -= digit * weight;
*(p++) = '0' + digit;
}
@ -988,10 +982,6 @@ static ULONG format_double( const double *ptr, unsigned char *buf )
}
return p - buf;
#else
FIXME( "powl not found at build time\n" );
return 0;
#endif
}
static inline int year_size( int year )
@ -3505,7 +3495,7 @@ static HRESULT write_type_wsz( struct writer *writer, WS_TYPE_MAPPING mapping,
if (!option || option == WS_WRITE_REQUIRED_VALUE || option == WS_WRITE_NILLABLE_VALUE) return E_INVALIDARG;
if ((hr = get_value_ptr( option, value, size, 0, (const void **)&ptr )) != S_OK) return hr;
if (option == WS_WRITE_NILLABLE_POINTER && !ptr) return write_add_nil_attribute( writer );
if (!(len = strlenW( ptr ))) return S_OK;
if (!(len = lstrlenW( ptr ))) return S_OK;
utf16.text.textType = WS_XML_TEXT_TYPE_UTF16;
utf16.bytes = (BYTE *)ptr;