a map Resizing a map file;
-
Hi all, I created a map file like this : HANDLE hMap=CreateFileMapping(hFile, NULL, _dwProtect, 0, _dwSize, _strMapName); but now I need to increase its size and create a new view on it!! does someone know how to to that the right way?? Thank you so much :)
-
Hi all, I created a map file like this : HANDLE hMap=CreateFileMapping(hFile, NULL, _dwProtect, 0, _dwSize, _strMapName); but now I need to increase its size and create a new view on it!! does someone know how to to that the right way?? Thank you so much :)
hatemtalbi wrote:
but now I need to...create a new view on it!!
To start over, can't you just call
UnmapViewOfFile()
followed byCloseHandle()
?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
-
hatemtalbi wrote:
but now I need to...create a new view on it!!
To start over, can't you just call
UnmapViewOfFile()
followed byCloseHandle()
?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
Yes, I did all that. But when I call mapViewOfFile() the secon time the whole size of the maapped file !!!
-
Yes, I did all that. But when I call mapViewOfFile() the secon time the whole size of the maapped file !!!
hatemtalbi wrote:
But when I call mapViewOfFile() the secon time the whole size of the maapped file !!!
Your sentence is incomplete. What happens when you call
MapViewOfFile()
the second time?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
-
hatemtalbi wrote:
But when I call mapViewOfFile() the secon time the whole size of the maapped file !!!
Your sentence is incomplete. What happens when you call
MapViewOfFile()
the second time?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
for example when I resize the file from 4KB to 8KB, I expect that MapViewOfFile() return a buffer size of 8KB but I get only 4KB !!!
-
for example when I resize the file from 4KB to 8KB, I expect that MapViewOfFile() return a buffer size of 8KB but I get only 4KB !!!
This is to be expected - that is how file-mapping objects work. You should use the ZwResizeSection native-API if you want to resize the file-mapping object. Lots of info on google about this. James
http://www.catch22.net -
This is to be expected - that is how file-mapping objects work. You should use the ZwResizeSection native-API if you want to resize the file-mapping object. Lots of info on google about this. James
http://www.catch22.netSorry, I typed ZwResizeSection in google but I didn't get any results !! please could you check the word orthography thank you
-
Sorry, I typed ZwResizeSection in google but I didn't get any results !! please could you check the word orthography thank you
my mistake. try: ZwExtendSection
http://www.catch22.net