Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

MapAndLoad function

Maps an image and preloads data from the mapped file.

Syntax


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

Parameters

ImageName [in]

The file name of the image (executable file or DLL) that is loaded.

DllPath [in]

The path used to locate the image if the name provided cannot be found. If this parameter is NULL, then the search path rules set using the SearchPath function apply.

LoadedImage [out]

A pointer to a LOADED_IMAGE structure that receives information about the image after it is loaded.

DotDll [in]

The default extension to be used if the image name does not contain a file name extension. If the value is TRUE, a .DLL extension is used. If the value is FALSE, then an .EXE extension is used.

ReadOnly [in]

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 value

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.

All ImageHlp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Imagehlp.h

Library

Imagehlp.lib

DLL

Imagehlp.dll

See also

ImageHlp Functions
LOADED_IMAGE
UnMapAndLoad

 

 

Community Additions

ADD
Show:
© 2015 Microsoft