FtpGetThreadQueue Function  
 
HQUEUE WINAPI FtpGetThreadQueue(
  DWORD dwThreadId  
);

The FtpGetThreadQueue function returns a handle to the queue associated with the specified thread.

Parameters

dwThreadId
An unsigned integer value which specifies a unique identifier for the queue manager thread. If this value is zero, it will return the handle associated with the current thread.

Return Value

If the function succeeds, the return value is the handle to the queue. If the function fails, it will return INVAID_QUEUE. To get extended error information, call FtpGetLastError.

Remarks

All queued file transfers are handled by a queue manager which executes asynchronously in a background worker thread. This worker thread is created when the FtpStartQueue function is called and terminates when all files in the queue have been processed, or when the FtpStopQueue function is called. This function will return the queue handle associated with that worker thread.

The most common use of this function would be to obtain the handle for the queue from within a queue event handler. The application would pass in a value of zero as the thread ID and the function will return the handle to the queue which invoked the event notification.

If you call this function outside of an event handler and the dwThreadId parameter is zero, or if the queue is idle and not transferring files, this function will return INVALID_QUEUE. The thread ID is only valid while the queue manager is actively processing files in the queue.

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