Re[2]: Re[2]: strcpy in DDK

I’ve already done that(got rid of ZwCreateFile and ZwClose).

The is only one call to hLogFile, that actually stores the data via
ZwWrite(passing the handle here).
I changed that to strcpy():
strcpy(pDevExt->hLogFile,vals);

and hLogFile is now declared as ‘char hLogFile[4096]’

And like any other program, if you change the handle to a string, you also
need to change every call that expects a handle to one that expects a
string. If this was a user space program you would not just change the
handle to the string and do nothing else.

Since you are using hLogFile which is polish notation for a handle to
LogFile, you should probably change that to a different name, and then get
rid of the CreateFile and on the WriteFiles make them a safe sring copy or
concatenation (for security reasons, strcpy is not recomended for the
kernel).

Of course one has to wonder why you would want to do this in the first
place.

Dear Mr. Newbie,

Please remove the (reply serialization “feature”) from your replies to this list. It’s confusing the list server’s threading system, and your replies are each being identified as a new topic.

Also, you might wanna lurk for a while to get a hint as to the kind of questions/issues we deal with in this forum.

Peter
OSR