🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #3452

Using DOS device driver under Windows

#3452
From: Shyh-Pei Yen
Date: Fri, 28 Jun 1991 03:49
27 lines
1906 bytes
I have a question about using DOS device driver with Windows application.
Please help me out if you have experienced this.

I am trying to read data from the scanner via bi-directional parallel port
by using the scanner's DOS device driver. To do so, I use OpenFile() to
open the device driver and then use _lread() to input data and _lwrite() to
output data. Everything works fine except it's horriblily slow (maybe I
exagerate a little bit, but it IS slow). After a lot of time fooling around,
we figured out that the Windows seems did something bad to the _lread() call
and read the data one byte at a time from the driver until the number of
bytes specified in the function's parameter of data read in the buffer, then
return the call. We set the driver into raw mode. It's no use. Windows just
keeps doing that no matter driver is in raw mode or cooked mode.

Rumor has it that we should use GlobalDosAlloc() function to allocate the
buffer memory for device driver. I don't know if it will solve the problem
(will it?). I want to give it a try. But the problem is I can find the
GlobalDosAlloc() function in Windows SDK reference manual, but Microsoft's
linker seems have problem locating this function in it's library. This
function is not defined in the windows.h header file, and every time I did
the link, GlobalDosAlloc() always is an unresolved external function.

Any idea why these are happenning?

I appreciate any input.

spyen@netcom.com
Technical Details
Message-ID: <1991Jun28.034930.2486@netcom.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!usc!apple!netcomsv!spyen

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!usc!apple!netcomsv!spyen
From: spyen@netcom.COM (Shyh-Pei Yen)
Newsgroups: comp.windows.ms.programmer
Subject: Using DOS device driver under Windows
Message-ID: <1991Jun28.034930.2486@netcom.COM>
Date: 28 Jun 91 03:49:30 GMT
Organization: Netcom - Online Communication Services  UNIX System {408 241-9760 guest}
Lines: 27