<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Eduardo,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>PacketGetAdapterNames uses a mixture of approaches to retrieve
the adapter names, mainly IPHelperAPI and registry. But it also tries to
open the adapters exported by the driver npf.sys to check that they are really
available. So the driver should be started.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>From the mails it seems that your wrapper is generating an
exception (managed? unmanaged?) because PacketGetAdapterNames is failing (i.e.
it's returning FALSE), and you are retrieving the error code using
GetLastError(). Right? If so, what is the exact error code? </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Finally, you were saying that you use the Packet API because
you need to retrieve some information not available with the pcap API, and you
talk about PacketGetPacket. Although it's true that some functionalities
are not available with the pcap API, PacketGetPacket is completely exposed
through pcap_next_ex (or similar calls).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Have a nice day</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<DIV><FONT size=2> </DIV>
<DIV><BR></DIV></FONT>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=edu.kungfu@gmail.com href="mailto:edu.kungfu@gmail.com">Eduardo
Escudero Sánchez</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=Tom@redtile.com
href="mailto:Tom@redtile.com">Tom@redtile.com</A> ; <A
title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, August 05, 2006 11:41
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Winpcap-users] Using
Packet.dll in an 'not-admin' session</DIV>
<DIV><FONT size=2></FONT><BR></DIV>
<DIV>As Far as i know the PacketGetAdapterNames function looks inside the
registry all the entries concerning to network adapters in the system and this
action looks like one which needs privileges i think, and which has nothing in
common with the starting of the NPF driver. </DIV>
<DIV>OK the C code can't throw any exception to my C# code but the C++ code
i'm using does. I will explain myself: i don't use the Packet.dll library
directly pinvoking it from my C sharp code. What i have done is making an
auxiliar C++ dll to manage directly the Packet.dll API and export some easy
pinvokable functions to my Csharp code. So i use the packet.dll API through an
auxiliar C++ dll, which was more easy for me than trying pinvoking
directly the API.</DIV>
<DIV>Im using Packet.dll because this API has some functions i need to
retrieve network adapter information, for example, the packetgetpacket
function to retrieve information about the number of frames received or the
number of frames received with collision, etc... </DIV>
<DIV>I think that this exception is being launched when the API tries to read
the registry in a not-privileged account.<BR><BR> </DIV>
<DIV><SPAN class=gmail_quote>2006/8/6, Thomas O'Hare <<A
href="mailto:Tom@redtile.com">Tom@redtile.com</A>>:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">FWIW...<BR><BR>Permissions
include "all" dirs and files that are used in the operation.<BR>IOW,
System32, your home dir, your working did, your files, etc, must <BR>all
have the correct permissions.<BR><BR>BTW, since I believe C# is Win32, why
are you not using WinPCap.Dll<BR>instead with the list of exported
functions?<BR><BR>Also, when you get it working, can you mention your
experiences using <BR>C#? I am using C and C++ and I wonder which
would really be better. My<BR>guess is C would be much more
portable. But I look forward to any<BR>comments on
this.<BR><BR>Thanks,<BR>~ Thomas O'Hare ~<BR>President, RedTile, Inc. - DBA:
RedTile Software <BR>Web, Wireless, Network, Database & Systems
Software<BR>+1.407.295.9148 ; +49.8651.717950 ; <A
href="http://www.RedTile.Com/">http://www.RedTile.Com/</A><BR>Operations
Manager; Virtual FoxPro User Group<BR><A
href="mailto:Tom@VFUG.Org">Tom@VFUG.Org</A> ; <A
href="http://www.VFUG.Org/">http://www.VFUG.Org/</A><BR><BR><BR>Eduardo
Escudero Sánchez wrote:<BR>> Hi i have developed an application in C#
which uses Packet.dll to capture<BR>> and send packets using an adapter.
<BR>> The problem is that i want to use that application in a session
without<BR>> admin privileges.<BR>> I have posted before a message on
this topic and someone told me that the<BR>> only thing i had to do was
run a command sc config npf start= auto and <BR>> that's all.<BR>> But
the thruth is that this is not enough. When i start running my
project<BR>> and PacketGetAdapterNames is called my program throws an
exception telling<BR>> me that i haven't enough permissions. <BR>> Can
someone tell me please how can i use Packet.dll API without admin<BR>>
privileges? thanks.<BR>><BR>><BR>>
------------------------------------------------------------------------<BR>><BR>>
_______________________________________________ <BR>> Winpcap-users
mailing list<BR>> <A
href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR>>
<A
href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users
</A><BR>_______________________________________________<BR>Winpcap-users
mailing list<BR><A
href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR><A
href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR></BLOCKQUOTE></DIV><BR>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></BODY></HTML>