Re: "NUL" device is missing
From: KM (konstmor_at_nospam_yahoo.com)
Date: 05/14/04
- Next message: Slobodan Brcin \(eMVP\): "Re: error 1109: component: 'session manager requires an additional enabled component not in the current configuration"
- Previous message: Bruce Wong: "Windows XP Embedded with WPA"
- In reply to: Chuck Chopp: "Re: "NUL" device is missing"
- Next in thread: google_at_amamment.cotse.net: "NUL Device"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 14 May 2004 09:19:41 -0700
Chuck,
> I'm stuck using Visual C/C++ v6.0 right now w/o the option to move on up
to
> the Studio 2003 compiler. However, I will keep this in mind for future
use.
> I spent quite a bit of time last night reviewing the source code for the
> CRT and had reached the point where everything comes down to a call to the
> _output() function that does all of the dirty work. If it is one of the
> string printf() types of functions, then a dummy _iob [a.k.a. "FILE"
> structure] is worked up where it lookes like a valid file handle but
really
> points to the string buffer. I can see the counted vs. uncounted versions
> set a member in the structure to limit define the output buffer size.
> Still, it is the _output() function that does all of the work and I
haven't
> gone through and reviewe the source code for _output to see if it tests
> properly for NULL. I think that in VC6 it doesnn't as I've had errors
occur
It does not. The _output will call to funtions like write_string,
write_char, etc. to output strings/character/etc. to the stream.
In VC 6.0 the write_xxxx funcitons do not check if stream->base
(stream->ptr) is NULL.
VC 2003 does it.
> when passing in a NULL pointer to sprintf(). I'll look at it all in more
> detail today.
>
> It is encouraging to hear than an updated ANSI C standard does finally
> address this problem, though. I've got VS2003 .NET on hand and I will
> review the CRT source code from it, too, to see what the differences in
the
> implementation look like. Perhaps I can cook up my own flavor of
_output()
> to use with VC6 in my own code to back-port that functionality and thus
> remove the dependency on the NUL device.
KM
- Next message: Slobodan Brcin \(eMVP\): "Re: error 1109: component: 'session manager requires an additional enabled component not in the current configuration"
- Previous message: Bruce Wong: "Windows XP Embedded with WPA"
- In reply to: Chuck Chopp: "Re: "NUL" device is missing"
- Next in thread: google_at_amamment.cotse.net: "NUL Device"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|