Skip to content

Box allocations lead to BSOD: PAGE_FAULT #326

@balenamiaa

Description

@balenamiaa
let rw_buffer = Box::new([0u8; align_size(NONPAGED_BUFFER_SIZE)]);
let rw_buffer: Box<[u8; align_size(NONPAGED_BUFFER_SIZE)]> = unsafe { Box::new_uninit().assume_init() };

Both of these fails. ExAllocatePool2 with the same size succeeds. Using alloc directly also succeeds:

let rw_buffer: *mut u8 = unsafe { alloc(Layout::new::<[u8; align_size(NONPAGED_BUFFER_SIZE)]>()) };

It's probably the cause I am not understanding something, but if that's so, I think it's important it's documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions