LoadLibarayExA
Unless an application depends on specific image mapping characteristics, the LOAD_LIBRARY_AS_IMAGE_RESOURCE value should be used with either LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE or LOAD_LIBRARY_AS_DATAFILE. This allows the loader to choose whether to load the module as an image resource or a data file, selecting whichever option enables the system to share pages more effectively. Resource functions such as FindResource can use either mapping.
There are three similar flags for loading LoadLibraryEx to load resource dll. Both LOAD_LIBRARY_AS_DATAFILE or LOAD_LIBRARY_AS_IMAGE_RESOURCE| (LOAD_LIBRARY_AS_DATAFILE or LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE) works well with subsequence load res apis like FindResource.
LoadLibraryEx
LOAD_LIBRARY_AS_DATAFILE
LOAD_LIBRARY_AS_IMAGE_RESOURCE|
LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE
FindResource
So what's the difference between LOAD_LIBRARY_AS_IMAGE_RESOURCE and LOAD_LIBRARY_AS_DATAFILE and how to chose?
LOAD_LIBRARY_AS_IMAGE_RESOURCE
2.1m questions
2.1m answers
60 comments
57.0k users