다음을 통해 공유


TSPI_phoneClose (Windows Embedded CE 6.0)

1/6/2010

This function closes the specified open phone device after completing or aborting all outstanding asynchronous operations on the device.

Syntax

long TSPIAPI TSPI_phoneClose(
  HDRVPHONE hdPhone 
);

Parameters

  • hdPhone
    Service provider's opaque handle to the phone to be closed. After the phone is successfully closed, this handle is no longer valid.

Return Value

Returns zero if the function succeeds, or an error number if an error occurs. The following table shows the return values for this method.

Value Description

PHONEERR_INVALPHONEHANDLE

The handle to the phone is invalid.

PHONEERR_OPERATIONFAILED

The operation failed.

PHONEERR_NOMEM

Not enough memory is available.

PHONEERR_OPERATIONUNAVAIL

The operation is unavailable.

PHONEERR_RESOURCEUNAVAIL

The resource is unavailable.

Remarks

The service provider must report completion for every asynchronous operation. If this procedure is called for a phone on which there are outstanding asynchronous operations, the operations should be reported complete with an appropriate result or error code before this procedure returns. Generally, TAPI waits for these to complete in an orderly fashion. However, the service provider should be prepared to handle an early call to TSPI_phoneClose in "abort" or "emergency shutdown" situations.

After this procedure returns the service provider must report no further events on the phone. The service provider's opaque handle for the phone becomes invalid.

The service provider must relinquish nonsharable resources it reserves while the phone is open. For example, closing a phone accessed through a COM port and modem should result in closing the COM port, making it available for use by other applications.

This function should always succeed except in extraordinary circumstances. Most callers will probably ignore the return code because they will be unable to compensate for any error that occurs. The specified return values are more advisory for development diagnostic purposes than anything else.

Requirements

Header tapicomn.h
Library coredll.lib
Windows Embedded CE Windows CE 3.0 and later

See Also

Reference

TSPI Phone Device Functions