none
如何解决win10下Verifier开启Code Integrity Checks 验证引起的DRIVER_VERIFIER_DETECTED_VIOLATION (c4)蓝屏 RRS feed

  • 问题

  • 各位前辈

    我的一个驱动程序,在win32下,开启verifier的Code Integrity Checks验证后蓝屏
    dmp如下
    DRIVER_VERIFIER_DETECTED_VIOLATION (c4)
    A device driver attempting to corrupt the system has been caught.  This is
    because the driver was specified in the registry as being suspect (by the
    administrator) and the kernel has enabled substantial checking of this driver.
    If the driver attempts to corrupt the system, bugchecks 0xC4, 0xC1 and 0xA will
    be among the most commonly seen crashes.
    Arguments:
    Arg1: 00002004, Code Integrity Issue: The image contains a section that is not page aligned.
    Arg2: b58fd0e4, ==》我的驱动程序名称
    Arg3: aa220350, The address of the section header.
    Arg4: 8ab65420, ==》 .text.

    搜索发现win10下,驱动程序编译时各个段的对齐长度为0x1000字节。
    http://blogs.msdn.com/b/windows_hardware_certification/archive/2015/05/22/driver-compatibility-with-device-guard-in-windows-10.aspx
    于是我在source文件中添加如下限制
    KMDF_VERSION_MAJOR=1
    INF_NAME=×××××
    DRIVER_ALIGNMENT=0x1000
    可以,悲催的发生了,添加前编译的程序,64位驱动没问题,32位报此蓝屏。
    添加后,32位解决了,64位蓝屏了。 同样的蓝屏。
    求解。

    2016年3月1日 2:13

答案