PFE_EXPORT_FUNC callback function (winbase.h)

An application-defined callback function used with ReadEncryptedFileRaw. The system calls ExportCallback one or more times, each time with a block of the encrypted file's data, until it has received all of the file data. ExportCallback writes the encrypted file's data to another storage media, usually for purposes of backing up the file.

The PFE_EXPORT_FUNC type defines a pointer to the callback function. ExportCallback is a placeholder for the application-defined function name.

Syntax

PFE_EXPORT_FUNC PfeExportFunc;

DWORD PfeExportFunc(
  [in]           PBYTE pbData,
  [in, optional] PVOID pvCallbackContext,
  [in]           ULONG ulLength
)
{...}

Parameters

[in] pbData

A pointer to a block of the encrypted file's data to be backed up. This block of data is allocated by the system.

[in, optional] pvCallbackContext

A pointer to an application-defined and allocated context block. The application passes this pointer to ReadEncryptedFileRaw, and ReadEncryptedFileRaw passes this pointer to the callback function so that it can have access to application-specific data. This data can be a structure and can contain any data the application needs, such as the handle to the file that contains the backup copy of the encrypted file.

[in] ulLength

The size of the data pointed to by the pbData parameter, in bytes.

Return value

If the function succeeds, it must set the return value to ERROR_SUCCESS.

If the function fails, set the return value to a nonzero error code defined in WinError.h. For example, if this function fails because an API that it calls fails, you can set the return value to the value returned by GetLastError for the failed API.

Remarks

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.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)

See also

CloseEncryptedFileRaw

File Encryption

File Management Functions

ImportCallback

OpenEncryptedFileRaw

ReadEncryptedFileRaw

WriteEncryptedFileRaw