Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
February 2022
- 87 participants
- 926 discussions
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/custom.c | 5 ++---
dlls/msi/handle.c | 6 +++---
dlls/msi/install.c | 17 ++++++++---------
dlls/msi/msipriv.h | 16 +++++-----------
dlls/msi/package.c | 15 +++++++--------
dlls/msi/streams.c | 3 ++-
dlls/msi/string.c | 10 ++++------
dlls/msi/where.c | 3 ++-
8 files changed, 33 insertions(+), 42 deletions(-)
diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index ee4f59b5faa..94c159c6a2a 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -36,7 +36,6 @@
#include "msipriv.h"
#include "winemsi.h"
#include "wine/asm.h"
-#include "wine/heap.h"
#include "wine/debug.h"
#include "wine/exception.h"
@@ -68,12 +67,12 @@ static struct list msi_pending_custom_actions = LIST_INIT( msi_pending_custom_ac
void __RPC_FAR * __RPC_USER MIDL_user_allocate(SIZE_T len)
{
- return heap_alloc(len);
+ return malloc(len);
}
void __RPC_USER MIDL_user_free(void __RPC_FAR * ptr)
{
- heap_free(ptr);
+ free(ptr);
}
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
diff --git a/dlls/msi/handle.c b/dlls/msi/handle.c
index 0881833ff68..26d8e7d7f85 100644
--- a/dlls/msi/handle.c
+++ b/dlls/msi/handle.c
@@ -92,13 +92,13 @@ static MSIHANDLE alloc_handle_table_entry(void)
if (msihandletable_size == 0)
{
newsize = 256;
- p = msi_alloc_zero(newsize*sizeof(msi_handle_info));
+ p = msi_alloc_zero(newsize * sizeof(*p));
}
else
{
newsize = msihandletable_size * 2;
- p = msi_realloc_zero(msihandletable,
- newsize*sizeof(msi_handle_info));
+ p = msi_realloc(msihandletable, newsize * sizeof(*p));
+ if (p) memset(p + msihandletable_size, 0, (newsize - msihandletable_size) * sizeof(*p));
}
if (!p)
return 0;
diff --git a/dlls/msi/install.c b/dlls/msi/install.c
index a3bfb53cfff..4d909b67682 100644
--- a/dlls/msi/install.c
+++ b/dlls/msi/install.c
@@ -34,7 +34,6 @@
#include "msipriv.h"
#include "winemsi.h"
-#include "wine/heap.h"
#include "wine/debug.h"
#include "wine/exception.h"
@@ -273,7 +272,7 @@ UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DW
if (!(remote = msi_get_remote(hinst)))
{
- heap_free(folderW);
+ free(folderW);
return ERROR_INVALID_HANDLE;
}
@@ -291,7 +290,7 @@ UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DW
r = msi_strncpyWtoA(path, -1, buf, sz, TRUE);
midl_user_free(path);
- heap_free(folderW);
+ free(folderW);
return r;
}
@@ -301,7 +300,7 @@ UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DW
else
r = ERROR_DIRECTORY;
- heap_free(folderW);
+ free(folderW);
msiobj_release(&package->hdr);
return r;
}
@@ -429,7 +428,7 @@ UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DW
if (!(remote = msi_get_remote(hinst)))
{
- heap_free(folderW);
+ free(folderW);
return ERROR_INVALID_HANDLE;
}
@@ -447,7 +446,7 @@ UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DW
r = msi_strncpyWtoA(path, -1, buf, sz, TRUE);
midl_user_free(path);
- heap_free(folderW);
+ free(folderW);
return r;
}
@@ -457,8 +456,8 @@ UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DW
else
r = ERROR_DIRECTORY;
- heap_free(path);
- heap_free(folderW);
+ free(path);
+ free(folderW);
msiobj_release(&package->hdr);
return r;
}
@@ -509,7 +508,7 @@ UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf,
else
r = ERROR_DIRECTORY;
- heap_free(path);
+ free(path);
msiobj_release(&package->hdr);
return r;
}
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 15130446b04..b5838bad6fe 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -1141,30 +1141,24 @@ extern void msi_ui_progress(MSIPACKAGE *, int, int, int, int) DECLSPEC_HIDDEN;
static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
static inline void *msi_alloc( size_t len )
{
- return HeapAlloc( GetProcessHeap(), 0, len );
+ return malloc( len );
}
static void *msi_alloc_zero( size_t len ) __WINE_ALLOC_SIZE(1);
static inline void *msi_alloc_zero( size_t len )
{
- return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len );
+ return calloc( 1, len );
}
static void *msi_realloc( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
static inline void *msi_realloc( void *mem, size_t len )
{
- return HeapReAlloc( GetProcessHeap(), 0, mem, len );
+ return realloc( mem, len );
}
-static void *msi_realloc_zero( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
-static inline void *msi_realloc_zero( void *mem, size_t len )
+static inline void msi_free( void *mem )
{
- return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len );
-}
-
-static inline BOOL msi_free( void *mem )
-{
- return HeapFree( GetProcessHeap(), 0, mem );
+ free( mem );
}
static inline char *strdupWtoA( LPCWSTR str )
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 7488c095080..349d7c0ffa3 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -43,7 +43,6 @@
#include "msidefs.h"
#include "sddl.h"
-#include "wine/heap.h"
#include "wine/debug.h"
#include "wine/exception.h"
@@ -2272,7 +2271,7 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
if (!(remote = msi_get_remote(hinst)))
{
- heap_free(nameW);
+ free(nameW);
return ERROR_INVALID_HANDLE;
}
@@ -2286,13 +2285,13 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
}
__ENDTRY
- heap_free(nameW);
+ free(nameW);
if (!r)
{
/* String might contain embedded nulls.
* Native returns the correct size but truncates the string. */
- tmp = heap_alloc_zero((len + 1) * sizeof(WCHAR));
+ tmp = calloc(1, (len + 1) * sizeof(WCHAR));
if (!tmp)
{
midl_user_free(value);
@@ -2302,7 +2301,7 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
r = msi_strncpyWtoA(tmp, len, buf, sz, TRUE);
- heap_free(tmp);
+ free(tmp);
}
midl_user_free(value);
return r;
@@ -2314,7 +2313,7 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
r = msi_strncpyWtoA(value, len, buf, sz, FALSE);
- heap_free(nameW);
+ free(nameW);
if (row) msiobj_release(&row->hdr);
msiobj_release(&package->hdr);
return r;
@@ -2355,7 +2354,7 @@ UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWOR
{
/* String might contain embedded nulls.
* Native returns the correct size but truncates the string. */
- tmp = heap_alloc_zero((len + 1) * sizeof(WCHAR));
+ tmp = calloc(1, (len + 1) * sizeof(WCHAR));
if (!tmp)
{
midl_user_free(value);
@@ -2365,7 +2364,7 @@ UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWOR
r = msi_strncpyW(tmp, len, buf, sz);
- heap_free(tmp);
+ free(tmp);
}
midl_user_free(value);
return r;
diff --git a/dlls/msi/streams.c b/dlls/msi/streams.c
index 1ef99c2ab05..8f6986039a9 100644
--- a/dlls/msi/streams.c
+++ b/dlls/msi/streams.c
@@ -57,7 +57,8 @@ static BOOL streams_resize_table( MSIDATABASE *db, UINT size )
{
MSISTREAM *tmp;
UINT new_size = db->num_streams_allocated * 2;
- if (!(tmp = msi_realloc_zero( db->streams, new_size * sizeof(MSISTREAM) ))) return FALSE;
+ if (!(tmp = msi_realloc( db->streams, new_size * sizeof(*tmp) ))) return FALSE;
+ memset( tmp + db->num_streams_allocated, 0, (new_size - db->num_streams_allocated) * sizeof(*tmp) );
db->streams = tmp;
db->num_streams_allocated = new_size;
}
diff --git a/dlls/msi/string.c b/dlls/msi/string.c
index 0e250ff4527..fb0134810b9 100644
--- a/dlls/msi/string.c
+++ b/dlls/msi/string.c
@@ -139,13 +139,11 @@ static int st_find_free_entry( string_table *st )
return i;
/* dynamically resize */
- sz = st->maxcount + 1 + st->maxcount/2;
- p = msi_realloc_zero( st->strings, sz * sizeof(struct msistring) );
- if( !p )
- return -1;
+ sz = st->maxcount + 1 + st->maxcount / 2;
+ if (!(p = msi_realloc( st->strings, sz * sizeof(*p) ))) return -1;
+ memset( p + st->maxcount, 0, (sz - st->maxcount) * sizeof(*p) );
- s = msi_realloc( st->sorted, sz*sizeof(UINT) );
- if( !s )
+ if (!(s = msi_realloc( st->sorted, sz * sizeof(*s) )))
{
msi_free( p );
return -1;
diff --git a/dlls/msi/where.c b/dlls/msi/where.c
index 2a64de8cd9d..684d9d5fb98 100644
--- a/dlls/msi/where.c
+++ b/dlls/msi/where.c
@@ -131,9 +131,10 @@ static UINT add_row(MSIWHEREVIEW *wv, UINT vals[])
MSIROWENTRY **new_reorder;
UINT newsize = wv->reorder_size * 2;
- new_reorder = msi_realloc_zero(wv->reorder, sizeof(MSIROWENTRY *) * newsize);
+ new_reorder = msi_realloc(wv->reorder, newsize * sizeof(*new_reorder));
if (!new_reorder)
return ERROR_OUTOFMEMORY;
+ memset(new_reorder + wv->reorder_size, 0, (newsize - wv->reorder_size) * sizeof(*new_reorder));
wv->reorder = new_reorder;
wv->reorder_size = newsize;
--
2.30.2
1
0
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/webservices/channel.c | 111 ++++++++++++-----------
dlls/webservices/error.c | 6 +-
dlls/webservices/heap.c | 6 +-
dlls/webservices/listener.c | 19 ++--
dlls/webservices/msg.c | 69 ++++++++-------
dlls/webservices/proxy.c | 6 +-
dlls/webservices/reader.c | 150 ++++++++++++++++----------------
dlls/webservices/string.c | 46 +++++-----
dlls/webservices/tests/writer.c | 28 +++---
dlls/webservices/url.c | 12 +--
dlls/webservices/writer.c | 46 +++++-----
11 files changed, 248 insertions(+), 251 deletions(-)
diff --git a/dlls/webservices/channel.c b/dlls/webservices/channel.c
index 9079d0a8cb1..9315334c23f 100644
--- a/dlls/webservices/channel.c
+++ b/dlls/webservices/channel.c
@@ -25,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
#include "sock.h"
@@ -132,7 +131,7 @@ static void CALLBACK queue_runner( TP_CALLBACK_INSTANCE *instance, void *ctx )
while ((task = dequeue_task( queue )))
{
task->proc( task );
- heap_free( task );
+ free( task );
}
break;
}
@@ -249,7 +248,7 @@ static struct channel *alloc_channel(void)
struct channel *ret;
ULONG size = sizeof(*ret) + prop_size( channel_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = CHANNEL_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -266,7 +265,7 @@ static struct channel *alloc_channel(void)
static void clear_addr( WS_ENDPOINT_ADDRESS *addr )
{
- heap_free( addr->url.chars );
+ free( addr->url.chars );
addr->url.chars = NULL;
addr->url.length = 0;
}
@@ -282,7 +281,7 @@ static void clear_queue( struct queue *queue )
{
struct task *task = LIST_ENTRY( ptr, struct task, entry );
list_remove( &task->entry );
- heap_free( task );
+ free( task );
}
CloseHandle( queue->wait );
@@ -342,7 +341,7 @@ static void reset_channel( struct channel *channel )
channel->u.http.connect = NULL;
WinHttpCloseHandle( channel->u.http.session );
channel->u.http.session = NULL;
- heap_free( channel->u.http.path );
+ free( channel->u.http.path );
channel->u.http.path = NULL;
channel->u.http.flags = 0;
break;
@@ -364,8 +363,8 @@ static void reset_channel( struct channel *channel )
static void free_header_mappings( WS_HTTP_HEADER_MAPPING **mappings, ULONG count )
{
ULONG i;
- for (i = 0; i < count; i++) heap_free( mappings[i] );
- heap_free( mappings );
+ for (i = 0; i < count; i++) free( mappings[i] );
+ free( mappings );
}
static void free_message_mapping( const WS_HTTP_MESSAGE_MAPPING *mapping )
@@ -389,8 +388,8 @@ static void free_channel( struct channel *channel )
WsFreeWriter( channel->writer );
WsFreeReader( channel->reader );
- heap_free( channel->read_buf );
- heap_free( channel->send_buf );
+ free( channel->read_buf );
+ free( channel->send_buf );
free_props( channel );
channel->send_q.cs.DebugInfo->Spare[0] = 0;
@@ -399,14 +398,14 @@ static void free_channel( struct channel *channel )
DeleteCriticalSection( &channel->send_q.cs );
DeleteCriticalSection( &channel->recv_q.cs );
DeleteCriticalSection( &channel->cs );
- heap_free( channel );
+ free( channel );
}
static WS_HTTP_HEADER_MAPPING *dup_header_mapping( const WS_HTTP_HEADER_MAPPING *src )
{
WS_HTTP_HEADER_MAPPING *dst;
- if (!(dst = heap_alloc( sizeof(*dst) + src->headerName.length ))) return NULL;
+ if (!(dst = malloc( sizeof(*dst) + src->headerName.length ))) return NULL;
dst->headerName.bytes = (BYTE *)(dst + 1);
memcpy( dst->headerName.bytes, src->headerName.bytes, src->headerName.length );
@@ -420,7 +419,7 @@ static HRESULT dup_message_mapping( const WS_HTTP_MESSAGE_MAPPING *src, WS_HTTP_
ULONG i, size;
size = src->requestHeaderMappingCount * sizeof(*dst->responseHeaderMappings);
- if (!(dst->requestHeaderMappings = heap_alloc( size ))) return E_OUTOFMEMORY;
+ if (!(dst->requestHeaderMappings = malloc( size ))) return E_OUTOFMEMORY;
for (i = 0; i < src->requestHeaderMappingCount; i++)
{
@@ -432,9 +431,9 @@ static HRESULT dup_message_mapping( const WS_HTTP_MESSAGE_MAPPING *src, WS_HTTP_
}
size = src->responseHeaderMappingCount * sizeof(*dst->responseHeaderMappings);
- if (!(dst->responseHeaderMappings = heap_alloc( size )))
+ if (!(dst->responseHeaderMappings = malloc( size )))
{
- heap_free( dst->responseHeaderMappings );
+ free( dst->responseHeaderMappings );
return E_OUTOFMEMORY;
}
@@ -848,7 +847,7 @@ static HRESULT queue_shutdown_session( struct channel *channel, const WS_ASYNC_C
{
struct shutdown_session *s;
- if (!(s = heap_alloc( sizeof(*s) ))) return E_OUTOFMEMORY;
+ if (!(s = malloc( sizeof(*s) ))) return E_OUTOFMEMORY;
s->task.proc = shutdown_session_proc;
s->channel = channel;
s->ctx = *ctx;
@@ -921,7 +920,7 @@ static HRESULT queue_close_channel( struct channel *channel, const WS_ASYNC_CONT
{
struct close_channel *c;
- if (!(c = heap_alloc( sizeof(*c) ))) return E_OUTOFMEMORY;
+ if (!(c = malloc( sizeof(*c) ))) return E_OUTOFMEMORY;
c->task.proc = close_channel_proc;
c->channel = channel;
c->ctx = *ctx;
@@ -973,11 +972,11 @@ static HRESULT parse_http_url( const WCHAR *url, ULONG len, URL_COMPONENTS *uc )
memset( uc, 0, sizeof(*uc) );
uc->dwStructSize = sizeof(*uc);
uc->dwHostNameLength = 128;
- uc->lpszHostName = heap_alloc( uc->dwHostNameLength * sizeof(WCHAR) );
+ uc->lpszHostName = malloc( uc->dwHostNameLength * sizeof(WCHAR) );
uc->dwUrlPathLength = 128;
- uc->lpszUrlPath = heap_alloc( uc->dwUrlPathLength * sizeof(WCHAR) );
+ uc->lpszUrlPath = malloc( uc->dwUrlPathLength * sizeof(WCHAR) );
uc->dwExtraInfoLength = 128;
- uc->lpszExtraInfo = heap_alloc( uc->dwExtraInfoLength * sizeof(WCHAR) );
+ uc->lpszExtraInfo = malloc( uc->dwExtraInfoLength * sizeof(WCHAR) );
if (!uc->lpszHostName || !uc->lpszUrlPath || !uc->lpszExtraInfo) goto error;
if (!WinHttpCrackUrl( url, len, ICU_DECODE, uc ))
@@ -987,11 +986,11 @@ static HRESULT parse_http_url( const WCHAR *url, ULONG len, URL_COMPONENTS *uc )
hr = HRESULT_FROM_WIN32( err );
goto error;
}
- if (!(tmp = heap_realloc( uc->lpszHostName, uc->dwHostNameLength * sizeof(WCHAR) ))) goto error;
+ if (!(tmp = realloc( uc->lpszHostName, uc->dwHostNameLength * sizeof(WCHAR) ))) goto error;
uc->lpszHostName = tmp;
- if (!(tmp = heap_realloc( uc->lpszUrlPath, uc->dwUrlPathLength * sizeof(WCHAR) ))) goto error;
+ if (!(tmp = realloc( uc->lpszUrlPath, uc->dwUrlPathLength * sizeof(WCHAR) ))) goto error;
uc->lpszUrlPath = tmp;
- if (!(tmp = heap_realloc( uc->lpszExtraInfo, uc->dwExtraInfoLength * sizeof(WCHAR) ))) goto error;
+ if (!(tmp = realloc( uc->lpszExtraInfo, uc->dwExtraInfoLength * sizeof(WCHAR) ))) goto error;
uc->lpszExtraInfo = tmp;
WinHttpCrackUrl( url, len, ICU_DECODE, uc );
}
@@ -999,9 +998,9 @@ static HRESULT parse_http_url( const WCHAR *url, ULONG len, URL_COMPONENTS *uc )
return S_OK;
error:
- heap_free( uc->lpszHostName );
- heap_free( uc->lpszUrlPath );
- heap_free( uc->lpszExtraInfo );
+ free( uc->lpszHostName );
+ free( uc->lpszUrlPath );
+ free( uc->lpszExtraInfo );
return hr;
}
@@ -1014,7 +1013,7 @@ static HRESULT open_channel_http( struct channel *channel )
if (channel->u.http.connect) return S_OK;
if ((hr = parse_http_url( channel->addr.url.chars, channel->addr.url.length, &uc )) != S_OK) return hr;
- if (!(channel->u.http.path = heap_alloc( (uc.dwUrlPathLength + uc.dwExtraInfoLength + 1) * sizeof(WCHAR) )))
+ if (!(channel->u.http.path = malloc( (uc.dwUrlPathLength + uc.dwExtraInfoLength + 1) * sizeof(WCHAR) )))
{
hr = E_OUTOFMEMORY;
goto done;
@@ -1058,9 +1057,9 @@ done:
WinHttpCloseHandle( con );
WinHttpCloseHandle( ses );
}
- heap_free( uc.lpszHostName );
- heap_free( uc.lpszUrlPath );
- heap_free( uc.lpszExtraInfo );
+ free( uc.lpszHostName );
+ free( uc.lpszUrlPath );
+ free( uc.lpszExtraInfo );
return hr;
}
@@ -1080,14 +1079,14 @@ static HRESULT open_channel_tcp( struct channel *channel )
if ((hr = parse_url( &channel->addr.url, &scheme, &host, &port )) != S_OK) return hr;
if (scheme != WS_URL_NETTCP_SCHEME_TYPE)
{
- heap_free( host );
+ free( host );
return WS_E_INVALID_ENDPOINT_URL;
}
winsock_init();
hr = resolve_hostname( host, port, addr, &addr_len, 0 );
- heap_free( host );
+ free( host );
if (hr != S_OK) return hr;
if ((channel->u.tcp.socket = socket( addr->sa_family, SOCK_STREAM, 0 )) == -1)
@@ -1120,14 +1119,14 @@ static HRESULT open_channel_udp( struct channel *channel )
if ((hr = parse_url( &channel->addr.url, &scheme, &host, &port )) != S_OK) return hr;
if (scheme != WS_URL_SOAPUDP_SCHEME_TYPE)
{
- heap_free( host );
+ free( host );
return WS_E_INVALID_ENDPOINT_URL;
}
winsock_init();
hr = resolve_hostname( host, port, addr, &addr_len, 0 );
- heap_free( host );
+ free( host );
if (hr != S_OK) return hr;
if ((channel->u.udp.socket = socket( addr->sa_family, SOCK_DGRAM, 0 )) == -1)
@@ -1155,7 +1154,7 @@ static HRESULT open_channel( struct channel *channel, const WS_ENDPOINT_ADDRESS
TRACE( "endpoint %s\n", debugstr_wn(endpoint->url.chars, endpoint->url.length) );
- if (!(channel->addr.url.chars = heap_alloc( endpoint->url.length * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
+ if (!(channel->addr.url.chars = malloc( endpoint->url.length * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
memcpy( channel->addr.url.chars, endpoint->url.chars, endpoint->url.length * sizeof(WCHAR) );
channel->addr.url.length = endpoint->url.length;
@@ -1207,7 +1206,7 @@ static HRESULT queue_open_channel( struct channel *channel, const WS_ENDPOINT_AD
{
struct open_channel *o;
- if (!(o = heap_alloc( sizeof(*o) ))) return E_OUTOFMEMORY;
+ if (!(o = malloc( sizeof(*o) ))) return E_OUTOFMEMORY;
o->task.proc = open_channel_proc;
o->channel = channel;
o->endpoint = endpoint;
@@ -1279,7 +1278,7 @@ static HRESULT write_bytes( struct channel *channel, BYTE *bytes, ULONG len )
if (!channel->send_buf)
{
channel->send_buflen = get_max_buffer_size( channel );
- if (!(channel->send_buf = heap_alloc( channel->send_buflen ))) return E_OUTOFMEMORY;
+ if (!(channel->send_buf = malloc( channel->send_buflen ))) return E_OUTOFMEMORY;
}
if (channel->send_size + len >= channel->send_buflen) return WS_E_QUOTA_EXCEEDED;
@@ -1344,7 +1343,7 @@ static HRESULT write_string_table( struct channel *channel, const struct diction
static HRESULT string_to_utf8( const WS_STRING *str, unsigned char **ret, int *len )
{
*len = WideCharToMultiByte( CP_UTF8, 0, str->chars, str->length, NULL, 0, NULL, NULL );
- if (!(*ret = heap_alloc( *len ))) return E_OUTOFMEMORY;
+ if (!(*ret = malloc( *len ))) return E_OUTOFMEMORY;
WideCharToMultiByte( CP_UTF8, 0, str->chars, str->length, (char *)*ret, *len, NULL, NULL );
return S_OK;
}
@@ -1441,7 +1440,7 @@ static HRESULT write_preamble( struct channel *channel )
hr = write_byte( channel, FRAME_RECORD_TYPE_PREAMBLE_END );
done:
- heap_free( url );
+ free( url );
return hr;
}
@@ -1597,14 +1596,14 @@ static HRESULT CALLBACK dict_cb( void *state, const WS_XML_STRING *str, BOOL *fo
return S_OK;
}
- if (!(bytes = heap_alloc( str->length ))) return E_OUTOFMEMORY;
+ if (!(bytes = malloc( str->length ))) return E_OUTOFMEMORY;
memcpy( bytes, str->bytes, str->length );
if ((hr = insert_string( dict, bytes, str->length, index, id )) == S_OK)
{
*found = TRUE;
return S_OK;
}
- heap_free( bytes );
+ free( bytes );
*found = FALSE;
return hr;
@@ -1723,7 +1722,7 @@ static HRESULT queue_send_message( struct channel *channel, WS_MESSAGE *msg, con
{
struct send_message *s;
- if (!(s = heap_alloc( sizeof(*s) ))) return E_OUTOFMEMORY;
+ if (!(s = malloc( sizeof(*s) ))) return E_OUTOFMEMORY;
s->task.proc = send_message_proc;
s->channel = channel;
s->msg = msg;
@@ -1833,7 +1832,7 @@ static HRESULT resize_read_buffer( struct channel *channel, ULONG size )
{
if (!channel->read_buf)
{
- if (!(channel->read_buf = heap_alloc( size ))) return E_OUTOFMEMORY;
+ if (!(channel->read_buf = malloc( size ))) return E_OUTOFMEMORY;
channel->read_buflen = size;
return S_OK;
}
@@ -1841,7 +1840,7 @@ static HRESULT resize_read_buffer( struct channel *channel, ULONG size )
{
char *tmp;
ULONG new_size = max( size, channel->read_buflen * 2 );
- if (!(tmp = heap_realloc( channel->read_buf, new_size ))) return E_OUTOFMEMORY;
+ if (!(tmp = realloc( channel->read_buf, new_size ))) return E_OUTOFMEMORY;
channel->read_buf = tmp;
channel->read_buflen = new_size;
}
@@ -2064,14 +2063,14 @@ static HRESULT receive_preamble( struct channel *channel )
unsigned char *url;
if ((hr = receive_size( channel, &size )) != S_OK) return hr;
- if (!(url = heap_alloc( size ))) return E_OUTOFMEMORY;
+ if (!(url = malloc( size ))) return E_OUTOFMEMORY;
if ((hr = receive_bytes( channel, url, size )) != S_OK)
{
- heap_free( url );
+ free( url );
return hr;
}
TRACE( "transport URL %s\n", debugstr_an((char *)url, size) );
- heap_free( url ); /* FIXME: verify */
+ free( url ); /* FIXME: verify */
break;
}
case FRAME_RECORD_TYPE_KNOWN_ENCODING:
@@ -2175,7 +2174,7 @@ static HRESULT build_dict( const BYTE *buf, ULONG buflen, struct dictionary *dic
return WS_E_INVALID_FORMAT;
}
buflen -= size;
- if (!(bytes = heap_alloc( size )))
+ if (!(bytes = malloc( size )))
{
hr = E_OUTOFMEMORY;
goto error;
@@ -2183,13 +2182,13 @@ static HRESULT build_dict( const BYTE *buf, ULONG buflen, struct dictionary *dic
memcpy( bytes, ptr, size );
if ((index = find_string( dict, bytes, size, NULL )) == -1) /* duplicate */
{
- heap_free( bytes );
+ free( bytes );
ptr += size;
continue;
}
if ((hr = insert_string( dict, bytes, size, index, NULL )) != S_OK)
{
- heap_free( bytes );
+ free( bytes );
clear_dict( dict );
return hr;
}
@@ -2375,7 +2374,7 @@ static HRESULT queue_receive_message( struct channel *channel, WS_MESSAGE *msg,
{
struct receive_message *r;
- if (!(r = heap_alloc( sizeof(*r) ))) return E_OUTOFMEMORY;
+ if (!(r = malloc( sizeof(*r) ))) return E_OUTOFMEMORY;
r->task.proc = receive_message_proc;
r->channel = channel;
r->msg = msg;
@@ -2485,7 +2484,7 @@ static HRESULT queue_request_reply( struct channel *channel, WS_MESSAGE *request
{
struct request_reply *r;
- if (!(r = heap_alloc( sizeof(*r) ))) return E_OUTOFMEMORY;
+ if (!(r = malloc( sizeof(*r) ))) return E_OUTOFMEMORY;
r->task.proc = request_reply_proc;
r->channel = channel;
r->request = request;
@@ -2583,7 +2582,7 @@ static HRESULT queue_read_message_start( struct channel *channel, WS_MESSAGE *ms
{
struct read_message_start *r;
- if (!(r = heap_alloc( sizeof(*r) ))) return E_OUTOFMEMORY;
+ if (!(r = malloc( sizeof(*r) ))) return E_OUTOFMEMORY;
r->task.proc = read_message_start_proc;
r->channel = channel;
r->msg = msg;
@@ -2660,7 +2659,7 @@ static HRESULT queue_read_message_end( struct channel *channel, WS_MESSAGE *msg,
{
struct read_message_end *r;
- if (!(r = heap_alloc( sizeof(*r) ))) return E_OUTOFMEMORY;
+ if (!(r = malloc( sizeof(*r) ))) return E_OUTOFMEMORY;
r->task.proc = read_message_end_proc;
r->msg = msg;
r->ctx = *ctx;
@@ -2735,7 +2734,7 @@ static HRESULT queue_write_message_start( struct channel *channel, WS_MESSAGE *m
{
struct write_message_start *w;
- if (!(w = heap_alloc( sizeof(*w) ))) return E_OUTOFMEMORY;
+ if (!(w = malloc( sizeof(*w) ))) return E_OUTOFMEMORY;
w->task.proc = write_message_start_proc;
w->channel = channel;
w->msg = msg;
@@ -2815,7 +2814,7 @@ static HRESULT queue_write_message_end( struct channel *channel, WS_MESSAGE *msg
{
struct write_message_start *w;
- if (!(w = heap_alloc( sizeof(*w) ))) return E_OUTOFMEMORY;
+ if (!(w = malloc( sizeof(*w) ))) return E_OUTOFMEMORY;
w->task.proc = write_message_end_proc;
w->channel = channel;
w->msg = msg;
diff --git a/dlls/webservices/error.c b/dlls/webservices/error.c
index 34135851ecc..d1a679b2ff6 100644
--- a/dlls/webservices/error.c
+++ b/dlls/webservices/error.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -24,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -53,7 +53,7 @@ static struct error *alloc_error(void)
struct error *ret;
ULONG size = sizeof(*ret) + prop_size( error_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = ERROR_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -68,7 +68,7 @@ static void free_error( struct error *error )
{
error->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &error->cs );
- heap_free( error );
+ free( error );
}
/**************************************************************************
diff --git a/dlls/webservices/heap.c b/dlls/webservices/heap.c
index 618a9c8729b..a202b8308f0 100644
--- a/dlls/webservices/heap.c
+++ b/dlls/webservices/heap.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -24,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -181,7 +181,7 @@ static struct heap *alloc_heap(void)
struct heap *ret;
ULONG size = sizeof(*ret) + prop_size( heap_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = HEAP_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -247,7 +247,7 @@ void WINAPI WsFreeHeap( WS_HEAP *handle )
heap->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &heap->cs );
- heap_free( heap );
+ free( heap );
}
/**************************************************************************
diff --git a/dlls/webservices/listener.c b/dlls/webservices/listener.c
index d41b64b9749..01b739084ed 100644
--- a/dlls/webservices/listener.c
+++ b/dlls/webservices/listener.c
@@ -24,7 +24,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
#include "sock.h"
@@ -128,18 +127,18 @@ static struct listener *alloc_listener(void)
struct listener *ret;
ULONG size = sizeof(*ret) + prop_size( listener_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = LISTENER_MAGIC;
if (!(ret->wait = CreateEventW( NULL, FALSE, FALSE, NULL )))
{
- heap_free( ret );
+ free( ret );
return NULL;
}
if (!(ret->cancel = CreateEventW( NULL, FALSE, FALSE, NULL )))
{
CloseHandle( ret->wait );
- heap_free( ret );
+ free( ret );
return NULL;
}
InitializeCriticalSection( &ret->cs );
@@ -181,7 +180,7 @@ static void free_listener( struct listener *listener )
listener->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &listener->cs );
- heap_free( listener );
+ free( listener );
}
static HRESULT create_listener( WS_CHANNEL_TYPE type, WS_CHANNEL_BINDING binding,
@@ -327,7 +326,7 @@ HRESULT parse_url( const WS_STRING *str, WS_URL_SCHEME_TYPE *scheme, WCHAR **hos
if (url->host.length == 1 && (url->host.chars[0] == '+' || url->host.chars[0] == '*')) *host = NULL;
else
{
- if (!(*host = heap_alloc( (url->host.length + 1) * sizeof(WCHAR) )))
+ if (!(*host = malloc( (url->host.length + 1) * sizeof(WCHAR) )))
{
WsFreeHeap( heap );
return E_OUTOFMEMORY;
@@ -355,14 +354,14 @@ static HRESULT open_listener_tcp( struct listener *listener, const WS_STRING *ur
if ((hr = parse_url( url, &scheme, &host, &port )) != S_OK) return hr;
if (scheme != WS_URL_NETTCP_SCHEME_TYPE)
{
- heap_free( host );
+ free( host );
return WS_E_INVALID_ENDPOINT_URL;
}
winsock_init();
hr = resolve_hostname( host, port, addr, &addr_len, AI_PASSIVE );
- heap_free( host );
+ free( host );
if (hr != S_OK) return hr;
if ((listener->u.tcp.socket = socket( addr->sa_family, SOCK_STREAM, 0 )) == -1)
@@ -406,14 +405,14 @@ static HRESULT open_listener_udp( struct listener *listener, const WS_STRING *ur
if ((hr = parse_url( url, &scheme, &host, &port )) != S_OK) return hr;
if (scheme != WS_URL_SOAPUDP_SCHEME_TYPE)
{
- heap_free( host );
+ free( host );
return WS_E_INVALID_ENDPOINT_URL;
}
winsock_init();
hr = resolve_hostname( host, port, addr, &addr_len, AI_PASSIVE );
- heap_free( host );
+ free( host );
if (hr != S_OK) return hr;
if ((listener->u.udp.socket = socket( addr->sa_family, SOCK_DGRAM, 0 )) == -1)
diff --git a/dlls/webservices/msg.c b/dlls/webservices/msg.c
index 51081217b7b..bd585b176fc 100644
--- a/dlls/webservices/msg.c
+++ b/dlls/webservices/msg.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -25,7 +26,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -94,10 +94,10 @@ static struct msg *alloc_msg(void)
struct msg *ret;
ULONG size = sizeof(*ret) + prop_size( msg_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
- if (!(ret->header = heap_alloc( HEADER_ARRAY_SIZE * sizeof(struct header *) )))
+ if (!(ret = calloc( 1, size ))) return NULL;
+ if (!(ret->header = malloc( HEADER_ARRAY_SIZE * sizeof(struct header *) )))
{
- heap_free( ret );
+ free( ret );
return NULL;
}
ret->magic = MSG_MAGIC;
@@ -114,10 +114,10 @@ static struct msg *alloc_msg(void)
static void free_header( struct header *header )
{
- heap_free( header->name.bytes );
- heap_free( header->ns.bytes );
+ free( header->name.bytes );
+ free( header->ns.bytes );
if (header->mapped) free_xml_string( header->u.text );
- heap_free( header );
+ free( header );
}
static void reset_msg( struct msg *msg )
@@ -129,7 +129,7 @@ static void reset_msg( struct msg *msg )
UuidCreate( &msg->id );
memset( &msg->id_req, 0, sizeof(msg->id_req) );
msg->is_addressed = FALSE;
- heap_free( msg->addr.chars );
+ free( msg->addr.chars );
msg->addr.chars = NULL;
msg->addr.length = 0;
@@ -159,11 +159,11 @@ static void free_msg( struct msg *msg )
WsFreeWriter( msg->writer );
WsFreeReader( msg->reader );
WsFreeHeap( msg->heap );
- heap_free( msg->header );
+ free( msg->header );
msg->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &msg->cs );
- heap_free( msg );
+ free( msg );
}
#define HEAP_MAX_SIZE (1 << 16)
@@ -454,7 +454,7 @@ HRESULT WINAPI WsAddressMessage( WS_MESSAGE *handle, const WS_ENDPOINT_ADDRESS *
if (msg->state < WS_MESSAGE_STATE_INITIALIZED || msg->is_addressed) hr = WS_E_INVALID_OPERATION;
else if (addr && addr->url.length)
{
- if (!(msg->addr.chars = heap_alloc( addr->url.length * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY;
+ if (!(msg->addr.chars = malloc( addr->url.length * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY;
else
{
memcpy( msg->addr.chars, addr->url.chars, addr->url.length * sizeof(WCHAR) );
@@ -1101,8 +1101,7 @@ static HRESULT grow_header_array( struct msg *msg, ULONG size )
{
struct header **tmp;
if (size <= msg->header_size) return S_OK;
- if (!(tmp = heap_realloc( msg->header, 2 * msg->header_size * sizeof(struct header *) )))
- return E_OUTOFMEMORY;
+ if (!(tmp = realloc( msg->header, 2 * msg->header_size * sizeof(struct header *) ))) return E_OUTOFMEMORY;
msg->header = tmp;
msg->header_size *= 2;
return S_OK;
@@ -1112,10 +1111,10 @@ static struct header *alloc_header( WS_HEADER_TYPE type, BOOL mapped, const WS_X
const WS_XML_STRING *ns )
{
struct header *ret;
- if (!(ret = heap_alloc_zero( sizeof(*ret) ))) return NULL;
+ if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL;
if (name && name->length)
{
- if (!(ret->name.bytes = heap_alloc( name->length )))
+ if (!(ret->name.bytes = malloc( name->length )))
{
free_header( ret );
return NULL;
@@ -1125,7 +1124,7 @@ static struct header *alloc_header( WS_HEADER_TYPE type, BOOL mapped, const WS_X
}
if (ns && ns->length)
{
- if (!(ret->ns.bytes = heap_alloc( ns->length )))
+ if (!(ret->ns.bytes = malloc( ns->length )))
{
free_header( ret );
return NULL;
@@ -1845,7 +1844,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 = lstrlenW( name ), len_value = lstrlenW( value );
- WCHAR *ret = heap_alloc( (len_name + len_value + 2) * sizeof(WCHAR) );
+ WCHAR *ret = malloc( (len_name + len_value + 2) * sizeof(WCHAR) );
if (!ret) return NULL;
memcpy( ret, name, len_name * sizeof(WCHAR) );
@@ -1866,7 +1865,7 @@ static WCHAR *from_xml_string( const WS_XML_STRING *str )
{
WCHAR *ret;
int len = MultiByteToWideChar( CP_UTF8, 0, (char *)str->bytes, str->length, NULL, 0 );
- if (!(ret = heap_alloc( (len + 1) * sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( (len + 1) * sizeof(*ret) ))) return NULL;
MultiByteToWideChar( CP_UTF8, 0, (char *)str->bytes, str->length, ret, len );
ret[len] = 0;
return ret;
@@ -1885,16 +1884,16 @@ static HRESULT insert_mapped_headers( struct msg *msg, HINTERNET req )
if (!(name = from_xml_string( &msg->header[i]->name ))) return E_OUTOFMEMORY;
if (!(value = from_xml_string( msg->header[i]->u.text )))
{
- heap_free( name );
+ free( name );
return E_OUTOFMEMORY;
}
header = build_http_header( name, value, &len );
- heap_free( name );
- heap_free( value );
+ free( name );
+ free( value );
if (!header) return E_OUTOFMEMORY;
hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_ADD|WINHTTP_ADDREQ_FLAG_REPLACE );
- heap_free( header );
+ free( header );
if (hr != S_OK) return hr;
}
return S_OK;
@@ -1932,13 +1931,13 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
if (!header) goto done;
if ((hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_ADD )) != S_OK) goto done;
- heap_free( header );
+ free( header );
hr = E_OUTOFMEMORY;
if (!(header = build_http_header( L"Content-Type", L"charset=utf-8", &len ))) goto done;
if ((hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON )) != S_OK)
goto done;
- heap_free( header );
+ free( header );
header = NULL;
switch (msg->version_env)
@@ -1949,14 +1948,14 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
break;
hr = E_OUTOFMEMORY;
- if (!(buf = heap_alloc( (len + 3) * sizeof(WCHAR) ))) goto done;
+ if (!(buf = malloc( (len + 3) * sizeof(WCHAR) ))) goto done;
buf[0] = '"';
MultiByteToWideChar( CP_UTF8, 0, (char *)msg->action->bytes, msg->action->length, buf + 1, len );
buf[len + 1] = '"';
buf[len + 2] = 0;
header = build_http_header( L"SOAPAction", buf, &len );
- heap_free( buf );
+ free( buf );
if (!header) goto done;
hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_ADD );
@@ -1970,7 +1969,7 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
break;
hr = E_OUTOFMEMORY;
- if (!(buf = heap_alloc( (len + len_action + 2) * sizeof(WCHAR) ))) goto done;
+ if (!(buf = malloc( (len + len_action + 2) * sizeof(WCHAR) ))) goto done;
memcpy( buf, L"action=\"", len_action * sizeof(WCHAR) );
MultiByteToWideChar( CP_UTF8, 0, (char *)msg->action->bytes, msg->action->length, buf + len_action, len );
len += len_action;
@@ -1978,7 +1977,7 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
buf[len] = 0;
header = build_http_header( L"Content-Type", buf, &len );
- heap_free( buf );
+ free( buf );
if (!header) goto done;
hr = insert_http_header( req, header, len, WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON );
@@ -1992,7 +1991,7 @@ HRESULT message_insert_http_headers( WS_MESSAGE *handle, HINTERNET req )
if (hr == S_OK) hr = insert_mapped_headers( msg, req );
done:
- heap_free( header );
+ free( header );
LeaveCriticalSection( &msg->cs );
TRACE( "returning %08x\n", hr );
return hr;
@@ -2012,26 +2011,26 @@ static HRESULT map_http_response_headers( struct msg *msg, HINTERNET req, const
GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
HRESULT hr;
- if (!(value = heap_alloc( size )))
+ if (!(value = malloc( size )))
{
- heap_free( name );
+ free( name );
return E_OUTOFMEMORY;
}
if (!WinHttpQueryHeaders( req, WINHTTP_QUERY_CUSTOM, name, value, &size, NULL ))
{
- heap_free( name );
+ free( name );
return HRESULT_FROM_WIN32( GetLastError() );
}
hr = add_mapped_header( msg, &mapping->responseHeaderMappings[i]->headerName, WS_WSZ_TYPE,
WS_WRITE_REQUIRED_POINTER, &value, sizeof(value) );
- heap_free( value );
+ free( value );
if (hr != S_OK)
{
- heap_free( name );
+ free( name );
return hr;
}
}
- heap_free( name );
+ free( name );
}
return S_OK;
}
diff --git a/dlls/webservices/proxy.c b/dlls/webservices/proxy.c
index b6278a6354c..80e5965ce3e 100644
--- a/dlls/webservices/proxy.c
+++ b/dlls/webservices/proxy.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -24,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -59,7 +59,7 @@ static struct proxy *alloc_proxy(void)
struct proxy *ret;
ULONG size = sizeof(*ret) + prop_size( proxy_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = PROXY_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -83,7 +83,7 @@ static void free_proxy( struct proxy *proxy )
proxy->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &proxy->cs );
- heap_free( proxy );
+ free( proxy );
}
static HRESULT create_proxy( WS_CHANNEL *channel, const WS_PROXY_PROPERTY *properties, ULONG count,
diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c
index 69c4f2a3007..d01222bd518 100644
--- a/dlls/webservices/reader.c
+++ b/dlls/webservices/reader.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include <assert.h>
#include <float.h>
#include <locale.h>
@@ -27,7 +28,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -72,7 +72,7 @@ struct node *alloc_node( WS_XML_NODE_TYPE type )
{
struct node *ret;
- if (!(ret = heap_alloc_zero( sizeof(*ret) ))) return NULL;
+ if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL;
ret->hdr.node.nodeType = type;
list_init( &ret->entry );
list_init( &ret->children );
@@ -85,8 +85,8 @@ void free_attribute( WS_XML_ATTRIBUTE *attr )
free_xml_string( attr->prefix );
free_xml_string( attr->localName );
free_xml_string( attr->ns );
- heap_free( attr->value );
- heap_free( attr );
+ free( attr->value );
+ free( attr );
}
void free_node( struct node *node )
@@ -100,7 +100,7 @@ void free_node( struct node *node )
ULONG i;
for (i = 0; i < elem->attributeCount; i++) free_attribute( elem->attributes[i] );
- heap_free( elem->attributes );
+ free( elem->attributes );
free_xml_string( elem->prefix );
free_xml_string( elem->localName );
free_xml_string( elem->ns );
@@ -109,13 +109,13 @@ void free_node( struct node *node )
case WS_XML_NODE_TYPE_TEXT:
{
WS_XML_TEXT_NODE *text = (WS_XML_TEXT_NODE *)node;
- heap_free( text->text );
+ free( text->text );
break;
}
case WS_XML_NODE_TYPE_COMMENT:
{
WS_XML_COMMENT_NODE *comment = (WS_XML_COMMENT_NODE *)node;
- heap_free( comment->value.bytes );
+ free( comment->value.bytes );
break;
}
case WS_XML_NODE_TYPE_CDATA:
@@ -129,7 +129,7 @@ void free_node( struct node *node )
ERR( "unhandled type %u\n", node_type( node ) );
break;
}
- heap_free( node );
+ free( node );
}
void destroy_nodes( struct node *node )
@@ -151,7 +151,7 @@ static WS_XML_ATTRIBUTE *dup_attribute( const WS_XML_ATTRIBUTE *src, WS_XML_WRIT
WS_XML_ATTRIBUTE *dst;
HRESULT hr;
- if (!(dst = heap_alloc_zero( sizeof(*dst) ))) return NULL;
+ if (!(dst = calloc( 1, sizeof(*dst) ))) return NULL;
dst->singleQuote = src->singleQuote;
dst->isXmlNs = src->isXmlNs;
@@ -191,13 +191,13 @@ static WS_XML_ATTRIBUTE **dup_attributes( WS_XML_ATTRIBUTE * const *src, ULONG c
WS_XML_ATTRIBUTE **dst;
ULONG i;
- if (!(dst = heap_alloc( sizeof(*dst) * count ))) return NULL;
+ if (!(dst = malloc( sizeof(*dst) * count ))) return NULL;
for (i = 0; i < count; i++)
{
if (!(dst[i] = dup_attribute( src[i], enc )))
{
for (; i > 0; i--) free_attribute( dst[i - 1] );
- heap_free( dst );
+ free( dst );
return NULL;
}
}
@@ -273,7 +273,7 @@ static struct node *dup_comment_node( const WS_XML_COMMENT_NODE *src )
if (!(node = alloc_node( WS_XML_NODE_TYPE_COMMENT ))) return NULL;
dst = (WS_XML_COMMENT_NODE *)node;
- if (src->value.length && !(dst->value.bytes = heap_alloc( src->value.length )))
+ if (src->value.length && !(dst->value.bytes = malloc( src->value.length )))
{
free_node( node );
return NULL;
@@ -413,10 +413,10 @@ static struct reader *alloc_reader(void)
struct reader *ret;
ULONG size = sizeof(*ret) + prop_size( reader_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
- if (!(ret->prefixes = heap_alloc_zero( sizeof(*ret->prefixes) )))
+ if (!(ret = calloc( 1, size ))) return NULL;
+ if (!(ret->prefixes = calloc( 1, sizeof(*ret->prefixes) )))
{
- heap_free( ret );
+ free( ret );
return NULL;
}
ret->nb_prefixes = ret->nb_prefixes_allocated = 1;
@@ -466,11 +466,12 @@ static HRESULT bind_prefix( struct reader *reader, const WS_XML_STRING *prefix,
}
if (i >= reader->nb_prefixes_allocated)
{
- ULONG new_size = reader->nb_prefixes_allocated * sizeof(*reader->prefixes) * 2;
- struct prefix *tmp = heap_realloc_zero( reader->prefixes, new_size );
+ ULONG new_size = reader->nb_prefixes_allocated * 2;
+ struct prefix *tmp = realloc( reader->prefixes, new_size * sizeof(*tmp) );
if (!tmp) return E_OUTOFMEMORY;
+ memset( tmp + reader->nb_prefixes_allocated, 0, (new_size - reader->nb_prefixes_allocated) * sizeof(*tmp) );
reader->prefixes = tmp;
- reader->nb_prefixes_allocated *= 2;
+ reader->nb_prefixes_allocated = new_size;
}
if ((hr = set_prefix( &reader->prefixes[i], prefix, ns )) != S_OK) return hr;
reader->nb_prefixes++;
@@ -517,13 +518,13 @@ static void free_reader( struct reader *reader )
{
destroy_nodes( reader->root );
clear_prefixes( reader->prefixes, reader->nb_prefixes );
- heap_free( reader->prefixes );
- heap_free( reader->stream_buf );
- heap_free( reader->input_conv );
+ free( reader->prefixes );
+ free( reader->stream_buf );
+ free( reader->input_conv );
reader->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &reader->cs );
- heap_free( reader );
+ free( reader );
}
static HRESULT init_reader( struct reader *reader )
@@ -839,7 +840,7 @@ WS_XML_UTF8_TEXT *alloc_utf8_text( const BYTE *data, ULONG len )
{
WS_XML_UTF8_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) + len ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) + len ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_UTF8;
ret->value.length = len;
ret->value.bytes = len ? (BYTE *)(ret + 1) : NULL;
@@ -853,7 +854,7 @@ WS_XML_UTF16_TEXT *alloc_utf16_text( const BYTE *data, ULONG len )
{
WS_XML_UTF16_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) + len ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) + len ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_UTF16;
ret->byteCount = len;
ret->bytes = len ? (BYTE *)(ret + 1) : NULL;
@@ -865,7 +866,7 @@ WS_XML_BASE64_TEXT *alloc_base64_text( const BYTE *data, ULONG len )
{
WS_XML_BASE64_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) + len ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) + len ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_BASE64;
ret->length = len;
ret->bytes = len ? (BYTE *)(ret + 1) : NULL;
@@ -877,7 +878,7 @@ WS_XML_BOOL_TEXT *alloc_bool_text( BOOL value )
{
WS_XML_BOOL_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_BOOL;
ret->value = value;
return ret;
@@ -887,7 +888,7 @@ WS_XML_INT32_TEXT *alloc_int32_text( INT32 value )
{
WS_XML_INT32_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_INT32;
ret->value = value;
return ret;
@@ -897,7 +898,7 @@ WS_XML_INT64_TEXT *alloc_int64_text( INT64 value )
{
WS_XML_INT64_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_INT64;
ret->value = value;
return ret;
@@ -907,7 +908,7 @@ WS_XML_UINT64_TEXT *alloc_uint64_text( UINT64 value )
{
WS_XML_UINT64_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_UINT64;
ret->value = value;
return ret;
@@ -917,7 +918,7 @@ WS_XML_FLOAT_TEXT *alloc_float_text( float value )
{
WS_XML_FLOAT_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_FLOAT;
ret->value = value;
return ret;
@@ -927,7 +928,7 @@ WS_XML_DOUBLE_TEXT *alloc_double_text( double value )
{
WS_XML_DOUBLE_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_DOUBLE;
ret->value = value;
return ret;
@@ -937,7 +938,7 @@ WS_XML_GUID_TEXT *alloc_guid_text( const GUID *value )
{
WS_XML_GUID_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_GUID;
ret->value = *value;
return ret;
@@ -947,7 +948,7 @@ WS_XML_UNIQUE_ID_TEXT *alloc_unique_id_text( const GUID *value )
{
WS_XML_UNIQUE_ID_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_UNIQUE_ID;
ret->value = *value;
return ret;
@@ -957,7 +958,7 @@ WS_XML_DATETIME_TEXT *alloc_datetime_text( const WS_DATETIME *value )
{
WS_XML_DATETIME_TEXT *ret;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
ret->text.textType = WS_XML_TEXT_TYPE_DATETIME;
ret->value = *value;
return ret;
@@ -1138,11 +1139,10 @@ HRESULT append_attribute( WS_XML_ELEMENT_NODE *elem, WS_XML_ATTRIBUTE *attr )
if (elem->attributeCount)
{
WS_XML_ATTRIBUTE **tmp;
- if (!(tmp = heap_realloc( elem->attributes, (elem->attributeCount + 1) * sizeof(attr) )))
- return E_OUTOFMEMORY;
+ if (!(tmp = realloc( elem->attributes, (elem->attributeCount + 1) * sizeof(attr) ))) return E_OUTOFMEMORY;
elem->attributes = tmp;
}
- else if (!(elem->attributes = heap_alloc( sizeof(attr) ))) return E_OUTOFMEMORY;
+ else if (!(elem->attributes = malloc( sizeof(attr) ))) return E_OUTOFMEMORY;
elem->attributes[elem->attributeCount++] = attr;
return S_OK;
}
@@ -1377,7 +1377,7 @@ static HRESULT read_attribute_value_text( struct reader *reader, WS_XML_ATTRIBUT
if (!(utf8 = alloc_utf8_text( NULL, len ))) return E_OUTOFMEMORY;
if ((hr = decode_text( start, len, utf8->value.bytes, &utf8->value.length )) != S_OK)
{
- heap_free( utf8 );
+ free( utf8 );
return hr;
}
}
@@ -1596,7 +1596,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
if (!(text_base64 = alloc_base64_text( NULL, val_uint8 ))) return E_OUTOFMEMORY;
if ((hr = read_bytes( reader, text_base64->bytes, val_uint8 )) != S_OK)
{
- heap_free( text_base64 );
+ free( text_base64 );
return hr;
}
break;
@@ -1606,7 +1606,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
if (!(text_base64 = alloc_base64_text( NULL, val_uint16 ))) return E_OUTOFMEMORY;
if ((hr = read_bytes( reader, text_base64->bytes, val_uint16 )) != S_OK)
{
- heap_free( text_base64 );
+ free( text_base64 );
return hr;
}
break;
@@ -1617,7 +1617,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
if (!(text_base64 = alloc_base64_text( NULL, val_int32 ))) return E_OUTOFMEMORY;
if ((hr = read_bytes( reader, text_base64->bytes, val_int32 )) != S_OK)
{
- heap_free( text_base64 );
+ free( text_base64 );
return hr;
}
break;
@@ -1684,7 +1684,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
if (!len) text_utf8->value.bytes = (BYTE *)(text_utf8 + 1); /* quirk */
if ((hr = read_bytes( reader, text_utf8->value.bytes, len )) != S_OK)
{
- heap_free( text_utf8 );
+ free( text_utf8 );
return hr;
}
}
@@ -1702,7 +1702,7 @@ static HRESULT read_attribute_text( struct reader *reader, WS_XML_ATTRIBUTE **re
WS_XML_STRING *prefix, *localname;
HRESULT hr;
- if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY;
+ if (!(attr = calloc( 1, sizeof(*attr) ))) return E_OUTOFMEMORY;
start = read_current_ptr( reader );
for (;;)
@@ -1773,7 +1773,7 @@ static HRESULT read_attribute_bin( struct reader *reader, WS_XML_ATTRIBUTE **ret
if ((hr = read_byte( reader, &type )) != S_OK) return hr;
if (!is_attribute_type( type )) return WS_E_INVALID_FORMAT;
- if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY;
+ if (!(attr = calloc( 1, sizeof(*attr) ))) return E_OUTOFMEMORY;
if (type >= RECORD_PREFIX_ATTRIBUTE_A && type <= RECORD_PREFIX_ATTRIBUTE_Z)
{
@@ -2175,13 +2175,13 @@ static HRESULT read_text_text( struct reader *reader )
text = (WS_XML_TEXT_NODE *)node;
if (!(utf8 = alloc_utf8_text( NULL, len )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
if ((hr = decode_text( start, len, utf8->value.bytes, &utf8->value.length )) != S_OK)
{
- heap_free( utf8 );
- heap_free( node );
+ free( utf8 );
+ free( node );
return hr;
}
text->text = &utf8->text;
@@ -2201,7 +2201,7 @@ static struct node *alloc_utf8_text_node( const BYTE *data, ULONG len, WS_XML_UT
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(utf8 = alloc_utf8_text( data, len )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2219,7 +2219,7 @@ static struct node *alloc_base64_text_node( const BYTE *data, ULONG len, WS_XML_
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(base64 = alloc_base64_text( data, len )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2237,7 +2237,7 @@ static struct node *alloc_bool_text_node( BOOL value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_bool = alloc_bool_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2254,7 +2254,7 @@ static struct node *alloc_int32_text_node( INT32 value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_int32 = alloc_int32_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2271,7 +2271,7 @@ static struct node *alloc_int64_text_node( INT64 value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_int64 = alloc_int64_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2288,7 +2288,7 @@ static struct node *alloc_float_text_node( float value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_float = alloc_float_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2305,7 +2305,7 @@ static struct node *alloc_double_text_node( double value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_double = alloc_double_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2322,7 +2322,7 @@ static struct node *alloc_datetime_text_node( const WS_DATETIME *value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_datetime = alloc_datetime_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2339,7 +2339,7 @@ static struct node *alloc_unique_id_text_node( const GUID *value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_unique_id = alloc_unique_id_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2356,7 +2356,7 @@ static struct node *alloc_guid_text_node( const GUID *value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_guid = alloc_guid_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2373,7 +2373,7 @@ static struct node *alloc_uint64_text_node( UINT64 value )
if (!(node = alloc_node( WS_XML_NODE_TYPE_TEXT ))) return NULL;
if (!(text_uint64 = alloc_uint64_text( value )))
{
- heap_free( node );
+ free( node );
return NULL;
}
text = (WS_XML_TEXT_NODE *)node;
@@ -2389,7 +2389,7 @@ static HRESULT append_text_bytes( struct reader *reader, WS_XML_TEXT_NODE *node,
if (!(new = alloc_base64_text( NULL, old->length + len ))) return E_OUTOFMEMORY;
memcpy( new->bytes, old->bytes, old->length );
if ((hr = read_bytes( reader, new->bytes + old->length, len )) != S_OK) return hr;
- heap_free( old );
+ free( old );
node->text = &new->text;
return S_OK;
}
@@ -2896,9 +2896,9 @@ static HRESULT read_comment_text( struct reader *reader )
if (!(node = alloc_node( WS_XML_NODE_TYPE_COMMENT ))) return E_OUTOFMEMORY;
comment = (WS_XML_COMMENT_NODE *)node;
- if (!(comment->value.bytes = heap_alloc( len )))
+ if (!(comment->value.bytes = malloc( len )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
memcpy( comment->value.bytes, start, len );
@@ -2925,9 +2925,9 @@ static HRESULT read_comment_bin( struct reader *reader )
if (!(node = alloc_node( WS_XML_NODE_TYPE_COMMENT ))) return E_OUTOFMEMORY;
comment = (WS_XML_COMMENT_NODE *)node;
- if (!(comment->value.bytes = heap_alloc( len )))
+ if (!(comment->value.bytes = malloc( len )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
if ((hr = read_bytes( reader, comment->value.bytes, len )) != S_OK)
@@ -2955,7 +2955,7 @@ static HRESULT read_startcdata( struct reader *reader )
if (!(node = alloc_node( WS_XML_NODE_TYPE_CDATA ))) return E_OUTOFMEMORY;
if (!(endnode = alloc_node( WS_XML_NODE_TYPE_END_CDATA )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
list_add_tail( &node->children, &endnode->entry );
@@ -2988,7 +2988,7 @@ static HRESULT read_cdata( struct reader *reader )
text = (WS_XML_TEXT_NODE *)node;
if (!(utf8 = alloc_utf8_text( start, len )))
{
- heap_free( node );
+ free( node );
return E_OUTOFMEMORY;
}
text->text = &utf8->text;
@@ -6905,7 +6905,7 @@ static HRESULT utf16le_to_utf8( const unsigned char *data, ULONG size, unsigned
{
if (size % sizeof(WCHAR)) return E_INVALIDARG;
*buflen = WideCharToMultiByte( CP_UTF8, 0, (const WCHAR *)data, size / sizeof(WCHAR), NULL, 0, NULL, NULL );
- if (!(*buf = heap_alloc( *buflen ))) return E_OUTOFMEMORY;
+ if (!(*buf = malloc( *buflen ))) return E_OUTOFMEMORY;
WideCharToMultiByte( CP_UTF8, 0, (const WCHAR *)data, size / sizeof(WCHAR), (char *)*buf, *buflen, NULL, NULL );
return S_OK;
}
@@ -6922,7 +6922,7 @@ static HRESULT set_input_buffer( struct reader *reader, const unsigned char *dat
HRESULT hr;
if ((hr = utf16le_to_utf8( data, size, &buf, &buflen )) != S_OK) return hr;
- heap_free( reader->input_conv );
+ free( reader->input_conv );
reader->read_bufptr = reader->input_conv = buf;
reader->read_size = reader->input_size = buflen;
}
@@ -7032,7 +7032,7 @@ HRESULT WINAPI WsSetInput( WS_XML_READER *handle, const WS_XML_READER_ENCODING *
case WS_XML_READER_INPUT_TYPE_STREAM:
{
const WS_XML_READER_STREAM_INPUT *stream = (const WS_XML_READER_STREAM_INPUT *)input;
- if (!reader->stream_buf && !(reader->stream_buf = heap_alloc( STREAM_BUFSIZE )))
+ if (!reader->stream_buf && !(reader->stream_buf = malloc( STREAM_BUFSIZE )))
{
hr = E_OUTOFMEMORY;
goto done;
@@ -7071,7 +7071,7 @@ static HRESULT set_input_xml_buffer( struct reader *reader, struct xmlbuf *xmlbu
HRESULT hr;
if ((hr = utf16le_to_utf8( xmlbuf->bytes.bytes, xmlbuf->bytes.length, &buf, &buflen )) != S_OK) return hr;
- heap_free( reader->input_conv );
+ free( reader->input_conv );
reader->read_bufptr = reader->input_conv = buf;
reader->read_size = reader->input_size = buflen;
}
@@ -7196,7 +7196,7 @@ HRESULT WINAPI WsSetReaderPosition( WS_XML_READER *handle, const WS_XML_NODE_POS
static HRESULT utf8_to_base64( const WS_XML_UTF8_TEXT *utf8, WS_XML_BASE64_TEXT *base64 )
{
if (utf8->value.length % 4) return WS_E_INVALID_FORMAT;
- if (!(base64->bytes = heap_alloc( utf8->value.length * 3 / 4 ))) return E_OUTOFMEMORY;
+ if (!(base64->bytes = malloc( utf8->value.length * 3 / 4 ))) return E_OUTOFMEMORY;
base64->length = decode_base64( utf8->value.bytes, utf8->value.length, base64->bytes );
return S_OK;
}
@@ -7242,14 +7242,14 @@ HRESULT WINAPI WsReadBytes( WS_XML_READER *handle, void *bytes, ULONG max_count,
if ((hr = utf8_to_base64( (const WS_XML_UTF8_TEXT *)text->text, &base64 )) != S_OK) goto done;
if (reader->text_conv_offset == base64.length)
{
- heap_free( base64.bytes );
+ free( base64.bytes );
hr = read_node( reader );
goto done;
}
*count = min( base64.length - reader->text_conv_offset, max_count );
memcpy( bytes, base64.bytes + reader->text_conv_offset, *count );
reader->text_conv_offset += *count;
- heap_free( base64.bytes );
+ free( base64.bytes );
}
done:
@@ -7261,7 +7261,7 @@ done:
static HRESULT utf8_to_utf16( const WS_XML_UTF8_TEXT *utf8, WS_XML_UTF16_TEXT *utf16 )
{
int len = MultiByteToWideChar( CP_UTF8, 0, (char *)utf8->value.bytes, utf8->value.length, NULL, 0 );
- if (!(utf16->bytes = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
+ if (!(utf16->bytes = malloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
MultiByteToWideChar( CP_UTF8, 0, (char *)utf8->value.bytes, utf8->value.length, (WCHAR *)utf16->bytes, len );
utf16->byteCount = len * sizeof(WCHAR);
return S_OK;
@@ -7309,14 +7309,14 @@ HRESULT WINAPI WsReadChars( WS_XML_READER *handle, WCHAR *chars, ULONG max_count
if ((hr = utf8_to_utf16( (const WS_XML_UTF8_TEXT *)text->text, &utf16 )) != S_OK) goto done;
if (reader->text_conv_offset == utf16.byteCount / sizeof(WCHAR))
{
- heap_free( utf16.bytes );
+ free( utf16.bytes );
hr = read_node( reader );
goto done;
}
*count = min( utf16.byteCount / sizeof(WCHAR) - reader->text_conv_offset, max_count );
memcpy( chars, utf16.bytes + reader->text_conv_offset * sizeof(WCHAR), *count * sizeof(WCHAR) );
reader->text_conv_offset += *count;
- heap_free( utf16.bytes );
+ free( utf16.bytes );
}
done:
diff --git a/dlls/webservices/string.c b/dlls/webservices/string.c
index 42af8fd9c58..3ecdcea85a4 100644
--- a/dlls/webservices/string.c
+++ b/dlls/webservices/string.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include <assert.h>
#include "windef.h"
@@ -24,7 +25,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -100,18 +100,18 @@ static HRESULT grow_dict( struct dictionary *dict, ULONG size )
if (!dict->dict.strings)
{
new_size = max( MIN_DICTIONARY_SIZE, size );
- if (!(dict->dict.strings = heap_alloc( new_size * sizeof(*dict->dict.strings) ))) return E_OUTOFMEMORY;
- if (!(dict->sorted = heap_alloc( new_size * sizeof(*dict->sorted) )))
+ if (!(dict->dict.strings = malloc( new_size * sizeof(*dict->dict.strings) ))) return E_OUTOFMEMORY;
+ if (!(dict->sorted = malloc( new_size * sizeof(*dict->sorted) )))
{
- heap_free( dict->dict.strings );
+ free( dict->dict.strings );
dict->dict.strings = NULL;
return E_OUTOFMEMORY;
}
- if (!(dict->sequence = heap_alloc( new_size * sizeof(*dict->sequence) )))
+ if (!(dict->sequence = malloc( new_size * sizeof(*dict->sequence) )))
{
- heap_free( dict->dict.strings );
+ free( dict->dict.strings );
dict->dict.strings = NULL;
- heap_free( dict->sorted );
+ free( dict->sorted );
dict->sorted = NULL;
return E_OUTOFMEMORY;
}
@@ -120,11 +120,11 @@ static HRESULT grow_dict( struct dictionary *dict, ULONG size )
}
new_size = max( dict->size * 2, size );
- if (!(tmp = heap_realloc( dict->dict.strings, new_size * sizeof(*tmp) ))) return E_OUTOFMEMORY;
+ if (!(tmp = realloc( dict->dict.strings, new_size * sizeof(*tmp) ))) return E_OUTOFMEMORY;
dict->dict.strings = tmp;
- if (!(tmp_sorted = heap_realloc( dict->sorted, new_size * sizeof(*tmp_sorted) ))) return E_OUTOFMEMORY;
+ if (!(tmp_sorted = realloc( dict->sorted, new_size * sizeof(*tmp_sorted) ))) return E_OUTOFMEMORY;
dict->sorted = tmp_sorted;
- if (!(tmp_sequence = heap_realloc( dict->sequence, new_size * sizeof(*tmp_sequence) ))) return E_OUTOFMEMORY;
+ if (!(tmp_sequence = realloc( dict->sequence, new_size * sizeof(*tmp_sequence) ))) return E_OUTOFMEMORY;
dict->sequence = tmp_sequence;
dict->size = new_size;
@@ -135,13 +135,13 @@ void clear_dict( struct dictionary *dict )
{
ULONG i;
assert( !dict->dict.isConst );
- for (i = 0; i < dict->dict.stringCount; i++) heap_free( dict->dict.strings[i].bytes );
- heap_free( dict->dict.strings );
+ for (i = 0; i < dict->dict.stringCount; i++) free( dict->dict.strings[i].bytes );
+ free( dict->dict.strings );
dict->dict.strings = NULL;
dict->dict.stringCount = 0;
- heap_free( dict->sorted );
+ free( dict->sorted );
dict->sorted = NULL;
- heap_free( dict->sequence );
+ free( dict->sequence );
dict->sequence = NULL;
dict->current_sequence = 0;
dict->size = 0;
@@ -179,7 +179,7 @@ HRESULT add_xml_string( WS_XML_STRING *str )
EnterCriticalSection( &dict_cs );
if ((index = find_string( &dict_builtin, str->bytes, str->length, &id )) == -1)
{
- heap_free( str->bytes );
+ free( str->bytes );
*str = dict_builtin.dict.strings[id];
}
else if ((hr = insert_string( &dict_builtin, str->bytes, str->length, index, &id )) == S_OK)
@@ -194,10 +194,10 @@ WS_XML_STRING *alloc_xml_string( const unsigned char *data, ULONG len )
{
WS_XML_STRING *ret;
- if (!(ret = heap_alloc_zero( sizeof(*ret) ))) return NULL;
- if ((ret->length = len) && !(ret->bytes = heap_alloc( len )))
+ if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL;
+ if ((ret->length = len) && !(ret->bytes = malloc( len )))
{
- heap_free( ret );
+ free( ret );
return NULL;
}
if (data)
@@ -211,8 +211,8 @@ WS_XML_STRING *alloc_xml_string( const unsigned char *data, ULONG len )
void free_xml_string( WS_XML_STRING *str )
{
if (!str) return;
- if (!str->dictionary) heap_free( str->bytes );
- heap_free( str );
+ if (!str->dictionary) free( str->bytes );
+ free( str );
}
WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src, BOOL use_static_dict )
@@ -223,7 +223,7 @@ WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src, BOOL use_static_dict )
int index;
ULONG id;
- if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL;
+ if (!(ret = malloc( sizeof(*ret) ))) return NULL;
if (src->dictionary)
{
*ret = *src;
@@ -241,9 +241,9 @@ WS_XML_STRING *dup_xml_string( const WS_XML_STRING *src, BOOL use_static_dict )
LeaveCriticalSection( &dict_cs );
return ret;
}
- if (!(data = heap_alloc( src->length )))
+ if (!(data = malloc( src->length )))
{
- heap_free( ret );
+ free( ret );
LeaveCriticalSection( &dict_cs );
return NULL;
}
diff --git a/dlls/webservices/tests/writer.c b/dlls/webservices/tests/writer.c
index 1d769189014..ab74c2e84e3 100644
--- a/dlls/webservices/tests/writer.c
+++ b/dlls/webservices/tests/writer.c
@@ -901,7 +901,7 @@ static void test_simple_struct_type(void)
s.fields = fields;
s.fieldCount = 1;
- test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) );
+ test = malloc( sizeof(*test) );
test->field = L"value";
hr = WsWriteType( writer, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, NULL,
WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL );
@@ -968,7 +968,7 @@ static void test_simple_struct_type(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<struct struct=\"value\"/>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
WsFreeWriter( writer );
}
@@ -1005,7 +1005,7 @@ static void test_WsWriteElement(void)
desc.type = WS_STRUCT_TYPE;
desc.typeDescription = &s;
- test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) );
+ test = malloc( sizeof(*test) );
test->str = L"test";
hr = WsWriteElement( NULL, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
@@ -1049,7 +1049,7 @@ static void test_WsWriteElement(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<str str=\"test\"/>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
WsFreeWriter( writer );
}
@@ -1192,7 +1192,7 @@ static void test_WsWriteAttribute(void)
desc.type = WS_STRUCT_TYPE;
desc.typeDescription = &s;
- test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) );
+ test = malloc( sizeof(*test) );
test->str = L"test";
hr = WsWriteAttribute( NULL, &desc, WS_WRITE_REQUIRED_POINTER, &test, sizeof(test), NULL );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
@@ -1219,7 +1219,7 @@ static void test_WsWriteAttribute(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<str str=\"test\"/>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
WsFreeWriter( writer );
}
@@ -1652,7 +1652,7 @@ static void test_complex_struct_type(void)
s.typeNs = &ns;
size = sizeof(struct officeconfig) + sizeof(struct services);
- test = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size );
+ test = calloc( 1, size );
test->services = (struct services *)(test + 1);
test->services->generationtime = L"2015-09-03T18:47:54";
hr = WsWriteType( writer, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s,
@@ -1663,7 +1663,7 @@ static void test_complex_struct_type(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output_buffer( buffer, expected, __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
WsFreeWriter( writer );
WsFreeHeap( heap );
}
@@ -3116,7 +3116,7 @@ static void test_repeating_element(void)
hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL );
ok( hr == S_OK, "got %08x\n", hr );
- test = HeapAlloc( GetProcessHeap(), 0, sizeof(*test) + 2 * sizeof(const WCHAR *) );
+ test = malloc( sizeof(*test) + 2 * sizeof(const WCHAR *) );
test->val = (const WCHAR **)(test + 1);
test->val[0] = L"1";
test->val[1] = L"2";
@@ -3127,7 +3127,7 @@ static void test_repeating_element(void)
hr = WsWriteEndElement( writer, NULL );
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<test><wrapper><val>1</val><val>2</val></wrapper></test>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test );
+ free( test );
/* array of integers, no wrapper */
hr = set_output( writer );
@@ -3139,7 +3139,7 @@ static void test_repeating_element(void)
f.localName = NULL;
f.ns = NULL;
- test2 = HeapAlloc( GetProcessHeap(), 0, sizeof(*test2) + 2 * sizeof(INT32) );
+ test2 = malloc( sizeof(*test2) + 2 * sizeof(INT32) );
test2->val = (INT32 *)(test2 + 1);
test2->val[0] = 1;
test2->val[1] = 2;
@@ -3167,7 +3167,7 @@ static void test_repeating_element(void)
hr = WsWriteEndElement( writer, NULL );
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<test><val>1</val><val>2</val></test>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test2 );
+ free( test2 );
/* nillable item */
hr = set_output( writer );
@@ -3198,7 +3198,7 @@ static void test_repeating_element(void)
f.options = WS_FIELD_POINTER|WS_FIELD_OPTIONAL|WS_FIELD_NILLABLE|WS_FIELD_NILLABLE_ITEM;
value.data = -1;
- test3 = HeapAlloc( GetProcessHeap(), 0, sizeof(*test3) + 2 * sizeof(const struct value *) );
+ test3 = malloc( sizeof(*test3) + 2 * sizeof(const struct value *) );
test3->val = (const struct value **)(test3 + 1);
test3->val[0] = &value;
test3->val[1] = NULL;
@@ -3211,7 +3211,7 @@ static void test_repeating_element(void)
ok( hr == S_OK, "got %08x\n", hr );
check_output( writer, "<test><wrapper><val><data>-1</data></val><val a:nil=\"true\" "
"xmlns:a=\"http://www.w3.org/2001/XMLSchema-instance\"/></wrapper></test>", __LINE__ );
- HeapFree( GetProcessHeap(), 0, test3 );
+ free( test3 );
WsFreeWriter( writer );
}
diff --git a/dlls/webservices/url.c b/dlls/webservices/url.c
index b44ee468e27..7585abadee8 100644
--- a/dlls/webservices/url.c
+++ b/dlls/webservices/url.c
@@ -17,6 +17,7 @@
*/
#include <stdarg.h>
+#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
@@ -25,7 +26,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -70,7 +70,7 @@ static unsigned char *strdup_utf8( const WCHAR *str, ULONG len, ULONG *ret_len )
{
unsigned char *ret;
*ret_len = WideCharToMultiByte( CP_UTF8, 0, str, len, NULL, 0, NULL, NULL );
- if ((ret = heap_alloc( *ret_len )))
+ if ((ret = malloc( *ret_len )))
WideCharToMultiByte( CP_UTF8, 0, str, len, (char *)ret, *ret_len, NULL, NULL );
return ret;
}
@@ -156,13 +156,13 @@ static WCHAR *url_decode( WCHAR *str, ULONG len, WS_HEAP *heap, ULONG *ret_len )
len_utf8, NULL, 0 )))
{
WARN( "invalid UTF-8 sequence\n" );
- heap_free( utf8 );
+ free( utf8 );
return NULL;
}
if ((ret = ws_alloc( heap, *ret_len * sizeof(WCHAR) )))
MultiByteToWideChar( CP_UTF8, 0, (char *)utf8, len_utf8, ret, *ret_len );
- heap_free( utf8 );
+ free( utf8 );
return ret;
}
@@ -357,7 +357,7 @@ static HRESULT url_encode_size( const WCHAR *str, ULONG len, const char *except,
*ret_len = 0;
if (!(utf8 = strdup_utf8( str, len, &len_utf8 ))) return E_OUTOFMEMORY;
for (i = 0; i < len_utf8; i++) *ret_len += escape_size( utf8[i], except );
- heap_free( utf8 );
+ free( utf8 );
return S_OK;
}
@@ -416,7 +416,7 @@ static HRESULT url_encode( const WCHAR *str, ULONG len, WCHAR *buf, const char *
p += len_enc;
}
- heap_free( utf8 );
+ free( utf8 );
return hr;
}
diff --git a/dlls/webservices/writer.c b/dlls/webservices/writer.c
index 044351f6094..1dacc10ec43 100644
--- a/dlls/webservices/writer.c
+++ b/dlls/webservices/writer.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <stdio.h>
#include <float.h>
#include <math.h>
@@ -29,7 +30,6 @@
#include "webservices.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "wine/list.h"
#include "webservices_private.h"
@@ -106,7 +106,7 @@ static struct writer *alloc_writer(void)
struct writer *ret;
ULONG size = sizeof(*ret) + prop_size( writer_props, count );
- if (!(ret = heap_alloc_zero( size ))) return NULL;
+ if (!(ret = calloc( 1, size ))) return NULL;
ret->magic = WRITER_MAGIC;
InitializeCriticalSection( &ret->cs );
@@ -122,11 +122,11 @@ static void free_writer( struct writer *writer )
destroy_nodes( writer->root );
free_xml_string( writer->current_ns );
WsFreeHeap( writer->output_heap );
- heap_free( writer->stream_buf );
+ free( writer->stream_buf );
writer->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection( &writer->cs );
- heap_free( writer );
+ free( writer );
}
static void write_insert_eof( struct writer *writer, struct node *eof )
@@ -430,7 +430,7 @@ HRESULT WINAPI WsSetOutput( WS_XML_WRITER *handle, const WS_XML_WRITER_ENCODING
case WS_XML_WRITER_OUTPUT_TYPE_STREAM:
{
const WS_XML_WRITER_STREAM_OUTPUT *stream = (const WS_XML_WRITER_STREAM_OUTPUT *)output;
- if (!writer->stream_buf && !(writer->stream_buf = heap_alloc( STREAM_BUFSIZE )))
+ if (!writer->stream_buf && !(writer->stream_buf = malloc( STREAM_BUFSIZE )))
{
hr = E_OUTOFMEMORY;
goto done;
@@ -1283,12 +1283,12 @@ static HRESULT write_attribute_value_bin( struct writer *writer, const WS_XML_TE
len = text_utf8->value.length;
if ((hr = write_grow_buffer( writer, sizeof(len) + len )) != S_OK)
{
- heap_free( new );
+ free( new );
return hr;
}
write_char( writer, len );
write_bytes( writer, text_utf8->value.bytes, len );
- heap_free( new );
+ free( new );
return S_OK;
}
case RECORD_CHARS16_TEXT:
@@ -1306,12 +1306,12 @@ static HRESULT write_attribute_value_bin( struct writer *writer, const WS_XML_TE
len = text_utf8->value.length;
if ((hr = write_grow_buffer( writer, sizeof(len) + len )) != S_OK)
{
- heap_free( new );
+ free( new );
return hr;
}
write_bytes( writer, (const BYTE *)&len, sizeof(len) );
write_bytes( writer, text_utf8->value.bytes, len );
- heap_free( new );
+ free( new );
return S_OK;
}
case RECORD_BYTES8_TEXT:
@@ -1629,7 +1629,7 @@ static HRESULT add_namespace_attribute( struct writer *writer, const WS_XML_STRI
WS_XML_ELEMENT_NODE *elem = &writer->current->hdr;
HRESULT hr;
- if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY;
+ if (!(attr = calloc( 1, sizeof(*attr) ))) return E_OUTOFMEMORY;
attr->singleQuote = !!single;
attr->isXmlNs = 1;
@@ -2044,7 +2044,7 @@ static HRESULT write_add_attribute( struct writer *writer, const WS_XML_STRING *
WS_XML_ELEMENT_NODE *elem = &writer->current->hdr;
HRESULT hr;
- if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY;
+ if (!(attr = calloc( 1, sizeof(*attr) ))) return E_OUTOFMEMORY;
if (!prefix && ns->length) prefix = elem->prefix;
@@ -2477,7 +2477,7 @@ static HRESULT write_set_attribute_value( struct writer *writer, const WS_XML_TE
{
WS_XML_UTF8_TEXT *new, *old = (WS_XML_UTF8_TEXT *)elem->attributes[elem->attributeCount - 1]->value;
if ((hr = text_to_utf8text( value, old, NULL, &new )) != S_OK) return hr;
- heap_free( old );
+ free( old );
elem->attributes[elem->attributeCount - 1]->value = &new->text;
break;
}
@@ -2485,7 +2485,7 @@ static HRESULT write_set_attribute_value( struct writer *writer, const WS_XML_TE
{
WS_XML_TEXT *new, *old = elem->attributes[elem->attributeCount - 1]->value;
if ((hr = text_to_text( value, old, NULL, &new )) != S_OK) return hr;
- heap_free( old );
+ free( old );
elem->attributes[elem->attributeCount - 1]->value = new;
break;
}
@@ -2517,7 +2517,7 @@ static HRESULT write_add_text_node( struct writer *writer, const WS_XML_TEXT *va
WS_XML_UTF8_TEXT *new;
if ((hr = text_to_utf8text( value, NULL, NULL, &new )) != S_OK)
{
- heap_free( node );
+ free( node );
return hr;
}
text->text = &new->text;
@@ -2528,7 +2528,7 @@ static HRESULT write_add_text_node( struct writer *writer, const WS_XML_TEXT *va
WS_XML_TEXT *new;
if ((hr = text_to_text( value, NULL, NULL, &new )) != S_OK)
{
- heap_free( node );
+ free( node );
return hr;
}
text->text = new;
@@ -2536,7 +2536,7 @@ static HRESULT write_add_text_node( struct writer *writer, const WS_XML_TEXT *va
}
default:
FIXME( "unhandled output encoding %u\n", writer->output_enc );
- heap_free( node );
+ free( node );
return E_NOTIMPL;
}
@@ -2691,13 +2691,13 @@ static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, U
len = text_utf8->value.length;
if ((hr = write_grow_buffer( writer, 1 + sizeof(len) + len )) != S_OK)
{
- heap_free( new );
+ free( new );
return hr;
}
write_char( writer, type );
write_char( writer, len );
write_bytes( writer, text_utf8->value.bytes, len );
- heap_free( new );
+ free( new );
return S_OK;
}
case RECORD_CHARS16_TEXT_WITH_ENDELEMENT:
@@ -2715,13 +2715,13 @@ static HRESULT write_text_bin( struct writer *writer, const WS_XML_TEXT *text, U
len = text_utf8->value.length;
if ((hr = write_grow_buffer( writer, 1 + sizeof(len) + len )) != S_OK)
{
- heap_free( new );
+ free( new );
return hr;
}
write_char( writer, type );
write_bytes( writer, (const BYTE *)&len, sizeof(len) );
write_bytes( writer, text_utf8->value.bytes, len );
- heap_free( new );
+ free( new );
return S_OK;
}
case RECORD_BYTES8_TEXT:
@@ -2920,7 +2920,7 @@ static HRESULT write_text_node( struct writer *writer, const WS_XML_TEXT *text )
WS_XML_UTF8_TEXT *new, *old = (WS_XML_UTF8_TEXT *)node->text;
offset = old->value.length;
if ((hr = text_to_utf8text( text, old, &offset, &new )) != S_OK) return hr;
- heap_free( old );
+ free( old );
node->text = &new->text;
break;
}
@@ -2928,7 +2928,7 @@ static HRESULT write_text_node( struct writer *writer, const WS_XML_TEXT *text )
{
WS_XML_TEXT *new, *old = node->text;
if ((hr = text_to_text( text, old, &offset, &new )) != S_OK) return hr;
- heap_free( old );
+ free( old );
node->text = new;
break;
}
@@ -4610,7 +4610,7 @@ static HRESULT write_add_comment_node( struct writer *writer, const WS_XML_STRIN
if (!(node = alloc_node( WS_XML_NODE_TYPE_COMMENT ))) return E_OUTOFMEMORY;
comment = (WS_XML_COMMENT_NODE *)node;
- if (value->length && !(comment->value.bytes = heap_alloc( value->length )))
+ if (value->length && !(comment->value.bytes = malloc( value->length )))
{
free_node( node );
return E_OUTOFMEMORY;
--
2.30.2
1
0
[PATCH 1/2] user32/tests: Rewrite msg tests ok_sequence to reduce verbosity.
by Rémi Bernon 01 Feb '22
by Rémi Bernon 01 Feb '22
01 Feb '22
At WINETEST_DEBUG <= 1, only sequence mismatches will be checked and
reported.
At WINETEST_DEBUG == 2, individual message mismatches will be checked
and reported, expected / received sequences will be traced on mismatch.
At WINETEST_DEBUG > 2, individual message will be checked or traced,
all expected / received sequences will be traced.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=51780
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/user32/tests/msg.c | 378 +++++++++++++---------------------------
1 file changed, 122 insertions(+), 256 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 90816a9df52..0626d77b638 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -2619,294 +2619,157 @@ static void flush_sequence(void)
LeaveCriticalSection( &sequence_cs );
}
-static void dump_sequence(const struct message *expected, const char *context, const char *file, int line)
+static int try_compare_message( const struct message *expected, const struct recvd_message *received )
{
- const struct recvd_message *actual = sequence;
- unsigned int count = 0;
+ static DWORD type_flags = hook | winevent_hook | kbd_hook;
+ int ret;
- trace_(file, line)("Failed sequence %s:\n", context );
- while (expected->message && actual->message)
+ if ((ret = (expected->flags & type_flags) - (received->flags & type_flags))) return ret;
+ if ((ret = expected->message - received->message)) return ret;
+
+ /* validate parent and defwinproc flags for optional messages */
+ if (!(expected->flags & optional)) return 0;
+ if ((ret = (expected->flags & defwinproc) - (received->flags & defwinproc))) return ret;
+ if ((ret = (expected->flags & parent) - (received->flags & parent))) return ret;
+
+ return 0;
+}
+
+static int compare_message( const struct message *expected, const struct recvd_message *received,
+ BOOL todo, const char *file, int line )
+{
+ static DWORD type_flags = hook | winevent_hook | kbd_hook;
+ static DWORD msg_flags = sent | posted;
+ int ret;
+
+ if ((ret = (expected->flags & type_flags) - (received->flags & type_flags))) goto done;
+ if ((ret = expected->message - received->message)) goto done;
+ if ((ret = (expected->flags & defwinproc) - (received->flags & defwinproc))) goto done;
+ if ((ret = (expected->flags & parent) - (received->flags & parent))) goto done;
+ if ((ret = (expected->flags & msg_flags) - (received->flags & msg_flags))) goto done;
+ if ((ret = (expected->flags & beginpaint) - (received->flags & beginpaint))) goto done;
+ if ((expected->flags & wparam) && (ret = (expected->wParam & ~expected->wp_mask) - (received->wParam & ~expected->wp_mask))) goto done;
+ if ((expected->flags & lparam) && (ret = (expected->lParam & ~expected->lp_mask) - (received->lParam & ~expected->lp_mask))) goto done;
+
+done:
+ if (ret && winetest_debug > 1)
{
- if (actual->output[0])
+ todo_wine_if(todo)
+ ok_(file, line)( 0, "mismatch %#x, %#x, %#lx, %#lx\n", received->message,
+ received->flags, received->wParam, received->lParam );
+ }
+ if (!ret && winetest_debug > 2)
+ trace_(file, line)( "match %#x, %#x, %#lx, %#lx\n", received->message,
+ received->flags, received->wParam, received->lParam );
+ return ret;
+}
+
+static BOOL find_next_message( const struct message **expected, const struct recvd_message **received,
+ BOOL *matches, BOOL todo, const char *file, int line )
+{
+ const struct recvd_message *first_received = *received, *tmp_received, *next_received;
+ const struct message *first_expected = *expected, *tmp_expected, *next_expected;
+ BOOL winhook_todo;
+
+ /* try matching messages in expected list with first received message */
+ for (next_expected = first_expected; next_expected->message; next_expected++)
+ if (!try_compare_message( next_expected, first_received )) break;
+
+ /* if current message doesn't match anything in the received list, match a non-optional message */
+ if (!next_expected->message) while (first_expected->flags & optional) first_expected++;
+
+ /* try matching messages in received list with first non-optional message */
+ for (next_received = first_received; next_received->message; next_received++)
+ if (!try_compare_message( first_expected, next_received ) &&
+ !(first_expected->flags & optional)) break;
+
+ /* couldn't find a match but there's more messages to try */
+ if (!next_expected->message && next_expected - first_expected > 1 &&
+ !next_received->message && next_received - first_received > 1)
+ return TRUE;
+
+ /* report the smallest mismatch which doesn't end the sequence */
+ if ((next_expected->message && next_expected - first_expected < next_received - first_received) ||
+ !next_received->message)
+ {
+ for (tmp_expected = first_expected; tmp_expected != next_expected; ++tmp_expected)
{
- if (expected->flags & hook)
+ if (tmp_expected->flags & optional) continue;
+ if ((tmp_expected->flags & winevent_hook) && !hEvent_hook) continue;
+ winhook_todo = (tmp_expected->flags & winevent_hook) && (tmp_expected->flags & winevent_hook_todo);
+ if (!winhook_todo) *matches = FALSE;
+ if (winetest_debug > 1)
{
- trace_(file, line)( " %u: expected: hook %04x - actual: %s\n",
- count, expected->message, actual->output );
- }
- else if (expected->flags & winevent_hook)
- {
- trace_(file, line)( " %u: expected: winevent %04x - actual: %s\n",
- count, expected->message, actual->output );
- }
- else if (expected->flags & kbd_hook)
- {
- trace_(file, line)( " %u: expected: kbd %04x - actual: %s\n",
- count, expected->message, actual->output );
- }
- else
- {
- trace_(file, line)( " %u: expected: msg %04x - actual: %s\n",
- count, expected->message, actual->output );
+ todo_wine_if(todo || winhook_todo)
+ ok_(file, line)( 0, "missing %#x, %#x, %#lx, %#lx\n", tmp_expected->message,
+ tmp_expected->flags, tmp_expected->wParam, tmp_expected->lParam );
}
}
+ *expected = next_expected;
+ }
- if (expected->message == actual->message)
- {
- if ((expected->flags & defwinproc) != (actual->flags & defwinproc) &&
- (expected->flags & optional))
- {
- /* don't match messages if their defwinproc status differs */
- expected++;
- }
- else
- {
- expected++;
- actual++;
- }
- }
- /* silently drop winevent messages if there is no support for them */
- else if ((expected->flags & optional) || ((expected->flags & winevent_hook) && !hEvent_hook) ||
- ((expected->flags & winevent_hook_todo) && !strcmp(winetest_platform, "wine")))
- expected++;
- else
+ if ((next_received->message && next_received - first_received < next_expected - first_expected) ||
+ !next_expected->message)
+ {
+ for (tmp_received = first_received; tmp_received != next_received; ++tmp_received)
{
- expected++;
- actual++;
+ *matches = FALSE;
+ if (winetest_debug > 1)
+ {
+ todo_wine_if(todo)
+ ok_(file, line)( 0, "spurious %#x, %#x, %#lx, %#lx\n", tmp_received->message,
+ tmp_received->flags, tmp_received->wParam, tmp_received->lParam );
+ }
}
- count++;
+ *received = next_received;
}
- /* optional trailing messages */
- while (expected->message && ((expected->flags & optional) ||
- ((expected->flags & winevent_hook) && !hEvent_hook)))
- {
- trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
- expected++;
- count++;
- }
-
- if (expected->message)
- {
- trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
- return;
- }
-
- while (actual->message && actual->output[0])
- {
- trace_(file, line)( " %u: expected: nothing - actual: %s\n", count, actual->output );
- actual++;
- count++;
- }
+ return (*expected)->message && (*received)->message;
}
#define ok_sequence( exp, contx, todo) \
ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__)
-
-static void ok_sequence_(const struct message *expected_list, const char *context, BOOL todo,
+static void ok_sequence_(const struct message *expected, const char *context, BOOL todo,
const char *file, int line)
{
static const struct recvd_message end_of_sequence;
- const struct message *expected = expected_list;
- const struct recvd_message *actual;
- int failcount = 0, dump = 0;
- unsigned int count = 0;
+ const struct recvd_message *first_received, *received;
+ const struct message *first_expected = expected;
+ BOOL matches = TRUE;
add_message(&end_of_sequence);
+ received = first_received = sequence;
- actual = sequence;
-
- while (expected->message && actual->message)
+ while (expected->message || received->message)
{
- if (expected->message == actual->message &&
- !((expected->flags ^ actual->flags) & (hook|winevent_hook|kbd_hook)))
- {
- if (expected->flags & wparam)
- {
- if (((expected->wParam ^ actual->wParam) & ~expected->wp_mask) && todo)
- {
- todo_wine {
- failcount ++;
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE,
- "%s: %u: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
- context, count, expected->message, expected->wParam, actual->wParam);
- }
- }
- else
- {
- ok_( file, line)( ((expected->wParam ^ actual->wParam) & ~expected->wp_mask) == 0,
- "%s: %u: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
- context, count, expected->message, expected->wParam, actual->wParam);
- if ((expected->wParam ^ actual->wParam) & ~expected->wp_mask) dump++;
- }
-
- }
- if (expected->flags & lparam)
- {
- if (((expected->lParam ^ actual->lParam) & ~expected->lp_mask) && todo)
- {
- todo_wine {
- failcount ++;
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE,
- "%s: %u: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
- context, count, expected->message, expected->lParam, actual->lParam);
- }
- }
- else
- {
- ok_( file, line)(((expected->lParam ^ actual->lParam) & ~expected->lp_mask) == 0,
- "%s: %u: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
- context, count, expected->message, expected->lParam, actual->lParam);
- if ((expected->lParam ^ actual->lParam) & ~expected->lp_mask) dump++;
- }
- }
- if ((expected->flags & optional) &&
- ((expected->flags ^ actual->flags) & (defwinproc|parent)))
- {
- /* don't match optional messages if their defwinproc or parent status differs */
- expected++;
- count++;
- continue;
- }
- if ((expected->flags & defwinproc) != (actual->flags & defwinproc) && todo)
- {
- todo_wine {
- failcount ++;
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE,
- "%s: %u: the msg 0x%04x should %shave been sent by DefWindowProc\n",
- context, count, expected->message, (expected->flags & defwinproc) ? "" : "NOT ");
- }
- }
- else
- {
- ok_( file, line) ((expected->flags & defwinproc) == (actual->flags & defwinproc),
- "%s: %u: the msg 0x%04x should %shave been sent by DefWindowProc\n",
- context, count, expected->message, (expected->flags & defwinproc) ? "" : "NOT ");
- if ((expected->flags & defwinproc) != (actual->flags & defwinproc)) dump++;
- }
-
- ok_( file, line) ((expected->flags & beginpaint) == (actual->flags & beginpaint),
- "%s: %u: the msg 0x%04x should %shave been sent by BeginPaint\n",
- context, count, expected->message, (expected->flags & beginpaint) ? "" : "NOT ");
- if ((expected->flags & beginpaint) != (actual->flags & beginpaint)) dump++;
-
- ok_( file, line) ((expected->flags & (sent|posted)) == (actual->flags & (sent|posted)),
- "%s: %u: the msg 0x%04x should have been %s\n",
- context, count, expected->message, (expected->flags & posted) ? "posted" : "sent");
- if ((expected->flags & (sent|posted)) != (actual->flags & (sent|posted))) dump++;
-
- ok_( file, line) ((expected->flags & parent) == (actual->flags & parent),
- "%s: %u: the msg 0x%04x was expected in %s\n",
- context, count, expected->message, (expected->flags & parent) ? "parent" : "child");
- if ((expected->flags & parent) != (actual->flags & parent)) dump++;
-
- ok_( file, line) ((expected->flags & hook) == (actual->flags & hook),
- "%s: %u: the msg 0x%04x should have been sent by a hook\n",
- context, count, expected->message);
- if ((expected->flags & hook) != (actual->flags & hook)) dump++;
-
- ok_( file, line) ((expected->flags & winevent_hook) == (actual->flags & winevent_hook),
- "%s: %u: the msg 0x%04x should have been sent by a winevent hook\n",
- context, count, expected->message);
- if ((expected->flags & winevent_hook) != (actual->flags & winevent_hook)) dump++;
-
- ok_( file, line) ((expected->flags & kbd_hook) == (actual->flags & kbd_hook),
- "%s: %u: the msg 0x%04x should have been sent by a keyboard hook\n",
- context, count, expected->message);
- if ((expected->flags & kbd_hook) != (actual->flags & kbd_hook)) dump++;
-
- expected++;
- actual++;
- }
- /*
- * silently drop hook messages if there is no support for them, mark
- * winevent todo's.
- */
- else if ((expected->flags & optional) ||
- ((expected->flags & hook) && !hCBT_hook) ||
- ((expected->flags & winevent_hook) && !hEvent_hook) ||
- ((expected->flags & kbd_hook) && !hKBD_hook) ||
- ((expected->flags & winevent_hook_todo) && !strcmp(winetest_platform, "wine")))
+ winetest_push_context( "%u", expected - first_expected );
+ if (find_next_message( &expected, &received, &matches, todo, file, line ))
{
- if ((expected->flags & winevent_hook_todo) && hEvent_hook)
- {
- todo_wine {
- ok_( file, line) (FALSE,
- "%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
- context, count, expected->message, actual->message);
- }
- }
- expected++;
- }
- else if (todo)
- {
- failcount++;
- todo_wine {
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE, "%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
- context, count, expected->message, actual->message);
- }
- goto done;
- }
- else
- {
- ok_( file, line) (FALSE, "%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
- context, count, expected->message, actual->message);
- dump++;
+ if (compare_message( expected, received, todo, file, line )) matches = FALSE;
expected++;
- actual++;
+ received++;
}
- count++;
+ winetest_pop_context();
}
- /* skip all optional trailing messages, check for winevent todo's. */
- while (expected->message && ((expected->flags & optional) ||
- ((expected->flags & hook) && !hCBT_hook) ||
- ((expected->flags & winevent_hook) && !hEvent_hook) ||
- ((expected->flags & winevent_hook_todo) && !strcmp(winetest_platform, "wine"))))
+ todo_wine_if(todo)
+ ok_(file, line)( matches, "%s mismatches\n", context );
+
+ if (winetest_debug > (matches ? 2 : 1))
{
- if ((expected->flags & winevent_hook_todo) && hEvent_hook)
- {
- todo_wine {
- ok_( file, line) (FALSE, "%s: %u: the msg sequence is not complete: expected 0x%04x - actual 0x%04x\n",
- context, count, expected->message, actual->message);
- }
- }
- expected++;
+ trace_(file, line)( "expected:\n" );
+ for (expected = first_expected; expected->message; ++expected)
+ trace_(file, line)( " %u: %#x, %#x, %#lx, %#lx\n", expected - first_expected,
+ expected->message, expected->flags, expected->wParam,
+ expected->lParam );
+ trace_(file, line)( "received:\n" );
+ for (received = first_received; received->message; ++received)
+ trace_(file, line)( " %u: %#x, %#x, %#lx, %#lx\n", received - first_received,
+ received->message, received->flags, received->wParam,
+ received->lParam );
}
- if (todo)
- {
- todo_wine {
- if (expected->message || actual->message) {
- failcount++;
- if (strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line) (FALSE, "%s: %u: the msg sequence is not complete: expected %04x - actual %04x\n",
- context, count, expected->message, actual->message);
- }
- }
- }
- else
- {
- if (expected->message || actual->message)
- {
- dump++;
- ok_( file, line) (FALSE, "%s: %u: the msg sequence is not complete: expected %04x - actual %04x\n",
- context, count, expected->message, actual->message);
- }
- }
- if( todo && !failcount) /* succeeded yet marked todo */
- todo_wine {
- if (!strcmp(winetest_platform, "wine")) dump++;
- ok_( file, line)( TRUE, "%s: marked \"todo_wine\" but succeeds\n", context);
- }
-
-done:
- if (dump) dump_sequence(expected_list, context, file, line);
flush_sequence();
}
@@ -13997,6 +13860,7 @@ static void test_ShowWindow(void)
};
char comment[64];
INT idx; /* index into the above array of names */
+ winetest_push_context("%u", i);
idx = (sw[i].cmd == SW_NORMALNA) ? 12 : sw[i].cmd;
@@ -14038,6 +13902,8 @@ static void test_ShowWindow(void)
if (0) /* FIXME: Wine behaves completely different here */
ok(EqualRect(&win_rc, &wp.rcNormalPosition), "expected %s got %s\n",
wine_dbgstr_rect(&win_rc), wine_dbgstr_rect(&wp.rcNormalPosition));
+
+ winetest_pop_context();
}
DestroyWindow(hwnd);
flush_events();
--
2.34.1
2
3
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
dlls/hnetcfg/apps.c | 21 ++++++++++-----------
dlls/hnetcfg/manager.c | 4 ++--
dlls/hnetcfg/policy.c | 14 +++++++-------
dlls/hnetcfg/port.c | 13 ++++++-------
dlls/hnetcfg/profile.c | 4 ++--
dlls/hnetcfg/service.c | 8 ++++----
6 files changed, 31 insertions(+), 33 deletions(-)
diff --git a/dlls/hnetcfg/apps.c b/dlls/hnetcfg/apps.c
index b6447cf4d63..16379e3457b 100644
--- a/dlls/hnetcfg/apps.c
+++ b/dlls/hnetcfg/apps.c
@@ -29,7 +29,6 @@
#include "natupnp.h"
#include "wine/debug.h"
-#include "wine/heap.h"
#include "hnetcfg_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
@@ -62,7 +61,7 @@ static ULONG WINAPI fw_app_Release(
{
TRACE("destroying %p\n", fw_app);
SysFreeString( fw_app->filename );
- HeapFree( GetProcessHeap(), 0, fw_app );
+ free( fw_app );
}
return refs;
}
@@ -281,7 +280,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
res = WNetGetUniversalNameW(image, UNIVERSAL_NAME_INFO_LEVEL, NULL, &sz);
if (res == WN_MORE_DATA)
{
- if (!(path = heap_alloc(sz)))
+ if (!(path = malloc(sz)))
return E_OUTOFMEMORY;
info = (UNIVERSAL_NAME_INFOW *)&path;
@@ -291,21 +290,21 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
SysFreeString(This->filename);
This->filename = SysAllocString(info->lpUniversalName);
}
- heap_free(path);
+ free(path);
return HRESULT_FROM_WIN32(res);
}
sz = GetFullPathNameW(image, 0, NULL, NULL);
- if (!(path = heap_alloc(++sz * sizeof(WCHAR))))
+ if (!(path = malloc(++sz * sizeof(WCHAR))))
return E_OUTOFMEMORY;
GetFullPathNameW(image, sz, path, NULL);
longsz = GetLongPathNameW(path, path, sz);
if (longsz > sz)
{
- if (!(path = heap_realloc(path, longsz * sizeof(WCHAR))))
+ if (!(path = realloc(path, longsz * sizeof(WCHAR))))
{
- heap_free(path);
+ free(path);
return E_OUTOFMEMORY;
}
GetLongPathNameW(path, path, longsz);
@@ -313,7 +312,7 @@ static HRESULT WINAPI fw_app_put_ProcessImageFileName(
SysFreeString( This->filename );
This->filename = SysAllocString(path);
- heap_free(path);
+ free(path);
return This->filename ? S_OK : E_OUTOFMEMORY;
}
@@ -432,7 +431,7 @@ HRESULT NetFwAuthorizedApplication_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fa = HeapAlloc( GetProcessHeap(), 0, sizeof(*fa) );
+ fa = malloc( sizeof(*fa) );
if (!fa) return E_OUTOFMEMORY;
fa->INetFwAuthorizedApplication_iface.lpVtbl = &fw_app_vtbl;
@@ -470,7 +469,7 @@ static ULONG WINAPI fw_apps_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_apps);
- HeapFree( GetProcessHeap(), 0, fw_apps );
+ free( fw_apps );
}
return refs;
}
@@ -645,7 +644,7 @@ HRESULT NetFwAuthorizedApplications_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fa = HeapAlloc( GetProcessHeap(), 0, sizeof(*fa) );
+ fa = malloc( sizeof(*fa) );
if (!fa) return E_OUTOFMEMORY;
fa->INetFwAuthorizedApplications_iface.lpVtbl = &fw_apps_vtbl;
diff --git a/dlls/hnetcfg/manager.c b/dlls/hnetcfg/manager.c
index 2c0790a73b5..fda69729901 100644
--- a/dlls/hnetcfg/manager.c
+++ b/dlls/hnetcfg/manager.c
@@ -58,7 +58,7 @@ static ULONG WINAPI fw_manager_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_manager);
- HeapFree( GetProcessHeap(), 0, fw_manager );
+ free( fw_manager );
}
return refs;
}
@@ -244,7 +244,7 @@ HRESULT NetFwMgr_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fm = HeapAlloc( GetProcessHeap(), 0, sizeof(*fm) );
+ fm = malloc( sizeof(*fm) );
if (!fm) return E_OUTOFMEMORY;
fm->INetFwMgr_iface.lpVtbl = &fw_manager_vtbl;
diff --git a/dlls/hnetcfg/policy.c b/dlls/hnetcfg/policy.c
index 1f5b0daa568..7bdc1563d90 100644
--- a/dlls/hnetcfg/policy.c
+++ b/dlls/hnetcfg/policy.c
@@ -105,7 +105,7 @@ static ULONG WINAPI netfw_rules_Release(
if (!refs)
{
TRACE("destroying %p\n", This);
- HeapFree( GetProcessHeap(), 0, This );
+ free( This );
}
return refs;
}
@@ -265,7 +265,7 @@ static HRESULT create_INetFwRules(INetFwRules **object)
TRACE("(%p)\n", object);
- rules = HeapAlloc( GetProcessHeap(), 0, sizeof(*rules) );
+ rules = malloc( sizeof(*rules) );
if (!rules) return E_OUTOFMEMORY;
rules->INetFwRules_iface.lpVtbl = &fw_rules_vtbl;
@@ -292,7 +292,7 @@ static ULONG WINAPI fw_policy_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_policy);
- HeapFree( GetProcessHeap(), 0, fw_policy );
+ free( fw_policy );
}
return refs;
}
@@ -435,7 +435,7 @@ HRESULT NetFwPolicy_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwPolicy_iface.lpVtbl = &fw_policy_vtbl;
@@ -487,7 +487,7 @@ static ULONG WINAPI fwpolicy2_Release(INetFwPolicy2 *iface)
{
INetFwRules_Release(fw_policy->fw_policy2_rules);
TRACE("destroying %p\n", fw_policy);
- HeapFree( GetProcessHeap(), 0, fw_policy );
+ free( fw_policy );
}
return refs;
}
@@ -768,7 +768,7 @@ HRESULT NetFwPolicy2_create( IUnknown *outer, void **obj )
TRACE("(%p,%p)\n", outer, obj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwPolicy2_iface.lpVtbl = &fw_policy2_vtbl;
@@ -778,7 +778,7 @@ HRESULT NetFwPolicy2_create( IUnknown *outer, void **obj )
if (FAILED(create_INetFwRules(&fp->fw_policy2_rules)))
{
- HeapFree( GetProcessHeap(), 0, fp );
+ free( fp );
return E_OUTOFMEMORY;
}
diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c
index fd4ac4977d3..9e9264df1dc 100644
--- a/dlls/hnetcfg/port.c
+++ b/dlls/hnetcfg/port.c
@@ -28,7 +28,6 @@
#include "netfw.h"
#include "natupnp.h"
-#include "wine/heap.h"
#include "wine/debug.h"
#include "hnetcfg_private.h"
@@ -64,7 +63,7 @@ static ULONG WINAPI fw_port_Release(
{
TRACE("destroying %p\n", fw_port);
SysFreeString( fw_port->name );
- HeapFree( GetProcessHeap(), 0, fw_port );
+ free( fw_port );
}
return refs;
}
@@ -363,7 +362,7 @@ HRESULT NetFwOpenPort_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwOpenPort_iface.lpVtbl = &fw_port_vtbl;
@@ -404,7 +403,7 @@ static ULONG WINAPI fw_ports_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_ports);
- HeapFree( GetProcessHeap(), 0, fw_ports );
+ free( fw_ports );
}
return refs;
}
@@ -592,7 +591,7 @@ HRESULT NetFwOpenPorts_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwOpenPorts_iface.lpVtbl = &fw_ports_vtbl;
@@ -653,7 +652,7 @@ static ULONG WINAPI upnpnat_Release(IUPnPNAT *iface)
LONG refs = InterlockedDecrement( &This->ref );
if (!refs)
{
- heap_free( This );
+ free( This );
}
return refs;
}
@@ -762,7 +761,7 @@ HRESULT IUPnPNAT_create(IUnknown *outer, void **object)
TRACE("(%p,%p)\n", outer, object);
- nat = heap_alloc( sizeof(*nat) );
+ nat = malloc( sizeof(*nat) );
if (!nat) return E_OUTOFMEMORY;
nat->IUPnPNAT_iface.lpVtbl = &upnpnat_vtbl;
diff --git a/dlls/hnetcfg/profile.c b/dlls/hnetcfg/profile.c
index d0e9f48dab4..63f6d0cc7ed 100644
--- a/dlls/hnetcfg/profile.c
+++ b/dlls/hnetcfg/profile.c
@@ -58,7 +58,7 @@ static ULONG WINAPI fw_profile_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_profile);
- HeapFree( GetProcessHeap(), 0, fw_profile );
+ free( fw_profile );
}
return refs;
}
@@ -334,7 +334,7 @@ HRESULT NetFwProfile_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwProfile_iface.lpVtbl = &fw_profile_vtbl;
diff --git a/dlls/hnetcfg/service.c b/dlls/hnetcfg/service.c
index 5bfeedaaedf..122d9797bab 100644
--- a/dlls/hnetcfg/service.c
+++ b/dlls/hnetcfg/service.c
@@ -58,7 +58,7 @@ static ULONG WINAPI fw_service_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_service);
- HeapFree( GetProcessHeap(), 0, fw_service );
+ free( fw_service );
}
return refs;
}
@@ -290,7 +290,7 @@ static HRESULT NetFwService_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwService_iface.lpVtbl = &fw_service_vtbl;
@@ -328,7 +328,7 @@ static ULONG WINAPI fw_services_Release(
if (!refs)
{
TRACE("destroying %p\n", fw_services);
- HeapFree( GetProcessHeap(), 0, fw_services );
+ free( fw_services );
}
return refs;
}
@@ -464,7 +464,7 @@ HRESULT NetFwServices_create( IUnknown *pUnkOuter, LPVOID *ppObj )
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
- fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
+ fp = malloc( sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY;
fp->INetFwServices_iface.lpVtbl = &fw_services_vtbl;
--
2.34.1
1
5
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
Runescape calls GL functions (SwapBuffers, glFinish) from different threads.
That mostly goes well except for when the DC is locked by ExtEscape() and the
other thread calls, e. g., SwapBuffers that fails because GL can't get driver
funcs (get_dc_ptr() in__wine_get_wgl_driver() returns NULL as the DC is locked
by the other thread).
I don't see any reason why getting GL funcs should fail in this case. Caching
gl_funcs and using them with get_dc_obj() locking solves this type of race.
dlls/win32u/dc.c | 19 -------------------
dlls/win32u/driver.c | 20 ++++++++++++--------
dlls/win32u/ntgdi_private.h | 21 +++++++++++++++++++++
3 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c
index 3aae73779e9..9c09bf66e03 100644
--- a/dlls/win32u/dc.c
+++ b/dlls/win32u/dc.c
@@ -63,25 +63,6 @@ static const struct gdi_obj_funcs dc_funcs =
};
-static inline DC *get_dc_obj( HDC hdc )
-{
- DWORD type;
- DC *dc = get_any_obj_ptr( hdc, &type );
- if (!dc) return NULL;
-
- switch (type)
- {
- case NTGDI_OBJ_DC:
- case NTGDI_OBJ_MEMDC:
- case NTGDI_OBJ_ENHMETADC:
- return dc;
- default:
- GDI_ReleaseObj( hdc );
- SetLastError( ERROR_INVALID_HANDLE );
- return NULL;
- }
-}
-
/* alloc DC_ATTR from a pool of memory accessible from client */
static DC_ATTR *alloc_dc_attr(void)
{
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c
index 39996086c6d..233427b0964 100644
--- a/dlls/win32u/driver.c
+++ b/dlls/win32u/driver.c
@@ -1347,14 +1347,18 @@ NTSTATUS WINAPI NtGdiDdDDICheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNE
*/
struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version )
{
- struct opengl_funcs *ret = NULL;
- DC * dc = get_dc_ptr( hdc );
+ struct opengl_funcs *ret;
+ PHYSDEV physdev;
+ DC * dc;
- if (dc)
- {
- PHYSDEV physdev = GET_DC_PHYSDEV( dc, wine_get_wgl_driver );
- ret = physdev->funcs->wine_get_wgl_driver( physdev, version );
- release_dc_ptr( dc );
- }
+ if (!(dc = get_dc_obj( hdc ))) return NULL;
+ ret = dc->gl_funcs;
+ GDI_ReleaseObj( hdc );
+ if (ret) return ret;
+
+ if (!(dc = get_dc_ptr( hdc ))) return NULL;
+ physdev = GET_DC_PHYSDEV( dc, wine_get_wgl_driver );
+ dc->gl_funcs = ret = physdev->funcs->wine_get_wgl_driver( physdev, version );
+ release_dc_ptr( dc );
return ret;
}
diff --git a/dlls/win32u/ntgdi_private.h b/dlls/win32u/ntgdi_private.h
index bfeb4557da7..54a4dc17eaf 100644
--- a/dlls/win32u/ntgdi_private.h
+++ b/dlls/win32u/ntgdi_private.h
@@ -87,6 +87,8 @@ typedef struct tagDC
XFORM xformVport2World; /* Inverse of the above transformation */
BOOL vport2WorldValid; /* Is xformVport2World valid? */
RECT bounds; /* Current bounding rect */
+
+ struct opengl_funcs *gl_funcs; /* Opengl driver functions */
} DC;
/* Certain functions will do no further processing if the driver returns this.
@@ -660,6 +662,25 @@ static inline void copy_bitmapinfo( BITMAPINFO *dst, const BITMAPINFO *src )
memcpy( dst, src, get_dib_info_size( src, DIB_RGB_COLORS ));
}
+static inline DC *get_dc_obj( HDC hdc )
+{
+ DWORD type;
+ DC *dc = get_any_obj_ptr( hdc, &type );
+ if (!dc) return NULL;
+
+ switch (type)
+ {
+ case NTGDI_OBJ_DC:
+ case NTGDI_OBJ_MEMDC:
+ case NTGDI_OBJ_ENHMETADC:
+ return dc;
+ default:
+ GDI_ReleaseObj( hdc );
+ SetLastError( ERROR_INVALID_HANDLE );
+ return NULL;
+ }
+}
+
extern void CDECL free_heap_bits( struct gdi_image_bits *bits ) DECLSPEC_HIDDEN;
void set_gdi_client_ptr( HGDIOBJ handle, void *ptr ) DECLSPEC_HIDDEN;
--
2.34.1
2
2
[PATCH 3/3] msdasql/tests: Fix printf format warnings with long types.
by Alistair Leslie-Hughes 01 Feb '22
by Alistair Leslie-Hughes 01 Feb '22
01 Feb '22
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msdasql/tests/Makefile.in | 1 -
dlls/msdasql/tests/provider.c | 184 ++++++++++++++++-----------------
2 files changed, 92 insertions(+), 93 deletions(-)
diff --git a/dlls/msdasql/tests/Makefile.in b/dlls/msdasql/tests/Makefile.in
index 2b911ed9716..314238660e2 100644
--- a/dlls/msdasql/tests/Makefile.in
+++ b/dlls/msdasql/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = msdasql.dll
IMPORTS = uuid oleaut32 ole32 odbccp32
diff --git a/dlls/msdasql/tests/provider.c b/dlls/msdasql/tests/provider.c
index 22fbf26c107..7a5175fa050 100644
--- a/dlls/msdasql/tests/provider.c
+++ b/dlls/msdasql/tests/provider.c
@@ -50,17 +50,17 @@ static void test_msdasql(void)
CLSID classid;
hr = CoCreateInstance( &CLSID_MSDASQL, NULL, CLSCTX_ALL, &IID_IUnknown, (void **)&unk);
- ok(hr == S_OK, "Failed to create object 0x%08x\n", hr);
+ ok(hr == S_OK, "Failed to create object 0x%08lx\n", hr);
if (FAILED(hr))
{
return;
}
hr = IUnknown_QueryInterface(unk, &IID_IPersist, (void**)&persist);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IPersist_GetClassID(persist, &classid);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(IsEqualGUID(&classid, &CLSID_MSDASQL), "got %s\n", debugstr_guid(&classid));
IPersist_Release(persist);
@@ -91,7 +91,7 @@ static void test_Properties(void)
};
hr = CoCreateInstance( &CLSID_MSDASQL, NULL, CLSCTX_ALL, &IID_IDBProperties, (void **)&props);
- ok(hr == S_OK, "Failed to create object 0x%08x\n", hr);
+ ok(hr == S_OK, "Failed to create object 0x%08lx\n", hr);
propidset.rgPropertyIDs = NULL;
propidset.cPropertyIDs = 0;
@@ -99,13 +99,13 @@ static void test_Properties(void)
infocount = 0;
hr = IDBProperties_GetPropertyInfo(props, 1, &propidset, &infocount, &propinfoset, &desc);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
if (hr == S_OK)
{
VARTYPE types[14] = { VT_BSTR, VT_BOOL, VT_BSTR, VT_BSTR, intptr_vartype, VT_BSTR, VT_I4, VT_I2 , VT_I4, VT_BSTR, VT_I4, VT_BSTR, VT_I4, VT_I4 };
ok(IsEqualGUID(&propinfoset->guidPropertySet, &DBPROPSET_DBINIT), "got %s\n", debugstr_guid(&propinfoset->guidPropertySet));
- ok(propinfoset->cPropertyInfos == 14, "got %d\n", propinfoset->cPropertyInfos);
+ ok(propinfoset->cPropertyInfos == 14, "got %lu\n", propinfoset->cPropertyInfos);
propidlist.guidPropertySet = DBPROPSET_DBINIT;
propidlist.cPropertyIDs = propinfoset->cPropertyInfos;
@@ -115,10 +115,10 @@ static void test_Properties(void)
{
ok(propinfoset->rgPropertyInfos[i].vtType == types[i], "got %d\n", propinfoset->rgPropertyInfos[i].vtType);
ok(propinfoset->rgPropertyInfos[i].dwFlags == (DBPROPFLAGS_DBINIT | DBPROPFLAGS_READ | DBPROPFLAGS_WRITE),
- "got %d\n", propinfoset->rgPropertyInfos[i].dwFlags);
- ok(properties[i] == propinfoset->rgPropertyInfos[i].dwPropertyID, "%d, got %d\n", i,
+ "got %lu\n", propinfoset->rgPropertyInfos[i].dwFlags);
+ ok(properties[i] == propinfoset->rgPropertyInfos[i].dwPropertyID, "%lu, got %lu\n", i,
propinfoset->rgPropertyInfos[i].dwPropertyID);
- ok(propinfoset->rgPropertyInfos[i].vtType != VT_EMPTY, "%d, got %d\n", i,
+ ok(propinfoset->rgPropertyInfos[i].vtType != VT_EMPTY, "%lu, got %u\n", i,
propinfoset->rgPropertyInfos[i].vtType);
propidlist.rgPropertyIDs[i] = propinfoset->rgPropertyInfos[i].dwPropertyID;
@@ -131,15 +131,15 @@ static void test_Properties(void)
CoTaskMemFree(propinfoset);
hr = IDBProperties_GetProperties(props, 1, &propidlist, &propcnt, &propset);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(propidlist.cPropertyIDs == 14, "got %d\n", propidlist.cPropertyIDs);
- ok(propset->cProperties == 14, "got %d\n", propset->cProperties);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
+ ok(propidlist.cPropertyIDs == 14, "got %lu\n", propidlist.cPropertyIDs);
+ ok(propset->cProperties == 14, "got %lu\n", propset->cProperties);
for (i = 0; i < propidlist.cPropertyIDs; i++)
{
VARTYPE vartype = VT_EMPTY;
- ok(properties[i] == propidlist.rgPropertyIDs[i], "%d, got %d\n", i, propidlist.rgPropertyIDs[i]);
+ ok(properties[i] == propidlist.rgPropertyIDs[i], "%lu, got %lu\n", i, propidlist.rgPropertyIDs[i]);
if(properties[i] == DBPROP_INIT_PROMPT)
{
@@ -157,7 +157,7 @@ static void test_Properties(void)
vartype = VT_I4;
}
- ok(V_VT(&propset->rgProperties[i].vValue) == vartype, "%d wrong type %d\n", i, V_VT(&propset->rgProperties[i].vValue));
+ ok(V_VT(&propset->rgProperties[i].vValue) == vartype, "%lu wrong type %d\n", i, V_VT(&propset->rgProperties[i].vValue));
}
CoTaskMemFree(propidlist.rgPropertyIDs);
@@ -172,11 +172,11 @@ static void test_Properties(void)
propcnt = 0;
propset = NULL;
hr = IDBProperties_GetProperties(props, 1, &propidlist, &propcnt, &propset);
- ok(hr == DB_E_ERRORSOCCURRED, "got 0x%08x\n", hr);
+ ok(hr == DB_E_ERRORSOCCURRED, "got 0x%08lx\n", hr);
ok(IsEqualGUID(&propset->guidPropertySet, &DBPROPSET_DATASOURCEINFO), "got %s\n", debugstr_guid(&propset->guidPropertySet));
- ok(propset->cProperties == 1, "got %d\n", propset->cProperties);
- ok(propset->rgProperties[0].dwPropertyID == DBPROP_MULTIPLERESULTS, "got %d\n", propset->rgProperties[0].dwPropertyID);
- ok(propset->rgProperties[0].dwStatus == DBPROPSTATUS_NOTSUPPORTED, "got %d\n", propset->rgProperties[0].dwStatus);
+ ok(propset->cProperties == 1, "got %lu\n", propset->cProperties);
+ ok(propset->rgProperties[0].dwPropertyID == DBPROP_MULTIPLERESULTS, "got %ld\n", propset->rgProperties[0].dwPropertyID);
+ ok(propset->rgProperties[0].dwStatus == DBPROPSTATUS_NOTSUPPORTED, "got %ld\n", propset->rgProperties[0].dwStatus);
CoTaskMemFree(propset);
@@ -197,43 +197,43 @@ static void test_command_interfaces(IUnknown *cmd)
IUnknown *unk;
hr = IUnknown_QueryInterface(cmd, &IID_ICommandProperties, (void**)&commandProp);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandProperties_Release(commandProp);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandWithParameters, (void**)&cmdwithparams);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandWithParameters_Release(cmdwithparams);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandText, (void**)&command_text);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandText_Release(command_text);
hr = IUnknown_QueryInterface(cmd, &IID_IConvertType, (void**)&convertype);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IConvertType_Release(convertype);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandPrepare, (void**)&commandprepare);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandPrepare_Release(commandprepare);
hr = IUnknown_QueryInterface(cmd, &IID_IColumnsInfo, (void**)&colinfo);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IColumnsInfo_Release(colinfo);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandStream, (void**)&commandstream);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_IMultipleResults, (void**)&multiple);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_IRowsetChange, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_IRowsetUpdate, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_IRowsetLocate, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
}
static void test_command_text(IUnknown *cmd)
@@ -244,43 +244,43 @@ static void test_command_text(IUnknown *cmd)
GUID dialect;
hr = IUnknown_QueryInterface(cmd, &IID_ICommandText, (void**)&command_text);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_GetCommandText(command_text, &dialect, &str);
- ok(hr == DB_E_NOCOMMAND, "got 0x%08x\n", hr);
+ ok(hr == DB_E_NOCOMMAND, "got 0x%08lx\n", hr);
if (0)
{
/* Crashes under windows */
hr = ICommandText_SetCommandText(command_text, NULL, L"select * from testing");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
}
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_GetCommandText(command_text, &dialect, &str);
- ok(hr == DB_E_NOCOMMAND, "got 0x%08x\n", hr);
+ ok(hr == DB_E_NOCOMMAND, "got 0x%08lx\n", hr);
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, L"select * from testing");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_GetCommandText(command_text, NULL, &str);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok (!lstrcmpW(L"select * from testing", str), "got %s\n", debugstr_w(str));
HeapFree(GetProcessHeap(), 0, str);
/* dialect empty value */
hr = ICommandText_GetCommandText(command_text, &dialect, &str);
- ok(hr == DB_S_DIALECTIGNORED, "got 0x%08x\n", hr);
+ ok(hr == DB_S_DIALECTIGNORED, "got 0x%08lx\n", hr);
ok(IsEqualGUID(&DBGUID_DEFAULT, &dialect), "got %s\n", debugstr_guid(&dialect));
ok (!lstrcmpW(L"select * from testing", str), "got %s\n", debugstr_w(str));
HeapFree(GetProcessHeap(), 0, str);
dialect = DBGUID_DEFAULT;
hr = ICommandText_GetCommandText(command_text, &dialect, &str);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(IsEqualGUID(&DBGUID_DEFAULT, &dialect), "got %s\n", debugstr_guid(&dialect));
ok (!lstrcmpW(L"select * from testing", str), "got %s\n", debugstr_w(str));
HeapFree(GetProcessHeap(), 0, str);
@@ -295,10 +295,10 @@ static void test_command_dbsession(IUnknown *cmd, IUnknown *session)
IUnknown *sess;
hr = IUnknown_QueryInterface(cmd, &IID_ICommandText, (void**)&command_text);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_GetDBSession(command_text, &IID_IUnknown, &sess);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(session == sess, "different session pointers\n");
ICommandText_Release(command_text);
@@ -315,40 +315,40 @@ static void test_rowset_interfaces(IRowset *rowset, ICommandText *commandtext)
HRESULT hr;
hr = IRowset_QueryInterface(rowset, &IID_IRowsetInfo, (void**)&info);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IRowsetInfo_GetSpecification(info, &IID_ICommandText, NULL);
- ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
hr = IRowsetInfo_GetSpecification(info, &IID_ICommandText, (IUnknown**)&specification);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
if (specification)
{
- ok(commandtext == specification, "got 0x%08x\n", hr);
+ ok(commandtext == specification, "got 0x%08lx\n", hr);
ICommandText_Release(specification);
}
IRowsetInfo_Release(info);
hr = IRowset_QueryInterface(rowset, &IID_IColumnsInfo, (void**)&col_info);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IColumnsInfo_Release(col_info);
hr = IRowset_QueryInterface(rowset, &IID_IAccessor, (void**)&accessor);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IAccessor_Release(accessor);
hr = IRowset_QueryInterface(rowset, &IID_IColumnsRowset, (void**)&col_rs);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IColumnsRowset_Release(col_rs);
hr = IRowset_QueryInterface(rowset, &IID_IRowsetChange, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IRowset_QueryInterface(rowset, &IID_IRowsetUpdate, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IRowset_QueryInterface(rowset, &IID_IRowsetLocate, (void**)&unk);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
}
static void test_command_rowset(IUnknown *cmd)
@@ -361,45 +361,45 @@ static void test_command_rowset(IUnknown *cmd)
DBROWCOUNT affected;
hr = IUnknown_QueryInterface(cmd, &IID_ICommandText, (void**)&command_text);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(cmd, &IID_ICommandPrepare, (void**)&commandprepare);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandPrepare_Prepare(commandprepare, 1);
- ok(hr == DB_E_NOCOMMAND, "got 0x%08x\n", hr);
+ ok(hr == DB_E_NOCOMMAND, "got 0x%08lx\n", hr);
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, L"CREATE TABLE testing (col1 INT, col2 SHORT)");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ICommandPrepare_Prepare(commandprepare, 1);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ICommandPrepare_Release(commandprepare);
affected = 9999;
hr = ICommandText_Execute(command_text, NULL, &IID_IRowset, NULL, &affected, &unk);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
todo_wine ok(unk == NULL, "Unexpected value\n");
- todo_wine ok(affected == -1, "got %ld\n", affected);
+ todo_wine ok(affected == -1, "got %Id\n", affected);
if (unk)
IUnknown_Release(unk);
hr = ICommandText_SetCommandText(command_text, &DBGUID_DEFAULT, L"select * from testing");
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
affected = 9999;
hr = ICommandText_Execute(command_text, NULL, &IID_IRowset, NULL, &affected, &unk);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(unk != NULL, "Unexpected value\n");
if (hr == S_OK)
{
ok(affected == -1, "wrong affected value\n");
hr = IUnknown_QueryInterface(unk, &IID_IRowset, (void**)&rowset);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
test_rowset_interfaces(rowset, command_text);
@@ -441,11 +441,11 @@ static void test_sessions(void)
hr = CoCreateInstance( &CLSID_MSDAINITIALIZE, NULL, CLSCTX_INPROC_SERVER, &IID_IDataInitialize,
(void **)&datainit );
- ok(hr == S_OK, "Failed to create object 0x%08x\n", hr);
+ ok(hr == S_OK, "Failed to create object 0x%08lx\n", hr);
hr = IDataInitialize_GetDataSource( datainit, NULL, CLSCTX_INPROC_SERVER, connect_str, &IID_IDBInitialize,
(IUnknown **)&dbinit );
SysFreeString(connect_str);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
if(FAILED(hr))
{
IDataInitialize_Release( datainit );
@@ -453,11 +453,11 @@ static void test_sessions(void)
}
hr = IDBInitialize_QueryInterface( dbinit, &IID_IDBProperties, (void **)&props );
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IDBProperties_Release(props);
hr = IDBInitialize_Initialize( dbinit );
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
if(FAILED(hr))
{
IDBInitialize_Release( dbinit );
@@ -466,54 +466,54 @@ static void test_sessions(void)
}
hr = IDBInitialize_QueryInterface( dbinit, &IID_IDBCreateSession, (void **)&dbsession );
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IDBCreateSession_CreateSession( dbsession, NULL, &IID_IUnknown, &session );
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(session, &IID_IGetDataSource, (void**)&datasource);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IGetDataSource_GetDataSource(datasource, &IID_IDBProperties, (IUnknown**)&dsource);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(dsource == props, "different pointers\n");
IDBProperties_Release(dsource);
IGetDataSource_Release(datasource);
hr = IUnknown_QueryInterface(session, &IID_ITransaction, (void**)&transaction);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ITransaction_Release(transaction);
hr = IUnknown_QueryInterface(session, &IID_ITransactionLocal, (void**)&local);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
if(hr == S_OK)
ITransactionLocal_Release(local);
hr = IUnknown_QueryInterface(session, &IID_ITransactionObject, (void**)&object);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(session, &IID_ITransactionJoin, (void**)&join);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ITransactionJoin_Release(join);
hr = IUnknown_QueryInterface(session, &IID_IBindResource, (void**)&unimplemented);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(session, &IID_ICreateRow, (void**)&unimplemented);
- ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
+ ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
hr = IUnknown_QueryInterface(session, &IID_ISessionProperties, (void**)&session_props);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ISessionProperties_Release(session_props);
hr = IUnknown_QueryInterface(session, &IID_IOpenRowset, (void**)&openrowset);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IOpenRowset_QueryInterface(openrowset, &IID_IDBCreateCommand, (void**)&create_command);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IDBCreateCommand_CreateCommand(create_command, NULL, &IID_IUnknown, (IUnknown **)&cmd);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
if (hr == S_OK)
{
test_command_interfaces(cmd);
@@ -566,7 +566,7 @@ static void setup_database(void)
if (!db_created)
{
SQLInstallerError(1, &code, buffer, sizeof(buffer), &size);
- trace("code %d, buffer %s, size %d\n", code, debugstr_a(buffer), size);
+ trace("code %ld, buffer %s, size %d\n", code, debugstr_a(buffer), size);
HeapFree(GetProcessHeap(), 0, driver);
@@ -595,7 +595,7 @@ static void cleanup_database(void)
WORD size;
SQLInstallerError(1, &code, buffer, sizeof(buffer), &size);
- trace("code %d, buffer %s, size %d\n", code, debugstr_a(buffer), size);
+ trace("code %ld, buffer %s, size %d\n", code, debugstr_a(buffer), size);
}
DeleteFileA(mdbpath);
@@ -630,15 +630,15 @@ static void test_enumeration(void)
}
hr = ISourcesRowset_GetSourcesRowset(source, NULL, &IID_IRowset, 0, NULL, (IUnknown**)&rowset);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = ISourcesRowset_GetSourcesRowset(source, NULL, &IID_IRowset, 0, NULL, (IUnknown**)&rowset2);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(rowset != rowset2, "same pointer\n");
IRowset_Release(rowset2);
hr = IRowset_QueryInterface(rowset, &IID_IColumnsInfo, (void**)&columninfo);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
+ todo_wine ok(hr == S_OK, "got 0x%08lx\n", hr);
if (hr == S_OK)
{
DBORDINAL columns;
@@ -647,8 +647,8 @@ static void test_enumeration(void)
int i;
hr = IColumnsInfo_GetColumnInfo(columninfo, &columns, &dbcolumninfo, &buffer);
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(columns == 6, "got %lu\n", columns);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
+ ok(columns == 6, "got %Iu\n", columns);
for( i = 0; i < columns; i++ )
{
@@ -659,9 +659,9 @@ static void test_enumeration(void)
debugstr_w(dbcolumninfo[i].pwszName), debugstr_w(colinfo_data[i].pwszName));
ok (dbcolumninfo[i].pTypeInfo == colinfo_data[i].pTypeInfo, "got %p/%p", dbcolumninfo[i].pTypeInfo, colinfo_data[i].pTypeInfo);
- ok (dbcolumninfo[i].iOrdinal == colinfo_data[i].iOrdinal, "got %ld/%ld", dbcolumninfo[i].iOrdinal, colinfo_data[i].iOrdinal);
- ok (dbcolumninfo[i].dwFlags == colinfo_data[i].dwFlags, "got 0x%08x/0x%0x8", dbcolumninfo[i].dwFlags, colinfo_data[i].dwFlags);
- ok (dbcolumninfo[i].ulColumnSize == colinfo_data[i].ulColumnSize, "got %lu/%lu", dbcolumninfo[i].ulColumnSize, colinfo_data[i].ulColumnSize);
+ ok (dbcolumninfo[i].iOrdinal == colinfo_data[i].iOrdinal, "got %Id/%Id", dbcolumninfo[i].iOrdinal, colinfo_data[i].iOrdinal);
+ ok (dbcolumninfo[i].dwFlags == colinfo_data[i].dwFlags, "got 0x%08lx/0x%08lx", dbcolumninfo[i].dwFlags, colinfo_data[i].dwFlags);
+ ok (dbcolumninfo[i].ulColumnSize == colinfo_data[i].ulColumnSize, "got %Iu/%Iu", dbcolumninfo[i].ulColumnSize, colinfo_data[i].ulColumnSize);
ok (dbcolumninfo[i].wType == colinfo_data[i].wType, "got %d/%d", dbcolumninfo[i].wType, colinfo_data[i].wType);
ok (dbcolumninfo[i].bPrecision == colinfo_data[i].bPrecision, "got %d/%d", dbcolumninfo[i].bPrecision, colinfo_data[i].bPrecision);
ok (dbcolumninfo[i].bScale == colinfo_data[i].bScale, "got %d/%d", dbcolumninfo[i].bScale, colinfo_data[i].bScale);
@@ -672,15 +672,15 @@ static void test_enumeration(void)
}
hr = IRowset_QueryInterface(rowset, &IID_IAccessor, (void**)&accessor);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
/* Request only SOURCES_NAME column */
hr = IAccessor_CreateAccessor(accessor, DBACCESSOR_ROWDATA, 1, &bindings, 0, &hacc, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
ok(hacc != 0, "got %Ix\n", hacc);
hr = IAccessor_ReleaseAccessor(accessor, hacc, NULL);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
IAccessor_Release(accessor);
--
2.34.1
1
0
01 Feb '22
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msdasql/session.c | 68 +++++++++++++++++++++++++++++++++++
dlls/msdasql/tests/provider.c | 5 ++-
2 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c
index abd8252218d..0f74c126138 100644
--- a/dlls/msdasql/session.c
+++ b/dlls/msdasql/session.c
@@ -44,6 +44,7 @@ struct msdasql_session
ISessionProperties ISessionProperties_iface;
IDBCreateCommand IDBCreateCommand_iface;
ITransactionJoin ITransactionJoin_iface;
+ ITransaction ITransaction_iface;
LONG refs;
IUnknown *datasource;
@@ -81,6 +82,11 @@ static inline struct msdasql_session *impl_from_ITransactionJoin( ITransactionJo
return CONTAINING_RECORD( iface, struct msdasql_session, ITransactionJoin_iface );
}
+static inline struct msdasql_session *impl_from_ITransaction( ITransaction *iface )
+{
+ return CONTAINING_RECORD( iface, struct msdasql_session, ITransaction_iface );
+}
+
static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
{
struct msdasql_session *session = impl_from_IUnknown( iface );
@@ -118,6 +124,11 @@ static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void
TRACE("(%p)->(ITransactionJoin %p)\n", iface, ppv);
*ppv = &session->ITransactionJoin_iface;
}
+ else if(IsEqualGUID(&IID_ITransaction, riid))
+ {
+ TRACE("(%p)->(ITransaction %p)\n", iface, ppv);
+ *ppv = &session->ITransaction_iface;
+ }
else if(IsEqualGUID(&IID_IBindResource, riid))
{
TRACE("(%p)->(IID_IBindResource not support)\n", iface);
@@ -1248,6 +1259,61 @@ static const ITransactionJoinVtbl transactionjoinVtbl =
transjoin_JoinTransaction
};
+static HRESULT WINAPI transaction_QueryInterface(ITransaction *iface, REFIID riid, void **out)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+ return IUnknown_QueryInterface(&session->session_iface, riid, out);
+}
+
+static ULONG WINAPI transaction_AddRef(ITransaction *iface)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+ return IUnknown_AddRef(&session->session_iface);
+}
+
+static ULONG WINAPI transaction_Release(ITransaction *iface)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+ return IUnknown_Release(&session->session_iface);
+}
+
+static HRESULT WINAPI transaction_Commit(ITransaction *iface, BOOL retaining, DWORD tc, DWORD rm)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+
+ FIXME("%p, %d, %ld, %ld\n", session, retaining, tc, rm);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transaction_Abort(ITransaction *iface, BOID *reason, BOOL retaining, BOOL async)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+
+ FIXME("%p, %p, %d, %d\n", session, reason, retaining, async);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI transaction_GetTransactionInfo(ITransaction *iface, XACTTRANSINFO *info)
+{
+ struct msdasql_session *session = impl_from_ITransaction( iface );
+
+ FIXME("%p, %p\n", session, info);
+
+ return E_NOTIMPL;
+}
+
+static const ITransactionVtbl transactionVtbl =
+{
+ transaction_QueryInterface,
+ transaction_AddRef,
+ transaction_Release,
+ transaction_Commit,
+ transaction_Abort,
+ transaction_GetTransactionInfo
+};
+
HRESULT create_db_session(REFIID riid, IUnknown *datasource, HDBC hdbc, void **unk)
{
struct msdasql_session *session;
@@ -1263,6 +1329,8 @@ HRESULT create_db_session(REFIID riid, IUnknown *datasource, HDBC hdbc, void **u
session->ISessionProperties_iface.lpVtbl = &propertiesVtbl;
session->IDBCreateCommand_iface.lpVtbl = &createcommandVtbl;
session->ITransactionJoin_iface.lpVtbl = &transactionjoinVtbl;
+ session->ITransaction_iface.lpVtbl = &transactionVtbl;
+
IUnknown_QueryInterface(datasource, &IID_IUnknown, (void**)&session->datasource);
session->refs = 1;
session->hdbc = hdbc;
diff --git a/dlls/msdasql/tests/provider.c b/dlls/msdasql/tests/provider.c
index ee81ad1d311..22fbf26c107 100644
--- a/dlls/msdasql/tests/provider.c
+++ b/dlls/msdasql/tests/provider.c
@@ -481,9 +481,8 @@ static void test_sessions(void)
IGetDataSource_Release(datasource);
hr = IUnknown_QueryInterface(session, &IID_ITransaction, (void**)&transaction);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
- if(hr == S_OK)
- ITransaction_Release(transaction);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ITransaction_Release(transaction);
hr = IUnknown_QueryInterface(session, &IID_ITransactionLocal, (void**)&local);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
--
2.34.1
1
0
[PATCH 1/3] msdasql: Fix printf format warnings with long types.
by Alistair Leslie-Hughes 01 Feb '22
by Alistair Leslie-Hughes 01 Feb '22
01 Feb '22
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msdasql/Makefile.in | 1 -
dlls/msdasql/msdasql_main.c | 42 +++++++++++++-------------
dlls/msdasql/session.c | 60 ++++++++++++++++++-------------------
3 files changed, 51 insertions(+), 52 deletions(-)
diff --git a/dlls/msdasql/Makefile.in b/dlls/msdasql/Makefile.in
index 3e9c482dbd3..0f5453131f6 100644
--- a/dlls/msdasql/Makefile.in
+++ b/dlls/msdasql/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = msdasql.dll
IMPORTS = uuid ole32 oleaut32 odbc32
diff --git a/dlls/msdasql/msdasql_main.c b/dlls/msdasql/msdasql_main.c
index d6c833c4c14..3e1af95b1a7 100644
--- a/dlls/msdasql/msdasql_main.c
+++ b/dlls/msdasql/msdasql_main.c
@@ -188,7 +188,7 @@ static HRESULT convert_dbproperty_mode(const WCHAR *src, VARIANT *dest)
{
V_VT(dest) = VT_I4;
V_I4(dest) = prop->value;
- TRACE("%s = %#x\n", debugstr_w(src), prop->value);
+ TRACE("%s = %#lx\n", debugstr_w(src), prop->value);
return S_OK;
}
@@ -303,7 +303,7 @@ static ULONG WINAPI msdsql_AddRef(IUnknown *iface)
struct msdasql *provider = impl_from_IUnknown(iface);
ULONG ref = InterlockedIncrement(&provider->ref);
- TRACE("(%p) ref=%u\n", provider, ref);
+ TRACE("(%p) ref=%lu\n", provider, ref);
return ref;
}
@@ -313,7 +313,7 @@ static ULONG WINAPI msdsql_Release(IUnknown *iface)
struct msdasql *provider = impl_from_IUnknown(iface);
ULONG ref = InterlockedDecrement(&provider->ref);
- TRACE("(%p) ref=%u\n", provider, ref);
+ TRACE("(%p) ref=%lu\n", provider, ref);
if (!ref)
{
@@ -362,7 +362,7 @@ static HRESULT WINAPI dbprops_GetProperties(IDBProperties *iface, ULONG cPropert
int i, j, k;
DBPROPSET *propset;
- TRACE("(%p)->(%d %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets);
+ TRACE("(%p)->(%ld %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets);
*pcPropertySets = 1;
@@ -397,7 +397,7 @@ static HRESULT WINAPI dbprops_GetProperties(IDBProperties *iface, ULONG cPropert
for (i=0; i < cPropertyIDSets; i++)
{
- TRACE("Property id %d (count %d, set %s)\n", i, rgPropertyIDSets[i].cPropertyIDs,
+ TRACE("Property id %d (count %ld, set %s)\n", i, rgPropertyIDSets[i].cPropertyIDs,
debugstr_guid(&rgPropertyIDSets[i].guidPropertySet));
propset->cProperties = rgPropertyIDSets[i].cPropertyIDs;
@@ -434,7 +434,7 @@ static HRESULT WINAPI dbprops_GetPropertyInfo(IDBProperties *iface, ULONG cPrope
int size = 1;
OLECHAR *ptr;
- TRACE("(%p)->(%d %p %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
+ TRACE("(%p)->(%ld %p %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets,
prgPropertyInfoSets, ppDescBuffer);
infoset = CoTaskMemAlloc(sizeof(DBPROPINFOSET));
@@ -474,7 +474,7 @@ static HRESULT WINAPI dbprops_SetProperties(IDBProperties *iface, ULONG cPropert
struct msdasql *provider = impl_from_IDBProperties(iface);
int i, j, k;
- TRACE("(%p)->(%d %p)\n", provider, cPropertySets, rgPropertySets);
+ TRACE("(%p)->(%ld %p)\n", provider, cPropertySets, rgPropertySets);
for (i=0; i < cPropertySets; i++)
{
@@ -757,7 +757,7 @@ static ULONG WINAPI msdasql_enum_AddRef(ISourcesRowset *iface)
struct msdasql_enum *enumerator = msdasql_enum_from_ISourcesRowset(iface);
ULONG ref = InterlockedIncrement(&enumerator->ref);
- TRACE("(%p) ref=%u\n", enumerator, ref);
+ TRACE("(%p) ref=%lu\n", enumerator, ref);
return ref;
}
@@ -767,7 +767,7 @@ static ULONG WINAPI msdasql_enum_Release(ISourcesRowset *iface)
struct msdasql_enum *enumerator = msdasql_enum_from_ISourcesRowset(iface);
ULONG ref = InterlockedDecrement(&enumerator->ref);
- TRACE("(%p) ref=%u\n", enumerator, ref);
+ TRACE("(%p) ref=%lu\n", enumerator, ref);
if (!ref)
{
@@ -825,7 +825,7 @@ static ULONG WINAPI enum_rowset_AddRef(IRowset *iface)
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
LONG refs = InterlockedIncrement( &rowset->ref );
- TRACE( "%p new refcount %d\n", rowset, refs );
+ TRACE( "%p new refcount %ld\n", rowset, refs );
return refs;
}
@@ -833,7 +833,7 @@ static ULONG WINAPI enum_rowset_Release(IRowset *iface)
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
LONG refs = InterlockedDecrement( &rowset->ref );
- TRACE( "%p new refcount %d\n", rowset, refs );
+ TRACE( "%p new refcount %ld\n", rowset, refs );
if (!refs)
{
TRACE( "destroying %p\n", rowset );
@@ -847,7 +847,7 @@ static HRESULT WINAPI enum_rowset_AddRefRows(IRowset *iface, DBCOUNTITEM count,
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld, %p, %p, %p\n", rowset, count, rows, ref_counts, status);
+ FIXME("%p, %Iu, %p, %p, %p\n", rowset, count, rows, ref_counts, status);
return E_NOTIMPL;
}
@@ -856,7 +856,7 @@ static HRESULT WINAPI enum_rowset_GetData(IRowset *iface, HROW row, HACCESSOR ac
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld, %ld, %p\n", rowset, row, accessor, data);
+ FIXME("%p, %Iu, %Iu, %p\n", rowset, row, accessor, data);
return E_NOTIMPL;
}
@@ -866,7 +866,7 @@ static HRESULT WINAPI enum_rowset_GetNextRows(IRowset *iface, HCHAPTER reserved,
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld, %ld, %ld, %p, %p\n", rowset, reserved, offset, count, obtained, rows);
+ FIXME("%p, %Iu, %Iu, %Iu, %p, %p\n", rowset, reserved, offset, count, obtained, rows);
if (!obtained || !rows)
return E_INVALIDARG;
@@ -884,7 +884,7 @@ static HRESULT WINAPI enum_rowset_ReleaseRows(IRowset *iface, DBCOUNTITEM count,
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld, %p, %p, %p, %p\n", rowset, count, rows, options, ref_counts, status);
+ FIXME("%p, %Iu, %p, %p, %p, %p\n", rowset, count, rows, options, ref_counts, status);
return S_OK;
}
@@ -893,7 +893,7 @@ static HRESULT WINAPI enum_rowset_RestartPosition(IRowset *iface, HCHAPTER reser
{
struct msdasql_enum_rowset *rowset = msdasql_rs_from_IRowset( iface );
- FIXME("%p, %ld\n", rowset, reserved);
+ FIXME("%p, %Iu\n", rowset, reserved);
return S_OK;
}
@@ -931,7 +931,7 @@ static ULONG WINAPI enum_rs_accessor_Release(IAccessor *iface)
static HRESULT WINAPI enum_rs_accessor_AddRefAccessor(IAccessor *iface, HACCESSOR accessor, DBREFCOUNT *count)
{
struct msdasql_enum_rowset *rowset = msdasql_enum_from_IAccessor( iface );
- FIXME("%p, %lu, %p\n", rowset, accessor, count);
+ FIXME("%p, %Iu, %p\n", rowset, accessor, count);
return E_NOTIMPL;
}
@@ -941,7 +941,7 @@ static HRESULT WINAPI enum_rs_accessor_CreateAccessor(IAccessor *iface, DBACCESS
{
struct msdasql_enum_rowset *rowset = msdasql_enum_from_IAccessor( iface );
- FIXME("%p 0x%08x, %lu, %p, %lu, %p, %p\n", rowset, flags, count, bindings, row_size, accessor, status);
+ FIXME("%p 0x%08lx, %Iu, %p, %Iu, %p, %p\n", rowset, flags, count, bindings, row_size, accessor, status);
if (accessor)
*accessor = 0xdeadbeef;
@@ -953,7 +953,7 @@ static HRESULT WINAPI enum_rs_accessor_GetBindings(IAccessor *iface, HACCESSOR a
DBACCESSORFLAGS *flags, DBCOUNTITEM *count, DBBINDING **bindings)
{
struct msdasql_enum_rowset *rowset = msdasql_enum_from_IAccessor( iface );
- FIXME("%p %lu, %p, %p, %p\n", rowset, accessor, flags, count, bindings);
+ FIXME("%p, %Iu, %p, %p, %p\n", rowset, accessor, flags, count, bindings);
return E_NOTIMPL;
}
@@ -961,7 +961,7 @@ static HRESULT WINAPI enum_rs_accessor_ReleaseAccessor(IAccessor *iface, HACCESS
{
struct msdasql_enum_rowset *rowset = msdasql_enum_from_IAccessor( iface );
- FIXME("%p, %lu, %p\n", rowset, accessor, count);
+ FIXME("%p, %Iu, %p\n", rowset, accessor, count);
if (count)
*count = 0;
@@ -987,7 +987,7 @@ static HRESULT WINAPI msdasql_enum_GetSourcesRowset(ISourcesRowset *iface, IUnkn
struct msdasql_enum_rowset *enum_rs;
HRESULT hr;
- TRACE("(%p) %p, %s, %d, %p, %p\n", enumerator, outer, debugstr_guid(riid), sets, properties, rowset);
+ TRACE("(%p) %p, %s, %lu, %p, %p\n", enumerator, outer, debugstr_guid(riid), sets, properties, rowset);
enum_rs = malloc(sizeof(*enum_rs));
enum_rs->IRowset_iface.lpVtbl = &enum_rowset_vtbl;
diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c
index e58d152a418..abd8252218d 100644
--- a/dlls/msdasql/session.c
+++ b/dlls/msdasql/session.c
@@ -143,7 +143,7 @@ static ULONG WINAPI session_AddRef(IUnknown *iface)
{
struct msdasql_session *session = impl_from_IUnknown( iface );
LONG refs = InterlockedIncrement( &session->refs );
- TRACE( "%p new refcount %d\n", session, refs );
+ TRACE( "%p new refcount %ld\n", session, refs );
return refs;
}
@@ -151,7 +151,7 @@ static ULONG WINAPI session_Release(IUnknown *iface)
{
struct msdasql_session *session = impl_from_IUnknown( iface );
LONG refs = InterlockedDecrement( &session->refs );
- TRACE( "%p new refcount %d\n", session, refs );
+ TRACE( "%p new refcount %ld\n", session, refs );
if (!refs)
{
TRACE( "destroying %p\n", session );
@@ -230,7 +230,7 @@ HRESULT WINAPI openrowset_OpenRowset(IOpenRowset *iface, IUnknown *pUnkOuter, DB
DBID *index, REFIID riid, ULONG count, DBPROPSET propertysets[], IUnknown **rowset)
{
struct msdasql_session *session = impl_from_IOpenRowset( iface );
- FIXME("%p, %p, %p %p %s, %d %p %p stub\n", session, pUnkOuter, table, index, debugstr_guid(riid),
+ FIXME("%p, %p, %p %p %s, %ld %p %p stub\n", session, pUnkOuter, table, index, debugstr_guid(riid),
count, propertysets, rowset);
return E_NOTIMPL;
@@ -267,7 +267,7 @@ static HRESULT WINAPI properties_GetProperties(ISessionProperties *iface, ULONG
const DBPROPIDSET id_sets[], ULONG *count, DBPROPSET **sets)
{
struct msdasql_session *session = impl_from_ISessionProperties( iface );
- FIXME("%p %d %p %p %p\n", session, set_count, id_sets, count, sets);
+ FIXME("%p %lu %p %p %p\n", session, set_count, id_sets, count, sets);
return E_NOTIMPL;
}
@@ -276,7 +276,7 @@ static HRESULT WINAPI properties_SetProperties(ISessionProperties *iface, ULONG
DBPROPSET sets[])
{
struct msdasql_session *session = impl_from_ISessionProperties( iface );
- FIXME("%p %d %p\n", session, count, sets);
+ FIXME("%p %lu %p\n", session, count, sets);
return S_OK;
}
@@ -426,7 +426,7 @@ static ULONG WINAPI command_AddRef(ICommandText *iface)
{
struct command *command = impl_from_ICommandText( iface );
LONG refs = InterlockedIncrement( &command->refs );
- TRACE( "%p new refcount %d\n", command, refs );
+ TRACE( "%p new refcount %ld\n", command, refs );
return refs;
}
@@ -434,7 +434,7 @@ static ULONG WINAPI command_Release(ICommandText *iface)
{
struct command *command = impl_from_ICommandText( iface );
LONG refs = InterlockedDecrement( &command->refs );
- TRACE( "%p new refcount %d\n", command, refs );
+ TRACE( "%p new refcount %ld\n", command, refs );
if (!refs)
{
TRACE( "destroying %p\n", command );
@@ -551,7 +551,7 @@ static ULONG WINAPI msdasql_rowset_AddRef(IRowset *iface)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
LONG refs = InterlockedIncrement( &rowset->refs );
- TRACE( "%p new refcount %d\n", rowset, refs );
+ TRACE( "%p new refcount %ld\n", rowset, refs );
return refs;
}
@@ -559,7 +559,7 @@ static ULONG WINAPI msdasql_rowset_Release(IRowset *iface)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
LONG refs = InterlockedDecrement( &rowset->refs );
- TRACE( "%p new refcount %d\n", rowset, refs );
+ TRACE( "%p new refcount %ld\n", rowset, refs );
if (!refs)
{
TRACE( "destroying %p\n", rowset );
@@ -576,14 +576,14 @@ static HRESULT WINAPI msdasql_rowset_AddRefRows(IRowset *iface, DBCOUNTITEM coun
const HROW rows[], DBREFCOUNT ref_counts[], DBROWSTATUS status[])
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld, %p, %p, %p\n", rowset, count, rows, ref_counts, status);
+ FIXME("%p, %Id, %p, %p, %p\n", rowset, count, rows, ref_counts, status);
return E_NOTIMPL;
}
static HRESULT WINAPI msdasql_rowset_GetData(IRowset *iface, HROW row, HACCESSOR accessor, void *data)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld, %ld, %p\n", rowset, row, accessor, data);
+ FIXME("%p, %Id, %Id, %p\n", rowset, row, accessor, data);
return E_NOTIMPL;
}
@@ -591,7 +591,7 @@ static HRESULT WINAPI msdasql_rowset_GetNextRows(IRowset *iface, HCHAPTER reserv
DBROWCOUNT count, DBCOUNTITEM *obtained, HROW **rows)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld, %ld, %ld, %p, %p\n", rowset, reserved, offset, count, obtained, rows);
+ FIXME("%p, %Id, %Id, %Id, %p, %p\n", rowset, reserved, offset, count, obtained, rows);
return E_NOTIMPL;
}
@@ -600,14 +600,14 @@ static HRESULT WINAPI msdasql_rowset_ReleaseRows(IRowset *iface, DBCOUNTITEM cou
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld, %p, %p, %p, %p\n", rowset, count, rows, options, ref_counts, status);
+ FIXME("%p, %Id, %p, %p, %p, %p\n", rowset, count, rows, options, ref_counts, status);
return E_NOTIMPL;
}
static HRESULT WINAPI msdasql_rowset_RestartPosition(IRowset *iface, HCHAPTER reserved)
{
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
- FIXME("%p, %ld\n", rowset, reserved);
+ FIXME("%p, %Id\n", rowset, reserved);
return E_NOTIMPL;
}
@@ -645,7 +645,7 @@ static HRESULT WINAPI rowset_info_GetProperties(IRowsetInfo *iface, const ULONG
const DBPROPIDSET propertyidsets[], ULONG *out_count, DBPROPSET **propertysets)
{
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
- FIXME("%p, %d, %p, %p, %p\n", rowset, count, propertyidsets, out_count, propertysets);
+ FIXME("%p, %lu, %p, %p, %p\n", rowset, count, propertyidsets, out_count, propertysets);
return E_NOTIMPL;
}
@@ -653,7 +653,7 @@ static HRESULT WINAPI rowset_info_GetReferencedRowset(IRowsetInfo *iface, DBORDI
REFIID riid, IUnknown **unk)
{
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
- FIXME("%p, %ld, %s, %p\n", rowset, ordinal, debugstr_guid(riid), unk);
+ FIXME("%p, %Id, %s, %p\n", rowset, ordinal, debugstr_guid(riid), unk);
return E_NOTIMPL;
}
@@ -713,7 +713,7 @@ static HRESULT WINAPI rowset_colsinfo_MapColumnIDs(IColumnsInfo *iface, DBORDINA
const DBID *dbids, DBORDINAL *columns)
{
struct msdasql_rowset *rowset = rowset_impl_from_IColumnsInfo( iface );
- FIXME("%p, %lu, %p, %p\n", rowset, column_ids, dbids, columns);
+ FIXME("%p, %Id, %p, %p\n", rowset, column_ids, dbids, columns);
return E_NOTIMPL;
}
@@ -747,7 +747,7 @@ static ULONG WINAPI rowset_accessor_Release(IAccessor *iface)
static HRESULT WINAPI rowset_accessor_AddRefAccessor(IAccessor *iface, HACCESSOR accessor, DBREFCOUNT *count)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
- FIXME("%p, %lu, %p\n", rowset, accessor, count);
+ FIXME("%p, %Id, %p\n", rowset, accessor, count);
return E_NOTIMPL;
}
@@ -756,7 +756,7 @@ static HRESULT WINAPI rowset_accessor_CreateAccessor(IAccessor *iface, DBACCESSO
DBBINDSTATUS status[])
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
- FIXME("%p 0x%08x, %lu, %p, %lu, %p, %p\n", rowset, flags, count, bindings, row_size, accessor, status);
+ FIXME("%p, 0x%08lx, %Id, %p, %Id, %p, %p\n", rowset, flags, count, bindings, row_size, accessor, status);
return E_NOTIMPL;
}
@@ -764,14 +764,14 @@ static HRESULT WINAPI rowset_accessor_GetBindings(IAccessor *iface, HACCESSOR ac
DBACCESSORFLAGS *flags, DBCOUNTITEM *count, DBBINDING **bindings)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
- FIXME("%p %lu, %p, %p, %p\n", rowset, accessor, flags, count, bindings);
+ FIXME("%p, %Id, %p, %p, %p\n", rowset, accessor, flags, count, bindings);
return E_NOTIMPL;
}
static HRESULT WINAPI rowset_accessor_ReleaseAccessor(IAccessor *iface, HACCESSOR accessor, DBREFCOUNT *count)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
- FIXME("%p, %lu, %p\n", rowset, accessor, count);
+ FIXME("%p, %Id, %p\n", rowset, accessor, count);
return E_NOTIMPL;
}
@@ -815,7 +815,7 @@ static HRESULT WINAPI column_rs_GetColumnsRowset(IColumnsRowset *iface, IUnknown
const DBID columns[], REFIID riid, ULONG property_cnt, DBPROPSET property_sets[], IUnknown **unk_rs)
{
struct msdasql_rowset *rowset = impl_from_IColumnsRowset( iface );
- FIXME("(%p)->(%p %ld %p %s %u, %p %p): stub\n", rowset, outer, count, columns, debugstr_guid(riid),
+ FIXME("(%p)->(%p, %Id, %p, %s, %lu, %p, %p): stub\n", rowset, outer, count, columns, debugstr_guid(riid),
property_cnt, property_sets, unk_rs);
return E_NOTIMPL;
}
@@ -953,7 +953,7 @@ static HRESULT WINAPI command_prop_GetProperties(ICommandProperties *iface, ULON
const DBPROPIDSET propertyidsets[], ULONG *sets_cnt, DBPROPSET **propertyset)
{
struct command *command = impl_from_ICommandProperties( iface );
- FIXME("%p %d %p %p %p\n", command, count, propertyidsets, sets_cnt, propertyset);
+ FIXME("%p %lu %p %p %p\n", command, count, propertyidsets, sets_cnt, propertyset);
return E_NOTIMPL;
}
@@ -961,7 +961,7 @@ static HRESULT WINAPI command_prop_SetProperties(ICommandProperties *iface, ULON
DBPROPSET propertyset[])
{
struct command *command = impl_from_ICommandProperties( iface );
- FIXME("%p %p\n", command, propertyset);
+ FIXME("%p, %lu, %p\n", command, count, propertyset);
return S_OK;
}
@@ -1004,7 +1004,7 @@ static HRESULT WINAPI colsinfo_MapColumnIDs(IColumnsInfo *iface, DBORDINAL colum
const DBID *dbids, DBORDINAL *columns)
{
struct command *command = impl_from_IColumnsInfo( iface );
- FIXME("%p, %lu, %p, %p\n", command, column_ids, dbids, columns);
+ FIXME("%p, %Iu, %p, %p\n", command, column_ids, dbids, columns);
return E_NOTIMPL;
}
@@ -1038,7 +1038,7 @@ static ULONG WINAPI converttype_Release(IConvertType *iface)
static HRESULT WINAPI converttype_CanConvert(IConvertType *iface, DBTYPE from, DBTYPE to, DBCONVERTFLAGS flags)
{
struct command *command = impl_from_IConvertType( iface );
- FIXME("%p, %u, %d, 0x%08x\n", command, from, to, flags);
+ FIXME("%p, %u, %d, 0x%08lx\n", command, from, to, flags);
return E_NOTIMPL;
}
@@ -1073,7 +1073,7 @@ static HRESULT WINAPI commandprepare_Prepare(ICommandPrepare *iface, ULONG runs)
struct command *command = impl_from_ICommandPrepare( iface );
RETCODE ret;
- TRACE("%p, %u\n", command, runs);
+ TRACE("%p, %lu\n", command, runs);
if (!command->query)
return DB_E_NOCOMMAND;
@@ -1138,7 +1138,7 @@ static HRESULT WINAPI cmd_with_params_MapParameterNames(ICommandWithParameters *
LPCWSTR names[], DB_LPARAMS ordinals[])
{
struct command *command = impl_from_ICommandWithParameters( iface );
- FIXME("%p, %ld, %p, %p\n", command, uparams, names, ordinals);
+ FIXME("%p, %Iu, %p, %p\n", command, uparams, names, ordinals);
return E_NOTIMPL;
}
@@ -1146,7 +1146,7 @@ static HRESULT WINAPI cmd_with_params_SetParameterInfo(ICommandWithParameters *i
const DB_UPARAMS ordinals[], const DBPARAMBINDINFO bindinfo[])
{
struct command *command = impl_from_ICommandWithParameters( iface );
- FIXME("%p, %ld, %p, %p\n", command, uparams, ordinals, bindinfo);
+ FIXME("%p, %Iu, %p, %p\n", command, uparams, ordinals, bindinfo);
return E_NOTIMPL;
}
@@ -1234,7 +1234,7 @@ static HRESULT WINAPI transjoin_JoinTransaction(ITransactionJoin *iface, IUnknow
{
struct msdasql_session *session = impl_from_ITransactionJoin( iface );
- FIXME("%p, %p, %d, 0x%08x, %p\n", session, unk, level, flags, options);
+ FIXME("%p, %p, %lu, 0x%08lx, %p\n", session, unk, level, flags, options);
return E_NOTIMPL;
}
--
2.34.1
1
0
01 Feb '22
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/hidclass.sys/Makefile.in | 1 -
dlls/hidclass.sys/device.c | 10 +++++-----
dlls/hidclass.sys/pnp.c | 20 ++++++++++----------
3 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/dlls/hidclass.sys/Makefile.in b/dlls/hidclass.sys/Makefile.in
index b597589dc53..788828ad66a 100644
--- a/dlls/hidclass.sys/Makefile.in
+++ b/dlls/hidclass.sys/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = hidclass.sys
IMPORTLIB = hidclass
IMPORTS = hal ntoskrnl user32 hidparse
diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c
index 0744865f8f7..c252125d8eb 100644
--- a/dlls/hidclass.sys/device.c
+++ b/dlls/hidclass.sys/device.c
@@ -351,7 +351,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
if (!(report = find_report_with_type_and_id( ext, HidP_Input, buffer[0], FALSE )))
WARN( "dropping unknown input id %u\n", buffer[0] );
else if (!polled && io.Information < report->InputLength)
- WARN( "dropping short report, len %u expected %u\n", (ULONG)io.Information, report->InputLength );
+ WARN( "dropping short report, len %Iu expected %u\n", io.Information, report->InputLength );
else
{
packet->reportId = buffer[0];
@@ -364,7 +364,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
res = WaitForSingleObject(ext->u.pdo.halt_event, polled ? ext->u.pdo.poll_interval : 0);
} while (res == WAIT_TIMEOUT);
- TRACE("device thread exiting, res %#x\n", res);
+ TRACE( "device thread exiting, res %#lx\n", res );
return 1;
}
@@ -561,7 +561,7 @@ NTSTATUS WINAPI pdo_ioctl(DEVICE_OBJECT *device, IRP *irp)
irp->IoStatus.Information = 0;
- TRACE("device %p ioctl(%x)\n", device, irpsp->Parameters.DeviceIoControl.IoControlCode);
+ TRACE( "device %p code %#lx\n", device, irpsp->Parameters.DeviceIoControl.IoControlCode );
KeAcquireSpinLock(&ext->u.pdo.lock, &irql);
removed = ext->u.pdo.removed;
@@ -661,8 +661,8 @@ NTSTATUS WINAPI pdo_ioctl(DEVICE_OBJECT *device, IRP *irp)
default:
{
ULONG code = irpsp->Parameters.DeviceIoControl.IoControlCode;
- FIXME("Unsupported ioctl %x (device=%x access=%x func=%x method=%x)\n",
- code, code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3);
+ FIXME( "Unsupported ioctl %#lx (device=%lx access=%lx func=%lx method=%lx)\n", code,
+ code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3 );
irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
break;
}
diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c
index 6dafa1b95af..fec51af40a9 100644
--- a/dlls/hidclass.sys/pnp.c
+++ b/dlls/hidclass.sys/pnp.c
@@ -143,13 +143,13 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
if ((status = get_device_id(bus_pdo, BusQueryDeviceID, device_id)))
{
- ERR("Failed to get PDO device id, status %#x.\n", status);
+ ERR( "Failed to get PDO device id, status %#lx.\n", status );
return status;
}
if ((status = get_device_id(bus_pdo, BusQueryInstanceID, instance_id)))
{
- ERR("Failed to get PDO instance id, status %#x.\n", status);
+ ERR( "Failed to get PDO instance id, status %#lx.\n", status );
return status;
}
@@ -159,7 +159,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
if ((status = IoCreateDevice(driver, sizeof(*ext) + minidriver->minidriver.DeviceExtensionSize,
NULL, FILE_DEVICE_BUS_EXTENDER, 0, FALSE, &fdo)))
{
- ERR("Failed to create bus FDO, status %#x.\n", status);
+ ERR( "Failed to create bus FDO, status %#lx.\n", status );
return status;
}
ext = fdo->DeviceExtension;
@@ -177,7 +177,7 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *b
status = minidriver->AddDevice(minidriver->minidriver.DriverObject, fdo);
if (status != STATUS_SUCCESS)
{
- ERR("Minidriver AddDevice failed (%x)\n",status);
+ ERR( "Minidriver AddDevice failed (%lx)\n", status );
IoDeleteDevice(fdo);
return status;
}
@@ -206,7 +206,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
call_minidriver( IOCTL_HID_GET_DEVICE_ATTRIBUTES, fdo, NULL, 0, &attr, sizeof(attr), &io );
if (io.Status != STATUS_SUCCESS)
{
- ERR( "Minidriver failed to get attributes, status %#x.\n", io.Status );
+ ERR( "Minidriver failed to get attributes, status %#lx.\n", io.Status );
return;
}
@@ -215,7 +215,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
RtlInitUnicodeString(&string, pdo_name);
if ((status = IoCreateDevice(fdo->DriverObject, sizeof(*pdo_ext), &string, 0, 0, FALSE, &child_pdo)))
{
- ERR( "Failed to create child PDO, status %#x.\n", io.Status );
+ ERR( "Failed to create child PDO, status %#lx.\n", io.Status );
return;
}
fdo_ext->u.fdo.child_pdo = child_pdo;
@@ -236,7 +236,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
call_minidriver( IOCTL_HID_GET_DEVICE_DESCRIPTOR, fdo, NULL, 0, &descriptor, sizeof(descriptor), &io );
if (io.Status != STATUS_SUCCESS)
{
- ERR("Cannot get Device Descriptor(%x)\n",status);
+ ERR( "Cannot get Device Descriptor, status %#lx\n", status );
IoDeleteDevice(child_pdo);
return;
}
@@ -256,7 +256,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
descriptor.DescriptorList[i].wReportLength, &io );
if (io.Status != STATUS_SUCCESS)
{
- ERR("Cannot get Report Descriptor(%x)\n",status);
+ ERR( "Cannot get Report Descriptor, status %#lx\n", status );
free(reportDescriptor);
IoDeleteDevice(child_pdo);
return;
@@ -290,7 +290,7 @@ static void create_child(minidriver *minidriver, DEVICE_OBJECT *fdo)
PLUGPLAY_PROPERTY_PERSISTENT, DEVPROP_TYPE_UINT32,
sizeof(pdo_ext->u.pdo.rawinput_handle), &pdo_ext->u.pdo.rawinput_handle)))
{
- ERR("Failed to set device handle property, status %x\n", status);
+ ERR( "Failed to set device handle property, status %#lx\n", status );
IoDeleteDevice(child_pdo);
return;
}
@@ -444,7 +444,7 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device, IRP *irp)
case IRP_MN_START_DEVICE:
if ((status = IoRegisterDeviceInterface(device, ext->class_guid, NULL, &ext->u.pdo.link_name)))
{
- ERR("Failed to register interface, status %#x.\n", status);
+ ERR( "Failed to register interface, status %#lx.\n", status );
break;
}
--
2.34.1
1
2
From: Eric Pouech <eric.pouech(a)gmail.com>
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/dwrite/font.c | 2 +-
dlls/dwrite/main.c | 3 ++-
dlls/dwrite/opentype.c | 5 +++--
dlls/dwrite/shape.c | 4 ++--
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index cbc0434b72d..4b32bf1e0de 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -5084,7 +5084,7 @@ HRESULT get_eudc_fontcollection(IDWriteFactory7 *factory, IDWriteFontCollection3
struct dwrite_fontcollection *collection;
WCHAR eudckeypathW[16];
HKEY eudckey;
- DWORD index;
+ UINT32 index;
BOOL exists;
LONG retval;
HRESULT hr;
diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c
index ab53d5cb80d..26415201d91 100644
--- a/dlls/dwrite/main.c
+++ b/dlls/dwrite/main.c
@@ -1515,8 +1515,9 @@ static HRESULT WINAPI dwritefactory3_CreateFontFaceReference(IDWriteFactory7 *if
static HRESULT create_system_path_list(WCHAR ***ret, unsigned int *ret_count)
{
- unsigned int index = 0, value_size, name_count, max_name_count, type, data_size;
+ unsigned int index = 0, value_size, max_name_count;
WCHAR **paths = NULL, *name, *value = NULL;
+ DWORD name_count, type, data_size;
size_t capacity = 0, count = 0;
HKEY hkey;
LONG r;
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 452b00240b8..5bac32f9ee7 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -4607,8 +4607,8 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex
next_bit = global_bit_shift + 1;
for (i = 0; i < features->count; ++i)
{
- unsigned int bits_needed;
BOOL found = FALSE;
+ DWORD bits_needed;
feature = &features->features[i];
@@ -5077,7 +5077,8 @@ static BOOL opentype_layout_apply_gsub_alt_substitution(struct scriptshaping_con
if (format == 1)
{
const struct ot_gsub_altsubst_format1 *format1 = table_read_ensure(table, subtable_offset, sizeof(*format1));
- unsigned int shift, alt_index;
+ DWORD shift;
+ unsigned int alt_index;
UINT16 set_offset;
coverage = table_read_be_word(table, subtable_offset + FIELD_OFFSET(struct ot_gsub_altsubst_format1, coverage));
diff --git a/dlls/dwrite/shape.c b/dlls/dwrite/shape.c
index 177ad1d06fe..bf80d686052 100644
--- a/dlls/dwrite/shape.c
+++ b/dlls/dwrite/shape.c
@@ -67,10 +67,10 @@ void release_scriptshaping_cache(struct scriptshaping_cache *cache)
free(cache);
}
-static unsigned int shape_select_script(const struct scriptshaping_cache *cache, DWORD kind, const DWORD *scripts,
+static unsigned int shape_select_script(const struct scriptshaping_cache *cache, DWORD kind, const unsigned int *scripts,
unsigned int *script_index)
{
- static const DWORD fallback_scripts[] =
+ static const unsigned int fallback_scripts[] =
{
DWRITE_MAKE_OPENTYPE_TAG('D','F','L','T'),
DWRITE_MAKE_OPENTYPE_TAG('d','f','l','t'),
--
2.34.1
1
0