Are there any places where one is preferable to another? Is there a performance impact to using one over the other?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
@Alex K.: Small remark:
NtFsControlFileis documented in http://msdn.microsoft.com/en-us/library/ff566462(v=VS.85).aspx. Kernel mode application should useZwFsControlFilefunction and user mode application can useNtFsControlFile.@vedang: From you question I would assume that you don’t a developer of kernel mode driver. So I will strictly recommend you to use only
DeviceIoControlto sendFSCTL_XXXcodes http://msdn.microsoft.com/en-us/library/aa364230(v=VS.85).aspx.Only if you plan to write an application which don’t use Win32 subsystem and use NT native subsystem only like a small checkdisk application or disk defragmentation application which run at the beginning of the windows start (see session manager registry key) than you will have advantage in using of
NtFsControlFile. In all cases of usual work you should use onlyDeviceIoControl.