Files.asm

This file defines file management functions of PwnOS.

See Also

Authors

  • Neil G.  Dickson
Summary
Files.asmThis file defines file management functions of PwnOS.
Functions
OpenFileThis procedure opens a file.
GetFileSizeThis procedure gets the size of an open file.
ReadFileThis procedure reads data from an open file.
CloseFileThis procedure closes an open file, freeing all of its resources.
GetCurrentDirectoryGets the current directory of the current thread.
Gateway Functions of Files.asm
Functions
OpenFileUGateway function for OpenFile
GetFileSizeUGateway function for GetFileSize
ReadFileUGateway function for ReadFile
WriteFileUGateway function for <WriteFile>
CloseFileUGateway function for CloseFile

Functions

OpenFile

This procedure opens a file.

Parameters

pNameaddress of unicode filename
Accessaccess options
Creationcreation options
Flagsmiscellaneous

Returns

  • address of the FILE structure or NULL if the file doesn’t exist or couldn’t be opened

GetFileSize

This procedure gets the size of an open file.

Parameters

pFileaddress of FILE structure

Returns

edx:eaxsize of the file in bytes, or -1 if the file has no particular size

ReadFile

This procedure reads data from an open file.

Parameters

pFileaddress of FILE structure
pDestinationaddress to which the data is to be read
nBytesnumber of bytes to read

Returns

  • number of bytes read from the file

CloseFile

This procedure closes an open file, freeing all of its resources.

Parameters

pFileaddress of FILE structure

GetCurrentDirectory

Gets the current directory of the current thread.

Not Implemented

Returns

  • address of the FILE structure for the current directory of the current thread

Gateway Functions of Files.asm

Summary
Functions
OpenFileUGateway function for OpenFile
GetFileSizeUGateway function for GetFileSize
ReadFileUGateway function for ReadFile
WriteFileUGateway function for <WriteFile>
CloseFileUGateway function for CloseFile

Functions

OpenFileU

Gateway function for OpenFile

TODO: Check parameters.

GetFileSizeU

Gateway function for GetFileSize

TODO: Check parameter.

ReadFileU

Gateway function for ReadFile

TODO: Check parameters.

WriteFileU

Gateway function for <WriteFile>

Not Implemented

CloseFileU

Gateway function for CloseFile

TODO: Check parameter.

This procedure opens a file.
This procedure gets the size of an open file.
This procedure reads data from an open file.
This procedure closes an open file, freeing all of its resources.
This file defines initialization code for the file management data of PwnOS.
This file defines constants, structures, and macros for file management functions of PwnOS.
This structure defines an open file.