DOC: How to use the RasSecurityDialogReceive API (193058)



The information in this article applies to:

  • Microsoft Windows NT Workstation 3.51
  • Microsoft Windows NT Workstation 4.0
  • Microsoft Windows NT Server 3.51
  • Microsoft Windows NT Server 4.0

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.

Modification Type:MajorLast Reviewed:8/10/2001
Keywords:kbAPI kbnetwork KB193058