Commit 7e446ce7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wusa: Remove string duplication helper.

parent 76fa97cd
......@@ -166,7 +166,7 @@ static BOOL create_directory(const WCHAR *path)
static BOOL create_parent_directory(const WCHAR *filename)
{
WCHAR *p, *path = strdupW(filename);
WCHAR *p, *path = wcsdup(filename);
BOOL ret = FALSE;
if (!path) return FALSE;
......@@ -430,7 +430,7 @@ static struct assembly_entry *lookup_assembly(struct list *manifest_list, struct
static WCHAR *get_assembly_source(struct assembly_entry *assembly)
{
WCHAR *p, *path = strdupW(assembly->filename);
WCHAR *p, *path = wcsdup(assembly->filename);
if (path && (p = wcsrchr(path, '.'))) *p = 0;
return path;
}
......@@ -527,7 +527,7 @@ static WCHAR *lookup_expression(struct assembly_entry *assembly, const WCHAR *ke
if (!wcsicmp(key, L"runtime.inf")) wcscat(path, L"\\inf");
else if (!wcsicmp(key, L"runtime.drivers")) wcscat(path, L"\\drivers");
else if (!wcsicmp(key, L"runtime.wbem")) wcscat(path, L"\\wbem");
return strdupW(path);
return wcsdup(path);
}
static WCHAR *expand_expression(struct assembly_entry *assembly, const WCHAR *expression)
......
......@@ -160,7 +160,7 @@ static WCHAR *get_xml_attribute(IXMLDOMElement *root, const WCHAR *name)
VariantInit(&var);
if (SUCCEEDED(IXMLDOMElement_getAttribute(root, bstr, &var)))
{
ret = (V_VT(&var) == VT_BSTR) ? strdupW(V_BSTR(&var)) : NULL;
ret = (V_VT(&var) == VT_BSTR) ? wcsdup(V_BSTR(&var)) : NULL;
VariantClear(&var);
}
SysFreeString(bstr);
......@@ -554,7 +554,7 @@ struct assembly_entry *load_manifest(const WCHAR *filename)
if ((entry = alloc_assembly()))
{
entry->filename = strdupW(filename);
entry->filename = wcsdup(filename);
entry->displayname = get_xml_attribute(root, L"displayName");
if (iter_assembly(root, entry)) goto done;
free_assembly(entry);
......
......@@ -100,14 +100,6 @@ static inline WCHAR *strdupAtoW(const char *str)
return ret;
}
static inline WCHAR *strdupW(const WCHAR *str)
{
WCHAR *ret;
if (!str) return NULL;
if ((ret = malloc((lstrlenW(str) + 1) * sizeof(WCHAR)))) lstrcpyW(ret, str);
return ret;
}
static inline WCHAR *strdupWn(const WCHAR *str, DWORD len)
{
WCHAR *ret;
......
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