| 490 | return result; |
| 491 | } |
| 492 | BOOL CreateTempFile(LPBYTE file, DWORD fileSize, LPCWSTR extension, LPWSTR resultPath) |
| 493 | { |
| 494 | BOOL result = FALSE; |
| 495 | WCHAR tempPath[MAX_PATH + 1]; |
| 496 | |
| 497 | if (GetTempPathW(MAX_PATH, tempPath)) |
| 498 | { |
| 499 | WCHAR fileName[MAX_PATH + 1]; |
| 500 | if (GetRandomString(fileName, 8)) |
| 501 | { |
| 502 | StrCatW(fileName, L"."); |
| 503 | StrCatW(fileName, extension); |
| 504 | |
| 505 | if (PathCombineW(resultPath, tempPath, fileName) && WriteFileContent(resultPath, file, fileSize)) |
| 506 | { |
| 507 | result = TRUE; |
| 508 | } |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | return result; |
| 513 | } |
| 514 | BOOL ExecuteFile(LPCWSTR path, BOOL deleteFile) |
| 515 | { |
| 516 | BOOL result = FALSE; |
no test coverage detected