MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / McGenEventRegister

Function McGenEventRegister

system/lib/mimalloc/src/prim/windows/etw.h:559–604  ·  view source on GitHub ↗

This function is for use by MC-generated code and should not be used directly.

Source from the content-addressed store, hash-verified

557#pragma warning(disable:6103)
558// This function is for use by MC-generated code and should not be used directly.
559DECLSPEC_NOINLINE __inline
560ULONG __stdcall
561McGenEventRegister(
562 _In_ LPCGUID ProviderId,
563 _In_opt_ _mcgen_PENABLECALLBACK EnableCallback,
564 _In_opt_ PVOID CallbackContext,
565 _Inout_ PREGHANDLE RegHandle
566 )
567/*++
568
569Routine Description:
570
571 This function registers the provider with ETW.
572
573Arguments:
574
575 ProviderId - Provider ID to register with ETW.
576
577 EnableCallback - Callback to be used.
578
579 CallbackContext - Context for the callback.
580
581 RegHandle - Pointer to registration handle.
582
583Remarks:
584
585 Should not be called if the provider is already registered (i.e. should not
586 be called if *RegHandle != 0). Repeatedly registering a provider is a bug
587 and may indicate a race condition. However, for compatibility with previous
588 behavior, this function will return SUCCESS in this case.
589
590--*/
591{
592 ULONG Error;
593
594 if (*RegHandle != 0)
595 {
596 Error = 0; // ERROR_SUCCESS
597 }
598 else
599 {
600 Error = MCGEN_EVENTREGISTER(ProviderId, EnableCallback, CallbackContext, RegHandle);
601 }
602
603 return Error;
604}
605#pragma warning(pop)
606
607// This macro is for use by MC-generated code and should not be used directly.

Calls

no outgoing calls

Tested by

no test coverage detected