MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / OpenLogFileHandle

Function OpenLogFileHandle

tools/sunshinesvc.cpp:119–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119HANDLE 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
133bool RunTerminationHelper(HANDLE console_token, DWORD pid) {
134 WCHAR module_path[MAX_PATH];

Callers 1

ServiceMainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected