I need to call the ReadFile function of the Windows API:
BOOL WINAPI ReadFile(
_In_ HANDLE hFile,
_Out_ LPVOID lpBuffer,
_In_ DWORD nNumberOfBytesToRead,
_Out_opt_ LPDWORD lpNumberOfBytesRead,
_Inout_opt_ LPOVERLAPPED lpOverlapped
);
The argument I'm interested in is the 3rd one:
nNumberOfBytesToRead [in]
The maximum number of bytes to be read.
I'm not interested so much in the "magic number" to put there but the process a seasoned programmer takes to determine the number to put there, preferably in numbered steps.
Also keep in mind I am writing my program in assembler so I'm more interested in the thought process from that perspective.