summaryrefslogtreecommitdiff
path: root/gpg_wrapper.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-08-18 08:26:47 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-08-18 08:26:47 +0300
commit45ff7b504d79072bfbd24cf12f5818ed356f94bc (patch)
treeb3e51aa789863f95d48d5e3775216fa336911c9d /gpg_wrapper.cpp
parente07a374f12258c3798c9f49ea926db29f90d93ec (diff)
modified: gpg_wrapper.cpp
modified: init.cpp modified: main.cpp modified: messages.cpp modified: new_gpg.rc modified: new_gpg.sln modified: new_gpg.vcproj modified: options.cpp modified: resource.h modified: utilities.cpp
Diffstat (limited to 'gpg_wrapper.cpp')
-rw-r--r--gpg_wrapper.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/gpg_wrapper.cpp b/gpg_wrapper.cpp
index 566031f..8ff6631 100644
--- a/gpg_wrapper.cpp
+++ b/gpg_wrapper.cpp
@@ -20,6 +20,8 @@
pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD aexitcode)
{
+ extern bool bDebugLog;
+ extern fstream debuglog;
BOOL success;
STARTUPINFO sinfo = {0};
SECURITY_ATTRIBUTES sattrs = {0};
@@ -80,6 +82,12 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
mir_free(home_dir);
}
+ if(bDebugLog)
+ {
+ char* tmp = mir_utf8encodeW(commandline.c_str());
+ debuglog<<"in: "<<tmp<<"\n";
+ mir_free(tmp);
+ }
success = CreateProcess(NULL, (TCHAR*)commandline.c_str(), NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &sinfo, &pri);
if (!success)
@@ -109,6 +117,12 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
}
storeOutput(readstdout,aoutput);
+
+ if(bDebugLog)
+ {
+ debuglog<<"out: "<<aoutput->c_str()<<"\n";
+ }
+
WaitForSingleObject(pri.hProcess,INFINITE);
CloseHandle(pri.hThread);