TDI driver, we can not cut local IP address

Home Forums Discussions Support TDI driver, we can not cut local IP address

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #5286
    eboev
    Participant

      Hello all!
      Test comp has IP 192.168.3.7. On this comp I tests driver.
      We have next problem: we register procedure to get IP:Port of connection:

      TdiBuildQueryInformation(query_irp, devobj, irps->FileObject,
      tdi_create_addrobj_complete2, ctx,
      TDI_QUERY_ADDRESS_INFO, mdl);
      //вызов драйвера, который даст нам в будущем информацию
      status = IoCallDriver(devobj, query_irp);

      After it, when driver calls our function we cut IP:Port:

      tdi_create_addrobj_complete2(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
      {
      NTSTATUS status;
      TDI_ADDRESS_INFO * ctx = (TDI_ADDRESS_INFO *)Context;
      TA_ADDRESS * addr = ctx->Address.Address;

      struct ot_entry *ote;
      KIRQL irql;

      if(addrobj_complete2Break)
      DbgBreakPoint();

      //вот где происходит получение порта и айпи адреса
      //AddressLength
      //addr->AddressLength
      KdPrint((“[tdi_fw] tdi_create_addrobj_complete2: address: %u:%u:%un”,
      ((TDI_ADDRESS_IP *)(addr->Address))->in_addr,
      ntohs(((TDI_ADDRESS_IP *)(addr->Address))->sin_port),
      addr->AddressType
      ));
      Problem next: when the real local pair is 192.168.3.7 : 123, we get IP=0 🙁
      when the real local pair is 127.0.0.1 : 1081, we get real 127.0.0.1 IP, Port really real we get.
      What do you think about it problem? Thanks 🙂

    Viewing 1 post (of 1 total)
    • You must be logged in to reply to this topic.