1 // Copyright 2024 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 use std::ffi::CString; 6 use windows_sys::Win32::Storage::FileSystem::{OpenFile, OFSTRUCT}; 7 main()8fn main() { 9 let filename = CString::new("hi").unwrap(); 10 let mut out = OFSTRUCT { 11 cBytes: 0, 12 fFixedDisk: 0, 13 nErrCode: 0, 14 Reserved1: 0, 15 Reserved2: 0, 16 szPathName: [0; 128], 17 }; 18 let ustyle: u32 = 0; 19 unsafe { OpenFile(filename.as_bytes().as_ptr(), &mut out as *mut OFSTRUCT, ustyle) }; 20 } 21