RE: Problems reading from a file on the network during op-en completio-n.

I’ve also discovered that if i do the following in the dispatch before i
pass the irp on.

Parameters.Create.SecurityContext->DesiredAccess |= FILE_READ_DATA;

The read described below passes and a few more opens pass, reads occur etc,
but the machine hangs.

-----Original Message-----
From: Rob Linegar [mailto:xxxxx@des.co.uk]
Sent: 20 September 2000 17:41
To: File Systems Developers
Cc: Duncan Hume
Subject: [ntfsd] Problems reading from a file on the network
during open
completio n.

Hi All,

Firstly, thanks to the two who replied to my last message, sending a
IRP_MJ_CLEANUP then an IRP_MJ_CLOSE fixed the problem I had.

My new problem is this!

In my worker during open completion I read a header from the
file that was
opened.
The code below works for all local filesystems, mapped and non mapped
network drives, apart from in one case.
This one case is when I’m trying to read the header during
when the file has
been opened CreateProcess.
IoCallDriver returns STATUS_INVALID_PARAMETER / 0xC000000D.
Open for the same file in notepad works fine.


KeInitializeEvent( &kEvent, NotificationEvent, FALSE );
pReadIrp = IoBuildSynchronousFsdRequest( IRP_MJ_READ, pDeviceObject,
pBuffer, Length, Offset, &kEvent, pIoStatusBlock );

if( pReadIrp )
{
PIO_STACK_LOCATION pReadStack =
IoGetNextIrpStackLocation( pReadIrp
);

OrigByteOffset = pFileObject->CurrentByteOffset;

pReadIrp->Flags = IRP_NOCACHE | IRP_READ_OPERATION;

pReadIrp->Tail.Overlay.Thread = KeGetCurrentThread();
pReadIrp->RequestorMode = KernelMode;

pReadStack->FileObject = pFileObject;
pReadStack->DeviceObject = pDeviceObject;

ntStatus = IoCallDriver( pDeviceObject, pReadIrp );

if (ntStatus == STATUS_PENDING)
KeWaitForSingleObject( &kEvent, Executive, KernelMode,
FALSE, NULL );
else
IoStatusBlock->Status = ntStatus;

pFileObject->CurrentByteOffset = OrigByteOffset;
}

Rob Linegar
Software Engineer
Data Encryption Systems Limited


You are currently subscribed to ntfsd as: xxxxx@des.co.uk
To unsubscribe send a blank email to $subst(‘Email.Unsub’)