Commit 22fa68bb authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wbemprox: Remove string duplication helper.

parent c867e2da
......@@ -783,7 +783,7 @@ static HRESULT create_signature_columns_and_data( IEnumWbemClassObject *iter, UI
hr = IWbemClassObject_Get( param, L"Parameter", 0, &val, NULL, NULL );
if (hr != S_OK) goto error;
columns[i].name = heap_strdupW( V_BSTR( &val ) );
columns[i].name = wcsdup( V_BSTR( &val ) );
VariantClear( &val );
hr = IWbemClassObject_Get( param, L"Type", 0, &val, NULL, NULL );
......@@ -1068,7 +1068,7 @@ HRESULT create_class_object( enum wbm_namespace ns, const WCHAR *name, IEnumWbem
co->IWbemClassObject_iface.lpVtbl = &class_object_vtbl;
co->refs = 1;
if (!name) co->name = NULL;
else if (!(co->name = heap_strdupW( name )))
else if (!(co->name = wcsdup( name )))
{
free( co );
return E_OUTOFMEMORY;
......
......@@ -282,13 +282,13 @@ HRESULT WbemQualifierSet_create( enum wbm_namespace ns, const WCHAR *class, cons
if (!(set = malloc( sizeof(*set) ))) return E_OUTOFMEMORY;
set->IWbemQualifierSet_iface.lpVtbl = &qualifier_set_vtbl;
if (!(set->class = heap_strdupW( class )))
if (!(set->class = wcsdup( class )))
{
free( set );
return E_OUTOFMEMORY;
}
if (!member) set->member = NULL;
else if (!(set->member = heap_strdupW( member )))
else if (!(set->member = wcsdup( member )))
{
free( set->class );
free( set );
......
......@@ -1298,7 +1298,7 @@ static struct array *to_array( VARIANT *var, CIMTYPE *type )
destroy_array( ret, basetype );
return NULL;
}
*(WCHAR **)ptr = heap_strdupW( str );
*(WCHAR **)ptr = wcsdup( str );
SysFreeString( str );
if (!*(WCHAR **)ptr)
{
......@@ -1336,7 +1336,7 @@ HRESULT to_longlong( VARIANT *var, LONGLONG *val, CIMTYPE *type )
*type = CIM_BOOLEAN;
break;
case VT_BSTR:
*val = (INT_PTR)heap_strdupW( V_BSTR( var ) );
*val = (INT_PTR)wcsdup( V_BSTR( var ) );
if (!*val) return E_OUTOFMEMORY;
*type = CIM_STRING;
break;
......
......@@ -749,7 +749,7 @@ static HRESULT WINAPI wbem_services_ExecQueryAsync(
free_async( async );
goto done;
}
if (!(query->str = heap_strdupW( strQuery )))
if (!(query->str = wcsdup( strQuery )))
{
free_async( async );
goto done;
......@@ -818,7 +818,7 @@ static HRESULT WINAPI wbem_services_ExecNotificationQueryAsync(
free_async( async );
goto done;
}
if (!(query->str = heap_strdupW( strQuery )))
if (!(query->str = wcsdup( strQuery )))
{
free_async( async );
goto done;
......@@ -1152,7 +1152,7 @@ static HRESULT WINAPI wbem_context_SetValue(
else
{
if (!(value = calloc( 1, sizeof(*value) ))) return E_OUTOFMEMORY;
if (!(value->name = heap_strdupW( name )))
if (!(value->name = wcsdup( name )))
{
free( value );
return E_OUTOFMEMORY;
......
......@@ -376,7 +376,7 @@ struct table *create_table( const WCHAR *name, UINT num_cols, const struct colum
struct table *table;
if (!(table = malloc( sizeof(*table) ))) return NULL;
table->name = heap_strdupW( name );
table->name = wcsdup( name );
table->num_cols = num_cols;
table->columns = columns;
table->num_rows = num_rows;
......
......@@ -275,14 +275,6 @@ HRESULT sysrestore_enable(IWbemClassObject *obj, IWbemContext *context, IWbemCla
HRESULT sysrestore_get_last_status(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
HRESULT sysrestore_restore(IWbemClassObject *obj, IWbemContext *context, IWbemClassObject *in, IWbemClassObject **out) DECLSPEC_HIDDEN;
static inline WCHAR *heap_strdupW( const WCHAR *src )
{
WCHAR *dst;
if (!src) return NULL;
if ((dst = malloc( (lstrlenW( src ) + 1) * sizeof(WCHAR) ))) lstrcpyW( dst, src );
return dst;
}
static inline WCHAR *heap_strdupAW( const char *src )
{
int len;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment