Function wintun::load

source ·
pub unsafe fn load() -> Result<Wintun, Error>
Expand description

Attempts to load the Wintun library from the current directory using the default name “wintun.dll”.

Use load_from_path with an absolute path when more control is needed as to where wintun.dll is

Safety

This function loads a dll file with the name wintun.dll using the default system search paths. This is inherently unsafe as a user could simply rename undefined_behavior.dll to wintun.dll and do nefarious things inside of its DllMain function. In most cases, a regular wintun.dll file which exports all of the required functions for these bindings to work is loaded. Because WinTun is a well-written and well-tested library, loading a normal wintun.dll file should be safe. Hoverer one can never be too cautious when loading a dll file.

For more information see libloading’s dynamic library safety guarantees: libloading