MCPcopy Index your code
hub / github.com/RustPython/RustPython / MapViewOfFile

Function MapViewOfFile

crates/vm/src/stdlib/_winapi.rs:1973–1996  ·  view source on GitHub ↗
(
        file_map: WinHandle,
        desired_access: u32,
        file_offset_high: u32,
        file_offset_low: u32,
        number_bytes: usize,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

1971 /// MapViewOfFile - Map a view of a file mapping into the address space.
1972 #[pyfunction]
1973 fn MapViewOfFile(
1974 file_map: WinHandle,
1975 desired_access: u32,
1976 file_offset_high: u32,
1977 file_offset_low: u32,
1978 number_bytes: usize,
1979 vm: &VirtualMachine,
1980 ) -> PyResult<isize> {
1981 let address = unsafe {
1982 windows_sys::Win32::System::Memory::MapViewOfFile(
1983 file_map.0,
1984 desired_access,
1985 file_offset_high,
1986 file_offset_low,
1987 number_bytes,
1988 )
1989 };
1990
1991 let ptr = address.Value;
1992 if ptr.is_null() {
1993 return Err(vm.new_last_os_error());
1994 }
1995 Ok(ptr as isize)
1996 }
1997
1998 /// UnmapViewOfFile - Unmap a mapped view of a file.
1999 #[pyfunction]

Callers 1

py_newMethod · 0.85

Calls 2

new_last_os_errorMethod · 0.80
ErrClass · 0.50

Tested by

no test coverage detected