FltSendMessage:无法发送消息

时间:2014-06-16 03:53:20

标签: c++ windows driver

我尝试使用fltkernel.h函数向应用程序发送消息。我尝试了几个更改,但无法使其工作。

驱动程序中的

   X.QuadPart = ((-1 * 10) * 1000) * 1000;  
   message.MessageId = 15;
   message.ReplyLength = 12;
   if NT_SUCCESS( FltSendMessage(fileManager.pFilter, &fileManager.ClientPort, buffer, sizeof(buffer), NULL/*&Reply*/, NULL/*&ReplyLength*/, &X) );
     DbgPrint("Success!");
App中的

  HRESULT hResult = S_OK;
  HANDLE Port;
  FILTER_MESSAGE_HEADER message;
  OVERLAPPED Ovlp;

    hResult = FilterConnectCommunicationPort(FLPORTNAME, 0, NULL, 0, NULL, &Port);

    message.MessageId = 0;
    message.ReplyLength = 0;

    while (true){
      hResult = FilterGetMessage(Port, &message, sizeof(FILTER_MESSAGE_HEADER), NULL);//&Ovlp
      printf("MessageId %d %d \n", message.MessageId, hResult);
    }

结果

DebugView =成功! App Output = MessageId 0 0

有任何提示的人吗?

0 个答案:

没有答案