Click here to Skip to main content
15,928,109 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to confirm the tree item selected Pin
try8819-Aug-05 7:45
try8819-Aug-05 7:45 
GeneralRe: how to confirm the tree item selected Pin
David Crow19-Aug-05 7:52
David Crow19-Aug-05 7:52 
AnswerRe: how to confirm the tree item selected Pin
Maximilien19-Aug-05 7:10
Maximilien19-Aug-05 7:10 
GeneralRe: how to confirm the tree item selected Pin
try8819-Aug-05 7:40
try8819-Aug-05 7:40 
GeneralRe: how to confirm the tree item selected Pin
David Crow19-Aug-05 7:52
David Crow19-Aug-05 7:52 
GeneralRe: how to confirm the tree item selected Pin
Maximilien19-Aug-05 7:52
Maximilien19-Aug-05 7:52 
GeneralRe: how to confirm the tree item selected Pin
try8819-Aug-05 8:43
try8819-Aug-05 8:43 
Generalquestion related to drivers Pin
gamitech19-Aug-05 3:46
gamitech19-Aug-05 3:46 
I have device driver and I want to write in a file from within the driver.
I am using ZwCreateFile()
ZwWriteFile()
ZwClose() functions.
When I call the InitializeObjectAttributesfunction()
i do not know how should the object name look like.
I mean if my file name is: D:\\status.txt or something like this:
\Device\HarddiskVolume1\status.txt
I want to ask now if these are the functions I should use when writting in a file from the kernel:
Here is a piece of code.
Can someone tell me what I do wrong?



NTSTATUS WriteStatusInFile(
IN PCWSTR FileName,
IN HANDLE hProcessId
)
{
UNICODE_STRING ObjN;
OBJECT_ATTRIBUTES ObjAttrib;
UNICODE_STRING ObjName;
IN HANDLE hFile;
IN IO_STATUS_BLOCK StatBlock,WStatBlock;
RtlInitUnicodeString(&ObjN,L"\\D:\\status.txt");
InitializeObjectAttributes(&ObjAttrib,&ObjN, OBJ_KERNEL_HANDLE , NULL, NULL);


ZwCreateFile(&hFile,
FILE_WRITE_DATA|FILE_APPEND_DATA,
&ObjAttrib,
&StatBlock,
0,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_WRITE,
FILE_CREATE |FILE_OPEN,
FILE_SEQUENTIAL_ONLY,
NULL,
0
);
ZwWriteFile(
hFile,
NULL,
NULL,
NULL,
&WStatBlock,
L"Process Created or Terminated\n",
sizeof("Process Created or Terminated\n"),
NULL,
NULL
);

ZwClose(hFile);

return WStatBlock.Status;

}


Thanks in advance.


gabby
GeneralRe: question related to drivers Pin
fat_boy19-Aug-05 4:05
fat_boy19-Aug-05 4:05 
Generalupdating Edit box in a Dialog from Callback function. Pin
kk_vp19-Aug-05 2:17
kk_vp19-Aug-05 2:17 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
David Crow19-Aug-05 2:28
David Crow19-Aug-05 2:28 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
kk_vp19-Aug-05 4:04
kk_vp19-Aug-05 4:04 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
David Crow19-Aug-05 4:21
David Crow19-Aug-05 4:21 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
kk_vp19-Aug-05 4:29
kk_vp19-Aug-05 4:29 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
David Crow19-Aug-05 4:34
David Crow19-Aug-05 4:34 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
Jose Lamas Rios19-Aug-05 2:44
Jose Lamas Rios19-Aug-05 2:44 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
MailtoGops19-Aug-05 2:49
MailtoGops19-Aug-05 2:49 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
gamitech19-Aug-05 3:33
gamitech19-Aug-05 3:33 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
kk_vp19-Aug-05 4:05
kk_vp19-Aug-05 4:05 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
ThatsAlok21-Aug-05 18:53
ThatsAlok21-Aug-05 18:53 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
kk_vp24-Aug-05 0:31
kk_vp24-Aug-05 0:31 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
MailtoGops19-Aug-05 4:26
MailtoGops19-Aug-05 4:26 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
kk_vp19-Aug-05 4:32
kk_vp19-Aug-05 4:32 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
MailtoGops22-Aug-05 0:23
MailtoGops22-Aug-05 0:23 
GeneralMIMESniffer.DLL MIME to HTML Conversion Problem ( if MIME tag starts with <DIV>,<P> or <UL> Pin
chandan kumar19-Aug-05 2:08
chandan kumar19-Aug-05 2:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.