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.
HRESULT RequestRuntimeLoadedNotification ( [in] RuntimeLoadedCallbackFnPtr pCallbackFunction);
[in] The callback function that is invoked when a new runtime has been loaded.
This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure.
|S_OK||The method completed successfully.|
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
pfnCallbackThreadUnset parameters that are provided in the callback function must be used in the following way:
pfnCallbackThreadSetmust be called by the thread that might cause a runtime load before such a load is attempted.
pfnCallbackThreadUnsetmust be called when the thread will no longer cause such a runtime load (and before returning from the initial callback).
pfnCallbackThreadUnsetare both non-reentrant.
Host applications must not call
Platforms: See System Requirements.
Library: Included as a resource in MSCorEE.dll
.NET Framework Versions: Available since 4