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 <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
#include <winsock2.h>
#include <ws2tcpip.h>
+#include <windows.h>
+#include <shellapi.h>
extern "C" {
#include <afs/param.h>
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);
}
osi_LogEvent0("AFSCreds Main command line",pCmdLine);
fs_utils_InitMountRoot();
+
if (InitApp (pCmdLine))
{
MSG msg;
void Shortcut_Init (void)
{
- CoInitialize(0);
+ CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
}