ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] how to open a HANDLE with a WiFi card

From: "Joshua (Shiwei) Zhao" <swzhao@xxxxxxxxx>
Date: Fri, 19 Jun 2009 17:51:25 -0700


On Fri, Jun 19, 2009 at 4:08 PM, Guy Harris <guy@xxxxxxxxxxxx> wrote:

On Jun 18, 2009, at 4:43 PM, Joshua (Shiwei) Zhao wrote:

> With Wireshark, I'm trying to modify it to send NDIS requests to a
> wifi card driver on windows OS.

Ideally, Wireshark shouldn't do that; all operations on capture
devices should be done through libpcap/WinPcap.

However, as not all the functionality that Wireshark can use is yet
implemented by libpcap/WinPcap APIs, sometimes Wireshark has to
implement that itself.  What is it you're trying to do?

> To do this I need to call CreateFile() and pass a string of device
> name to it.

That's not necessarily the case.

See, for example, gtk/capture_if_details_dlg_win32.c, which makes
calls to wpcap_packet_request_uint() to fetch various statistics and
other information about a network adapter.  It calls wpcap_packet_open
() to get a lower-level handle on the device.

Those routines are in capture_wpcap_packet.c, which provides access to
the Packet Driver API in Winpcap; the routines from that file might be
sufficient to do what you want.
 
Yeah, this seems to be what I'm looking for. I'll try it out.
 
Many thanks,
Joshua
 
 

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe