Crate winmmf_ffi

Source
Expand description

§An FFI interface for WinMMF

The recommended way of working with this interface is therefore to call this function for the first read, reuse the pointer provided for all subsequent reads by calling read_buf, and then freeing it with free_result with other teardown and exit steps for your program. If the lifetime for any MMFs should be &'static it’s possible to leave cleanup to the OS. But no guarantees are made if or when that happens.

During the lifetime of your program, if you decide to close any MMFs, they will be ejected from the inner collection. Should you need to reopen one, and you’re sure other handles to it yet live in the system, you can open it anew and your data should be there unchanged. Should you forget to free a pointer, use free_raw at your own risk.

Enums§

ValidNamespaces
Namespaces as an enum, to unambiguously represent relevant information.

Functions§

close
Close the MMF
free_raw
You had better know how big that thing is.
free_result
Free a pointer used for reading from an MMF by its index number.
init
Initialize the inner object to hold MMF instances.
new
Create a new MMF and push it into the list, returning the new index or an error indicator.
open
Open an existing MMF and push it into the list, returning its index or an error indicator.
open_ro
Convenience function to open a read-only MMF and get an index back to read from it.
read
Read count bytes or all contents from the MMF and give back a pointer to the data.
read_buf
Read count bytes from the MMF into the provided buffer.
select_default
Selects a different default mmf for all operations.
write
Expose writing data as well. Slightly less complex for FFI purposes than reading.