Re: ReadFille error caused by USB sniffer
"William DePalo [MVP VC++]" <willd.no.spam@mvps.org> wrote in message
news:%23tIxZkOZHHA.992@TK2MSFTNGP02.phx.gbl...
"HMS Surprise" <john@datavoiceint.com> wrote in message
news:1173729030.390192.305820@h3g2000cwc.googlegroups.com...
I had a ReadFile call for a USB device that worked fine until I
installed a USB sniffer. Then I started getting 1784 error
ERROR_INVALID_USER_BUFFER. The sniffer was not running only installed.
I uninstalled the sniffer and the problem left.
This is only a guess - I don't think there is enough information to go
on - but perhaps the problem is related to timing. Timing bugs are
sensitive to what all else is going on in the machine. So, I'd suggest
that you look at the code to see if there is a wild-pointer problem or
buffer that gets deleted or goes out of scope before the I/O completes.
Specifically, we need to know if you're using overlapped I/O, completion
routines, anything like that.
I should have started by asking a more basic question as I come from a
Unix background. On one of the MSDN library page for ReadFile,
http://msdn2.microsoft.com/en-us/library/aa365467.aspx , it says lib
Kernel32.lib is needed as well as Kernel32.dll. Why are both needed?
The .lib file is what is called an import library. It is used at link time
to resolve references (up to a point) to external functions which are
implemented in a DLL. The DLL is a dynamic-link library required at load
time.
I'm told that a DLL is like a "shareable" (.so??????) but I wouldn't know
a shareable if it came up and bit me in the @$$ so take that with a grain
of salt. <g>
DLL and shared object are really just two names for the same thing, they are
fully equivalent. But most compilers used on *nix, like gcc, can read the
export table of a shared object/DLL and don't need to create an import
library as a separate step.
In any case, the DLL contains all the information, and the LIB.EXE tool can
extract that and create an import library.
Regards,
Will
www.ivrforbeginners.com