OpenFilterDriver fails.. help!

Home Forums Discussions Support OpenFilterDriver fails.. help!

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5115
    dvsing
    Participant

      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

      #6363
      Vadim Smirnov
      Keymaster

        Hmm, 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.

        #6364
        dvsing
        Participant

          ok… Has this successfully been used with Microsoft Visual Studio 2005 on a 64-bit platform?

          -Dan

          #6365
          dvsing
          Participant

            Working!!!

            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

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.