Hello,

First I'm newbe with Winpcap and I'm sorry if this question has already been
dealt with.
I tried to get the local MAC Address using the PacketRequest method but it
didn't work.
The PacketOpenAdapter() seems to work fine.
The GetLastError() returns an Empty string.

Do you have any idea why it doesn't work and how to fix it?
Regards,
Pierre.


   LPADAPTER m_lpAdapter;
   PPACKET_OID_DATA  pOidData;
   ULONG             length = 6;

   // Open the specified adapter
   if ((lpAdapter = PacketOpenAdapter(localAdaptersName)) != NULL)
   {
     pOidData =
(PACKET_OID_DATA*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, length);

     pOidData->Oid = OID_802_3_PERMANENT_ADDRESS;
     pOidData->Length = sizeof (ULONG);

     if (PacketRequest(lpAdapter, FALSE, pOidData) == 0)
     {
       DWORD dwErrorCode=GetLastError();
       AfxMessageBox("PacketRequest failed!, " + dwErrorCode);
     }
     else
       // make something here
     }
     // freing memory ...



==================================================================
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/[EMAIL PROTECTED]/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]
==================================================================

Reply via email to