Questions tagged [file-mapping]

87 questions
1
vote
1 answer

Using file mapping in different sessions on Windows

I using CreateFileMapping and MapViewOfFile to use a file as Shared storage between two process. The process A, it is running as Service in session 0, to clear the content in file mapping. The process B, it is a normal process run in session 1, to…
Lion Kuo
  • 239
  • 4
  • 13
1
vote
2 answers

In C++, How std::list in a struct will allocate memory and while using this in file mapping, the list result as empty

Problem faced : List shared by using file mapping does'nt provide any data inside the list... I have a process 1, in which i store all my datas as a List of hash_map and then i try to share that using File mapping ... in Process2 while i try to…
Angelina
  • 13
  • 3
1
vote
0 answers

Writing windows debugger, Read/WriteProcessMemory vs file mapping

I wonder what is the "correct" way for the debugger to read debuggee's memory. Since debugger provides the ability to view and alter debuggee's memory, the user can modify the code. The code section is frequently read by the debugger to produce…
igntec
  • 1,006
  • 10
  • 24
1
vote
2 answers

CreateFileMapping error code 8

CreateFileMapping error code 8.Not enough storage is available to process this command. Im trying to create file mapping with 4 Gb (0xFFFFFFFF) on 64bit Win10 visual c++. #define UBS_MEM_SIZE 0xffffffff HANDLE hMapObject =…
Smit Ycyken
  • 1,189
  • 1
  • 11
  • 25
1
vote
1 answer

MapViewOfFile offset - how to use it

Developing a game ("jogo" in PT), the server can host up to 5 simultaneous games, which the client will access via mapped memory. So here's what I have: Server: #define MAX_JOGOS 5 typedef struct{ ... } sJogo; typedef struct{ sJogo * pS; }…
user4398110
1
vote
0 answers

Passing a memory file to function that requires a filename

I am using pythonista on iOS, although I hope that does not matter. Some lib calls require a path to a json file to render the content into a form/user interface. However as far as I can see, no API to render the JSON data from a variable . I can…
IanJ
  • 21
  • 2
1
vote
1 answer

Copy one file's content to other file using memcpy()

I need to copy file1 context to file2. Here's my files file1 My name is John file2 I like water so my resilt should be file2 I like water My name is John I have to use mmap and memcpyfor this. So here what I do First I open both files int…
David
  • 3,055
  • 4
  • 30
  • 73
1
vote
1 answer

Can file mapping object and file object be used interchangeably?

Say I want to a generated a wrapper function to CreateFile function This new function will not generate a real file on the disk but create file mapping object and return a handle to the new object. I've looked at this example, Creating Named Shared…
idanshmu
  • 5,061
  • 6
  • 46
  • 92
1
vote
0 answers

I cannot memory map large files. Map Failed. OutOfMemoryError

Here is my code: FileChannel fc = new RandomAccessFile(afile.getAbsolutePath(), "r").getChannel(); ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); Here are the errors: java.io.IOException: Map failed Caused by:…
Danny Rancher
  • 1,923
  • 3
  • 24
  • 43
1
vote
1 answer

Windows API: find process for a file mapping handle

I created an SSH agent (similar to PuTTY's pageant.exe) which has a predefined protocol: Authentication requests are sent to the agent window via WM_COPYDATA containing the name of a file mapping: // mapname is supplied via WM_COPYDATA HANDLE…
divB
  • 896
  • 1
  • 11
  • 28
1
vote
1 answer

How to CreateFileMapping in C++?

I am coding a game preloader (a simple program that loads certain files [maps] into cache before starting the program. I was told to use CreateFileMapping which I am still unsure whether it loads it into the physical or virtual memory... Anyway,…
user1808010
  • 141
  • 1
  • 3
  • 11
1
vote
1 answer

Copy Memory Block

//include headers. #include #include #define BUF_SIZE 256 TCHAR szName[]=TEXT("MyFileMappingObject"); LPCTSTR pBuf; //my data stracture. struct NetworkVariabel { int ServerTime; int Value1; int Value2; }; //main…
1
vote
4 answers

CreateFileMapping and MapViewOfFile with interprocess (un)synchronized multithreaded access?

I use a Shared Memory area to get som data to a second process. The first process uses CreateFileMapping(INVALID_HANDLE_VALUE, ..., PAGE_READWRITE, ...) and MapViewOfFile( ... FILE_MAP_WRITE). The second process uses OpenFileMapping(FILE_MAP_WRITE,…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
1
vote
3 answers

C++ Accessing another classes public member

I have a COM object. In the main class I made two public members. public: HANDLE m_hVoiceData; void* m_pVoiceData; They are for mapping a file. I map the file at the instantiation of the COM object. The…
tmighty
  • 10,734
  • 21
  • 104
  • 218
1
vote
3 answers

How to send vector> via MapViewOfFile

I have the following code in a parent process: vector > matrix(n); /* matrix NxM */ /* pushing data */ HANDLE hMapping = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, 2*sizeof(int) + sizeof(double)*n*m,…
zerospiel
  • 632
  • 8
  • 20