For a memory file (MEM) that cannot expand, mmioWrite returns the number of bytes written. This might be fewer than requested if the end of file (EOF) was encountered prematurely. If the logical file pointer was past the EOF when the write operation was initiated, MMIO_ERROR is returned. If a pointer is at the EOF, a 0 is returned indicating no bytes were written. If the file can expand, it will do so and write the number of bytes requested, even if the logical file pointer was past the EOF when the write operation was initiated.

Note: User buffers cannot be expanded, but system-allocated buffers can be expanded.