出错的这一部分代码:
NTSTATUS WDM_DeviceIOControl(IN PDEVICE_OBJECT pdevobj,IN PIRP pirp)
{
NTSTATUS status;
PIO_STACK_LOCATION CurrentStack;
int ioctl_code,*kernel_inputbuffer,*kernel_outputbuffer;
DbgPrint("enter WDM_DeviceIOControl");
CurrentStack=IoGetCurrentIrpStackLocation(pirp);
ioctl_code=CurrentStack->Parameters.DeviceIoControl.IoControlCode;
if (ioctl_code==IOCTL_CODE1) ;显示这一行有错误
{
kernel_inputbuffer=(int *)pirp->AssociatedIrp.SystemBuffer;
kernel_outputbuffer=(int *)MmGetSystemAddressForMdlSafe(pirp->MdlAddress,NormalPagePriority);
*kernel_outputbuffer=*kernel_inputbuffer;
*kernel_outputbuffer++;
}
pirp->IoStatus.Status=STATUS_SUCCESS;
pirp->IoStatus.Information=CurrentStack->Parameters.DeviceIoControl.OutputBufferLength;
IoCompleteRequest(pirp,IO_NO_INCREMENT);
DbgPrint("leave WDM_DeviceIOControl");
return status;
}
错误如下:
c_driver.c(46) : error C2143: syntax error : missing ')' before ';'
c_driver.c(46) : error C2059: syntax error : ')'
第46行就是我指出的那一行(一行一行的数了好几遍,确定第46行就是那一行),但我就是没看出来哪儿错了??
[培训]科锐逆向工程师培训第53期2025年7月8日开班!