BUG: GP Fault in LoadLibrary() with C++ DLLLast reviewed: August 8, 1997Article ID: Q110180 |
The information in this article applies to:
SYMPTOMSWhen loading a dynamic-link library (DLL) developed with Microsoft C/C++ 7.0 or Visual C++ with a large number of exports not listed in the module definition (.DEF) file, LoadLibrary() will cause a general protection (GP) fault in Kernel with the message:
Application Error MYAPP caused a General Protection Fault in module KRNL386.EXE at 0002:0E8D CAUSEThe cause of the GP fault is the unusually large amount of exported decorated C++ names in the resident name table in the executable header. The Windows loader is not designed to handle the resident portion of the executable header larger than 64K.
RESOLUTIONThe GP fault can be eliminated by reducing the size the resident name table by listing the exported function names along with an ordinal number in the EXPORTS section of the .DEF file. Because the compiler generates decorated names, it is easier to copy the decorated function names from the .MAP file to the .DEF file.
STATUSMicrosoft has confirmed this to be a bug in Microsoft Windows version 3.1 and Windows for Workgroups versions 3.1 and 3.11. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe error also occurs when loading the 16-bit DLL on Windows 95. Although our linker does not support this feature, some 3rd-party linkers such as OptLink has a switch that will automatically set the names destined for the non-resident name table without doing the copy/paste operation from the .MAP file to the .DEF file.
|
Additional query words: 3.11 gpf gp-fault
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |