| 117 | } |
| 118 | |
| 119 | HANDLE OpenLogFileHandle() { |
| 120 | WCHAR log_file_name[MAX_PATH]; |
| 121 | |
| 122 | // Create sunshine.log in the Temp folder (usually %SYSTEMROOT%\Temp) |
| 123 | GetTempPathW(_countof(log_file_name), log_file_name); |
| 124 | wcscat_s(log_file_name, L"sunshine.log"); |
| 125 | |
| 126 | // The file handle must be inheritable for our child process to use it |
| 127 | SECURITY_ATTRIBUTES security_attributes = {sizeof(security_attributes), nullptr, TRUE}; |
| 128 | |
| 129 | // Overwrite the old sunshine.log |
| 130 | return CreateFileW(log_file_name, GENERIC_WRITE, FILE_SHARE_READ, &security_attributes, CREATE_ALWAYS, 0, nullptr); |
| 131 | } |
| 132 | |
| 133 | bool RunTerminationHelper(HANDLE console_token, DWORD pid) { |
| 134 | WCHAR module_path[MAX_PATH]; |