MCPcopy Create free account
hub / github.com/Freaky/Compactor / uncompress_file_handle

Function uncompress_file_handle

src/compact.rs:327–348  ·  view source on GitHub ↗
(file: &std::fs::File)

Source from the content-addressed store, hash-verified

325}
326
327pub fn uncompress_file_handle(file: &std::fs::File) -> std::io::Result<()> {
328 let mut bytes_returned: DWORD = 0;
329
330 let ret = unsafe {
331 DeviceIoControl(
332 file.as_raw_handle() as HANDLE,
333 FSCTL_DELETE_EXTERNAL_BACKING,
334 std::ptr::null_mut(),
335 0,
336 std::ptr::null_mut(),
337 0,
338 &mut bytes_returned,
339 std::ptr::null_mut(),
340 )
341 };
342
343 if SUCCEEDED(ret) {
344 Ok(())
345 } else {
346 Err(std::io::Error::from_raw_os_error(HRESULT_CODE(ret)))
347 }
348}
349
350#[link(name = "WofUtil")]
351extern "system" {

Callers 2

uncompress_fileFunction · 0.85
handle_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected