finestre-sys 0.1.0

Bare-bones bindings for a very limited subset of the Win32 API. Advise you use the official windows-sys crate instead.
Documentation
mod consts;
pub use consts::*;
use crate::typedefs::*;


#[link(name = "Kernel32")]
unsafe extern "system" {
    pub unsafe fn GetLastError() -> DWORD;
    pub unsafe fn GetCurrentProcessId() -> DWORD;
    pub unsafe fn GlobalAddAtomW(atom_name: LPCWSTR) -> ATOM;
    pub unsafe fn GlobalDeleteAtom(atom: ATOM) -> ATOM;
    pub unsafe fn CloseHandle(handle: HANDLE) -> BOOL;


    pub unsafe fn CreateFileMappingW(
        file: HANDLE,
        file_mapping_attributes: *const SecurityAttributes,
        page_protection: DWORD,
        max_size_high: DWORD,
        max_size_low: DWORD,
        name: LPCWSTR,
    ) -> HANDLE;

    pub unsafe fn UnmapViewOfFile(
        base_address: LPCVOID,
    ) -> BOOL;

    pub unsafe fn MapViewOfFile(
        file_mapping_object: HANDLE,
        desired_access: DWORD,
        file_offset_high: DWORD,
        file_offset_low: DWORD,
        number_of_bytes_to_map: SIZE_T,
    ) -> LPVOID;
}

#[repr(C)]
#[derive(finestre_init_with_size_derive::InitWithSize)]
pub struct SecurityAttributes {
    #[size_field]
    pub length: DWORD,
    pub security_descriptor: LPVOID,
    pub inherit_handle: BOOL,
}