This commit is contained in:
REDMOND\jingf 2022-04-20 07:15:35 -07:00
Родитель b63e9be950
Коммит 6db95cfc2d
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -500,6 +500,9 @@ void EventTraceHelper::Start()
{
return;
}
// Please refer to this link to understand why buffersize was setup in such a seemingly random manner:
// https://docs.microsoft.com/en-us/windows/win32/api/evntrace/ns-evntrace-event_trace_propertiesbuffersize
int bufferSize = sizeof(EVENT_TRACE_PROPERTIES) + (sizeof(LOGSESSION_NAME) + 1) * sizeof(wchar_t);
m_sessionProperties = static_cast<PEVENT_TRACE_PROPERTIES>(malloc(bufferSize));
ZeroMemory(m_sessionProperties, bufferSize);