MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / EnableCallback

Function EnableCallback

Provider/PresentMonProvider.cpp:114–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void __stdcall EnableCallback(
115 LPCGUID, // SourceId
116 ULONG ControlCode,
117 UCHAR Level,
118 ULONGLONG MatchAnyKeyword,
119 ULONGLONG MatchAllKeyword,
120 PEVENT_FILTER_DESCRIPTOR, // FilterData
121 PVOID CallbackContext)
122{
123 auto ctxt = (PresentMonProvider*) CallbackContext;
124 if (ctxt != nullptr) {
125 switch (ControlCode) {
126 case EVENT_CONTROL_CODE_ENABLE_PROVIDER:
127 ctxt->EnableBits = 0;
128 if (Level == 0 || Level >= TRACE_LEVEL_INFORMATION) {
129 for (uint32_t i = 0; i < Event_Count; ++i) {
130 ULONG bit = KeywordIsEnabled(EventDescriptor[i].Keyword, MatchAnyKeyword, MatchAllKeyword) ? 1u : 0u;
131 ctxt->EnableBits |= (bit << i);
132 }
133 }
134 break;
135
136 case EVENT_CONTROL_CODE_DISABLE_PROVIDER:
137 ctxt->EnableBits = 0;
138 break;
139 }
140 }
141}
142
143void FillDesc(EVENT_DATA_DESCRIPTOR*) {}
144

Callers

nothing calls this directly

Calls 1

KeywordIsEnabledFunction · 0.85

Tested by

no test coverage detected