From: Alex Henrie alexhenrie24@gmail.com
--- dlls/msado15/command.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/msado15/command.c b/dlls/msado15/command.c index b796dd0a8a4..152528308e0 100644 --- a/dlls/msado15/command.c +++ b/dlls/msado15/command.c @@ -24,7 +24,6 @@ #include "msado15_backcompat.h"
#include "wine/debug.h" -#include "wine/heap.h"
#include "msado15_private.h"
@@ -83,8 +82,8 @@ static ULONG WINAPI command_Release( _Command *iface ) { TRACE( "destroying %p\n", command ); if (command->connection) _Connection_Release(command->connection); - heap_free( command->text ); - heap_free( command ); + free( command->text ); + free( command ); } return ref; } @@ -196,8 +195,8 @@ static HRESULT WINAPI command_put_CommandText( _Command *iface, BSTR text )
TRACE( "%p, %s\n", command, debugstr_w( text ) );
- if (text && !(source = strdupW( text ))) return E_OUTOFMEMORY; - heap_free( command->text ); + if (text && !(source = wcsdup( text ))) return E_OUTOFMEMORY; + free( command->text ); command->text = source; return S_OK; } @@ -379,7 +378,7 @@ HRESULT Command_create( void **obj ) { struct command *command;
- if (!(command = heap_alloc( sizeof(*command) ))) return E_OUTOFMEMORY; + if (!(command = malloc( sizeof(*command) ))) return E_OUTOFMEMORY; command->Command_iface.lpVtbl = &command_vtbl; command->type = adCmdUnknown; command->text = NULL;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/msado15/connection.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c index e1fbea187b0..d6ca0c2df39 100644 --- a/dlls/msado15/connection.c +++ b/dlls/msado15/connection.c @@ -29,7 +29,6 @@ #include "msado15_backcompat.h"
#include "wine/debug.h" -#include "wine/heap.h"
#include "msado15_private.h"
@@ -108,10 +107,10 @@ static ULONG WINAPI connection_Release( _Connection *iface ) IUnknown_Release( connection->cp_connev.sinks[i] ); } if (connection->session) IUnknown_Release( connection->session ); - heap_free( connection->cp_connev.sinks ); - heap_free( connection->provider ); - heap_free( connection->datasource ); - heap_free( connection ); + free( connection->cp_connev.sinks ); + free( connection->provider ); + free( connection->datasource ); + free( connection ); } return refs; } @@ -234,8 +233,8 @@ static HRESULT WINAPI connection_put_ConnectionString( _Connection *iface, BSTR
TRACE( "%p, %s\n", connection, debugstr_w( str && !wcsstr( str, L"Password" ) ? L"<hidden>" : str ) );
- if (str && !(source = strdupW( str ))) return E_OUTOFMEMORY; - heap_free( connection->datasource ); + if (str && !(source = wcsdup( str ))) return E_OUTOFMEMORY; + free( connection->datasource ); connection->datasource = source; return S_OK; } @@ -518,8 +517,8 @@ static HRESULT WINAPI connection_put_Provider( _Connection *iface, BSTR str )
if (!str) return MAKE_ADO_HRESULT(adErrInvalidArgument);
- if (!(provider = strdupW( str ))) return E_OUTOFMEMORY; - heap_free( connection->provider ); + if (!(provider = wcsdup( str ))) return E_OUTOFMEMORY; + free( connection->provider ); connection->provider = provider; return S_OK; } @@ -751,15 +750,16 @@ static HRESULT WINAPI connpoint_Advise( IConnectionPoint *iface, IUnknown *unk_s if (i == connpoint->sinks_size) { new_size = connpoint->sinks_size * 2; - if (!(tmp = heap_realloc_zero( connpoint->sinks, new_size * sizeof(*connpoint->sinks) ))) + if (!(tmp = realloc( connpoint->sinks, new_size * sizeof(*connpoint->sinks) ))) return E_OUTOFMEMORY; + memset( tmp + connpoint->sinks_size, 0, (new_size - connpoint->sinks_size) * sizeof(*connpoint->sinks) ); connpoint->sinks = tmp; connpoint->sinks_size = new_size; } } else { - if (!(connpoint->sinks = heap_alloc_zero( sizeof(*connpoint->sinks) ))) return E_OUTOFMEMORY; + if (!(connpoint->sinks = calloc( 1, sizeof(*connpoint->sinks) ))) return E_OUTOFMEMORY; connpoint->sinks_size = 1; i = 0; } @@ -860,7 +860,7 @@ HRESULT Connection_create( void **obj ) { struct connection *connection;
- if (!(connection = heap_alloc( sizeof(*connection) ))) return E_OUTOFMEMORY; + if (!(connection = malloc( sizeof(*connection) ))) return E_OUTOFMEMORY; connection->Connection_iface.lpVtbl = &connection_vtbl; connection->ISupportErrorInfo_iface.lpVtbl = &support_error_vtbl; connection->IConnectionPointContainer_iface.lpVtbl = &connpointcontainer_vtbl; @@ -869,9 +869,9 @@ HRESULT Connection_create( void **obj ) connection->state = adStateClosed; connection->timeout = 30; connection->datasource = NULL; - if (!(connection->provider = strdupW( L"MSDASQL" ))) + if (!(connection->provider = wcsdup( L"MSDASQL" ))) { - heap_free( connection ); + free( connection ); return E_OUTOFMEMORY; } connection->mode = adModeUnknown;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/msado15/recordset.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index 6d3b3ca352f..177938af2f7 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -26,7 +26,6 @@ #include "oledb.h"
#include "wine/debug.h" -#include "wine/heap.h"
#include "msado15_private.h"
@@ -102,8 +101,8 @@ static ULONG WINAPI field_Release( Field *iface ) if (!refs) { TRACE( "destroying %p\n", field ); - heap_free( field->name ); - heap_free( field ); + free( field->name ); + free( field ); } return refs; } @@ -591,14 +590,14 @@ static HRESULT Field_create( const WCHAR *name, LONG index, struct recordset *re { struct field *field;
- if (!(field = heap_alloc_zero( sizeof(*field) ))) return E_OUTOFMEMORY; + if (!(field = calloc( 1, sizeof(*field) ))) return E_OUTOFMEMORY; field->Field_iface.lpVtbl = &field_vtbl; field->ISupportErrorInfo_iface.lpVtbl = &field_supporterrorinfo_vtbl; field->Properties_iface.lpVtbl = &field_properties_vtbl; field->refs = 1; - if (!(field->name = strdupW( name ))) + if (!(field->name = wcsdup( name ))) { - heap_free( field ); + free( field ); return E_OUTOFMEMORY; } field->index = index; @@ -799,7 +798,7 @@ static BOOL resize_fields( struct fields *fields, ULONG count ) { Field **tmp; ULONG new_size = max( count, fields->allocated * 2 ); - if (!(tmp = heap_realloc( fields->field, new_size * sizeof(*tmp) ))) return FALSE; + if (!(tmp = realloc( fields->field, new_size * sizeof(*tmp) ))) return FALSE; fields->field = tmp; fields->allocated = new_size; } @@ -976,7 +975,7 @@ static HRESULT fields_create( struct recordset *recordset, struct fields **ret ) { struct fields *fields;
- if (!(fields = heap_alloc_zero( sizeof(*fields) ))) return E_OUTOFMEMORY; + if (!(fields = calloc( 1, sizeof(*fields) ))) return E_OUTOFMEMORY; fields->Fields_iface.lpVtbl = &fields_vtbl; fields->ISupportErrorInfo_iface.lpVtbl = &fields_supporterrorinfo_vtbl; fields->refs = 1; @@ -1034,7 +1033,7 @@ static void close_recordset( struct recordset *recordset ) for (col = 0; col < col_count; col++) VariantClear( &recordset->data[row * col_count + col] );
recordset->count = recordset->allocated = recordset->index = 0; - heap_free( recordset->data ); + free( recordset->data ); recordset->data = NULL; }
@@ -1047,7 +1046,7 @@ static ULONG WINAPI recordset_Release( _Recordset *iface ) { TRACE( "destroying %p\n", recordset ); close_recordset( recordset ); - heap_free( recordset ); + free( recordset ); } return refs; } @@ -1339,7 +1338,8 @@ static BOOL resize_recordset( struct recordset *recordset, ULONG row_count ) { VARIANT *tmp; ULONG count = max( row_count, recordset->allocated * 2 ); - if (!(tmp = heap_realloc_zero( recordset->data, count * row_size ))) return FALSE; + if (!(tmp = realloc( recordset->data, count * row_size ))) return FALSE; + memset( tmp + recordset->allocated, 0, (count - recordset->allocated) * row_size ); recordset->data = tmp; recordset->allocated = count; } @@ -2121,7 +2121,7 @@ HRESULT Recordset_create( void **obj ) { struct recordset *recordset;
- if (!(recordset = heap_alloc_zero( sizeof(*recordset) ))) return E_OUTOFMEMORY; + if (!(recordset = calloc( 1, sizeof(*recordset) ))) return E_OUTOFMEMORY; recordset->Recordset_iface.lpVtbl = &recordset_vtbl; recordset->ISupportErrorInfo_iface.lpVtbl = &recordset_supporterrorinfo_vtbl; recordset->ADORecordsetConstruction_iface.lpVtbl = &rsconstruction_vtbl;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/msado15/stream.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/msado15/stream.c b/dlls/msado15/stream.c index bd8d4972274..50833aecf34 100644 --- a/dlls/msado15/stream.c +++ b/dlls/msado15/stream.c @@ -25,7 +25,6 @@ #include "msado15_backcompat.h"
#include "wine/debug.h" -#include "wine/heap.h"
#include "msado15_private.h"
@@ -64,9 +63,9 @@ static ULONG WINAPI stream_Release( _Stream *iface ) if (!refs) { TRACE( "destroying %p\n", stream ); - heap_free( stream->charset ); - heap_free( stream->buf ); - heap_free( stream ); + free( stream->charset ); + free( stream->buf ); + free( stream ); } return refs; } @@ -183,7 +182,8 @@ static HRESULT resize_buffer( struct stream *stream, LONG size ) { BYTE *tmp; LONG new_size = max( size, stream->allocated * 2 ); - if (!(tmp = heap_realloc_zero( stream->buf, new_size ))) return E_OUTOFMEMORY; + if (!(tmp = realloc( stream->buf, new_size ))) return E_OUTOFMEMORY; + memset( tmp + stream->allocated, 0, new_size - stream->allocated ); stream->buf = tmp; stream->allocated = new_size; } @@ -289,8 +289,8 @@ static HRESULT WINAPI stream_put_Charset( _Stream *iface, BSTR charset )
TRACE( "%p, %s\n", stream, debugstr_w(charset) );
- if (!(str = strdupW( charset ))) return E_OUTOFMEMORY; - heap_free( stream->charset ); + if (!(str = wcsdup( charset ))) return E_OUTOFMEMORY; + free( stream->charset ); stream->charset = str; return S_OK; } @@ -360,7 +360,7 @@ static HRESULT WINAPI stream_Close( _Stream *iface )
if (stream->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
- heap_free( stream->buf ); + free( stream->buf ); stream->buf = NULL; stream->size = stream->allocated = stream->pos = 0;
@@ -539,7 +539,7 @@ HRESULT Stream_create( void **obj ) { struct stream *stream;
- if (!(stream = heap_alloc_zero( sizeof(*stream) ))) return E_OUTOFMEMORY; + if (!(stream = calloc( 1, sizeof(*stream) ))) return E_OUTOFMEMORY; stream->Stream_iface.lpVtbl = &stream_vtbl; stream->refs = 1; stream->type = adTypeText;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/msado15/msado15_private.h | 14 -------------- 1 file changed, 14 deletions(-)
diff --git a/dlls/msado15/msado15_private.h b/dlls/msado15/msado15_private.h index bb55eaaa3aa..71344934b95 100644 --- a/dlls/msado15/msado15_private.h +++ b/dlls/msado15/msado15_private.h @@ -26,20 +26,6 @@ HRESULT Connection_create( void ** ) DECLSPEC_HIDDEN; HRESULT Recordset_create( void ** ) DECLSPEC_HIDDEN; HRESULT Stream_create( void ** ) DECLSPEC_HIDDEN;
-static inline void *heap_realloc_zero( void *mem, SIZE_T len ) -{ - if (!mem) return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len ); - return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len ); -} - -static inline WCHAR *strdupW( const WCHAR *src ) -{ - WCHAR *dst; - if (!src) return NULL; - if ((dst = heap_alloc( (lstrlenW( src ) + 1) * sizeof(*dst) ))) lstrcpyW( dst, src ); - return dst; -} - typedef enum tid_t { ADORecordsetConstruction_tid, Command_tid,