Microsoft KB Archive/259433

= BUG: Wrong Event Is Signaled When Using RAS Custom Script API =

PSS ID Number: 259433

Article Last Modified on 11/20/2003

-

The information in this article applies to:


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional

-



This article was previously published under Q259433



SYMPTOMS
The WAIT_OBJECT_0 event is signaled even when there is no data available on the wire to read. This causes the RasRetrieveBuffer function to fill up the receiving buffer with a NULL character.



RESOLUTION
On the client side, when the WAIT_OBJECT_0 event is signaled, if pRecvBuf contains a NULL character, just ignore this, and then call the RasReceiveBuffer function again.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
dwErr = pfnRasReceiveBuffer(hPort, pRecvBuf, &dwRecvBufSize, 1, hEvent);

dwWait = WaitForSingleObject (hEvent, INFINITE);

switch (dwWait) { case WAIT_FAILED: OutputDebugString(_T(&quot;Wait Failed&quot;)); return 1;

case WAIT_TIMEOUT: dwErr = ERROR_SMM_TIMEOUT; return 1;

case WAIT_ABANDONED: OutputDebugString(_T(&quot;WAIT_ABANDONED\n&quot;)); return 1;

case WAIT_OBJECT_0: OutputDebugString(_T(&quot;The state of the object is signaled\n&quot;)); break; }

dwErr = pfnRasRetrieveBuffer(hPort,pRecvBuf,&dwRecvBufSize); The server side does not send out any data. RasReceiveBuffer returns immediately. Even though there is no data on the wire, the WAIT_OBJECT_0 event is signaled. RasRetrieveBuffer is executed, and it fills pRecvBuf with NULL character.

