I need to finish a C program, but I'm stuck in the shared memory part of a task.
Basically this is what I should do:
MapViewOfFilereturns a pointer to voidwhich you can overlay on anything. I suggest you create a structure that represents the structure that you would like to have in your memory and put a return pointer on that structure.
I call a function MapViewOffFile, but I donβt understand how I should point to the structure of it. The code:
typedef struct {
LARGE_INTEGER start;
LARGE_INTEGER end;
LARGE_INTEGER frq;
} TimeOfSharing;
TimeOfSharing timing;
HANDLE fileView;
fileView = MapViewOfFile(fileHandle, FILE_MAP_READ | FILE_MAP_WRITE,PAGE_READONLY, 0, 0);
So how do I point fileViewto my structure? (I need to get the structure from another process)
Hope I was clear enough! Many thanks!
source
share