Questions tagged [file-mapping]

87 questions
3
votes
2 answers

Overlapped IO or file mapping?

In a Windows application I have a class which wraps up a filename and a buffer. You construct it with a filename and you can query the object to see if the buffer is filled yet, returning nullptr if not and the buffer addres if so. When the object…
hatcat
  • 1,876
  • 1
  • 18
  • 37
3
votes
2 answers

linux - map nonlinear parts of file

I have a scenario where I need to map non-linear parts of a file, linearly in a process space. For example, if file is 10 pages, I may need to map first 3, skip 4, and last 3. The mapping should be linear, s.t. incremental access in process space…
Jake
  • 16,329
  • 50
  • 126
  • 202
2
votes
1 answer

How to handle different templates in a similar way?

I have been dealing with a problem for several days and still have no proper solution. Imagine I have several (number can vary) instruments. Each instrument produces data of different type. For each instrument I have a structure (I show very…
Alexander
  • 43
  • 5
2
votes
1 answer

How can I decommit a file-mapped page?

I have a memory mapped file, and a page in a view which is currently committed. I would like to decommit it. MapViewOfFile tells me I cannot use VirtualFree on file mapped pages. Is there some other way to do it?
Suma
  • 33,181
  • 16
  • 123
  • 191
2
votes
1 answer

Trying to create a global file mapping object from a user-mode process fails

I have a Windows app that runs without requiring elevation. I need to create a file mapping object for a memory array to be shared between all running instances of the app (note that some of those instances may run in different logon sessions.) I…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
2
votes
1 answer

MapViewOfFile and VirtualLock

Will the following code load data from file into system memory so that access to the resulting pointer will never block threads? auto ptr = VirtualLock(MapViewOfFile(file_map, FILE_MAP_READ, high, low, size), size); // Map file to memory and wait…
ronag
  • 49,529
  • 25
  • 126
  • 221
2
votes
2 answers

How do I allow a segment of memory to be swapped out to disk, when more RAM is needed by the application?

I have a large matrix of values that takes up about 2GB of RAM. I need to form a copy of this matrix, then the original can be swapped out to disk, to be loaded later. The contents of this matrix are important. Computing it initially is expensive,…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
2
votes
1 answer

Access denied on CreateFileMapping when run under different user accounts with runas

This code gives me access denied errors when trying to open previously created file mapping. Help, help, help. OS: WinXP SP3, no fast user switching. Following code is run on 2 different user accounts using runas. Both users have Administrator…
Ivarpoiss
  • 1,025
  • 1
  • 10
  • 18
1
vote
2 answers

How do I add a drop down list of strings that represent different worksheet names in Excel 2007?

I have recently been placed on a reporting project for my job. My overall objective is to make a report of 9 different charts that is able to filter the data by date and also by group. There are 22 different groups and I need to drill down to show…
Sean Montana
  • 445
  • 6
  • 22
1
vote
1 answer

How to send a bitmap and text data thought processes using file mapping?

Im trying to send a bitmap and some text string from a script to another using file mapping, below is my attempt: FM := new FileMapping() Return F1:: FM.Read() Esc::ExitApp F2:: ; Write the pbitmap to map ; GDIp startup VarSetCapacity(si, 8 +…
Cesar
  • 41
  • 2
  • 5
  • 16
1
vote
1 answer

How to find the end of a memory mapped file in Windows platform without previously knowing the size of the file?

I have mapped a file of unknown size (around 4-6 GiB) in Windows platform and got a pointer to the start of the file data returned from the MapFileView function. But how can I know that I have reached the end of the file when I access the data using…
Rohan Saha
  • 15
  • 4
1
vote
1 answer

Resize a memory mapped file on windows without invalidating pointers

I would like to resize a memory mapped file on windows, without invalidating the pointer retrieved from a previous call to MapViewOfFileEx. This way, all pointers to any file data that are stored throughout the application are not invalidated by the…
tly
  • 1,202
  • 14
  • 17
1
vote
1 answer

C++ Named Shared Memory on Windows, SSD vs HDD

I am using NSM to exchange data between separate processes, and it's all working fine and dandy, however the memory space is declared in the page file, which I think is a default way of doing it. hMapFile = CreateFileMapping( …
1
vote
1 answer

Exception thrown at 0x00007FFF168E1657 (vcruntime140d.dll) in ".exe": 0xC0000005: Access violation writing location 0x0000000000000000

I tried creating two different visual c++ console applications for Inter Process Communication(IPC). The Build for both codes is successful.But,when I try to debug it, I get exception like this "Exception thrown at 0x00007FFF168E1657…
Prabakar
  • 174
  • 2
  • 4
  • 14
1
vote
2 answers

How to remap view of shared memory via file mapping object?

Say, if I have a shared file mapping object: HANDLE hFileMapping = ::CreateFileMapping(INVALID_HANDLE_VALUE, &sa, PAGE_READWRITE, 0, 0x8000, L"MyObjectName"); and I got a small chunk of it for view, as such: BYTE* pData =…
c00000fd
  • 20,994
  • 29
  • 177
  • 400