-
-
[旧帖]
看tdi_fw代码,关于函数指针的问题
0.00雪花
-
发表于:
2013-12-14 22:56
6052
-
[旧帖] 看tdi_fw代码,关于函数指针的问题
0.00雪花
static TCPSendData_t *g_TCPSendData = NULL;
static TCPSendData_t new_TCPSendData;
...
if (status != STATUS_SUCCESS) {
void *buf = (irps->Parameters.DeviceIoControl.IoControlCode == IOCTL_TDI_QUERY_DIRECT_SEND_HANDLER) ?
irps->Parameters.DeviceIoControl.Type3InputBuffer : NULL;
// send IRP to original driver
status = tdi_dispatch_complete(DeviceObject, irp, FILTER_ALLOW, NULL, NULL);
if (buf != NULL && status == STATUS_SUCCESS) {
g_TCPSendData = *(TCPSendData_t **)buf;
KdPrint(("[tdi_fw] DeviceDispatch: IOCTL_TDI_QUERY_DIRECT_SEND_HANDLER: TCPSendData = 0x%x\n",
g_TCPSendData));
*(TCPSendData_t **)buf = new_TCPSendData;
}
...
NTSTATUS
new_TCPSendData(IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
{
...
}
为什么不是g_TCPSendData = (TCPSendData_t *)buf;
(TCPSendData_t *)buf = new_TCPSendData;?
new_TCPSendData已经是函数名static TCPSendData_t new_TCPSendData;是函数的声明吗?
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课