Dear all,
This question maybe is a bit stupid. But I really don’t know which function I should call, if I want to creat a .txt (say mylog.txt) file and access it in the kernel mode.
Thank you very much.
Elton
Dear all,
This question maybe is a bit stupid. But I really don’t know which function I should call, if I want to creat a .txt (say mylog.txt) file and access it in the kernel mode.
Thank you very much.
Elton
> But I really don’t know which function I should call, if I
want to creat a .txt (say mylog.txt) file and access it in
the kernel mode.
Check out http://www.osr.com/ntinsider/1996/native.htm
and accompanying example: http://www.osr.com/ntinsider/1996/native.zip
This is a user-mode example, but it shows you the use of the native API.
Use the Zw variant of these functions, as documented in the DDK.
Be careful, though. There are a significant number of subtle issues laying
in wait for you (for example: The handle can only be used in the context in
which it was created, you can only call these functions at IRQL
PASSIVE_LEVEL, etc.)
If you are trying to do this to create your own logging, this is not a good
idea. If your code is restricted to, say, XP and later, an excellent idea
might be to use the logging package that’s built into Windows via WMI.
Peter
OSR
Hello,
Try calling ZwCreateFile() function.
It will enable you to open/create/rewrite an existing/new file.
Sachin
On Sun, 28 Jul 2002, lidong wrote:
Dear all,
This question maybe is a bit stupid. But I really don’t know which function I should call, if I want to creat a .txt (say mylog.txt) file and access it in the kernel mode.
Thank you very much.
Elton
You are currently subscribed to ntdev as: xxxxx@tatainfotech.com
To unsubscribe send a blank email to %%email.unsub%%