From 69adbe2de2322fb9c12ea9295c57046edb9f08c5 Mon Sep 17 00:00:00 2001 From: "Nicholas \"Indy\" Ray" Date: Thu, 5 Sep 2019 11:39:19 -0700 Subject: [PATCH 1/3] Fix for the tracebuild sample not correctly parsing the response file, we end up skipping past the beginning of the argument causing the rest to fail. --- samples/tracebld/trcbld.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/tracebld/trcbld.cpp b/samples/tracebld/trcbld.cpp index 0573fd95..97360591 100644 --- a/samples/tracebld/trcbld.cpp +++ b/samples/tracebld/trcbld.cpp @@ -4266,7 +4266,7 @@ PWCHAR LoadCommandLine(PCWSTR pwz, PWCHAR pwzDst, PWCHAR pwzDstEnd) // More arguments! WCHAR wzPath[MAX_PATH]; PWCHAR pwzPath = wzPath; - PCWSTR pwzTmp = pwzArgBeg + 1; + PCWSTR pwzTmp = pwzArgBeg; while (pwzTmp < pwzArgEnd && pwzPath < wzPath + ARRAYSIZE(wzPath)-2) { *pwzPath++ = *pwzTmp++; } From b12a441a16ed5e2262e03afa5ef74cceddf67c5b Mon Sep 17 00:00:00 2001 From: "Nicholas \"Indy\" Ray" Date: Thu, 5 Sep 2019 11:41:19 -0700 Subject: [PATCH 2/3] Fix for logging output for command line arguments that overflow the buffer, we just send it over the line in fragments instead. --- samples/tracebld/trcbld.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/tracebld/trcbld.cpp b/samples/tracebld/trcbld.cpp index 97360591..c8896706 100644 --- a/samples/tracebld/trcbld.cpp +++ b/samples/tracebld/trcbld.cpp @@ -4496,11 +4496,15 @@ int WINAPI Mine_EntryPoint(VOID) FileNames::ParameterizeLine(pwzFin, pwzFin + wcNew); if (HasSpace(wzPath)) { - Tblog(""%le" %le\n", wzPath, pwzFin); + Tblog(""%le" ", wzPath); } else { - Tblog("%le %le\n", wzPath, pwzFin); + Tblog("%le", wzPath); } + for(PWCHAR pwzTmp = pwzFin; pwzTmp < pwzFin + wcNew; pwzTmp += 32764) { + Tblog("%le", pwzTmp); + } + Tblog("\n"); TestHandle("t:StdIn", GetStdHandle(STD_INPUT_HANDLE)); TestHandle("t:StdOut", GetStdHandle(STD_OUTPUT_HANDLE)); From 4cb773aef8540ade80fe40882dc7cb7db203885c Mon Sep 17 00:00:00 2001 From: "Nicholas \"Indy\" Ray" Date: Thu, 5 Sep 2019 11:54:15 -0700 Subject: [PATCH 3/3] Fix for missing space in output for unquoted commands. --- samples/tracebld/trcbld.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/tracebld/trcbld.cpp b/samples/tracebld/trcbld.cpp index c8896706..62a7cf4a 100644 --- a/samples/tracebld/trcbld.cpp +++ b/samples/tracebld/trcbld.cpp @@ -4499,7 +4499,7 @@ int WINAPI Mine_EntryPoint(VOID) Tblog(""%le" ", wzPath); } else { - Tblog("%le", wzPath); + Tblog("%le ", wzPath); } for(PWCHAR pwzTmp = pwzFin; pwzTmp < pwzFin + wcNew; pwzTmp += 32764) { Tblog("%le", pwzTmp);