The information in this article applies to:
SUMMARY
Under Windows NT 4.0 and Windows 2000, GetCommProperties API call fails when called using a
communication handle obtained from the TAPI lineGetID API if COMMPROP
structure is not properly initialized.
MORE INFORMATIONUnder Windows 95's UNIMODEM, GetCommProperties succeeds when COMMPROP is allocated and zero initialized as follows:
The same code fails under Windows NT/Windows 2000 and dwError will be set to 122
(ERROR_INSUFFICIENT_BUFFER).
This occurs when UNIMODEM tries to append provider specific information to the end of COMMPROP in a form of MODEMDEVCAPS. To work around this, you need to allocate space for MODEMDEVCAPS structure after COMMPROP. You also need to set the appropriate member variable in COMMPROP so UNIMODEM knows that the structure has been allocated to the proper size. The following code sample demonstrates this process:
The following example demonstrates a method that works for both platforms.
The code below calls GetCommProperties first with the Windows 95 style
structure allocation. If that fails, it calls GetCommProperties with
Windows NT/Windows 2000 style structure allocation.
Additional query words: tapi commapi unimodem ntbug nt40 commbug tapibug
Keywords : kbAPI kbKernBase kbWinOS2000 kbTAPI kbDSupport kbGrpKernBase |
Last Reviewed: January 6, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |