2006-09-04 17:11:14 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: File Management IFS Utility functions
|
|
|
|
* FILE: reactos/dll/win32/fmifs/compress.c
|
|
|
|
* PURPOSE: Volume compression
|
1999-05-11 21:19:41 +00:00
|
|
|
*
|
2006-09-04 17:11:14 +00:00
|
|
|
* PROGRAMMERS: Emanuele Aliberti
|
1999-05-11 21:19:41 +00:00
|
|
|
*/
|
2006-09-04 17:11:14 +00:00
|
|
|
|
2005-10-19 17:03:38 +00:00
|
|
|
#include "precomp.h"
|
1999-05-11 21:19:41 +00:00
|
|
|
|
2004-09-15 13:32:27 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2014-07-06 14:03:04 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2006-09-04 17:11:14 +00:00
|
|
|
EnableVolumeCompression(
|
2014-07-06 14:03:04 +00:00
|
|
|
IN PWCHAR DriveRoot,
|
|
|
|
IN USHORT Compression)
|
1999-05-11 21:19:41 +00:00
|
|
|
{
|
2014-07-06 14:03:04 +00:00
|
|
|
HANDLE hFile;
|
|
|
|
DWORD RetBytes;
|
|
|
|
BOOL Ret;
|
|
|
|
|
|
|
|
hFile = CreateFileW(DriveRoot,
|
|
|
|
FILE_READ_DATA | FILE_WRITE_DATA,
|
|
|
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
|
|
|
NULL,
|
|
|
|
OPEN_EXISTING,
|
|
|
|
FILE_FLAG_BACKUP_SEMANTICS,
|
|
|
|
NULL);
|
|
|
|
if (hFile == INVALID_HANDLE_VALUE)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
Ret = DeviceIoControl(hFile,
|
|
|
|
FSCTL_SET_COMPRESSION,
|
|
|
|
&Compression,
|
|
|
|
sizeof(USHORT),
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
&RetBytes,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
CloseHandle(hFile);
|
|
|
|
|
|
|
|
return (Ret != 0);
|
1999-05-11 21:19:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|