[ Home | Optimize | Current | Project | Tools | Made in France | F.A.Q | Forums | Links | Sources Codes ]

File_LoadEntire

File_LoadEntire PROTO __lpszFileToLoad:LPSTR,__lpOriginalFile:Ptr HANDLE,__lpFileMappingObject:Ptr HANDLE

Load the file <__lpszFileToLoad> into memory using CreateFileMapping

__lpszFileToLoad is a pointer on a string containing the name of the file to load.
__lpOriginalFile is a pointer on a vraible that will receive the file handle
__lpFileMappingObject is a pointer on the handle of the mapped object.

If the file can be loaded successfully, the register EAX receives a pointer to the newly memory area where the file has been loaded.
If the file cannot be loaded, EAX returns NULL.

File_Unload

File_Unload PROTO __lpBuffer:LPBYTE,__hOriginalFile:HANDLE,__hFileMappingObject:HANDLE

The function unload a file previously loaded with File_LoadEntire.

__lpBuffer is a pointer to the memory block to free.
__hOriginalFile is a variable containing the file handle.
__hFileMappingObject must contain the handle on the mapped file object.

If the file can be unloaded successfully, EAX return TRUE. If the unload function fails it return FALSE.

Folder_Browse

This function was copied from the Masm Library.

Folder_Browse PROTO __hParent:HWND,__lpBuffer:LPBYTE,__lpszTitle:LPSTR,__lpszString:LPSTR

__hParent is the window parent handle.
__lpBuffer is a pointer to a string buffer receiving the folder name.
__lpszTitle is the main title used by the browse window.
__lpszString is a pointer to a secondary title.

If the function ends successfully it return non zero value into the EAX register otherwise it returns FALSE.

File_IsValidFileName

File_IsValidFileName PROTO __lpszFileName:LPSTR

__lpszFileName Pointer to a string that contains the file name.

This function verifies that the __lpszFileName is not NULL.
It verifies that the length of the string parameter is not 0.
It verifies that the file exists.

File_Read

File_Read PROTO __hFile:HANDLE,__lpBuffer:LPBYTE,__dwBufferLength:DWord

__hFile is the file handle to read
__lpBuffer is a pointer to a buffer receiving datas.
__dwBufferLength indicates the buffer size and the length of the datas to read.

If the reading operation ends successfully it returns TRUE.
If the reading operation fails, it returns FALSE.
If the end of file is encountered the function returns -1.

File_Write

File_Write PROTO __hFile:HANDLE,__lpBuffer:LPBYTE,__dwBufferLength:DWord

__hFile is the file handle
__lpBuffer is a pointer to the buffer to write
__dwBufferLength is the size of datas to write.

If the write operation ends successfully, it returns TRUE.
If the functions fails, it returns FALSE.

 

Download the library here

[ Home | Optimize | Current | Project | Tools | Made in France | F.A.Q | Forums | Links | Sources Codes ]