AllocationSize in ZwCreateFile/NTCreateFile

Hi,

I am trying to create a file with a specific size allocated to it. I thought, NTCreateFile should be able to do that.

But whatever I specify as Allocationsize, the file created is always 0 bytes if I close the file.

Is there a limitation in user mode? Or is there a specific way of writing the function?

Specs say that the File should be opened for Create only, that is all.

Any help on this will be greatly appreciated.

Thanks

Basudeb

Allocation size does not say anything about the real file size.
It’s just disk space occuppied by the file.

Try to call NtQueryInformationFile, you will see that the file
has the allocation size requested by you. You can use
FileTest utility (available at osronline.com), this thingy
has been created exactly for this playing.

L.