FtpCancelQueuedFile Function  
 
BOOL WINAPI FtpCancelQueuedFile(
  HQUEUE hQueue,  
  DWORD dwFileId  
);

The FtpCancelQueuedFile function cancels the queued file transfer.

Parameters

hQueue
A handle to a file transfer queue.
dwFileId
An unsigned integer value which uniquely identifies the file in the queue. If this value is zero, the function will cancel the current file transfer in progress. If queue transfers have been suspended, this parameter cannot be zero.

Return Value

If the function succeeds, the return value is non-zero. If the function fails, it will return zero. To get extended error information, call FtpGetLastError.

Remarks

When this function is called, the queued file transfer may not immediately stop. An internal flag is set which causes the file transfer to exit with an error and the queue manager will begin processing the next file in the queue. If the queue is in an idle state, this function will fail.

It is permitted to call FtpCancelQueuedFile from within a queue event handler to cancel the current file transfer. In this case, the dwFileId parameter should be zero. If you specify a file which has not been transferred, it will be flagged as canceled and skipped by the queue manager when processing the queue. If you specify a file which has already been processed, this function will fail.

A canceled file transfer is also considered a failed transfer. When you call FtpGetQueueStatus after a queued file transfer is canceled, the dwFailedFiles member of the FTPQUEUESTATUS structure will be incremented to reflect this change. You can determine the status of an individual file transfer by calling the FtpGetQueuedFile function and checking the value of the dwQueueFlags member of the FTPQUEUEDFILE structure.

The FtpResetQueue function can be used to reset the state of previously canceled transfers. 

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csftpv12.lib

See Also