System Failure

Hi all,
I have odd problem with my driver, when I calls ‘ZwCreateFile’ function in my DispatchRoutine system WinXP switches off and it restart, but when I calls the same function ‘ZwCreateFile’ in DriverEntry function all is OK - why does??

My ‘ZwCreateFile’ function has such figure:

HANDLE uchwyt;
OBJECT_ATTRIBUTES Atrybuty ;
IO_STATUS_BLOCK blok ;

status = ZwCreateFile( &uchwyt,
SYNCHRONIZE | FILE_APPEND_DATA,
&Atrybuty,
&blok,
NULL,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_WRITE | FILE_SHARE_READ,
FILE_OPEN_IF,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL, 0 ) ;

I do not know if this is important, but at the beginning of my driver are such declarations:
#pragma alloc_text (INIT, DriverEntry)
#pragma alloc_text (PAGE, Ctrl2capDispatchGeneral) //My DispatchRoutine

Grand merci for every help - THX
It greeting from Polish.

>I do not know if this is important, but at the beginning of my driver are such declarations:

#pragma alloc_text (INIT, DriverEntry)
#pragma alloc_text (PAGE, Ctrl2capDispatchGeneral) //My DispatchRoutine

You SHOULD know if these are important. You have no business trying to write a driver without knowning about paged, nonpaged, and init sections.

You also can’t write a driver without knowing about IRQL and being able to understand the sentence about it at the bottom of the page describing a driver function.

This stuff is in the manual. Its there because it is important.

Loren

How many times must this be explained on this list?

For Christ’s sake, read the DDK documents.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marcin O.
Sent: Monday, July 14, 2003 2:49 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] System Failure

Hi all,

I have odd problem with my driver, when I calls ‘ZwCreateFile’
function in my DispatchRoutine system WinXP switches off and it restart,
but when I calls the same function ‘ZwCreateFile’ in DriverEntry
function all is OK - why does??

My ‘ZwCreateFile’ function has such figure:

HANDLE uchwyt;
OBJECT_ATTRIBUTES Atrybuty ;
IO_STATUS_BLOCK blok ;

status = ZwCreateFile( &uchwyt,
SYNCHRONIZE | FILE_APPEND_DATA,
&Atrybuty,
&blok,
NULL,
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_WRITE | FILE_SHARE_READ,
FILE_OPEN_IF,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL, 0 ) ;

I do not know if this is important, but at the beginning of my driver
are such declarations:

#pragma alloc_text (INIT, DriverEntry)
#pragma alloc_text (PAGE, Ctrl2capDispatchGeneral) //My
DispatchRoutine

Grand merci for every help - THX
It greeting from Polish.


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