zwcreatefile in IRP_MJ_CREATE!!??

Hi,

Iam trying to open a file(by using ZwCreateFile) in

IRP_MJ_CREATE, but it

blue screens.

Is it not possible to open a file in IRP_MJ_CREATE?

Does native calls like ZwCreateFile results in recursive IRP_MJ_CREATE??

With Regards,
A.Ilamparithi

It’s hard to know without more informaiton about the blue screen.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of A.Ilamparithi
Sent: Sunday, July 25, 2004 9:20 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] zwcreatefile in IRP_MJ_CREATE!!??

Hi,

Iam trying to open a file(by using ZwCreateFile) in

IRP_MJ_CREATE, but it

blue screens.

Is it not possible to open a file in IRP_MJ_CREATE?

Does native calls like ZwCreateFile results in recursive IRP_MJ_CREATE??

With Regards,
A.Ilamparithi


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,

This is the code sample i used.

swprintf( loggerPath, L"\Device\HarddiskVolume1\glDriver_logger.txt");

RtlInitUnicodeString( &fileName, loggerPath );
InitializeObjectAttributes(&ObjectAttributes, &fileName,
OBJ_CASE_INSENSITIVE,
NULL, NULL);

Status =
ZwCreateFile(&fileHandle,GENERIC_WRITE,&ObjectAttributes,
&IoStatusBlock,NULL,FILE_ATTRIBUTE_NORMAL,0,
FILE_CREATE,FILE_SYNCHRONOUS_IO_NONALERT,NULL,0);

if ( NT_SUCCESS( Status ) )
{
file://Close opened file and signal that we can log.
DbgPrint(“File Opened successfully”);
Status=ZwClose( fileHandle );
if(NT_SUCCESS(Status))
{
DbgPrint(“File Closed Successfully”);
}
}
else
{
if(IoStatusBlock.Information ==FILE_CREATED)
DbgPrint(“File Created”);
else if(IoStatusBlock.Information ==FILE_OPENED)
DbgPrint(“File opened”);
else if(IoStatusBlock.Information ==FILE_OVERWRITTEN)
DbgPrint(“File Written”);
else if(IoStatusBlock.Information ==FILE_SUPERSEDED)
DbgPrint(“File superseed”);
else if(IoStatusBlock.Information ==FILE_EXISTS)
DbgPrint(“File exist”);
else if(IoStatusBlock.Information ==FILE_DOES_NOT_EXIST)
DbgPrint(“File not exist”);
else
DbgPrint(“UNKNOWN return value”);
}

It works correctly when i try this with my IOCTL.

But when i try to do this in IRP_MJ_CREATE it blue screens.

I get unexcepted_kernel_mode_trap.

The trap number is sometimes 0x00000005 or 0x00000008.

With Thanks,
A.Ilamparithi.

“Peter Wieland” wrote in message
news:xxxxx@ntdev…
It’s hard to know without more informaiton about the blue screen.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of A.Ilamparithi
Sent: Sunday, July 25, 2004 9:20 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] zwcreatefile in IRP_MJ_CREATE!!??

Hi,

Iam trying to open a file(by using ZwCreateFile) in

IRP_MJ_CREATE, but it

blue screens.

Is it not possible to open a file in IRP_MJ_CREATE?

Does native calls like ZwCreateFile results in recursive IRP_MJ_CREATE??

With Regards,
A.Ilamparithi


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,

Can you put ur code snnipet of opening file in IRP_MJ_CREATE?

 

yatindra 

From: “A.Ilamparithi”

>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] zwcreatefile in IRP_MJ_CREATE!!??
>Date: Sun, 25 Jul 2004 21:19:59 -0700
>
>Hi,
>
>Iam trying to open a file(by using ZwCreateFile) in
>
>IRP_MJ_CREATE, but it
>
>blue screens.
>
>Is it not possible to open a file in IRP_MJ_CREATE?
>
>Does native calls like ZwCreateFile results in recursive IRP_MJ_CREATE??
>
>With Regards,
>A.Ilamparithi
>
>
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


The bold ‘n the beautiful! The rich and the famous! Meet them all at one place!

Hi,

This is the code sample i used.

swprintf( loggerPath, L"\Device\HarddiskVolume1\glDriver_logger.txt");

RtlInitUnicodeString( &fileName, loggerPath );
InitializeObjectAttributes(&ObjectAttributes, &fileName,
OBJ_CASE_INSENSITIVE,
NULL, NULL);

Status =
ZwCreateFile(&fileHandle,GENERIC_WRITE,&ObjectAttributes,
&IoStatusBlock,NULL,FILE_ATTRIBUTE_NORMAL,0,
FILE_CREATE,FILE_SYNCHRONOUS_IO_NONALERT,NULL,0);

if ( NT_SUCCESS( Status ) )
{

DbgPrint(“File Opened successfully”);
Status=ZwClose( fileHandle );
if(NT_SUCCESS(Status))
{
DbgPrint(“File Closed Successfully”);
}
}
else
{
if(IoStatusBlock.Information ==FILE_CREATED)
DbgPrint(“File Created”);
else if(IoStatusBlock.Information ==FILE_OPENED)
DbgPrint(“File opened”);
else if(IoStatusBlock.Information ==FILE_OVERWRITTEN)
DbgPrint(“File Written”);
else if(IoStatusBlock.Information ==FILE_SUPERSEDED)
DbgPrint(“File superseed”);
else if(IoStatusBlock.Information ==FILE_EXISTS)
DbgPrint(“File exist”);
else if(IoStatusBlock.Information ==FILE_DOES_NOT_EXIST)
DbgPrint(“File not exist”);
else
DbgPrint(“UNKNOWN return value”);
}

It works correctly when i try this with my IOCTL.

But when i try to do this in IRP_MJ_CREATE it blue screens.

I get unexcepted_kernel_mode_trap.

The trap number is sometimes 0x00000005 or 0x00000008.

With Thanks,
A.Ilamparithi.


Hi,

Can you put ur code snnipet of opening file in IRP_MJ_CREATE?

yatindra

Hi the name shud be init to

swprintf( loggerPath, L[\DosDevices\C:\glDriver_logger.txt](file://\DosDevices\C:\glDriver_logger.txt));

 

just check it out and just send me the WinDbg Output for the bugcheck.

 

luck

yogi

From: “A.Ilamparithi”

>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] zwcreatefile in IRP_MJ_CREATE!!??
>Date: Mon, 26 Jul 2004 16:57:34 -0700
>
>Hi,
>
>This is the code sample i used.
>
>swprintf( loggerPath, L"\Device\HarddiskVolume1\glDriver_logger.txt");
>
> RtlInitUnicodeString( &fileName, loggerPath );
> InitializeObjectAttributes(&ObjectAttributes, &fileName,
>OBJ_CASE_INSENSITIVE,
> NULL, NULL);
>
> Status =
>ZwCreateFile(&fileHandle,GENERIC_WRITE,&ObjectAttributes,
> &IoStatusBlock,NULL,FILE_ATTRIBUTE_NORMAL,0,
> FILE_CREATE,FILE_SYNCHRONOUS_IO_NONALERT,NULL,0);
>
> if ( NT_SUCCESS( Status ) )
> {
>
> DbgPrint(“File Opened successfully”);
> Status=ZwClose( fileHandle );
> if(NT_SUCCESS(Status))
> {
> DbgPrint(“File Closed Successfully”);
> }
> }
> else
> {
> if(IoStatusBlock.Information ==FILE_CREATED)
> DbgPrint(“File Created”);
> else if(IoStatusBlock.Information ==FILE_OPENED)
> DbgPrint(“File opened”);
> else if(IoStatusBlock.Information ==FILE_OVERWRITTEN)
> DbgPrint(“File Written”);
> else if(IoStatusBlock.Information ==FILE_SUPERSEDED)
> DbgPrint(“File superseed”);
> else if(IoStatusBlock.Information ==FILE_EXISTS)
> DbgPrint(“File exist”);
> else if(IoStatusBlock.Information ==FILE_DOES_NOT_EXIST)
> DbgPrint(“File not exist”);
> else
> DbgPrint(“UNKNOWN return value”);
> }
>
>It works correctly when i try this with my IOCTL.
>
>But when i try to do this in IRP_MJ_CREATE it blue screens.
>
>I get unexcepted_kernel_mode_trap.
>
>The trap number is sometimes 0x00000005 or 0x00000008.
>
>With Thanks,
>A.Ilamparithi.
>
>
>
>
>------------------------------------------------------------------
>Hi,
>
>Can you put ur code snnipet of opening file in IRP_MJ_CREATE?
>
>
>
>yatindra
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Marriage? Join BharatMatrimony.com for free.

Hi

I already tried with L"\??\C:\glDriver_logger.txt".

It doesnot work in IRP_MJ_CREATE.

With Thanks,
A.Ilamparithi.
“yatindra vaishnav” wrote in message news:xxxxx@ntdev…
Hi the name shud be init to

swprintf( loggerPath, L\DosDevices\C:\glDriver_logger.txt);

just check it out and just send me the WinDbg Output for the bugcheck.

luck

yogi

>From: “A.Ilamparithi”
>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] zwcreatefile in IRP_MJ_CREATE!!??
>Date: Mon, 26 Jul 2004 16:57:34 -0700
>
>Hi,
>
>This is the code sample i used.
>
>swprintf( loggerPath, L"\Device\HarddiskVolume1\glDriver_logger.txt");
>
> RtlInitUnicodeString( &fileName, loggerPath );
> InitializeObjectAttributes(&ObjectAttributes, &fileName,
>OBJ_CASE_INSENSITIVE,
> NULL, NULL);
>
> Status =
>ZwCreateFile(&fileHandle,GENERIC_WRITE,&ObjectAttributes,
> &IoStatusBlock,NULL,FILE_ATTRIBUTE_NORMAL,0,
> FILE_CREATE,FILE_SYNCHRONOUS_IO_NONALERT,NULL,0);
>
> if ( NT_SUCCESS( Status ) )
> {
>
> DbgPrint(“File Opened successfully”);
> Status=ZwClose( fileHandle );
> if(NT_SUCCESS(Status))
> {
> DbgPrint(“File Closed Successfully”);
> }
> }
> else
> {
> if(IoStatusBlock.Information ==FILE_CREATED)
> DbgPrint(“File Created”);
> else if(IoStatusBlock.Information ==FILE_OPENED)
> DbgPrint(“File opened”);
> else if(IoStatusBlock.Information ==FILE_OVERWRITTEN)
> DbgPrint(“File Written”);
> else if(IoStatusBlock.Information ==FILE_SUPERSEDED)
> DbgPrint(“File superseed”);
> else if(IoStatusBlock.Information ==FILE_EXISTS)
> DbgPrint(“File exist”);
> else if(IoStatusBlock.Information ==FILE_DOES_NOT_EXIST)
> DbgPrint(“File not exist”);
> else
> DbgPrint(“UNKNOWN return value”);
> }
>
>It works correctly when i try this with my IOCTL.
>
>But when i try to do this in IRP_MJ_CREATE it blue screens.
>
>I get unexcepted_kernel_mode_trap.
>
>The trap number is sometimes 0x00000005 or 0x00000008.
>
>With Thanks,
>A.Ilamparithi.
>
>
>
>
>------------------------------------------------------------------
>Hi,
>
>Can you put ur code snnipet of opening file in IRP_MJ_CREATE?
>
>
>
>yatindra
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

------------------------------------------------------------------------------
Marriage? Join BharatMatrimony.com for free.

Hi,

Just send me the bug check and its analysis by windbg.

 

good luck,

yogi

From: “A.Ilamparithi”

>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] Re:zwcreatefile in IRP_MJ_CREATE!!??
>Date: Mon, 26 Jul 2004 18:30:43 -0700
>
>Hi
>
>I already tried with L"\??\C:\glDriver_logger.txt".
>
>It doesnot work in IRP_MJ_CREATE.
>
>With Thanks,
>A.Ilamparithi.
> “yatindra vaishnav” wrote in message news:xxxxx@ntdev…
> Hi the name shud be init to
>
>
> swprintf( loggerPath, L\DosDevices\C:\glDriver_logger.txt);
>
>
>
> just check it out and just send me the WinDbg Output for the bugcheck.
>
>
>
> luck
>
> yogi
>
>
> >From: “A.Ilamparithi”
> >Reply-To: “Windows System Software Devs Interest List”
> >To: “Windows System Software Devs Interest List”
> >Subject: Re:[ntdev] zwcreatefile in IRP_MJ_CREATE!!??
> >Date: Mon, 26 Jul 2004 16:57:34 -0700
> >
> >Hi,
> >
> >This is the code sample i used.
> >
> >swprintf( loggerPath, L"\Device\HarddiskVolume1\glDriver_logger.txt");
> >
> > RtlInitUnicodeString( &fileName, loggerPath );
> > InitializeObjectAttributes(&ObjectAttributes, &fileName,
> >OBJ_CASE_INSENSITIVE,
> > NULL, NULL);
> >
> > Status =
> >ZwCreateFile(&fileHandle,GENERIC_WRITE,&ObjectAttributes,
> > &IoStatusBlock,NULL,FILE_ATTRIBUTE_NORMAL,0,
> > FILE_CREATE,FILE_SYNCHRONOUS_IO_NONALERT,NULL,0);
> >
> > if ( NT_SUCCESS( Status ) )
> > {
> >
> > DbgPrint(“File Opened successfully”);
> > Status=ZwClose( fileHandle );
> > if(NT_SUCCESS(Status))
> > {
> > DbgPrint(“File Closed Successfully”);
> > }
> > }
> > else
> > {
> > if(IoStatusBlock.Information ==FILE_CREATED)
> > DbgPrint(“File Created”);
> > else if(IoStatusBlock.Information ==FILE_OPENED)
> > DbgPrint(“File opened”);
> > else if(IoStatusBlock.Information ==FILE_OVERWRITTEN)
> > DbgPrint(“File Written”);
> > else if(IoStatusBlock.Information ==FILE_SUPERSEDED)
> > DbgPrint(“File superseed”);
> > else if(IoStatusBlock.Information ==FILE_EXISTS)
> > DbgPrint(“File exist”);
> > else if(IoStatusBlock.Information ==FILE_DOES_NOT_EXIST)
> > DbgPrint(“File not exist”);
> > else
> > DbgPrint(“UNKNOWN return value”);
> > }
> >
> >It works correctly when i try this with my IOCTL.
> >
> >But when i try to do this in IRP_MJ_CREATE it blue screens.
> >
> >I get unexcepted_kernel_mode_trap.
> >
> >The trap number is sometimes 0x00000005 or 0x00000008.
> >
> >With Thanks,
> >A.Ilamparithi.
> >
> >
> >
> >
> >------------------------------------------------------------------
> >Hi,
> >
> >Can you put ur code snnipet of opening file in IRP_MJ_CREATE?
> >
> >
> >
> >yatindra
> >
> >
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>------------------------------------------------------------------------------
> Marriage? Join BharatMatrimony.com for free.
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Beat the summer heat. Get the new International Gillette Series Range!!

Please do the following:

  1. Connect windbg to the target system
  2. setup symbols.
  3. type !analyze -v followed by an enter in windbg command line.
  4. Cut n paste the output from the debugger.
  5. post the output here.

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
From: A.Ilamparithi [mailto:xxxxx@msn.com]
Sent: Monday, July 26, 2004 9:31 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Re:zwcreatefile in IRP_MJ_CREATE!!??

Hi

I already tried with L"\??\C:\glDriver_logger.txt".

It doesnot work in IRP_MJ_CREATE.

With Thanks,
A.Ilamparithi.

“yatindra vaishnav” < xxxxx@hotmail.com mailto:xxxxx >
wrote in message news:xxxxx@ntdev news:xxxxx

Hi the name shud be init to

swprintf( loggerPath, L \DosDevices\C:\glDriver_logger.txt
<file:> );

just check it out and just send me the WinDbg Output for the bugcheck.

luck

yogi

>From: “A.Ilamparithi”
>Reply-To: “Windows System Software Devs Interest List”

>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] zwcreatefile in IRP_MJ_CREATE!!??
>Date: Mon, 26 Jul 2004 16:57:34 -0700
>
>Hi,
>
>This is the code sample i used.
>
>swprintf( loggerPath, L"\Device\HarddiskVolume1\glDriver_logger.txt");
>
> RtlInitUnicodeString( &fileName, loggerPath );
> InitializeObjectAttributes(&ObjectAttributes, &fileName,
>OBJ_CASE_INSENSITIVE,
> NULL, NULL);
>
> Status =
>ZwCreateFile(&fileHandle,GENERIC_WRITE,&ObjectAttributes,
> &IoStatusBlock,NULL,FILE_ATTRIBUTE_NORMAL,0,
> FILE_CREATE,FILE_SYNCHRONOUS_IO_NONALERT,NULL,0);
>
> if ( NT_SUCCESS( Status ) )
> {
>
> DbgPrint(“File Opened successfully”);
> Status=ZwClose( fileHandle );
> if(NT_SUCCESS(Status))
> {
> DbgPrint(“File Closed Successfully”);
> }
> }
> else
> {
> if(IoStatusBlock.Information ==FILE_CREATED)
> DbgPrint(“File Created”);
> else if(IoStatusBlock.Information ==FILE_OPENED)
> DbgPrint(“File opened”);
> else if(IoStatusBlock.Information ==FILE_OVERWRITTEN)
> DbgPrint(“File Written”);
> else if(IoStatusBlock.Information ==FILE_SUPERSEDED)
> DbgPrint(“File superseed”);
> else if(IoStatusBlock.Information ==FILE_EXISTS)
> DbgPrint(“File exist”);
> else if(IoStatusBlock.Information ==FILE_DOES_NOT_EXIST)
> DbgPrint(“File not exist”);
> else
> DbgPrint(“UNKNOWN return value”);
> }
>
>It works correctly when i try this with my IOCTL.
>
>But when i try to do this in IRP_MJ_CREATE it blue screens.
>
>I get unexcepted_kernel_mode_trap.
>
>The trap number is sometimes 0x00000005 or 0x00000008.
>
>With Thanks,
>A.Ilamparithi.
>
>
>
>
>------------------------------------------------------------------
>Hi,
>
>Can you put ur code snnipet of opening file in IRP_MJ_CREATE?
>
>
>
>yatindra
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_____

Marriage? Join http:
BharatMatrimony.com for free.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@ati.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</http:></file:></news:xxxxx></mailto:xxxxx>