Commit c6932e24 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

localspl: Use the wcsdup function instead of reimplementing it.

parent 26be4fb9
...@@ -276,24 +276,6 @@ static const DWORD di_sizeof[] = {0, sizeof(DRIVER_INFO_1W), sizeof(DRIVER_INFO_ ...@@ -276,24 +276,6 @@ static const DWORD di_sizeof[] = {0, sizeof(DRIVER_INFO_1W), sizeof(DRIVER_INFO_
/****************************************************************** /******************************************************************
* strdupW [internal]
*
* create a copy of a unicode-string
*
*/
static LPWSTR strdupW(LPCWSTR p)
{
LPWSTR ret;
DWORD len;
if(!p) return NULL;
len = (wcslen(p) + 1) * sizeof(WCHAR);
ret = malloc(len);
if (ret) memcpy(ret, p, len);
return ret;
}
/******************************************************************
* apd_copyfile [internal] * apd_copyfile [internal]
* *
* Copy a file from the driverdirectory to the versioned directory * Copy a file from the driverdirectory to the versioned directory
...@@ -618,8 +600,8 @@ static monitor_t * monitor_load(LPCWSTR name, LPWSTR dllname) ...@@ -618,8 +600,8 @@ static monitor_t * monitor_load(LPCWSTR name, LPWSTR dllname)
WARN("%s not found\n", debugstr_w(regroot)); WARN("%s not found\n", debugstr_w(regroot));
} }
pm->name = strdupW(name); pm->name = wcsdup(name);
pm->dllname = strdupW(driver); pm->dllname = wcsdup(driver);
if ((name && (!regroot || !pm->name)) || !pm->dllname) { if ((name && (!regroot || !pm->name)) || !pm->dllname) {
monitor_unload(pm); monitor_unload(pm);
...@@ -1427,10 +1409,10 @@ static HANDLE printer_alloc_handle(LPCWSTR name, LPPRINTER_DEFAULTSW pDefault) ...@@ -1427,10 +1409,10 @@ static HANDLE printer_alloc_handle(LPCWSTR name, LPPRINTER_DEFAULTSW pDefault)
if (!printer) goto end; if (!printer) goto end;
/* clone the base name. This is NULL for the printserver */ /* clone the base name. This is NULL for the printserver */
printer->printername = strdupW(printername); printer->printername = wcsdup(printername);
/* clone the full name */ /* clone the full name */
printer->name = strdupW(name); printer->name = wcsdup(name);
if (name && (!printer->name)) { if (name && (!printer->name)) {
printer_free(printer); printer_free(printer);
printer = NULL; printer = NULL;
......
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