?? overvw1_83j9.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML DIR="LTR"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso8859-1">
</HEAD>
<TITLE>Passthrough Mode</TITLE>
<SCRIPT SRC="/library/psdk/linkcss.js"></SCRIPT>
<META NAME="MS-HAID" CONTENT="_tapi2_passthrough_mode">
</HEAD>
<BODY TOPMARGIN="0">
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<!--SYNC_START-->
<script language="JavaScript" src='/library/synch.js'></script>
<!--SYNC_END-->
<H2><A NAME="_tapi2_passthrough_mode"></A>Passthrough Mode</H2>
<P>When a call is active in LINEBEARERMODE_PASSTHROUGH, the service provider gives direct access to the attached hardware for control by the application. Applications can use this mode for temporary direct control over asynchronous modems, accessed through the Win32 Communication functions, for the purpose of configuring or using special features not otherwise supported by the service provider, such as facsimile (Class 1, 2, and so on). This bearer mode is supported by the Universal Modem Driver (UNIMODEM) service provider. </P>
<P>Service providers that support LINEBEARERMODE_PASSTHROUGH indicate it in the <B>dwBearerModes</B> member of the <A HREF="struc2_67aq.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc2_67aq.htm"><B>LINEDEVCAPS</B></A> structure. When LINEBEARERMODE_PASSTHROUGH is indicated, the Unimodem service provider will also include in the <B>DevSpecific</B> area of the <B>LINEDEVCAPS</B> structure the registry key used to access information about the modem associated with the line device, in the following format: </P>
<PRE>struct {
DWORD dwContents; // Set to 1 (indicates containing key)
DWORD dwKeyOffset; // Offset to key from start of this
// structure (not from start of
// LINEDEVCAPS structure). 8 in
// our case.
BYTE rgby[...]; // place containing null-terminated
// registry key.
}</PRE>
<P>For example: </P>
<PRE> 00000001 00000008 74737953 435c6d65 ........System\C
65727275 6f43746e 6f72746e 7465536c urrentControlSet
7265535c 65636976 6c435c73 5c737361 urrentControlSet
65646f4d 30305c6d xx003030 xxxxxxxx Modem\0000. </PRE>
<P>This registry key could then be opened using this function: </P>
<PRE>RegOpenKey(HKEY_LOCAL_MACHINE, pszDevSpecificRegKey, &phkResult)</PRE>
<P>Passthrough mode is invoked most often using the <A HREF="func1_7mgc.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_7mgc.htm"><B>lineMakeCall</B></A> function, by setting the LINEBEARERMODE_PASSTHROUGH bit in the <B>dwBearerMode</B> member of the <A HREF="struc1_904y.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/struc1_904y.htm"><B>LINECALLPARAMS</B></A> structure pointed to by the <I>lpCallParams</I> parameter. When this is done, the service provider will open the serial port to the modem and immediately place the call into LINECALLSTATE_CONNECTED. The application can then use the <A HREF="func1_2gf8.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_2gf8.htm"><B>lineGetID</B></A> function with the device class "comm/datamodem" to obtain an open Win32 file handle to read from and write to the comm port. </P>
<P>Passthrough mode can be invoked in response to an incoming call as well. Generally, applications will invoke passthrough mode while the call is in LINECALLSTATE_OFFERING, before the call has been answered. Instead of calling <A HREF="func1_52nm.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_52nm.htm"><B>lineAnswer</B></A>, the application calls <A HREF="func2_1sj7.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_1sj7.htm"><B>lineSetCallParams</B></A>, passing LINEBEARERMODE_PASSTHROUGH as the <I>dwBearerMode</I> parameter. When this is done, as with <B>lineMakeCall</B>, the call will immediately be placed into LINECALLSTATE_CONNECTED by the service provider, and the application can obtain a handle to the open port using <B>lineGetID</B>. The <B>lineSetCallParams</B> function can be called when the call is in LINECALLSTATE_OFFERING, LINECALLSTATE_ACCEPTED, or LINECALLSTATE_CONNECTED. </P>
<P>Passthrough mode is normally terminated by calling <A HREF="func1_1i5s.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_1i5s.htm"><B>lineDrop</B></A> on the call handle obtained from <A HREF="func1_7mgc.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_7mgc.htm"><B>lineMakeCall</B></A> or the first <A HREF="msgs_1xid.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/msgs_1xid.htm">LINE_CALLSTATE</A> message (if the call was an incoming call). The service provider will close the port, and restore the modem to its default state. The application must call <B>CloseHandle</B> on the handle it received from <A HREF="func1_2gf8.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func1_2gf8.htm"><B>lineGetID</B></A>. </P>
<P>Passthrough mode can also be terminated by calling <A HREF="func2_1sj7.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_1sj7.htm"><B>lineSetCallParams</B></A> with the <I>dwBearerMode</I> parameter set to LINEBEARERMODE_VOICE. The media type (mode) set by <A HREF="func2_9691.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_9691.htm"><B>lineSetMediaMode</B></A> is presumed to be in effect. If LINEMEDIAMODE_DATAMODEM is active, the service provider will take over the call as though it was a data modem call already in progress; if <B>lineDrop</B> is subsequently called, the service provider will issue the appropriate modem commands or interface state changes to drop a data call. </P>
<DIV CLASS="footer">Built on Monday, August 14, 2000</DIV>
<!--FOOTER_START-->
<DIV CLASS="footer" STYLE="color:#000000;font-size:90%;">
<A HREF="mailto:sdkfdbk@microsoft.com">Send feedback</A> to the Platform SDK.</P>
<P><A HREF="javascript:if(confirm('http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm \n\n這個文件不能通過 Teleport Pro 取回, 因為 地址在一個域或為它的開始地址設定的邊界的外部路徑上. \n\n你想從服務器打開它嗎?'))window.location='http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm'" tppabs="http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm" TARGET="_top">© 1999 Microsoft Corporation. All rights reserved. Terms of use.</A></P>
</DIV>
<!--FOOTER_END-->
</BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -