problem with winpkfilter

Home Forums Discussions Support problem with winpkfilter

  • This topic has 4 replies, 2 voices, and was last updated 20 years ago by PLY.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4836
    PLY
    Participant

      Hi please help
      i think your winpkfilter is work well but Can we use it in windows application? because your example are console applications
      and when i try to use it in windows application, the other application that try to broadcast windows message will not respond until i close win app that use winpkfilter. if it can’t use with win app , please tell me how console app trap the windows message because i want to send WM_CLOSE to it.

      #5491
      Vadim Smirnov
      Keymaster

        There should be no problem with using WinpkFilter from GUI application. As for you problem, then it is probably somethere in your packet filtering code. Hope it helps…

        #5492
        PLY
        Participant

          i think your winpkfilter can work on GUI app but problem is the example code of winpkfilter. i try copy two example code (passthru and packetsniffer) to GUI app and problem still occure when other application try call SendMessage or GetMessage for broadcast windows message. so the other application will not respond because SendMessage and GetMessage wait for return message from process and i think the problem are few line of code (i use delphi )

          while counter <> 0 do begin
          WaitForSingleObject ( hEvent,INFINITE);
          ResetEvent(hEvent);
          while (ReadPacket (hFilt, @ReadRequest) <> 0) do begin
          Dec (counter);
          …..
          end;
          end;

          i think because we use 2 while loop and WaitForSingleObject. if we don’t exit 2 while loop, the app can’t process any win message and also WaitForSingleObject , Can WaitForSingleObject not use INFINITE? or Can we use other method instead WaitForSingleObject?

          Please Help

          #5493
          Vadim Smirnov
          Keymaster

            I think you can create the dedicated working thread and perform packet processing in this thread. In this case you won’t block your main thread.

            #5494
            PLY
            Participant

              Thank you very much. this is very simple solution that i forgot it 😆 so sorry for waste your time.

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