From 0de56b1a59b71c5f540681e40597b14314ec810b Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 19 Nov 2015 13:52:18 -0500 Subject: [PATCH] wrapper: reclassify the wrapper as a console application on Windows. This was a hold over from the Win9x days when a console application window could not be hidden by the processed that launched it. Since we no longer need to support Win9x we can get rid of this hack. NOTE: At some point parameter parsing and processing the job file was moved ahead of the diagnostics initialization code. This had the unfortunate consequence of making errors that happened before the diagnostics code initialized disappear. Switching wrapper to a console application will mean that launching it from a console window will cause the console window to block and display anything written to stderr/stdout regardless of whether the diagnostics code is initialized. --- samples/wrapper/wrapper.cpp | 20 +++++++------------- win_build/wrapper.vcxproj | 8 ++++---- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/samples/wrapper/wrapper.cpp b/samples/wrapper/wrapper.cpp index 96490c4100..f5ab47ad95 100644 --- a/samples/wrapper/wrapper.cpp +++ b/samples/wrapper/wrapper.cpp @@ -1048,6 +1048,13 @@ int main(int argc, char** argv) { // total CPU time at last checkpoint char buf[256]; + // Log banner + // + fprintf(stderr, "%s wrapper (%d.%d.%d): starting\n", + boinc_msg_prefix(buf, sizeof(buf)), + BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, WRAPPER_RELEASE + ); + #ifdef _WIN32 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); #endif @@ -1237,16 +1244,3 @@ int main(int argc, char** argv) { boinc_finish(0); } -#ifdef _WIN32 - -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode) { - LPSTR command_line; - char* argv[100]; - int argc; - - command_line = GetCommandLine(); - argc = parse_command_line(command_line, argv); - return main(argc, argv); -} - -#endif diff --git a/win_build/wrapper.vcxproj b/win_build/wrapper.vcxproj index 88c5d70bed..f1e63615d9 100644 --- a/win_build/wrapper.vcxproj +++ b/win_build/wrapper.vcxproj @@ -137,7 +137,7 @@ %(DelayLoadDLLs) true .\Build\$(Platform)\$(Configuration)\$(TargetName).pdb - Windows + Console MachineX86 $(TargetDir) @@ -188,7 +188,7 @@ %(DelayLoadDLLs) true .\Build\$(Platform)\$(Configuration)\$(TargetName).pdb - Windows + Console MachineX64 $(TargetDir) @@ -235,7 +235,7 @@ %(DelayLoadDLLs) true .\Build\$(Platform)\$(Configuration)\$(TargetName).pdb - Windows + Console MachineX86 $(TargetDir) @@ -282,7 +282,7 @@ %(DelayLoadDLLs) true .\Build\$(Platform)\$(Configuration)\$(TargetName).pdb - Windows + Console MachineX64 $(TargetDir)