Category : memory-mapped-files

I wrote a simple inter-process communication with a memory-mapped file. The code works relatively well, but I have a problem with the buffer that I’ll explain shortly. Here is the code (C++, Windows): #define UNICODE #define _UNICODE #include <iostream> #include <tchar.h> #include <Windows.h> int wmain(int argc, wchar_t** argv) { if (argc != 2) { std::cout ..

Read more

I have written a simple test code that injects my hooking dll to some of Windows applications(explorer.exe, notepad.exe etc.) and in the target processes, I hooked Win32 API functions like CopyFileEx, CreateFile using EasyHook library. In my hooking function for instance Hooked_CopyFileExW, I need to send an event message (contains source file path, pid of ..

Read more

I have 1400 files (315GB), trying to optimize random access by mapping all these file, but get ERROR_NOT_ENOUGH_MEMORY on 7000 file(189GB), whats I’m doing wrogn (Windows 10, x64) auto hFileHadnle = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); auto mapper_handles = CreateFileMapping( hFileHadnle, // use paging file NULL, // default security PAGE_READONLY, // read access ..

Read more