Platform SDK: Fax Services

Receiving a Fax Using a Virtual Fax Device

When the fax service calls FaxDevVirtualDeviceCreation the service specifies a handle to an I/O completion port in the CompletionPort parameter and a value in the CompletionKey parameter. The fax service provider must use these values when the provider posts an I/O completion port packet to signal the fax service that the provider wants to receive a fax on the provider's virtual port. These values signal the fax service to call the FaxDevStartJob function to initialize the fax job and then the FaxDevReceive function. (This step is necessary because a virtual device does not have an associated telephony service provider to generate ring events for the fax service.)

To receive an incoming fax using a virtual fax device, the fax service provider must perform the following steps.

Receiving a fax using a virtual fax device

  1. Export the FaxDevVirtualDeviceCreation function.
  2. Call the PostQueuedCompletionStatus function to signal the fax service that the fax service provider wants to receive a fax. Use the CompletionPort parameter value and the CompletionKey parameter value the fax service specifies when the service calls the FaxDevVirtualDeviceCreation function. The completion port packet must be a LINEMESSAGE structure.
  3. Respond appropriately when the fax service calls the FaxDevStartJob function.
  4. Respond appropriately when the fax service calls the FaxDevReceive function.
  5. Continue to call the PostQueuedCompletionStatus function, to receive messages and to post status updates, until the fax service calls the FaxDevEndJob function. Specify the CompletionPort parameter value and the CompletionKey parameter value the fax service specifies when the service calls the FaxDevStartJob function. The completion port packet must be a FAX_DEV_STATUS structure.

For more information about setting the members of the LINEMESSAGE structure and about allocating memory for the structure, see FaxDevVirtualDeviceCreation.