PRWIN9102002: sopen Fails When Called from a Windows DLL

ID Number: Q72458

3.00

WINDOWS

buglist3.00 fixlist3.10

Summary:

PROBLEM ID: WIN9102002

SYMPTOMS

When the sopen function is called from a Windows dynamic-link

library (DLL), the file sharing flags are ignored.

CAUSE

The sopen function refers to a C run-time library variable,

_osmajor, to determine whether file sharing is supported. This

variable is not initialized in the DLL version of the Microsoft C

version 6.0 run-time libraries.

RESOLUTION

Microsoft has confirmed this to be a problem in the Microsoft C

run-time libraries for DLLs provided with the Windows Software

Development Kit version 3.0. To avoid this problem, declare an

unsigned char variable, _osmajor, in a module that uses the sopen

function and assign the variable a value of 3 or higher.

This problem was corrected in the Microsoft C/C++ Optimizing

Compiler version 7.0.

Additional reference words: 3.00 6.00 7.00