diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-12 21:19:08 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-12 21:19:08 +0300 |
commit | 07bff43c1ee8ffb1e19dc2ed6419f602c0053f56 (patch) | |
tree | bf349ae8a0acc329b0bb738fca0342197894b569 /gpg_wrapper.cpp | |
parent | 82e4196bfcfe5fa976ef602f54fbaf82d3854f6d (diff) |
modified: gpg_wrapper.cpp
modified: gpg_wrapper.h
modified: main.cpp
modified: messages.cpp
modified: options.cpp
Diffstat (limited to 'gpg_wrapper.cpp')
-rw-r--r-- | gpg_wrapper.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/gpg_wrapper.cpp b/gpg_wrapper.cpp index b9e9029..53f06dc 100644 --- a/gpg_wrapper.cpp +++ b/gpg_wrapper.cpp @@ -18,7 +18,7 @@ //thx gpg module from Harald Treder, Zakhar V. Bardymov
-pxResult pxExecute(TCHAR *acommandline, char *ainput, string *aoutput, LPDWORD aexitcode)
+pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD aexitcode)
{
BOOL success;
STARTUPINFO sinfo = {0};
@@ -39,8 +39,7 @@ pxResult pxExecute(TCHAR *acommandline, char *ainput, string *aoutput, LPDWORD a return pxNotFound;
}
}
- TCHAR *home_dir = UniGetContactSettingUtf(NULL, szModuleName, "szHomePath", _T(""));
- TCHAR commandline[4096] = {0};
+ wstring commandline;
sattrs.nLength=sizeof(SECURITY_ATTRIBUTES);
sattrs.bInheritHandle=TRUE;
@@ -70,19 +69,18 @@ pxResult pxExecute(TCHAR *acommandline, char *ainput, string *aoutput, LPDWORD a sinfo.hStdInput=newstdin;
{ //form initial command
- _tcscpy(commandline, _T("\""));
- _tcscat(commandline, bin_path);
- _tcscat(commandline, _T("\""));
- _tcscat(commandline, _T(" --homedir"));
- _tcscat(commandline, _T(" \""));
- _tcscat(commandline, home_dir);
- _tcscat(commandline, _T("\" "));
- _tcscat(commandline, acommandline);
+ commandline += _T("\"");
+ commandline += bin_path;
+ commandline += _T("\" --homedir \"");
+ TCHAR *home_dir = UniGetContactSettingUtf(NULL, szModuleName, "szHomePath", _T(""));
+ commandline += home_dir;
+ commandline += _T("\" ");
+ commandline += *acommandline;
mir_free(bin_path);
mir_free(home_dir);
}
- success = CreateProcess(NULL, commandline, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &sinfo, &pri);
+ success = CreateProcess(NULL, (TCHAR*)commandline.c_str(), NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &sinfo, &pri);
if (!success)
{
|