tags:

views:

31

answers:

1

How to use createfile api open pagefile.sys and get it's handle ? How does pagedfrg.exe tool open pagefile.sys and get it's file cluster info?

I want to using FSCTL_QUERY_RETRIEVAL_POINTERS to get this file's cluster info. The intent is to send strictly this FSCTL to analyze the used clusters for statistical purposes.

A: 

AFAIK, all defragment tools which try to defrag pagefile.sys work in offline mode (outside Windows). I think they write a kernel driver for that purpose, and use ZwCreateFile() to get the handle of pagefile.sys file. They are likely also utilyzing ZwDeviceIoControlFile() to access files in sector based.

Vantomex