ValidateFileName

The ValidateFileName callback function should be provided by an application to validate file transfers between the client and the KCM Core 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 the transfer should be allowed.

TCHAR * (*ValidateFileName) (
	void      *Context,	// Context field of structure
TCHAR     *FileName,	// suggested filename
BOOL       TransferMode	// transfer modus
);

The function has the following parameters:

  • Context. This is an application defined data. This parameter gets the value of the Context field of the SUBMITJOB4/ SUBMITJOB5 structure.
  • FileName. This is the file name for the transferred file as suggested or requested by the KCM Core server.
  • TransferMode flag. Indicates the type of transfer requested by the KCM Core server. TransferMode is TRUE if the client should receive a file from the KCM Core server, and FALSE if the KCM Core server needs 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 needs to refuse the transfer. KCM Core terminates the transfer with the message that the client refused the transfer.

If ValidateFileName needs to accept the transfer without modifications in the file name, it returns the FileName pointer. If it needs to modify the file name, it provides memory that remains 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 std call when it is passed through the SUBMITJOB5 data structure to SSubmitJobEx5.

QuickInfo

Header, N/A.

Import Library, N/A.

Unicode, N/A.