Hi Ed.

How can you be sure that lpAdapter is not NULL?

The error message you sent seems an access to a null pointer....

I've tried to replicate this issue on my machine, and a similar problem occurs if lpAdapter is NULL.

Have a nice day
GV


----- Original Message ----- From: "Ed Remmell" <[EMAIL PROTECTED]>
To: <winpcap-users@winpcap.polito.it>
Sent: Saturday, January 15, 2005 2:17 AM
Subject: [WinPcap-users] Bug in v3.1beta4 of winpcap? Crash when open and close WAN adapter



Dear winpcap team -

On Win32 (I'm running Win XP Pro with the latest MS service packs applied),
I've noted that your latest v3.1beta4 release of winpcap will crash if I
execute the following sequence of packet.dll API calls on a WAN adapter:

   lpAdapter =  PacketOpenAdapter(adapterName);
   PacketCloseAdapter(lpAdapter);

lpAdapter is of course not NULL. After the call to PacketOpenAdapter, I look
at the structure that lpAdapter points to and lpAdapter->pWanAdapter is
non-NULL, indicating that it is a WAN adapter. adapterName in this case is
"\Device\NPF_GenericNdisWanAdapter".

When the code crashes somewhere in PacketCloseAdapter, the error message I
get in the Microsoft Visual C++ debugger is:

"Unhandled exception at 0x7c918fea in TreckDemo32d18.exe: 0xC0000005: Access
violation writing location 0x00000010."

If I try this exact same sequence of calls with a non-WAN adapter
(lpAdapter->pWanAdapter is NULL), it works perfectly fine.

I'm not exactly sure how I'm going to code around this problem. Right now,
what comes to mind is doing a string search in the adapterName to look for
"WanAdapter" and if found then don't try opening the adapter because of this
bug. That's obviously a hack, I'd prefer if you instead fix this.

Thanks.
- Ed Remmell

Treck, Inc. (formerly Elmic Systems, USA)

Best of Show Winner, ESC 2003

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.12 - Release Date: 1/14/2005



---
Treck, Inc. -  Confidentiality Notice

This electronic transmission may contain information that is proprietary or confidential. You are hereby notified that any dissemination, distribution or duplication of this electronic transmission to some other entity, without the expressed written consent of Treck, Inc. is strictly prohibited, unless the contents of this electronic transmission specifically authorizes you to do so. If your receipt of this electronic transmission is in error, please notify the corporate offices of Treck, Inc. immediately by calling (513) 528-5732, or by reply to this transmission.




====================== This is the WinPcap users list. It is archived at http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

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





==================================================================
This is the WinPcap users list. It is archived at
http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

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

Reply via email to