Microsoft KB Archive/193058

= DOC: How to use the RasSecurityDialogReceive API =

Article ID: 193058

Article Last Modified on 10/31/2006

-

APPLIES TO


 * Microsoft Windows NT Workstation 3.51
 * Microsoft Windows NT Workstation 4.0 Developer Edition
 * Microsoft Windows NT Server 3.51
 * Microsoft Windows NT Server 4.0 Standard Edition

-



This article was previously published under Q193058



SUMMARY
The documentaion does not explain how to correctly use the third parameter (pBufferLength) of the RasSecurityDialogReceive API.



MORE INFORMATION
The documentation does not mention that the third parameter of the RasSecurityDialogReceive API should be set to the number of bytes expected to be received before the API is called. Upon API completion, this parameter will have the number of bytes received (excluding a terminating NULL character).

For example, if the user expects to enter a password up to 10 characters long, the following code could be used: WORD dwBytes = 10; gfpRasSecurityDialogReceive ( hPort, pRecvBuf, &dwBytes, 0, hEvent); DWORD dwWait = WaitForSingleObject (hEvent, MY_TIMEOUT); if (dwWait == WAIT_OBJECT_0) {

// We have received data wsprintf (szTemp, "Bytes recevied: %d, buffer received: %s\n",      dwBytes, pRecvBuf); }

For more information about using this API, please refer to the RASHOST sample located in the Win32 SDK.

Keywords: kbapi kbnetwork KB193058

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.