fixes for win32

This commit is contained in:
Andrea Fioraldi 2021-03-18 16:33:12 +01:00
parent cc0da780ef
commit 1e7a5ebe81
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
fn main() { fn main() {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
windows::build!( windows::build!(
windows::win32::system_services::{HANDLE, BOOL}, windows::win32::system_services::HANDLE,
windows::win32::windows_programming::CloseHandle, windows::win32::windows_programming::CloseHandle,
// API needed for the shared memory // API needed for the shared memory
windows::win32::system_services::{CreateFileMappingA, OpenFileMappingA, MapViewOfFile, UnmapViewOfFile}, windows::win32::system_services::{CreateFileMappingA, OpenFileMappingA, MapViewOfFile, UnmapViewOfFile},

View File

@ -446,7 +446,7 @@ pub mod shmem {
use super::ShMem; use super::ShMem;
use crate::{ use crate::{
bolts::bindings::{ bolts::bindings::{
windows::win32::system_services::{HANDLE, BOOL}, windows::win32::system_services::{HANDLE, BOOL, PAGE_TYPE},
windows::win32::system_services::{ windows::win32::system_services::{
CreateFileMappingA, MapViewOfFile, OpenFileMappingA, UnmapViewOfFile, CreateFileMappingA, MapViewOfFile, OpenFileMappingA, UnmapViewOfFile,
}, },
@ -460,7 +460,7 @@ pub mod shmem {
const INVALID_HANDLE_VALUE: isize = -1; const INVALID_HANDLE_VALUE: isize = -1;
const FILE_MAP_ALL_ACCESS: u32 = 0xf001f; const FILE_MAP_ALL_ACCESS: u32 = 0xf001f;
const PAGE_READWRITE: u32 = 0x04; //const PAGE_READWRITE: u32 = 0x04;
/// The default Sharedmap impl for windows using shmctl & shmget /// The default Sharedmap impl for windows using shmctl & shmget
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
@ -543,7 +543,7 @@ pub mod shmem {
let handle = CreateFileMappingA( let handle = CreateFileMappingA(
HANDLE(INVALID_HANDLE_VALUE), HANDLE(INVALID_HANDLE_VALUE),
ptr::null_mut(), ptr::null_mut(),
PAGE_READWRITE, PAGE_TYPE::PAGE_READWRITE,
0, 0,
map_size as u32, map_size as u32,
map_str_bytes.as_ptr() as *const i8, map_str_bytes.as_ptr() as *const i8,