DOCUMENT:Q259433 29-OCT-2000 [winnt] TITLE :BUG: Wrong Event Is Signaled When Using RAS Custom Script API PRODUCT :Microsoft Windows NT PROD/VER:WINDOWS: OPER/SYS: KEYWORDS:kbnetwork kbAPI kbOSWin2000 _IK12469 _IK912 kbSDKPlatform kbSDKWin32 kbDSupport kbGrpDS ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Windows 2000 Advanced Server - Microsoft Windows 2000 Server - Microsoft Windows 2000 Professional ------------------------------------------------------------------------------- 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. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- dwErr = pfnRasReceiveBuffer(hPort, pRecvBuf, &dwRecvBufSize, 1, hEvent); dwWait = WaitForSingleObject (hEvent, INFINITE); switch (dwWait) { case WAIT_FAILED: OutputDebugString(_T("Wait Failed")); return 1; case WAIT_TIMEOUT: dwErr = ERROR_SMM_TIMEOUT; return 1; case WAIT_ABANDONED: OutputDebugString(_T("WAIT_ABANDONED\n")); return 1; case WAIT_OBJECT_0: OutputDebugString(_T("The state of the object is signaled\n")); 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. REFERENCES ========== Please see the Platform SDK\Samples\NetDs\RAS\CustomScript\CustomClient folder for the complete sample on how to use the RAS Custom Script APIs. Additional query words: ====================================================================== Keywords : kbnetwork kbAPI kbOSWin2000 _IK12469 _IK912 kbSDKPlatform kbSDKWin32 kbDSupport kbGrpDSNet Technology : kbwin2000AdvServ kbwin2000AdvServSearch kbwin2000Serv kbwin2000ServSearch kbwin2000Search kbwin2000ProSearch kbwin2000Pro kbWinAdvServSearch Version : WINDOWS: Issue type : kbbug Solution Type : kbpending ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2000.