Platform SDK: Fax Services |
The fax service calls the FaxDevStartJob function to initialize a new fax job. The fax service also calls FaxDevStartJob to signal the beginning of each fax operation to the fax service provider. Each fax service provider must export the FaxDevStartJob function.
BOOL WINAPI FaxDevStartJob( HLINE LineHandle, // handle to the open line device DWORD DeviceId, // TAPI line device identifier PHANDLE FaxHandle, // pointer to fax handle HANDLE CompletionPortHandle, // handle to an I/O completion port ULONG_PTR CompletionKey // completion key value );
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero. To get extended error information, the fax service calls GetLastError.
The FaxDevStartJob function provides an opportunity for the fax service provider to perform call setup.
The fax service calls FaxDevStartJob at the beginning of a new fax job and once for each fax operation. This is because each operation executes in a separate thread. It calls FaxDevStartJob just before the FaxDevSend function call for a fax send operation, and just before the FaxDevReceive function call for a fax receive operation. For more information, see Operating in a Multithreaded Environment.
The fax service provider should create an I/O completion packet and call the PostQueuedCompletionStatus function when the service provider changes its status. One example of a status change is when the fax service provider finishes receiving or sending fax transmission pages. The completion packet must be a FAX_DEV_STATUS structure. The fax service provider must allocate memory for the structure from the heap indicated by the HeapHandle parameter passed to the FaxDevInitialize function. The fax service frees any memory allocated for the completion packet structure.
The fax service provider should use the CompletionPortHandle and CompletionKey parameters to post completion packets for fax service provider status changes. This method of status notification optimizes performance because the fax service does not need to poll fax service providers to obtain updated status information. For more information, see Creating a Completion Packet.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in faxdev.h.
Import Library: User-defined.
Fax Service Provider Application Programming Interface Overview, Fax Service Provider Functions, PostQueuedCompletionStatus, FaxDevEndJob, FaxDevSend, FaxDevReceive, FaxDevInitialize, FAX_DEV_STATUS