Microsoft KB Archive/318556

= BUG: ZeroConfig (802.11) Fails When Scanning 20 or More Access Points Simultaneously =

Article ID: 318556

Article Last Modified on 12/27/2003

-

APPLIES TO


 * Microsoft Windows CE .NET 4.2

-



This article was previously published under Q318556



SYMPTOMS
The ZeroConfig component (802.11) may fail to work in a wireless environment in which the device can scan 20 or more access points simultaneously.



CAUSE
ZeroConfig receives the STATUS_BUFFER_TOO_SMALL value from the NDISUIO module, instead of receiving ERROR_INSUFFICIENT_BUFFER. ZeroConfig uses the Ndisuio.dll file (from the \Public\Common\Oak\Drivers\ folder) to request and set network driver interface specification (NDIS) object identifiers (OIDs) to the wireless miniport driver.

For the OID_802_11_BSSID_LIST value, ZeroConfig initially passes in a buffer that is large enough for about 20 service set identifiers (SSIDs). If the miniport can scan more than 20 SSIDs, the buffer is too small to contain all the information.

In this scenario, the miniport is required to return NDIS_STATUS_BUFFER_TOO_SHORT. However, instead of converting the NDIS error code to a Win32 error code, NDISUIO converts it to an NT status error code, which causes the problem.



RESOLUTION
Modify the NDISUIO module to convert the NT status error code to a Win32 error code.

There are three SetLastError calls in the Public\Common\Oak\Drivers\Ndisuio\Uio_ce.c file. Currently, NDISUIO passes in the current NT status error for the value of the dwErrCode argument for the SetLastError API.

To change the NT status error code to a Win32 error code and resolve the problem, paste the following sample code in the Public\Common\Oak\Drivers\Ndisuio\Uio_ce.c file before the SetLastError call: //////////////////////////////////////////////////////////////////////////////// // NT_STATUS_TO_WIN32_STATUS // // Routine Description: // // This function converts NT error status (STATUS_XXX) to Win32 Error //     status ERROR_XXX // // Arguments: //     //      NTStatus             :: NT Error Status. //     pdwWin32Status       :: Win32 Error Status. // //  Return Value: // //     None. //

NT_STATUS_TO_WIN32_STATUS(NTSTATUS NTStatus, DWORD *pdwWin32Status) {

if (NTStatus == STATUS_SUCCESS) {       //         //  Map directly to Win32.. //

*pdwWin32Status = NTStatus; }   else if (NTStatus  == STATUS_PENDING) {       *pdwWin32Status = ERROR_IO_PENDING; }   else if (NTStatus  == STATUS_BUFFER_OVERFLOW) {       *pdwWin32Status = ERROR_MORE_DATA; }   else if (NTStatus  == STATUS_UNSUCCESSFUL) {       *pdwWin32Status = ERROR_GEN_FAILURE; }       else if (NTStatus  == STATUS_INSUFFICIENT_RESOURCES) {       *pdwWin32Status = ERROR_NO_SYSTEM_RESOURCES; }   else if (NTStatus  == STATUS_NOT_SUPPORTED) {       *pdwWin32Status = ERROR_NOT_SUPPORTED; }   else if (NTStatus  == STATUS_BUFFER_TOO_SMALL) {       *pdwWin32Status = ERROR_INSUFFICIENT_BUFFER; }   else if (NTStatus  == STATUS_INVALID_BUFFER_SIZE) {       *pdwWin32Status = ERROR_INVALID_USER_BUFFER; }   else if (NTStatus  == STATUS_INVALID_PARAMETER) {       *pdwWin32Status = ERROR_INVALID_PARAMETER; }   else if (NTStatus  == STATUS_NO_MORE_ENTRIES) {       *pdwWin32Status = ERROR_NO_MORE_ITEMS; }    else if (NTStatus  == STATUS_DEVICE_NOT_CONNECTED) {       *pdwWin32Status = ERROR_DEVICE_NOT_CONNECTED; }   else {       *pdwWin32Status = ERROR_GEN_FAILURE; }

}  //  NT_STATUS_TO_WIN32_STATUS

NOTE: When you apply this modification to NDISUIO, an assertion may occur in the Wzcsvc.dll module when you start the device. This assertion is harmless and can be ignored. To avoid the problem, use the retail version of the Wzcsvc.dll.



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

Additional query words: Zero Config

Keywords: kbbug kbfix kbdocerr KB318556

-

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

© Microsoft Corporation. All rights reserved.