<< Back


FVSDK_ValidFileInfo

Synopsis

FVSDK_ERROR_CODE FVSDK_ValidFileInfo(FVSDK_FileInfo* pFileInfo);

Description

Checks the administrative elements of an FVSDK_FileInfo structure for validity. In order for this function to succeed, pFileInfo cannot be NULL, the nSize element must match the size of an FVSDK_FileInfo structure, and the nVersion element must match the FVSDK_FILE_INFO_CURRENT_VERSION macro. This function is generally used internally by the FTP Voyager SDK, but can be used externally as well.

Parameters

pFileInfo

A pointer to a FVSDK_FileInfo structure to check.

Return Value

FVSDK_OK if pFileInfo appears to be valid, FVSDK_INVALID_PARAMETER if pFileInfo is NULL, FVSDK_INVALID_FILE_INFO_SIZE if the nSize element is incorrect, FVSDK_INVALID_FILE_INFO_VERSION if nVersion is not FVSDK_FILE_INFO_CURRENT_VERSION.

Example

FVSDK_FileInfo FileInfo;
FileInfo.nSize = sizeof(FileInfo);
FileInfo.nVersion = FVSDK_FILE_INFO_CURRENT_VERSION;

// verify the file info structure
if (FVSDK_ValidFileInfo(&FileInfo) != FVSDK_OK)
    AfxMessageBox("FileInfo is invalid.");