Platform SDK: Debugging and Error Handling

MapAndLoad

The MapAndLoad function maps an image and preloads data from the mapped file.

BOOL MapAndLoad(
  PSTR ImageName,             
  PSTR DllPath,               
  PLOADED_IMAGE LoadedImage,  
  BOOL DotDll,                 
  BOOL ReadOnly                
);

Parameters

ImageName
[in] Pointer to a null-terminated string that specifies the name of the image that is loaded.
DllPath
[in] Pointer to a null-terminated string that specifies the path used to locate the image if the name provided cannot be found. If NULL is used, then the search path rules set forth in the SearchPath function apply.
LoadedImage
[out] Pointer to a LOADED_IMAGE structure that receives information about the image after it is loaded.
DotDll
[in] Specifies the default extension, if the image name does not contain a file extension. If the value is TRUE, a .DLL extension is used. If the value is FALSE, then an .EXE extension is used.
ReadOnly
[in] Specifies the access mode. If this value is TRUE, the file is mapped for read-access only. If the value is FALSE, the file is mapped for read and write access.

Return Values

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.

Remarks

The MapAndLoad function maps an image and preloads data from the mapped file. The corresponding function, UnMapAndLoad, must be used to deallocate all resources that are allocated by the MapAndLoad function.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Imagehlp.h.
  Library: Use Imagehlp.lib.

See Also

Image Help Library Overview, ImageHlp Functions, LOADED_IMAGE, UnMapAndLoad