Displaying 1 result from an estimated 1 matches for "fsctl_set_compress".
2004 Nov 07
2
Problems with DeviceIoControl()
...ORMAT_NONE;
}
fn =
NUM2INT(rb_funcall(self,rb_intern("fileno"),0,0));
h = (HANDLE)_get_osfhandle(fn); // Get HANDLE based
on fileno
if(h == INVALID_HANDLE_VALUE){
rb_raise(cFileError,ErrorDescription(GetLastError()));
}
rv = DeviceIoControl(
h,
FSCTL_SET_COMPRESSION,
(LPVOID)inBuf,
sizeof(inBuf),
NULL,
0,
&dwBytesReturned,
NULL
);
if(!rv){
rb_raise(cFileError,ErrorDescription(GetLastError()));
}
return self;
}
// Inside Init_file()
rb_define_method(rb_cFile,"compressed=",file_set_com...