共用方式為


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 (FSP) 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 (TSP) to generate ring events for the fax service.)

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

To receive a fax using a virtual fax device

  1. Export the FaxDevVirtualDeviceCreation function.
  2. Call the PostQueuedCompletionStatus function to signal the fax service that the FSP 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.