Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Running a Program on the Target Win32 Date and Time Management Win32 DLLs Win32 Thread Local Storage (TLS) Win32 API Function Cross Reference Alternate Heap Manager RTTHeap Compiling and Linking with On Time RTOS-32 |
Win32 DLLsRTTarget-32 supports LoadLibrary, FreeLibrary, GetModuleHandle, GetModuleFileName, and GetProcAddress for any modules supplied in the locate process through the RTLoc DLL directive or for DLMs loaded through a file system (see Advanced Topics for details). GetModuleHandle will return a handle for the module containing Rtt32.lib for module names Kernel32.dll and User32.dll (except if there are modules with these names present on the target). GetProcAddress only works if the .edata section of the module searched for a function has been mapped. The entrypoints of all DLLs which are statically referenced are called before the entrypoint of the main program is called. The entrypoints of other DLLs are called by the first call to LoadLibrary and again when a matching FreeLibrary call occurs. Care must be taken with repeated calls to LoadLibrary/FreeLibrary for DLLs linked into the program image. Many run-time systems of DLLs will not release their resources (for example, allocated memory) when FreeLibrary unloads the DLL. Repeated loading/unloading of such DLLs can quickly exhaust memory. Some other DLLs cannot be initialized twice, because RTTarget-32 cannot bring their initialized data into the state it had at boot time. Thus, it is recommended to load all required DLLs only once without unloading them (or unload them only once at program termination). More information about using DLLs is available in Advanced Topics, Using DLLs through RTLoc and Loading DLLs through a File System. Win32 Date and Time Management
|