<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>