Re: Receiving a boolean from an InputBuffer ?
From: Gary G. Little (gglittle.nospam_at_sbcglobal.net)
Date: 01/06/05
- Next message: Gary G. Little: "Re: Question about threads?"
- Previous message: qfel: "Re: Catching exceptions"
- In reply to: o: "Re: Receiving a boolean from an InputBuffer ?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 06 Jan 2005 18:10:44 GMT
O my goo'ness O, how many times can one person shoot themselves in the foot?
First you got petulant and then you show your ignorance.
Of course memcpy et al are functions defined in an Application Programmers
Interface (API for short). You get access to them, like any well behaved API
by including the proper header file that has the prototypes imported.
Try using memcpy or even strcpy in a source module without using ANY
includes in the source. This is a rather dumb, but apro po, test, but like
any API, to use it you have to include the proper header that imports the
desired functions, and write the functions as defined by the function
prototypes, which did not in the example below.
Surely you do not equate memcpy to "switch"? If so, how in the hell did you
pass C Programming 101?!?!?!?
////////////////////////////////////////////////////////////////////////////
/////////////////
//
// Is memcpy or is NOT memcpy an API
void main (void)
{
char *buf[256];
memcpy(buf, &buf[128], 128);
fwrite();
strcpy();
return;
}
-- The personal opinion of Gary G. Little <o> wrote in message news:%2399GLT28EHA.824@TK2MSFTNGP11.phx.gbl... > > "Larry Brasfield" <donotspam_larry_brasfield@hotmail.com> wrote in message > news:e43ghB18EHA.1392@tk2msftngp13.phx.gbl... > > > "Larry Brasfield" <donotspam_larry_brasfield@hotmail.com> wrote in > message > > > news:OI6vqvy8EHA.4028@TK2MSFTNGP15.phx.gbl... > > >> Two things wrong here: > > >> 1. Your question is not about the kernel or kernel programming. > > >> Hence it is off-topic here. > > >> > > >> 2. If 'InputBuffer' refers to an object of type void *, then > > >> *InputBuffer is not an evaluatable expression. Casting > > >> it does no good. > > >> > > >> Perhaps you mean to write: > > >> reply= *((BOOL *)InputBuffer); > > >> or, better yet in C++ > > >> reply = *reinterpret_cast<BOOL *>(InputBuffer); > > > > > Two things... > > > First, if it's off topic why r u answering? > > > > Because newbies need to learn about topicality and because you > > appeared to need the assistance, both on that and the question. > > > > > 2. DeviceIoControl is very much related to this ng. You may say, > > > go and learn api programming first, but this particular api is the > > > only one which uses void pointers as input/output. Show me another > > > api that uses input/output buffers which are void, and I say you will > > > not find. > > > > A great many interfaces use void * for passing buffers of > > unspecified content. Lookup memset() and memcpy(). > > Or fwrite() and fread(). Or countless others. > > Once again you are not accurate, memcpy/fwrite/fread > are not api's, they are C run-time functions. >
- Next message: Gary G. Little: "Re: Question about threads?"
- Previous message: qfel: "Re: Catching exceptions"
- In reply to: o: "Re: Receiving a boolean from an InputBuffer ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|