MCPcopy Create free account
hub / github.com/Kudaes/Dumpy / create_file_mapping

Function create_file_mapping

dumpy/dinvoke/src/lib.rs:513–527  ·  view source on GitHub ↗

Dynamically calls CreateFileMappingW.

(file: HANDLE, attributes: *const SECURITY_ATTRIBUTES, protect: u32, max_size_high: u32, max_size_low: u32, name: *mut u8)

Source from the content-addressed store, hash-verified

511/// Dynamically calls CreateFileMappingW.
512///
513pub fn create_file_mapping (file: HANDLE, attributes: *const SECURITY_ATTRIBUTES, protect: u32, max_size_high: u32, max_size_low: u32, name: *mut u8) -> HANDLE {
514
515 unsafe
516 {
517 let ret: Option<HANDLE>;
518 let func_ptr: data::CreateFileMapping;
519 let kernel32 = get_module_base_address(&lc!("kernel32.dll"));
520 dynamic_invoke!(kernel32,&lc!("CreateFileMappingW"),func_ptr,ret,file,attributes,protect,max_size_high,max_size_low,name);
521
522 match ret {
523 Some(x) => return x,
524 None => return HANDLE { 0: 0 } ,
525 }
526 }
527}
528
529/// Dynamically calls MapViewOfFile.
530///

Callers 1

dumpFunction · 0.85

Calls 1

get_module_base_addressFunction · 0.85

Tested by

no test coverage detected