File_ReadFileToMemoryA

Reads a disk file into memory and returns the address and length in two QWORD variables. This is the Ansi version of File_ReadFileToMemory, File_ReadFileToMemoryW is the Unicode version.

File_ReadFileToMemoryA PROTO lpszFilename:QWORD, lpqwMemory:QWORD, lpqwMemoryLength:QWORD

Parameters

  • lpszFilename - The zero terminated file name to open and read into memory.

  • lpqwMemory - The address of the QWORD variable that receives the starting address of the buffer, for the file contents.

  • lpqwMemoryLength - The address of the QWORD variable that receives the number of bytes written to the memory buffer.

Returns

The return value is zero on error, otherwise non-zero.

Notes

The memory address written to lpqwMemory must be deallocated using the GlobalFree function, once the memory buffer is no longer required.

This function as based on the MASM32 Library function: read_disk_file

See Also

File_ReadFileToMemoryW, File_WriteMemoryToFileA, File_WriteMemoryToFileW, File_OpenA, File_Read, File_FileSize, File_Close, Memory_Alloc