/* this completion routine gets address and port from reply to TDI_QUERY_ADDRESS_INFO */ NTSTATUS tdi_create_addrobj_complete2(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context) { NTSTATUS status; TDI_CREATE_ADDROBJ2_CTX *ctx = (TDI_CREATE_ADDROBJ2_CTX *)Context; TA_ADDRESS *addr = ctx->tai->Address.Address; struct ot_entry *ote_addr; KIRQL irql; int ipproto;
KdPrint(("[tdi_fw] we got the local address: %x:%u\n", ntohl(((TDI_ADDRESS_IP *)(addr->Address))->in_addr), ntohs(((TDI_ADDRESS_IP *)(addr->Address))->sin_port))); } 以上代码是获取ip地址的回调函数,我在虚拟机中运行该驱动,本来应该得到的地址是192.168.58.100,但是现在得到的是0, 求解。。感谢。。