I have written a simple test code that injects my hooking dll to some of Windows applications(
notepad.exe etc.) and in the target processes, I hooked Win32 API functions like
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 target process etc.) from target process to my application. After receiving the message from my appliation, based on file’s content I will decide to complete the copy operation or block it. Also I need source and destination paths for logging purposes. I decided to use memory mapped file to send these file name information since it is an efficient method.
My purpose is to create a queue in memory mapped file to organise events. It is kind of a producer consumer problem.
How can I implement such a queue using linked list in a memory mapped file?
I know how to do it using arrays but I want do it using linked list. I feel like linked list is a better way since it can grow and shrink at each enqueue and dequeue operation dynamically. Which method is more convenient? If it is linked list, little help would be very appreciated. I do not have any idea about handling pointers in each linked list node because memory block in a memory mapped file is contiguous, there is only a starting address of it. Or beside all of this, do you recommend any other way to accomplish this task?
Source: Windows Questions