This documentation is archived and is not being maintained.

_CorValidateImage Function

Notifies the loader when the managed module images are loaded.

In Windows XP, the operating system loader checks for managed modules by examining a bit in the common object file format (COFF) header. A set bit denotes a managed module. If the loader detects managed modules, it loads Mscoree.dll. _CorValidateImage notifies the loader when the managed module images are loaded, and _CorImageUnloading notifies the loader when the managed module images are unloaded. _CorValidateImage performs the following actions:

  • Ensures that the code is valid managed code.

  • Changes the entry point in the image to an entry point in the runtime.

For 64-bit versions of Windows, _CorValidateImage modifies the image that is in memory by transforming it from PE32 to PE32+ format.

STDAPI _CorValidateImage ( 
     [in] PVOID* ImageBase,
     [in] LPCWSTR FileName


[in] A pointer to the starting location of the image to validate as managed code. The image must already be loaded into memory.


[in] The file name of the image.

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following values.


The image is invalid. This value has the HRESULT 0xC000007BL.


The image is valid. This value has the HRESULT 0x00000000L.

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

Header: Cor.h

Library: Included as a resource in MsCorEE.dll

.NET Framework Version: 2.0, 1.1, 1.0