MCPcopy Create free account
hub / github.com/PowerShell/DSC / load_fn

Function load_fn

resources/dism_dsc/src/dism.rs:153–162  ·  view source on GitHub ↗
(lib: *mut c_void, name: &[u8])

Source from the content-addressed store, hash-verified

151}
152
153unsafe fn load_fn<T>(lib: *mut c_void, name: &[u8]) -> Result<T, String> {
154 unsafe {
155 let ptr = GetProcAddress(lib, name.as_ptr());
156 if ptr.is_null() {
157 let fn_name = std::str::from_utf8(&name[..name.len() - 1]).unwrap_or("?");
158 return Err(t!("dism.functionNotFound", name = fn_name).to_string());
159 }
160 Ok(std::mem::transmute_copy(&ptr))
161 }
162}
163
164struct DismApi {
165 lib: *mut c_void,

Callers 2

loadMethod · 0.85
openMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected