I tried with mentioned changes i.e.
ObOpenObjectByPointer( pFileObj, OBJ_FORCE_ACCESS_CHECK, NULL, FILE_READ_DATA | FILE_WRITE_DATA| SYNCHRONIZE,
*IoFileObjectType, UserMode, &hFile );
Modified this call as mentioned but while using this handle with readfile, call return with error as INVALID_HANDLE.
its simple readfile call as
if( !ReadFile(hFile,&Start,sizeof(INFO),&dwRead,&obTemp)) where obTemp is OVERLAPPED structure and its field are set to o as obTemp.Offset = 0;
obTemp.OffsetHigh = 0;
Any idea why its failing?
From: xxxxx@hotmail.com
To: xxxxx@lists.osr.com
Subject: RE: [ntfsd] GetFileHandle from filter
Date: Tue, 14 Dec 2010 18:39:39 +0530
I will make design changes to support both approach.
But still user buffer should work as am passing “UserMode” parameter to ObOpenObjectByPointer function.
Is there anything that needs to be taken care?
I have not tried yet with mentioned changes. I will do that as well.
Thank you so much.
Date: Mon, 13 Dec 2010 10:39:24 -0500
From: xxxxx@xythos.com
To: xxxxx@lists.osr.com
Subject: RE:[ntfsd] GetFileHandle from filter
It looks like invalid parameter is buffer laying in user mode address space. I would try OBJ_FORCE_ACCESS_CHECK and add SYNCHRONIZE access. You cannot specify CreateOptions with this API, so it is not clear if you can use synchronous or asynchronous read. Try asynchronous read and fill offset in each operation. You know it is not official way, so even if you find a way how it works, it may be broken in future by some security update.
Change your design, so it works always. e.g. IOCTL calls, or communication through pipes, pending IPRs (inverted call)…
Good luck,
Bronislav Gabrhelik
NTFSD is sponsored by OSR
For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
NTFSD is sponsored by OSR
For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer