Platform SDK: Fax Services |
The fax service calls the FaxDevVirtualDeviceCreation function during initialization to allow the fax service provider to present virtual fax devices. Each fax service provider that presents virtual fax devices to the fax service must export the FaxDevVirtualDeviceCreation function.
BOOL WINAPI FaxDevVirtualDeviceCreation( LPDWORD DeviceCount, // number of virtual devices LPWSTR DeviceNamePrefix, // device name prefix LPDWORD DeviceIdPrefix, // device identifier prefix HANDLE CompletionPort, // completion port handle for ring events ULONG_PTR CompletionKey // completion port key for ring events );
The completion port packet must be a LINEMESSAGE 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. For more information, see Allocating Memory.
The fax service provider must set the members of the structure as follows.
Member | Contents |
---|---|
hDevice | Set to DeviceId from FaxDevStartJob |
dwMessageID | Set to 0 |
dwCallbackInstance | Set to 0 |
dwParam1 | Set to LINEDEVSTATE_RINGING |
dwParam2 | Set to 0 |
dwParam3 | Set to 0 |
For information about line status events, see LINEDEVSTATE_ Constants in the TAPI documentation. For information about I/O completion ports, see I/O Completion Ports.
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 fax service checks the fax service provider DLL for the FaxDevVirtualDeviceCreation function during initialization. If the fax service provider exports the function, the fax service assumes that the provider will present virtual fax devices. The fax service handles virtual fax devices the same way it handles physical fax devices. After initialization there is no difference between the functionality or operation of a fax service provider that presents virtual fax devices, and one that does not present them.
When a fax service provider uses physical fax devices, the Telephony Application Programming Interface (TAPI) and the telephony service provider enumerate the devices for the fax service. If the fax service provider does not have physical fax devices, and it presents only virtual fax devices, a telephony service provider will not exist, and TAPI will not enumerate the devices. In this instance, FaxDevVirtualDeviceCreation provides the virtual fax device enumeration for the fax service.
For more information, see Virtual Fax Devices, Using a Virtual Device to Transmit a Fax, and 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, FaxDevStartJob, FaxDevInitialize, PostQueuedCompletionStatus, LINEMESSAGE