| 110 | file_ = file::TempFile::AdoptExisting(logFilePath); |
| 111 | } |
| 112 | file::TempFile EtwLogSession::Finish() |
| 113 | { |
| 114 | if (Empty()) { |
| 115 | throw Except<Exception>("cannot finish empty etw log session"); |
| 116 | } |
| 117 | if (auto sta = ControlTraceW(hTraceSession_, traceProps_.LoggerName, &traceProps_, EVENT_TRACE_CONTROL_STOP); |
| 118 | sta != ERROR_SUCCESS) { |
| 119 | pmlog_error("Failed to stop ETL log session").hr(sta); |
| 120 | } |
| 121 | hTraceSession_ = 0; |
| 122 | return std::move(file_); |
| 123 | } |
| 124 | EtwLogSession::~EtwLogSession() |
| 125 | { |
| 126 | if (!Empty()) { |