From: Jeffrey Altman Date: Thu, 22 Oct 2009 14:27:41 +0000 (-0400) Subject: Windows: no longer use WinExec in afscreds X-Git-Tag: openafs-devel-1_5_66~9 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=234acbbb84534c5327bb69a2fcb7675dcd0d1198;p=packages%2Fo%2Fopenafs.git Windows: no longer use WinExec in afscreds WinExec is a compatibility interface for 16-bit applications. It is not compatible with Windows 7. Replace it with ShellExecuteEx. LICENSE MIT Reviewed-on: http://gerrit.openafs.org/714 Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- diff --git a/src/WINNT/client_creds/advtab.cpp b/src/WINNT/client_creds/advtab.cpp index 58256f9b3..ee208ab71 100644 --- a/src/WINNT/client_creds/advtab.cpp +++ b/src/WINNT/client_creds/advtab.cpp @@ -9,6 +9,8 @@ #include #include +#include +#include extern "C" { #include @@ -289,7 +291,14 @@ void Advanced_OnChangeService (HWND hDlg, WORD wCmd) void Advanced_OnOpenCPL (HWND hDlg) { - WinExec ("afs_config.exe", SW_SHOW); + SHELLEXECUTEINFO shellExecInfo; + + memset(&shellExecInfo, 0, sizeof(shellExecInfo)); + shellExecInfo.cbSize = sizeof(shellExecInfo); + shellExecInfo.nShow = SW_SHOWNORMAL; + shellExecInfo.hwnd = hDlg; + shellExecInfo.lpFile = "afs_config.exe"; + ShellExecuteEx(&shellExecInfo); } diff --git a/src/WINNT/client_creds/main.cpp b/src/WINNT/client_creds/main.cpp index 26b598e08..db8cc805b 100644 --- a/src/WINNT/client_creds/main.cpp +++ b/src/WINNT/client_creds/main.cpp @@ -68,6 +68,7 @@ extern "C" int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR pCmdLine, osi_LogEvent0("AFSCreds Main command line",pCmdLine); fs_utils_InitMountRoot(); + if (InitApp (pCmdLine)) { MSG msg; diff --git a/src/WINNT/client_creds/shortcut.cpp b/src/WINNT/client_creds/shortcut.cpp index 3ef523a34..904d9a12c 100644 --- a/src/WINNT/client_creds/shortcut.cpp +++ b/src/WINNT/client_creds/shortcut.cpp @@ -35,7 +35,7 @@ extern "C" { void Shortcut_Init (void) { - CoInitialize(0); + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); }