This documentation is archived and is not being maintained.

_CorValidateImage

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. The _CorValidateImage method notifies the loader when the managed module images are loaded, and the _CorImageUnloading method notifies the loader when the managed module images are unloaded. _CorValidateImage performs the following actions:

  1. Ensures that the code is valid managed code.
  2. Changes the entry point in the image to an entry point in the runtime.

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

Syntax

STDAPI _CorValidateImage(
  PVOID* ImageBase,
  LPCWSTR FileName
);

Parameters

ImageBase
The pointer to the starting location of the image to validate as managed code. The image must be already loaded into memory.
FileName
The file name of the image.

Return Values

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following two defined values:

STATUS_INVALID_IMAGE_FORMAT
The image is invalid. This value has the HRESULT 0xC000007BL.
STATUS_SUCCESS
The image is valid. This value has the HRESULT 0x00000000L.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family
Header: Declared in Mscoree.h
Library: Included as a resource in Mscoree.dll

Show: