MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / ComFlagsToString

Method ComFlagsToString

WinArk/FormatHelper.cpp:282–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282CString FormatHelper::ComFlagsToString(ComFlags flags) {
283 static const struct {
284 ComFlags Flag;
285 PCWSTR Name;
286 } sflags[] = {
287 { ComFlags::LocalTid, L"Local TID" },
288 { ComFlags::UuidInitialized, L"GUID Initialized" },
289 { ComFlags::InThreadDetach, L"In Thread Detach" },
290 { ComFlags::ChannelInitialized, L"Channel Initialized" },
291 { ComFlags::WowThread, L"Wow Thread" },
292 { ComFlags::ThreadUninitializing, L"Thread Uninitializing" },
293 { ComFlags::DisableOle1DDE, L"Disable Ole1 DDE" },
294 { ComFlags::STA, L"STA" },
295 { ComFlags::MTA, L"MTA" },
296 { ComFlags::Impersonating, L"Impersonating" },
297 { ComFlags::DisableEventLogger, L"Disable Event Logger" },
298 { ComFlags::InNeutralApartment, L"In NA" },
299 { ComFlags::DispatchThread, L"Disptach Thread" },
300 { ComFlags::HostThread, L"Host Thread" },
301 { ComFlags::AllowCoInit, L"Allow CoInit" },
302 { ComFlags::PendingUninit, L"Pending Uninit" },
303 { ComFlags::FirstMTAInit, L"First MTA Init" },
304 { ComFlags::FirstNTAInit, L"First TNA Init" },
305 { ComFlags::ApartmentInitializing, L"Apt Initializing" },
306 { ComFlags::UIMessageInModalLoop, L"UI Msg in Modal Loop" },
307 { ComFlags::MarshallingErrorObject, L"Marshaling Error Object" },
308 { ComFlags::WinRTInitialize, L"WinRT Init" },
309 { ComFlags::ASTA, L"ASTA" },
310 { ComFlags::InShutdownCallbacks, L"In Shutdown Callbacks" },
311 { ComFlags::PointerInputBlocked, L"Pointer Input Blocked" },
312 { ComFlags::InActivationFilter, L"In Activation Filter" },
313 { ComFlags::ASTAtoASTAExempQuirk, L"ASTA to STA Exep Quirk" },
314 { ComFlags::ASTAtoASTAExempProxy, L"ASTA to STA Exep Proxy" },
315 { ComFlags::ASTAtoASTAExempIndoubt, L"ASTA to STA Exep In Doubt" },
316 { ComFlags::DetectedUserInit, L"Detect User Init" },
317 { ComFlags::BridgeSTA, L"Bridge STA" },
318 { ComFlags::MainInitializing, L"Main Initializing" },
319 };
320
321 CString result;
322 for (const auto& attr : sflags)
323 if ((attr.Flag & flags) == attr.Flag)
324 (result += attr.Name) += ", ";
325
326 if (!result.IsEmpty())
327 result = result.Left(result.GetLength() - 2);
328 return result;
329}
330
331PCWSTR FormatHelper::ComApartmentToString(ComFlags flags) {
332 if (flags == ComFlags::Error)

Callers

nothing calls this directly

Calls 2

IsEmptyMethod · 0.80
GetLengthMethod · 0.45

Tested by

no test coverage detected