ImportCallback

The ImportCallback function is an application-defined callback function used with the WriteRaw function. The system calls ImportCallback to retrieve blocks of file data. ImportCallback reads the data from its current location and sends it to the system, until the system has received all data for processing.

The PFE_IMPORT_FUNC type defines a pointer to this callback function. ImportCallback is a placeholder for the application-defined function name.

DWORD ImportCallback(
  PBYTE pbData,
  PVOID pvCallbackContext,
  ULONG ulLength
);
 

Parameters

pbData
Pointer to a block of data to be restored.
pvCallbackContext
Pointer to an application-defined context block.
ulLength
Specifies the length, in bytes, of the data pointed to by the pbData parameter. When the function returns, this parameter contains the length, in bytes, of the data written to pbData.

Return Values

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a nonzero error code defined in WINERROR.H. To get a generic description of the error, use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag.

Remarks

The system calls the ImportCallback function until the callback function indicates there is no more data to restore. To indicate that there is no more data can be restored, set *ulLength to 0 and use a return code of ERROR_SUCCESS.

You can use the application-defined context block for internal tracking of information, such as the file handle and the current offset in the file.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in winbase.h.
  Import Library: User-defined.

See Also

File Systems Overview, File System Functions, WriteRaw