implemented EnableVolumeCompression()

svn path=/trunk/; revision=10864
This commit is contained in:
Thomas Bluemel 2004-09-15 13:32:27 +00:00
parent 919419da33
commit 650bd77805
3 changed files with 36 additions and 7 deletions

View file

@ -1,4 +1,4 @@
/* $Id: compress.c,v 1.2 2004/02/23 11:55:12 ekohl Exp $ /* $Id: compress.c,v 1.3 2004/09/15 13:32:26 weiden Exp $
* *
* COPYING: See the top level directory * COPYING: See the top level directory
* PROJECT: ReactOS * PROJECT: ReactOS
@ -12,14 +12,42 @@
#define UNICODE #define UNICODE
#define _UNICODE #define _UNICODE
#include <windows.h> #include <windows.h>
#include <winioctl.h>
#include <fmifs.h> #include <fmifs.h>
/* FMIFS.4 */ /*
BOOLEAN STDCALL * @implemented
*/
BOOL STDCALL
EnableVolumeCompression (PWCHAR DriveRoot, EnableVolumeCompression (PWCHAR DriveRoot,
BOOLEAN Enable) USHORT Compression)
{ {
HANDLE 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)
{
DWORD RetBytes;
BOOL Ret = DeviceIoControl(hFile,
FSCTL_SET_COMPRESSION,
&Compression,
sizeof(USHORT),
NULL,
0,
&RetBytes,
NULL);
CloseHandle(hFile);
return (Ret != 0);
}
return FALSE; return FALSE;
} }

View file

@ -1,4 +1,4 @@
/* $Id: format.c,v 1.4 2004/02/23 11:55:12 ekohl Exp $ /* $Id: format.c,v 1.5 2004/09/15 13:32:27 weiden Exp $
* *
* COPYING: See the top level directory * COPYING: See the top level directory
* PROJECT: ReactOS * PROJECT: ReactOS
@ -12,6 +12,7 @@
#define UNICODE #define UNICODE
#define _UNICODE #define _UNICODE
#include <windows.h> #include <windows.h>
#include <ntddk.h>
#include <fmifs.h> #include <fmifs.h>
#include <fslib/vfatlib.h> #include <fslib/vfatlib.h>
#include <string.h> #include <string.h>

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.22 2004/05/29 21:24:43 hbirr Exp $ # $Id: makefile,v 1.23 2004/09/15 13:32:27 weiden Exp $
PATH_TO_TOP = ../.. PATH_TO_TOP = ../..
@ -10,7 +10,7 @@ TARGET_BASE = $(TARGET_BASE_LIB_FMIFS)
TARGET_ENTRY = _InitializeFmIfs@12 TARGET_ENTRY = _InitializeFmIfs@12
TARGET_CFLAGS = -fno-builtin -Werror -Wall TARGET_CFLAGS = -fno-builtin -Werror -Wall -D__USE_W32API
# require os code to explicitly request A/W version of structs/functions # require os code to explicitly request A/W version of structs/functions
TARGET_CFLAGS += -D_DISABLE_TIDENTS TARGET_CFLAGS += -D_DISABLE_TIDENTS