- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings;
Currently we are stuck with a group of 16-bit legacy apps written in C/C++. We are using the generic thunk mechanism to call a Fortran DLL from one of these apps. At the time, this appears to work. We can load the DLL and call the exported functions.
However, we were having a lot of random crashes on our 95/98 machines and we traced the problem down to the loading of the Fortran DLL. All you have to do is load the Fortran DLL (never calling an exported function) using LoadLibraryEx32W( "name", NULL, 0 );
A test program that does nothing but make the above call (or the above call combined with the appropriate FreeLibrary32W call) will cause the computer to exhibit the following symptoms: Random crashes of the OS sometime thereafter (sometimes) or (always) you will be unable to shut down the OS correctly (it hangs during the shutdown process, never completing and wanting you to run scandisk upon the next startup).
Anyone ever seen this before?
Thanks,
Darrell
Currently we are stuck with a group of 16-bit legacy apps written in C/C++. We are using the generic thunk mechanism to call a Fortran DLL from one of these apps. At the time, this appears to work. We can load the DLL and call the exported functions.
However, we were having a lot of random crashes on our 95/98 machines and we traced the problem down to the loading of the Fortran DLL. All you have to do is load the Fortran DLL (never calling an exported function) using LoadLibraryEx32W( "name", NULL, 0 );
A test program that does nothing but make the above call (or the above call combined with the appropriate FreeLibrary32W call) will cause the computer to exhibit the following symptoms: Random crashes of the OS sometime thereafter (sometimes) or (always) you will be unable to shut down the OS correctly (it hangs during the shutdown process, never completing and wanting you to run scandisk upon the next startup).
Anyone ever seen this before?
Thanks,
Darrell
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't recall hearing of this problem before. Does the Dll have a DllMain entry point? (This is optional - if it is there, Windows calls it on loading the DLL.)
I'm unfamiliar with the "thunk" mechanism, though. The Visual Fortran run-time DLL probably DOES have a DllMain entry point, and it may be doing something that doesn't work in this "thunked" environment. Try, as an experiment, building your DLL with the Libraries setting changed from DLL to Static (or on the command line, use /libs:static), and see if that makes a difference.
Steve
I'm unfamiliar with the "thunk" mechanism, though. The Visual Fortran run-time DLL probably DOES have a DllMain entry point, and it may be doing something that doesn't work in this "thunked" environment. Try, as an experiment, building your DLL with the Libraries setting changed from DLL to Static (or on the command line, use /libs:static), and see if that makes a difference.
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page