Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
myrkraverk

23.11.2010, 01:04
 

HX and memory mapped writable files. (DOSX)

Hi all,

I just tested memory mapping to write a file with HX and the file is either not created or not written to (I don't recall) when the map is not explicitly closed by the application. Is that a bug in HX?

More explicitly, using CreateFile(), CreateFileMapping() and MapViewOfFile() for writing, the file isn't written without
UnmapViewOfFile( map );
CloseHandle( mapping );
CloseHandle( f );


I just added all three since and so I do not know if only one or all three are needed.

Wine creates the file without this explicit closing. I did not test on NT itself.


Johann

Japheth

Homepage

Germany (South),
23.11.2010, 09:04

@ myrkraverk

HX and memory mapped writable files.

> I just added all three since and so I do not know if only one or all three
> are needed.

I did look into the source and AFAICS it isn't necessary to close the file handle - this is done automatically when the mapping object is closed.

> Wine creates the file without this explicit closing. I did not test on NT
> itself.

I will test if the file is created without unmapping/closing the mapping object.

---
MS-DOS forever!

Back to the board
Thread view  Mix view  Order
22049 Postings in 2034 Threads, 396 registered users, 42 users online (1 registered, 41 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum