James Hawkins : advpack:
Forward DelNodeRunDLL32A to its Unicode counterpart.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Apr 7 08:05:24 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 12a9ed0ade5e993cd419315cdf1d95146e8e9523
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=12a9ed0ade5e993cd419315cdf1d95146e8e9523
Author: James Hawkins <truiken at gmail.com>
Date: Fri Apr 7 05:28:17 2006 -0500
advpack: Forward DelNodeRunDLL32A to its Unicode counterpart.
---
dlls/advpack/advpack.spec | 2 +-
dlls/advpack/files.c | 43 ++++++++++++++++++++++++++++++++-----------
2 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/dlls/advpack/advpack.spec b/dlls/advpack/advpack.spec
index f94146c..2ba1057 100644
--- a/dlls/advpack/advpack.spec
+++ b/dlls/advpack/advpack.spec
@@ -9,7 +9,7 @@
@ stdcall DelNodeW(wstr long)
@ stdcall DelNode(str long) DelNodeA
@ stdcall DelNodeRunDLL32A(ptr ptr str long)
-# stdcall DelNodeRunDLL32W(ptr ptr wstr long)
+@ stdcall DelNodeRunDLL32W(ptr ptr wstr long)
@ stdcall DelNodeRunDLL32(ptr ptr str long) DelNodeRunDLL32A
@ stdcall -private DllMain(long long ptr)
@ stdcall DoInfInstall(ptr)
diff --git a/dlls/advpack/files.c b/dlls/advpack/files.c
index 565c600..1ad531c 100644
--- a/dlls/advpack/files.c
+++ b/dlls/advpack/files.c
@@ -454,14 +454,14 @@ HRESULT WINAPI DelNodeW( LPCWSTR pszFile
/* sequentially returns pointers to parameters in a parameter list
* returns NULL if the parameter is empty, e.g. one,,three */
-static LPSTR get_parameter(LPSTR *params, char separator)
+static LPWSTR get_parameter(LPWSTR *params, WCHAR separator)
{
- LPSTR token = *params;
+ LPWSTR token = *params;
if (!*params)
return NULL;
- *params = strchr(*params, separator);
+ *params = strchrW(*params, separator);
if (*params)
*(*params)++ = '\0';
@@ -474,6 +474,27 @@ static LPSTR get_parameter(LPSTR *params
/***********************************************************************
* DelNodeRunDLL32A (ADVPACK.@)
*
+ * See DelNodeRunDLL32W.
+ */
+HRESULT WINAPI DelNodeRunDLL32A(HWND hWnd, HINSTANCE hInst, LPSTR cmdline, INT show)
+{
+ UNICODE_STRING params;
+ HRESULT hr;
+
+ TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_a(cmdline), show);
+
+ RtlCreateUnicodeStringFromAsciiz(¶ms, cmdline);
+
+ hr = DelNodeRunDLL32W(hWnd, hInst, params.Buffer, show);
+
+ RtlFreeUnicodeString(¶ms);
+
+ return hr;
+}
+
+/***********************************************************************
+ * DelNodeRunDLL32W (ADVPACK.@)
+ *
* Deletes a file or directory, WinMain style.
*
* PARAMS
@@ -486,27 +507,27 @@ static LPSTR get_parameter(LPSTR *params
* Success: S_OK.
* Failure: E_FAIL.
*/
-HRESULT WINAPI DelNodeRunDLL32A( HWND hWnd, HINSTANCE hInst, LPSTR cmdline, INT show )
+HRESULT WINAPI DelNodeRunDLL32W(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
{
- LPSTR szFilename, szFlags;
- LPSTR cmdline_copy, cmdline_ptr;
+ LPWSTR szFilename, szFlags;
+ LPWSTR cmdline_copy, cmdline_ptr;
DWORD dwFlags = 0;
HRESULT res;
- TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_a(cmdline), show);
+ TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_w(cmdline), show);
- cmdline_copy = HeapAlloc(GetProcessHeap(), 0, lstrlenA(cmdline) + 1);
+ cmdline_copy = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(cmdline) + 1) * sizeof(WCHAR));
cmdline_ptr = cmdline_copy;
- lstrcpyA(cmdline_copy, cmdline);
+ lstrcpyW(cmdline_copy, cmdline);
/* get the parameters at indexes 0 and 1 respectively */
szFilename = get_parameter(&cmdline_ptr, ',');
szFlags = get_parameter(&cmdline_ptr, ',');
if (szFlags)
- dwFlags = atol(szFlags);
+ dwFlags = atolW(szFlags);
- res = DelNodeA(szFilename, dwFlags);
+ res = DelNodeW(szFilename, dwFlags);
HeapFree(GetProcessHeap(), 0, cmdline_copy);
More information about the wine-cvs
mailing list