This function is for use by MC-generated code and should not be used directly.
| 557 | #pragma warning(disable:6103) |
| 558 | // This function is for use by MC-generated code and should not be used directly. |
| 559 | DECLSPEC_NOINLINE __inline |
| 560 | ULONG __stdcall |
| 561 | McGenEventRegister( |
| 562 | _In_ LPCGUID ProviderId, |
| 563 | _In_opt_ _mcgen_PENABLECALLBACK EnableCallback, |
| 564 | _In_opt_ PVOID CallbackContext, |
| 565 | _Inout_ PREGHANDLE RegHandle |
| 566 | ) |
| 567 | /*++ |
| 568 | |
| 569 | Routine Description: |
| 570 | |
| 571 | This function registers the provider with ETW. |
| 572 | |
| 573 | Arguments: |
| 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 | |
| 583 | Remarks: |
| 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. |
no outgoing calls
no test coverage detected