ZwCreateFile

Hi All,

can sombody explain why this is hanging at zwcreatefile call. Trying to
create a file from within driver.

HANDLE handle;
OBJECT_ATTRIBUTES InitializedAttributes;
IO_STATUS_BLOCK ioStatusBlock;
NTSTATUS ntStatus;
UNICODE_STRING uniFileName;

RtlInitUnicodeString(&uniFileName, L"\??\c:\Mydata.dat");

InitializeObjectAttributes(&InitializedAttributes,
&uniFileName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);

ntStatus = ZwCreateFile(&handle,
FILE_WRITE_DATA,
&InitializedAttributes,
&ioStatusBlock,
NULL,
FILE_ATTRIBUTE_NORMAL,
0,
FILE_OVERWRITE_IF,
FILE_NON_DIRECTORY_FILE,
NULL,
0);

TIA
-Fareed

When are you calling this? In a dispatche handler?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of fareed mohammed
Sent: Thursday, August 03, 2000 2:18 PM
To: NT Developers Interest List
Subject: [ntdev] ZwCreateFile

Hi All,

can sombody explain why this is hanging at zwcreatefile call. Trying to
create a file from within driver.

HANDLE handle;
OBJECT_ATTRIBUTES InitializedAttributes;
IO_STATUS_BLOCK ioStatusBlock;
NTSTATUS ntStatus;
UNICODE_STRING uniFileName;

RtlInitUnicodeString(&uniFileName, L"\??\c:\Mydata.dat");

InitializeObjectAttributes(&InitializedAttributes,
&uniFileName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);

ntStatus = ZwCreateFile(&handle,
FILE_WRITE_DATA,
&InitializedAttributes,
&ioStatusBlock,
NULL,
FILE_ATTRIBUTE_NORMAL,
0,
FILE_OVERWRITE_IF,
FILE_NON_DIRECTORY_FILE,
NULL,
0);

TIA
-Fareed


You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)