MCPcopy Create free account
hub / github.com/Recordscript/recordscript / load_func

Method load_func

libs/scrap/src/dxgi/mag.rs:191–205  ·  view source on GitHub ↗
(lib_module: HMODULE, func_name: &str)

Source from the content-addressed store, hash-verified

189 }
190
191 unsafe fn load_func(lib_module: HMODULE, func_name: &str) -> Result<FARPROC> {
192 let func_name_c = CString::new(func_name)?;
193 let func = GetProcAddress(lib_module, func_name_c.as_ptr() as _);
194 if func.is_null() {
195 return Err(Error::new(
196 ErrorKind::Other,
197 format!(
198 "Failed to GetProcAddress {}, error {}",
199 func_name,
200 Error::last_os_error()
201 ),
202 ));
203 }
204 Ok(func)
205 }
206
207 pub(super) fn uninit(&mut self) {
208 if self.init_succeeded {

Callers

nothing calls this directly

Calls 1

is_nullMethod · 0.45

Tested by

no test coverage detected