The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
FNWRITE macro
The FNWRITE macro provides the declaration for the application-defined callback function to write data to a file in an FDI context.
Syntax
void FNWRITE( [in] INT_PTR hf, [in] void FAR *pv[bcount(cb)], UINT cb );
Parameters
- hf [in]
-
An application-defined value used to identify the open file.
- pv [in]
-
Pointer to the buffer containing the data to be written.
- cb
-
The maximum number of bytes to be written.
Return value
The indicated callback function returns the number of bytes written. However, a value of -1 indicates an error.
Remarks
The function accepts parameters similar to _write.
Examples
FNWRITE(fnFileWrite)
{
DWORD dwBytesWritten = 0;
if ( WriteFile((HANDLE)hf, pv, cb, &dwBytesWritten, NULL) == FALSE )
{
dwBytesWritten = (DWORD)-1;
}
return dwBytesWritten;
}
Requirements
|
Header |
|
|---|
See also
Show: