Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- programs/wusa/main.c | 6 +++--- programs/wusa/manifest.c | 4 ++-- programs/wusa/wusa.h | 8 -------- 3 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/programs/wusa/main.c b/programs/wusa/main.c index 53534628c31..ef7302847cc 100644 --- a/programs/wusa/main.c +++ b/programs/wusa/main.c @@ -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) diff --git a/programs/wusa/manifest.c b/programs/wusa/manifest.c index efd2845c7e2..620da4fc63b 100644 --- a/programs/wusa/manifest.c +++ b/programs/wusa/manifest.c @@ -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); diff --git a/programs/wusa/wusa.h b/programs/wusa/wusa.h index da679a27f07..e61fc025e09 100644 --- a/programs/wusa/wusa.h +++ b/programs/wusa/wusa.h @@ -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;