The ValidateFileName callback function should be provided by an application if they want to validate file transfers between the client and the ITP/Server server. If provided, the ValidateFileName function is called before every transfer to allow the application to convert the passed file name and to determine whether or not the transfer should be allowed.
TCHAR * (*ValidateFileName) (
void *Context, // Context field of structure
TCHAR *FileName, // suggested filename
BOOL TransferMode // transfer modus
);
Context, application defined data. This parameter gets the value of the Context field of the SUBMITJOB4/SUBMITJOB5 structure.
FileName, file name for the transferred file as suggested or requested by the ITP/Server server.
TransferMode, flag that indicates the type of transfer requested by the ITP/Server server. TransferMode is TRUE if the client should receive a file from the ITP/Server server, and FALSE if the ITP/Server server wants to request a file.
The ValidateFileName should return a pointer to the file name the API should transfer.
The ValidateFileName can return NULL if it wants to refuse the transfer. ITP/Server will terminate the transfer with the message that the client refused the transfer.
If the ValidateFileName wants to accept the transfer without modifications in the file name, it should return the FileName pointer. If it wants to modify the file name it must provide memory that will remain allocated until either the next call to ValidateFileName or until the API returns.
The calling convention of the ValidateFileName function is cdecl when it is passed through the SUBMITJOB4 data structure to SSubmitJobEx4, and stdcall when it is passed through the SUBMITJOB5 data structure to SSubmitJobEx5.
Header, N/A.
Import Library, N/A.
Unicode, N/A.