A summary of the rules that the loader follows to search for EXEs and DLLs.
To start a new process, call
The result of a search for an EXE depends on:
the name of the EXE. You provide this information.
the UID type : you provide. This is optional
the version of the EXEs on the device
You pass the name of the EXE in the first parameter of
you can specify the file name only. The loader will assume a
you can specify a filename and an extension. For example:
you can put a path in front of the file name. A path has limited use, because the loader can load EXEs only from the directory
The search procedure
The loader searches for EXEs with the given name and extension. More than one EXE with the given name and extension can exist on a device.
If you do not provide a path, the loader searches the
If you provide a path, there are only three useful cases:
to limit the search to a specific drive. For example:
where
to limit the search to a subdirectory of
The use of subdirectories in
where
to limit the search to a subdirectory of
The loader searches all drives in the order
The use of subdirectories in
The loader cannot load EXEs from other directories, because system security prevents it.
The loader compares the UID type (
If the search has found no EXEs, the load fails.
If the search has found one EXE only, the loader loads that EXE.
If more than one EXE has been found, the loader loads the EXE with the highest version. A version
If all EXEs have the same version, the loader loads the version found first.
After the loader has selected the EXE, the loader loads all DLLs in the import table. This is also called static linkage.
The import table contains the name and extension of each DLL. The import table also contains the version of each DLL and the 3rd UID that identifies each DLL. The version information is stored in the import table when the executable file is built. All DLLs have an ordered set of three UIDs. The third UID gives a unique identity to the DLL. See
The search procedure
The search uses the following procedure for each DLL:
The loader searches the
The loader cannot load DLLs from other directories, because system security prevents it.
[Before December 2007, the loader had different behaviour. The loader searched the drive from which the EXE was loaded before the loader checked the other drives. For example, if the EXE was loaded from drive
The loader then selects those DLLs that have the same 3rd UID from the set of possible DLLs. This operation can decrease the set of possible DLLs. If there are no DLLs in the set, the load fails.
The loader then selects those DLLs that have platform security capabilities that match or exceed those of the EXE. This selection operation can decrease the set of possible DLLs. If there are no DLLs in the set the load fails.
See also :
Each DLL in the import table of the EXE has a version number. This number is the version of the DLL to which the EXE is linked. The loader uses the version number in the import table to select the correct version of the DLL. The following flowchart shows how the loader selects the DLL from the set of possible DLLs.
If there are no DLLs that meet the requirements, the load fails.
To load a DLL from a program, call
The result of a search for an DLL depends on:
the name of the DLL. You provide this information.
the UID type : you provide. This is optional.
the required version : you provide. This is optional.
the version of the DLLs on the device.
You pass the name of the DLL in the first parameter of
you can specify the file name only. The loader will assume a
you can specify a filename and an extension. For example:
you can put a path in front of the file name. A path has limited use, because the loader can load DLLs only from the directory
See
The search procedure
The loader searches for DLLs with the given name and extension. More than one DLL with the given name and extension can exist on a device.
If you do not provide a path, the loader searches the
If you provide a path, there are only three useful cases:
to limit the search to a specific drive. For example:
where
to limit the search to a subdirectory of
The use of subdirectories in
where
to limit the search to a subdirectory of
The loader searches all drives in the order
The use of subdirectories in
System security prevents the loader from loading DLLs from any other directories.
The loader compares the UID type (
If the search has found no DLLs, the load fails.
The loader then selects those DLLs that have platform security capabilities that match or exceed those of the process . This selection operation can decrease the set of possible DLLs. If there are no DLLs in the set the load fails.
If the search has found no DLLs, the load fails.
If you specify a version number in
If there are no DLLs that meet the requirements, the load fails.
If you do not specify a version number in
If all DLLs have the same version, the loader loads the DLL found first.
To start a new process, call
The result +of a search for an EXE depends on:
the name of the EXE. +You provide this information.
the UID type : you provide. +This is optional
the version of the EXEs +on the device
You pass the name of the EXE in the first parameter of
you can specify the
+file name only. The loader will assume a
you can specify a filename +and an extension. For example:
you can put a path in
+front of the file name. A path has limited use, because the loader can load
+EXEs only from the directory
The +search procedure
The loader searches for EXEs with the given name +and extension. More than one EXE with the given name and extension can exist +on a device.
If you do not provide
+a path, the loader searches the
If you provide a path, there are only three useful cases:
to limit the search +to a specific drive. For example:
where
to limit the search
+to a subdirectory of
The use
+of subdirectories in
where
to limit the search
+to a subdirectory of
The
+loader searches all drives in the order
The use of subdirectories
+in
The loader cannot load EXEs from other directories, because system +security prevents it.
The loader compares
+the UID type (
If the search has found +no EXEs, the load fails.
If the search has found +one EXE only, the loader loads that EXE.
If more than one EXE
+has been found, the loader loads the EXE with the highest version. A version
If all EXEs have the +same version, the loader loads the version found first.
After the +loader has selected the EXE, the loader loads all DLLs in the import table. +This is also called static linkage.
The import table contains the
+name and extension of each DLL. The import table also contains the version
+of each DLL and the 3rd UID that identifies each DLL. The version information
+is stored in the import table when the executable file is built. All DLLs
+have an ordered set of three UIDs. The third UID gives a unique identity to
+the DLL. See
The search procedure
The search uses the following procedure +for each DLL:
The loader searches
+the
The loader cannot load DLLs from +other directories, because system security prevents it.
[Before December
+2007, the loader had different behaviour. The loader searched the drive from
+which the EXE was loaded before the loader checked the other drives. For example,
+if the EXE was loaded from drive
The loader then selects +those DLLs that have the same 3rd UID from the set of possible DLLs. This +operation can decrease the set of possible DLLs. If there are no DLLs in the +set, the load fails.
The loader then selects +those DLLs that have platform security capabilities that match or exceed those +of the EXE. This selection operation can decrease the set of possible DLLs. +If there are no DLLs in the set the load fails.
See also :
Each DLL in the import +table of the EXE has a version number. This number is the version of the DLL +to which the EXE is linked. The loader uses the version number in the import +table to select the correct version of the DLL. The following flowchart shows +how the loader selects the DLL from the set of possible DLLs.
If there are no DLLs +that meet the requirements, the load fails.
To load a DLL from a program, call
The +result of a search for an DLL depends on:
the name of the DLL. +You provide this information.
the UID type : you provide. +This is optional.
the required version +: you provide. This is optional.
the version of the DLLs +on the device.
You pass the name of the DLL in the first parameter of
you can specify the
+file name only. The loader will assume a
you can specify a filename +and an extension. For example:
you can put a path in
+front of the file name. A path has limited use, because the loader can load
+DLLs only from the directory
See
The +search procedure
The loader searches for DLLs with the given name +and extension. More than one DLL with the given name and extension can exist +on a device.
If you do not provide
+a path, the loader searches the
If you provide a path, there are only three useful cases:
to limit the search +to a specific drive. For example:
where
to limit the search
+to a subdirectory of
The use
+of subdirectories in
where
to limit the search
+to a subdirectory of
The
+loader searches all drives in the order
The use of subdirectories
+in
System security prevents the loader from loading DLLs from any other +directories.
The loader compares
+the UID type (
If the search has found +no DLLs, the load fails.
The loader then selects +those DLLs that have platform security capabilities that match or exceed those +of the process . This selection operation can decrease the set of possible +DLLs. If there are no DLLs in the set the load fails.
If the search has found +no DLLs, the load fails.
If you specify a version
+number in
If there are no DLLs +that meet the requirements, the load fails.
If you do not specify
+a version number in
If all DLLs have the +same version, the loader loads the DLL found first.