Microsoft KB Archive/66656

PRWIN9012013: Data Segment Changes for DATA NONE DLL Function ID Number: Q66656

3.00 WINDOWS buglist3.00 fixlist3.10

Summary:

PROBLEM ID: WIN9012013

SYMPTOMS A DLL is created with no local data (no LibEntry function, DATA NONE and HEAPSIZE 0). When a function from this DLL is used, the value of the DS register changes. This behavior is inconsistent with that of Windows versions 2.x.

CAUSE Windows uses a new value for DS instead of the DS associated with the calling application.

RESOLUTION Microsoft has confirmed this to be a problem in Windows version 3.0. To avoid this problem, declare each function of the DLL in the EXPORTS section of the DEF file, and include the NODATA keyword, as follows:

EXPORTS MyDLLFunction @2  NODATA This problem was corrected in Windows version 3.1.

Additional reference words: 3.00