views:

160

answers:

2

Suddenly, we found out that WinXP SP3 didn't allow to create NTFS sparse file in user-mode application. Namely, DeviceIoControl with FSCTL_SET_SPARSE returns with error 0x57 (ERROR_INVALID_PARAMETER). The same code works well in SP2. Also, it's all ok if make the same calls from kernel-mode (both in SP3 and SP2).

Google says nothing about this. Has anyone met this problem or even have some additional info about it?

+1  A: 

Sparse files are working fine for me in WinXP SP3. What is the value of GetLastError after the call to CreateFile? Or after DeviceIoControl if that is what you are using?

This site has some good info on sparse files: http://www.flexhex.com/docs/articles/sparse-files.phtml

The MSDN documentation is a given.

Hi Adzm, it's interesting that it behaves differently. We get an 0x57 (ERROR_INVALID_PARAMETER) after DeviceIoControl (added these details into the question text). But, it happens only when we try to create sparse file in user mode, in kernel mode it works well.Thanks for the link.
Yakov
A: 

Hello, Sparse files work for me too in XP SP3: Here is small utility I wrote. Works

I haven't seen your code, but do you reset the value that is returned by the GetLastError() call (use SetLastError() to do that )? I mean before calling DeviceIoControl().

Regards

opal