X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=rostests%2Frosautotest%2Fwinetests.c;h=710939d2a6f0d734b6d161153ea372029aaef98b;hp=5ab622a558271d7fa4045759b412236d409392fa;hb=0cedc2a03cda4c4193887c6069c05717be945d3e;hpb=0330519da7db7b0eeb4bcd43f1d19acd2720d890 diff --git a/rostests/rosautotest/winetests.c b/rostests/rosautotest/winetests.c index 5ab622a5582..710939d2a6f 100644 --- a/rostests/rosautotest/winetests.c +++ b/rostests/rosautotest/winetests.c @@ -49,13 +49,14 @@ IntRunTest(PWSTR CommandLine, HANDLE hReadPipe, LPSTARTUPINFOW StartupInfo, PWIN LogLength = BUFFER_BLOCKSIZE; } - /* Execute the test */ - StringOut("Running Wine Test, Module: "); - StringOut(GetSuiteIDData->Module); - StringOut(", Test: "); - StringOut(GetSuiteIDData->Test); - StringOut("\n"); + /* Allocate a buffer with the exact size of the output string. + We have to output this string in one call to prevent a race condition, when another application also outputs a string over the debug line. */ + Buffer = HeapAlloc(hProcessHeap, 0, 27 + strlen(GetSuiteIDData->Module) + 8 + strlen(GetSuiteIDData->Test) + 2); + sprintf(Buffer, "Running Wine Test, Module: %s, Test: %s\n", GetSuiteIDData->Module, GetSuiteIDData->Test); + StringOut(Buffer); + HeapFree(hProcessHeap, 0, Buffer); + /* Execute the test */ if(!CreateProcessW(NULL, CommandLine, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, StartupInfo, &ProcessInfo)) { StringOut("CreateProcessW for running the test failed\n");