Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 12  
11 Jan 17 01:19
vinay kp
xxxxxx@gmail.com
Join Date: 15 Dec 2016
Posts To This List: 182
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

I am currently trying to pass " 2c_oidsndisrequest " HLK test for my network driver . When i run this test , my driver failed to pass this test case . Using HLK Logs i can see that error as Errors : --------- Testing OID_GEN_SUPPORTED_LIST - BytesNeeded is not a multiple of 4 Testing unknown length OID OID_802_3_MULTICAST_LIST - Unable to clear multicast address list. NdisStatus = 0xC0010009 --------------------------------------------------------------------------------- ------ But i am handling these OID's inside mini port driver is like this : miniport.cpp --------------- ULONG Id = 0 ; MaximumListSize = 32; SupportedOidsSize = 45; SupportedOids = new NDIS_OID[SupportedOidsSize]; SupportedOids[Id++] = OID_GEN_SUPPORTED_LIST; SupportedOids[Id++] = OID_802_3_MAXIMUM_LIST_SIZE; etc.... NDIS_STATUS CMiniport::OidRequest( __in PNDIS_OID_REQUEST OidRequest ) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; if ((OidRequest->RequestType == NdisRequestQueryInformation) || (OidRequest->RequestType == NdisRequestQueryStatistics)) { PVOID pInformation = NULL; ULONG ulInformationLength = 0; ULONG ulZerro = 0; switch (OidRequest->DATA.QUERY_INFORMATION.Oid) { case OID_GEN_SUPPORTED_LIST: pInformation = (PVOID)SupportedOids; ulInformationLength = sizeof(SupportedOids); //OidRequest->DATA.QUERY_INFORMATION.BytesNeeded = sizeof(ULONG64); break; .. ... etc .. OID's ... .. case OID_802_3_MAXIMUM_LIST_SIZE: pInformation = &MaximumListSize; ulInformationLength = sizeof(MaximumListSize); break; default: status = NDIS_STATUS_NOT_SUPPORTED; break; } if (pInformation != NULL) { if (OidRequest->DATA.QUERY_INFORMATION.InformationBufferLength < ulInformationLength) { OidRequest->DATA.QUERY_INFORMATION.BytesNeeded = ulInformationLength; status = NDIS_STATUS_BUFFER_TOO_SHORT; } else { NdisMoveMemory(OidRequest->DATA.QUERY_INFORMATION.InformationBuffer, pInformation, ulInformationLength); OidRequest->DATA.QUERY_INFORMATION.BytesWritten = ulInformationLength; status = NDIS_STATUS_SUCCESS; } } } else if (OidRequest->RequestType == NdisRequestSetInformation) { switch (OidRequest->DATA.SET_INFORMATION.Oid) { case OID_802_3_MULTICAST_LIST: break; } } return status; } I don't know what mistake i made . i tried to add OidRequest->DATA.QUERY_INFORMATION.BytesNeeded = sizeof(ULONG64); as BytesNeeded in OID_GEN_SUPPORTED_LIST Oid's . I am not handling anything in OID_802_3_MULTICAST_LIST . just skip it . If i add NDIS_STATUS_NOT_SUPPORTED in OID_802_3_MULTICAST_LIST , still i got same error in HLK Test . Any suggestions ? Thanks
  Message 2 of 12  
11 Jan 17 12:28
Larry Clawson
xxxxxx@honeywell.com
Join Date: 25 Sep 2003
Posts To This List: 186
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

Could this be your problem? From the MSDN: "Miniport drivers that support multicast address lists must support OID_802_3_MULTICAST_LIST set requests." you can't just drop it, you may need to send it on down to lower drivers if there are any or do a proper completion. Larry C
  Message 3 of 12  
11 Jan 17 13:56
Alex Grig
xxxxxx@broadcom.com
Join Date: 14 Apr 2008
Posts To This List: 3219
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

ulInformationLength = sizeof(SupportedOids); This line is wrong. Read up on what sizeof means.
  Message 4 of 12  
12 Jan 17 01:00
vinay kp
xxxxxx@gmail.com
Join Date: 15 Dec 2016
Posts To This List: 182
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

@Larry Clawson Yeah . got it . i should send it on down to lower drivers . i am working on it . @Alex Grig supported required bytes ----------- ---------- OID_GEN_SUPPORTED_LIST, Query Arr(4) sizeof(SupportedOids) , that means it return 4 bytes . isn't ? i am sending ulInformationLength 4 bytes . then what is wrong with this ? Any mistakes ?
  Message 5 of 12  
12 Jan 17 08:55
Alex Grig
xxxxxx@broadcom.com
Join Date: 14 Apr 2008
Posts To This List: 3219
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

1. sizeof(SupportedOids)==sizeof(NDIS_OID*)==8 2. The request returns an array of OIDs into the NDIS-provided buffer, and returns size of an array. You are allocating your own buffer and trying to return a pointer to it. This is not going to work.
  Message 6 of 12  
13 Jan 17 02:20
vinay kp
xxxxxx@gmail.com
Join Date: 15 Dec 2016
Posts To This List: 182
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

So should i change to sizeof(SupportedOids) * SupportedOidsSize = ? Here SupportedOidsSize = size of supported list = 45 . But most of the sample codes https://github.com/Microsoft/Windows-driver-samples/blob/master/network/ndis/mux/ driver/60/miniport.c Doing same concept like sizeof(SupportedOids) . Is it different with my array ?
  Message 7 of 12  
13 Jan 17 17:28
Jan Bottorff
xxxxxx@pmatrix.com
Join Date: 16 Apr 2013
Posts To This List: 394
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

What you're doing, which is dynamically locating an array of NDIS_OID items in pool using the c++ new operator, is totally different than the second sample you reference, which statically allocates an array as global memory. The size of your pointer is 4/8 bytes, the size of the static global array is size of(NDIS_OID)*nbr of elements. If you return the size of your pointer, the OS has no way of knowing how many elements in the array. You need to return the size of what your pointer points at. Jan ________________________________ From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> on behalf of xxxxx@gmail.com <xxxxx@gmail.com> Sent: Thursday, January 12, 2017 11:17:56 PM To: Windows System Software Devs Interest List Subject: RE:[ntdev] Unable to solve BytesNeeded and unable to clear address list in NDIS Test So should i change to sizeof(SupportedOids) * SupportedOidsSize = ? Here SupportedOidsSize = size of supported list = 45 . But most of the sample codes https://github.com/Microsoft/Windows-driver-samples/blob/master/network/ndis/mux/ driver/60/miniport.c Doing same concept like sizeof(SupportedOids) . Is it different with my array ? --- NTDEV is sponsored by OSR Visit the list online at: <http://www.osronline.com/showlists.cfm?list=ntdev> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <http://www.osr.com/seminars> To unsubscribe, visit the List Server section of OSR Online at <http://www.osronline.com/page.cfm?name=ListServer> --
  Message 8 of 12  
13 Jan 17 17:32
Alex Grig
xxxxxx@broadcom.com
Join Date: 14 Apr 2008
Posts To This List: 3219
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

>So should i change to sizeof(SupportedOids) * SupportedOidsSize = ? I would recommend that you take "Programming in C 101" course first.
  Message 9 of 12  
15 Jan 17 19:58
anton bassov
xxxxxx@hotmail.com
Join Date: 16 Jul 2006
Posts To This List: 4401
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

> I would recommend that you take "Programming in C 101" course first. As someone ( I cannot immediately recall this poster's name but I think it rhymes with "Jim Floberts") is so fond of saying, we were all inexperienced once..... Anton Bassov
  Message 10 of 12  
17 Jan 17 08:48
Alex Grig
xxxxxx@broadcom.com
Join Date: 14 Apr 2008
Posts To This List: 3219
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

>we were all inexperienced once ...then we learned to program C...
  Message 11 of 12  
17 Jan 17 14:53
anton bassov
xxxxxx@hotmail.com
Join Date: 16 Jul 2006
Posts To This List: 4401
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

> ...then we learned to program C... Fair enough - the story with this particular OP and his NDIS driver is truly unique. I think that even above mentioned mega-patient poster had eventually given up on him at least a year ago,and IIRC, even gave him a trashing on a couple of occasions before finally turning his back to him for good..... Anton Bassov
  Message 12 of 12  
18 Jan 17 01:26
vinay kp
xxxxxx@gmail.com
Join Date: 15 Dec 2016
Posts To This List: 182
Unable to solve BytesNeeded and unable to clear address list in NDIS Test

Yeah . I solved this supported OID List error . Thank you all for your valuable suggestions .
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 10:18.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license