Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

LockClrVersion Function

Allows the host to determine which version of the common language runtime (CLR) will be used within the process before explicitly initializing the CLR.


HRESULT LockClrVersion (
        [in] FLockClrVersionCallback   hostCallback,
        [in] FLockClrVersionCallback  *pBeginHostSetup,
        [in] FLockClrVersionCallback  *pEndHostSetup
);

Parameters

hostCallback

[in] The function to be called by the CLR upon initialization.

pBeginHostSetup

[in] The function to be called by the host to inform the CLR that initialization is starting.

pEndHostSetup

[in] The function to be called by the host to inform the CLR that initialization is complete.

This method returns standard Component Object Model (COM) error codes, as defined in WinError.h, in addition to the following values.

Return code Description

S_OK

The method completed successfully.

E_INVALIDARG

One or more of the arguments is null.

The host calls LockClrVersion before initializing the CLR. LockClrVersion takes three parameters, all of which are callbacks of type FLockClrVersionCallback Function Pointer. This type is defined as follows.

typedef HRESULT ( __stdcall *FLockClrVersionCallback ) ();

The following steps occur upon initialization of the runtime:

  1. The host calls CorBindToRuntimeEx Function or one of the other runtime initialization functions. Alternatively, the host could initialize the runtime using COM object activation.

  2. The runtime calls the function specified by the hostCallback parameter.

  3. The function specified by hostCallback then makes the following sequence of calls:

All the calls from pBeginHostSetup to pEndHostSetup must occur on a single thread or fiber, with the same logical stack. This thread can be different from the thread upon which hostCallback is called.

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: MSCorEE.idl

Library: MSCorEE.dll

.NET Framework Version: 2.0

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.