Questions tagged [file-mapping]

87 questions
0
votes
1 answer

how to create a share memory pool in windows

I want to make a share memory pool for all the other process to share the data, but after I read about the CreateFileMapping API document, I was confused about that it will need to specify the size of the share memory. I actually want it to be…
Cyber_Rush
  • 43
  • 4
0
votes
0 answers

Trouble locking physical memory for shared memory using Windows functions

I have been trying to use the CreateFileMapping and PrefetchVirtualMemory functions provided by Windows to share memory between processes. However, I am having trouble locking the physical memory so that it can be read by other processes. Can anyone…
0
votes
0 answers

How to get the mapped file object name from the objecthandle in C++?

I am working on a project where I need to decrypt some media files which are mapped to memory by a process. I have successfully hooked the CreateFileW() and MappedViewOfFile() functions. I need to verify the "name of mapping object" inside the…
0
votes
1 answer

CreateFileMapping size limit in a 64-bit process

Is there a size limit to the file mapping object? The reason I'm asking is that there is a mentioning of 2GB limit somewhere in MSDN (lost the track..) and I also checked this sample, which also expects 2GB size…
mrzacek mrzacek
  • 308
  • 2
  • 12
0
votes
1 answer

WINAPI Cpp - OpenFileMapping fails with error (2) ERROR_FILE_NOT_FOUND

I'm trying to use WinApi to CreateFileMapping, MapViewOfFile and CopyMemory. It's not showhing me errors and buffor is being filed with my PID int write_pid_to_memory(const char *t_pid) { _tprintf(TEXT("[write_pid_to_memory] t_pid: (%s).\n"),…
0
votes
1 answer

SetEndOfFile error 1224: ERROR_USER_MAPPED_FILE, even the file mapping closed successfully

I'm writing a program which logs out to the file with file-mapping. When I want to read the log, Logger::Destroy() is called so that the content writed on file-mapped-view could be flushed to the physical file. The code is as follows: int…
coding monster
  • 384
  • 4
  • 18
0
votes
1 answer

C++ too many initializer values on GENERIC_READ when creating a file mapping object

I'm trying to create a file mapping object but I'm experiencing a few compiler errors. (I'm using MinGW GCC-8.2.0-3) I'm getting the following error from VS-code: too many initializer values on the GENERIC_READ line. HANDLE CreateFile( …
Handge
  • 75
  • 1
  • 2
  • 15
0
votes
1 answer

Reading large files on Linux vs Windows (mmap vs CreateFileMapping/MapViewOfFile)

I have to read some data line by line from a large file (more than 7GB), it contains a list of vertex coordinates and face to vertex connectivity information to form a mesh. I am also learning how to use open, mmap on Linux and CreateFileA,…
lucmobz
  • 151
  • 1
  • 6
0
votes
0 answers

Is Windows File-Mapping (named) invalidated by file overwrites?

We have a data processing engine that uses reference data that is mapped into memory when first opened using CreateFile and CreateFileMapping from the Windows API. This results in the data being cached for each portion of the file that is read, and…
0
votes
0 answers

Prevent CreateFileMapping from altering source file (Windows)

I'm studying Memory Mapping on Windows and wrote the following piece code (I omitted error handling from the copy for the sake of readability): HANDLE file_h = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING,…
Kron
  • 75
  • 7
0
votes
0 answers

Determining whether a file has a open file mapping - is there a less hackish approach?

We need to determine whether a file we have open has an open file mapping handle or mapped view. The only method I have found which should work is to use SetEndOfFile to attempt to add a few bytes to the end of the file, and remove these again, and…
0
votes
1 answer

How to improve general i/o to be on par with file mapping

File mapping is great, but for comparatively large files on 32-bit system one should forget about it and implement everything with general file i/o. For large random reads and write the system cache works almost as good as file mapping. But for…
Maksee
  • 2,311
  • 2
  • 24
  • 34
0
votes
1 answer

Shared data Filemapping

Hello I want to share an object from a class from a P1 process to a P2.exe process using the filemapping from microsoft: https://msdn.microsoft.com/fr-fr/library/windows/desktop/aa366537(v=vs.85).aspx. P1 write the datas and P2 read them. I want to…
John Summer
  • 15
  • 1
  • 5
0
votes
0 answers

Opening apps for corresponding file type

How to open file with associated application when clicked in ios using swift? The file type can be anything like .pdf, .html, .png, .mp4 in swift? How do I open the default file manager app in iphone using swift and import the selected file?
Prabu Raj
  • 577
  • 1
  • 6
  • 11
0
votes
1 answer

Memory mapping on file expires?

I have a file on which I use memory mapping to create huge array (which may not fit in physical memory). There are two areas mapped on memory - array count (4 bytes) and some window which is moving on file to get access to different elements of…
Mike K.
  • 145
  • 10