Let’s say I’m opening a file with NtCreateFile (user mode) .
Is there an class in e.g NtQueryInformationFile that for given handle will return share access anyhow?
There is access class, but it looks like i returns only informaiton about desired access.
If you are opening the file, you know what you are asking for so just store that information alongside the file HANDLE
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, February 14, 2014 11:32 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] get file access from file handle
Hello,
Let’s say I’m opening a file with NtCreateFile (user mode) .
Is there an class in e.g NtQueryInformationFile that for given handle will return share access anyhow?
There is access class, but it looks like i returns only informaiton about desired access.
hehe yes, I just realized that this question looks somehow stupid.
Basically I need to write test application that will check if minifilter is working correct and was wondering if I can do assertion with checking stripped access by taking it from file handle.
So is there such option?
Let’s say I’m opening a file with NtCreateFile (user mode) .
Is there an class in e.g NtQueryInformationFile that for given handle will return share access anyhow?
There is access class, but it looks like i returns only informaiton about desired access.
Is there any possibility to take it in user mode?
NtQueryInformationFile(FileAccessInformation) returns desired access,
not filtered (granted)? Is this correct behavior?
>NtQueryInformationFile(FileAccessInformation) returns desired access,
not filtered (granted)? Is this correct behavior?
not sure if I understand you correct.
You want to say that whem minifilter will filter out some access - then NtQuery with access interomation class will return not filtered access? Are you sure? I think if I would work as you say - this would be wierd since when calling this API you expect to receive real information.
Anyway - this is only partial infomation - what about shared access?
> NtQueryInformationFile(FileAccessInformation) returns desired access,
not filtered (granted)? Is this correct behavior?
not sure if I understand you correct.
You want to say that whem minifilter will filter out some access - then NtQuery with access interomation class will return not filtered access? Are you sure? I think if I would work as you say - this would be wierd since when calling this API you expect to receive real information.
Anyway - this is only partial infomation - what about shared access?
You wrote that NtQuery returned the desired access to you, not filtered
(actually granted) - this is surprising. IIRC it should return the
granted access.
Unfortunately I could not find answer to your question how to get the
sharing mode.
– pa