RE: Getting network (MAC) address of network card in inte rmediate driver

Hi,

Here is the code I am using (in my MiniportInitialize function). I get
a fatal error right after the debugger outputs the “request firing”
debug statement. The memory allocations are successful and the
OS_ASSERT passes. When it dies it says “DRIVER_IRQL_NOT_LESS_OR_EQUAL”.
Suggestions?

PNDIS_REQUEST pRequest;

PNDIS_BUFFER pBuffer;

NDIS_PHYSICAL_ADDRESS noMaxAddr = NDIS_PHYSICAL_ADDRESS_CONST(-1,-1);

Status = NdisAllocateMemory(&pBuffer, 6, 0, noMaxAddr);

if (Status != NDIS_STATUS_SUCCESS)

DBG_PRINTF((“AdapterRequest - Not enough memory1”))

Status = NdisAllocateMemory(&pRequest, sizeof(NDIS_REQUEST), 0,
noMaxAddr);

if (Status != NDIS_STATUS_SUCCESS)

DBG_PRINTF((“AdapterRequest - Not enough memory2”))

NdisZeroMemory(pRequest, sizeof(NDIS_REQUEST));

pRequest->DATA.QUERY_INFORMATION.Oid = OID_802_3_CURRENT_ADDRESS;

pRequest->DATA.QUERY_INFORMATION.InformationBuffer = pBuffer;

pRequest->DATA.QUERY_INFORMATION.InformationBufferLength = 6;

pRequest->DATA.QUERY_INFORMATION.BytesWritten = 0;

pRequest->DATA.QUERY_INFORMATION.BytesNeeded = 6;

OS_ASSERT(pAdapt->BindingHandle);

DBG_PRINTF((“request firing”))

NdisRequest(&Status, pAdapt->BindingHandle, pRequest);

DBG_PRINTF((“checking status”))

if (Status == NDIS_STATUS_SUCCESS)

{

DBG_PRINTF((“successful request”))

}

else

{

DBG_PRINTF((“unsuccessful request”))

}

-----Original Message-----
From: Vodicka, Michal [mailto:xxxxx@rkk.cz]
Sent: Tuesday, February 20, 2001 4:02 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Getting network (MAC) address of network card in
inte rmediate driver

I’m using OID_802_3_CURRENT_ADDRESS for this purpose but permanent one
should work as well. There is no problem, just fill NDIS_REQUEST
structure
with appropriatte values, call NdisRequest() with correct parameters and
wait for completion if it returns pending status.
ProtocolRequestComplete()
is called when pending request is completed. Of course, 802_3 OIDs work
for
ethernet adapters only.

BTW, if you have been unsuccessful, there should be some error code
which is
the most important information when solving such a problem.

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


From: John Hirschi[SMTP:xxxxx@SonicWALL.com]
Reply To: NT Developers Interest List
Sent: Tuesday, February 20, 2001 11:42 PM
To: NT Developers Interest List
Subject: [ntdev] Getting network (MAC) address of network card in
intermediate driver

Hi,

I am working on an intermediate driver for Win2k. In my intermediate
driver, I need to know the 6 byte MAC address of the network card that
I
am controlling. I have tried using the NdisReadNetworkAddress()
function, but the call fails. I think it fails because the function
expects the MAC address to be written in the registry under a
NetworkAddress key that is not there. So after banging my head
against
that problem for a while, I decided to look for a different way to get
the network address. I found this: OID_802_3_PERMANENT_ADDRESS . It
seems that I can call NdisRequest, pass it this OID, and get the
information I need. However, I have been unsuccessful so far. Can
you
please send me information, a link, a suggestion, cold compress, etc?

Thanks,
John


You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@sonicwall.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com