Limitations When Using Ada DLLs from Ada (GNAT User’s Guide for Native Platforms)

#### 7.4.8.13 Limitations When Using Ada DLLs from Ada ¶

When using Ada DLLs from Ada applications there is a limitation you should be aware of. On Windows, the GNAT run-time is not in a DLL of its own, so each Ada DLL includes a part of the GNAT run-time. Specifically, each Ada DLL includes the services of the GNAT run-time that are necessary for the Ada code inside the DLL. As a result, when an Ada program uses an Ada DLL there are two independent GNAT run-times: one in the Ada DLL and one in the main program.

It is therefore not possible to exchange GNAT run-time objects between the Ada DLL and the main Ada program. Example of GNAT run-time objects are file handles (e.g., `Text_IO.File_Type`), tasks types, protected objects types, etc.

It is completely safe to exchange plain elementary, array or record types, Windows object handles, etc.