FNREAD macro

The FNREAD macro provides the declaration for the application-defined callback function to read data from a file in an FDI context.

Syntax


void FNREAD(
  [in]  INT_PTR  hf,
  [out] void FAR *pv[bcount(cb)],
        UINT     cb
);

Parameters

hf [in]

An application-defined value used to identify the open file.

pv [out]

Pointer to the buffer that receives the data read from a file.

cb

The maximum number of bytes to be read.

Return value

The indicated callback function returns the number of bytes read. However, a value of -1 indicates an error.

Remarks

The function accepts parameters similar to _read.

Examples


FNREAD(fnFileRead)
{
    DWORD dwBytesRead = 0;

    if ( ReadFile((HANDLE)hf, pv, cb, &dwBytesRead, NULL) == FALSE )
    {
        dwBytesRead = (DWORD)-1L;
    }
             
    return dwBytesRead;
}


Requirements

Header

Fdi.h

See also

FDICreate

 

 

Show: