Home › Forums › Discussions › Support › OpenFilterDriver fails.. help!
- This topic has 3 replies, 2 voices, and was last updated 17 years, 4 months ago by dvsing.
-
AuthorPosts
-
July 26, 2007 at 12:57 am #5115
I just downloaded the 64-bit version demo from the website, installed it, and I’m starting to write up some code. I’ve been able to get the code to compile (by linking to ndisapi.lib, etc) and run (placing the ndisapi.dll in the right place so it’s loaded).. but after making a call:
HANDLE hDriver;
hDriver = OpenFilterDriver();
BOOL loaded = IsDriverLoaded(hDriver);… the variable loaded is false. Calls to GetTcpipBoundAdaptersInfo(…) return FALSE. It seems my program is not communicating with the WinPkFilter driver. The precompiled demo programs (ListAdapters, etc) in the “bin” directory of winpkfilter run correctly and can list adapters and capture packets, so I’m not sure why my code isn’t working.
Also, for what it’s worth, I was unable to use the C++ wrapper class CNdisApi with Microsoft Visual Studio 2005 (C++)…. during linking it had a problem finding the constructor saying that it had an unresolved token (1st error) and an unresolved external symbol (2nd error).
Should I be able to use the C interface to WinPkFilter from Microsoft Visual Studio 2005?
Also, is the driver that is downloadable from the website time-limited in any way or is it an unlimited demo for private use? (this is what I understood… but I read a few posts here mentioning a 100-packet limit.. please clarify)
Thanks!!
-Dan
July 26, 2007 at 10:22 am #6363Hmm, it is kind of difficulty to point the problem, but I suspect it is somehow related to setting up the project. I would suggest to start from the existing project (an example from passthru) and try to compile it in your environment.
Also, is the driver that is downloadable from the website time-limited in any way or is it an unlimited demo for private use? (this is what I understood… but I read a few posts here mentioning a 100-packet limit.. please clarify)
This limitation was removed a couple of years ago.
July 26, 2007 at 5:20 pm #6364ok… Has this successfully been used with Microsoft Visual Studio 2005 on a 64-bit platform?
-Dan
July 26, 2007 at 5:49 pm #6365Working!!!
I figured out the problem. There was one project option that seemed to cause it to suddenly work. Your ListAdapters program uses a Multi-Byte character set whereas the c++ Visual Studio 2005 default character set is unicode. I bet this was causing a problem with OpenFilterDriver because the default string being passed didn’t hook up with the driver properly (you could probably shed more light on the exact reason why).
Anyhow, I think we’re in business now – thank you!
-Dan
-
AuthorPosts
- You must be logged in to reply to this topic.