https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cc8b2717ae8dce0fff79d…
commit cc8b2717ae8dce0fff79d2b601c78d683f32027d
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Jun 25 02:46:06 2018 +0900
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Jun 24 19:46:06 2018 +0200
[SHELL32] Implement OpenAs_RunDLLA/W (#628)
CORE-14751
---
dll/win32/shell32/shlexec.cpp | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp
index bfbec4b704..67c10f317c 100644
--- a/dll/win32/shell32/shlexec.cpp
+++ b/dll/win32/shell32/shlexec.cpp
@@ -3,6 +3,7 @@
*
* Copyright 1998 Marcus Meissner
* Copyright 2002 Eric Pouech
+ * Copyright 2018 Katayama Hirofumi MZ
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -2288,17 +2289,32 @@ EXTERN_C HINSTANCE WINAPI WOWShellExecute(HWND hWnd, LPCSTR
lpVerb, LPCSTR lpFil
}
/*************************************************************************
- * OpenAs_RunDLLA [SHELL32.@]
+ * OpenAs_RunDLLW [SHELL32.@]
*/
-EXTERN_C void WINAPI OpenAs_RunDLLA(HWND hwnd, HINSTANCE hinst, LPCSTR cmdline, int
cmdshow)
+EXTERN_C void WINAPI
+OpenAs_RunDLLW(HWND hwnd, HINSTANCE hinst, LPCWSTR cmdline, int cmdshow)
{
- FIXME("%p, %p, %s, %d\n", hwnd, hinst, debugstr_a(cmdline), cmdshow);
+ OPENASINFO info;
+ TRACE("%p, %p, %s, %d\n", hwnd, hinst, debugstr_w(cmdline), cmdshow);
+
+ ZeroMemory(&info, sizeof(info));
+ info.pcszFile = cmdline;
+ info.pcszClass = NULL;
+ info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT | OAIF_EXEC;
+
+ SHOpenWithDialog(hwnd, &info);
}
/*************************************************************************
- * OpenAs_RunDLLW [SHELL32.@]
+ * OpenAs_RunDLLA [SHELL32.@]
*/
-EXTERN_C void WINAPI OpenAs_RunDLLW(HWND hwnd, HINSTANCE hinst, LPCWSTR cmdline, int
cmdshow)
+EXTERN_C void WINAPI
+OpenAs_RunDLLA(HWND hwnd, HINSTANCE hinst, LPCSTR cmdline, int cmdshow)
{
- FIXME("%p, %p, %s, %d\n", hwnd, hinst, debugstr_w(cmdline), cmdshow);
+ LPWSTR pszCmdLineW = NULL;
+ TRACE("%p, %p, %s, %d\n", hwnd, hinst, debugstr_a(cmdline), cmdshow);
+
+ __SHCloneStrAtoW(&pszCmdLineW, cmdline);
+ OpenAs_RunDLLW(hwnd, hinst, pszCmdLineW, cmdshow);
+ SHFree(pszCmdLineW);
}