This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// | |
// Magic Ring Buffer | |
// https://gist.github.com/mmozeiko/3b09a340f3c53e5eaed699a1aea95250 | |
// | |
// Sets up memory mapping so the same memory block follows itself in virtual address space: | |
// | |
// [abcd...xyz][abc...xyz] | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <cstdio> | |
#include "ntos.h" | |
#define WINIO_DEVICE_TYPE (DWORD)0x8010 | |
#define WINIO_MAP_FUNCID (DWORD)0x810 | |
#define WINIO_UNMAP_FUNCID (DWORD)0x811 | |
#define IOCTL_WINIO_MAP_USER_PHYSICAL_MEMORY \ |