PRB: _lwrite() Function Defined Incorrectly in Online Help

ID Number: Q76696

1.00

WINDOWS

docerr

Summary:

SYMPTOMS

The _lwrite() function, as well as the functions listed below, are

defined in the Microsoft QuickC for Windows (QC/Win) version 1.0

online help as returning an integer type. However, they are

prototyped in WINDOWS.H as type FAR PASCAL, and as returning a WORD

type. For these functions, the prototypes listed in WINDOWS.H are

correct, not the prototypes listed in the online help.

For example, the definition of the _lwrite() function in the online

help appears as follows:

int _lwrite(hFile, lpBuffer, wBytes)

However, it is prototyped in WINDOWS.H as follows:

WORD FAR PASCAL _lwrite(int, LPSTR, int);

If the description in the online help were correct, the function

would not return the correct number of bytes read if the number of

bytes requested was greater than 32K (unless it was cast to a

WORD).

RESOLUTION

The correct prototype for the _lwrite() function is

WORD FAR PASCAL _lwrite(int, LPSTR, int);

and similarly for _lread(). The following list shows the incorrect

function prototypes listed in the online help with the correct

function prototypes listed in WINDOWS.H. In each case below,

WINDOWS.H contains the correct prototype.

Function Online Help WINDOWS.H

-------- ----------- ---------

_lwrite() int _lwrite(hFile... ) WORD FAR PASCAL _lwrite(int..)

_lread() int _lread(int... ) WORD FAR PASCAL _lread(int...)

_lclose() int _lclose(hFile) int FAR PASCAL _lclose(...

_lopen() int _lopen(lpPathName...) int FAR PASCAL _lopen(...

_lcreat() int _lcreat(lpPathName...) int FAR PASCAL _lcreat(...

_llseek() LONG _llseek(hFile...) LONG FAR PASCAL _llseek(...

STATUS

Microsoft has confirmed this to be a problem in QuickC for Windows

version 1.0. We are researching this problem and will post new

information here as it becomes available.

Additional reference words: QCWin QC/Win 1.00