Provides a callback function that is guaranteed to be called when a common language runtime (CLR) version is first loaded, but not yet started. This method supersedes the LockClrVersion function.
The callback works in the following way:
The callback is invoked only when a runtime is loaded for the first time.
The callback is not invoked for reentrant loads of the same runtime.
For non-reentrant runtime loads, calls to the callback function are serialized.
The callback function has the following prototype:
typedef void (__stdcall *RuntimeLoadedCallbackFnPtr)( ICLRRuntimeInfo *pRuntimeInfo, CallbackThreadSetFnPtr pfnCallbackThreadSet, CallbackThreadUnsetFnPtr pfnCallbackThreadUnset);
The callback function prototypes are as follows:
typedef HRESULT (__stdcall *CallbackThreadSetFnPtr)();
typedef HRESULT (__stdcall *CallbackThreadUnsetFnPtr)();
If the host intends to load or cause another runtime to be loaded in a reentrant manner, the pfnCallbackThreadSet and pfnCallbackThreadUnset parameters that are provided in the callback function must be used in the following way:
pfnCallbackThreadSet must be called by the thread that might cause a runtime load before such a load is attempted.
pfnCallbackThreadUnset must be called when the thread will no longer cause such a runtime load (and before returning from the initial callback).
pfnCallbackThreadSet and pfnCallbackThreadUnset are both non-reentrant.
Host applications must not call pfnCallbackThreadSet and pfnCallbackThreadUnset outside the scope of the pCallbackFunction parameter.
Platforms: See .NET Framework System Requirements.
Library: Included as a resource in MSCorEE.dll
.NET Framework Versions: 4.5, 4