[Win32utils-devel] Playing with NtQueryInformationFile

Park Heesob phasis at gmail.com
Wed May 7 09:18:53 EDT 2008


Hi,
----- Original Message ----- 
From: "Daniel Berger" <djberg96 at gmail.com>
To: "Development and ideas for win32utils projects" <win32utils-devel at rubyforge.org>
Sent: Wednesday, May 07, 2008 8:57 PM
Subject: Re: [Win32utils-devel] Playing with NtQueryInformationFile


> On Wed, May 7, 2008 at 12:51 AM, Heesob Park <phasis at gmail.com> wrote:
>> Hi,
>>
>>  2008/5/7 Berger, Daniel <Daniel.Berger at qwest.com>:
>>  >
>>  >
>>  <snip>
>>
>> > Many thanks, that works.
>>  >
>>  > The AllocationSize returns the sectors, but I don't see a structure that
>>  > gives me bytes per sector. Or is it always 512?
>>  >
>>  >
>>  The AllocationSize returns not sectors but bytes.
>>  In my case, it returns 4096.
>>
>>  A file has two size. One is actual file size and the other is disk
>>  allocation size.
>>  Why do you want to get allocation size?
> 
> I'm trying to get File::Stat#blksize working. It's easy enough when I
> have the file _name_, but I'd like to get it from the file _handle_ so
> I can make it work properly.
> 
You must need some function like 'handle_to_fn'.
It can be implemented using NtQueryObject with ObjectNameInformation.

Regards,

Park Heesob


More information about the win32utils-devel mailing list