20 #include <winpr/config.h>
22 #include <winpr/crt.h>
23 #include <winpr/path.h>
24 #include <winpr/file.h>
30 char* WLog_Message_GetOutputFileName(
int id,
const char* ext)
33 char* FilePath = NULL;
34 char* FileName = NULL;
35 char* FullFileName = NULL;
37 if (!(FileName = (
char*)malloc(256)))
40 FilePath = GetKnownSubPath(KNOWN_PATH_TEMP,
"wlog");
42 if (!winpr_PathFileExists(FilePath))
44 if (!winpr_PathMakePath(FilePath, NULL))
52 ProcessId = GetCurrentProcessId();
54 (void)sprintf_s(FileName, 256,
"%" PRIu32
"-%d.%s", ProcessId,
id, ext);
56 (
void)sprintf_s(FileName, 256,
"%" PRIu32
".%s", ProcessId, ext);
58 FullFileName = GetCombinedPath(FilePath, FileName);