FNFCIREAD macro
The FNFCIREAD macro provides the declaration for the application-defined callback function to read data from a file in an FCI context.
Syntax
UINT FNFCIREAD( INT_PTR hf, void FAR *memory, UINT cb, int FAR *err, void FAR *pv );
Parameters
- hf
-
An application-defined value used to identify the open file.
- memory
-
Pointer to the buffer that receives the data read from a file.
- cb
-
The maximum number of bytes to read.
- err
-
Pointer to the error code value. This value will be used to provide extended error information in the ERF structure used to create the FCI context.
- pv
-
Pointer to an application-defined value
Return value
The return value is a UINT representing the number of bytes actually read. If the end of the logical file has been reached, the return value is zero. If an error occurs, the return value is (UINT)-1.
Remarks
The function accepts parameters similar to _read with the addition to err and pv.
Examples
FNFCIREAD(fnFileRead)
{
DWORD dwBytesRead = 0;
UNREFERENCED_PARAMETER(pv);
if( ReadFile((HANDLE)hf, memory, cb, &dwBytesRead, NULL) == FALSE )
{
dwBytesRead = (DWORD)-1;
*err = GetLastError();
}
return dwBytesRead;
}
Requirements
|
Header |
|
|---|
See also