Click here to Skip to main content
15,942,847 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have created a basic empty WDM driver using Visual studio and
Spectre Mitigation
is set to Disabled .
Even after that i am getting the above mentioned error.
Any Idea.

The issue is not coming when I am creating sample user mode project.


What I have tried:

Disabled Spectre Mitigation but this is not working.
Updated 19-May-23 2:30am

1 solution

Not my field of expertise at all, some Googling I found the following -

The error is related to compiler security checks for Spectre variant 1 vulnerabilities Spectre (security vulnerability)[^].

Try the following steps(again, not my field) -
Open your driver project in Visual Studio.

Right-click on the project in the Solution Explorer and select "Properties" from the context menu.

In the project properties window, navigate to the "C/C++" tab.

Expand the "Code Generation" category.

Locate the "Control Flow Guard (CFG)" option and set it to "No" or "Disable (/guard:cf-)".

Save the changes and build the project again.

Keep in mind that disabling Spectre mitigations may introduce potential security risks as per documentation - Spectre mitigations in MSVC[^]
Share this answer
Rahul@puna 19-May-23 8:33am    
hi, disabling CFG is not resolving the issue.
Andre Oosthuizen 19-May-23 8:43am    
It then seems the problem is not directly related to disabling CFG (Control Flow Guard) but VS?
Try the following, not sure it will help -
Right-click on your project in the Solution Explorer and select "Properties."

In the project properties window, navigate to the "Build" tab.

Ensure that the "Platform Target" setting is set correctly for your project. Make sure it matches your target platform (e.g., x86, x64).

If you have multiple build configurations (e.g., Debug and Release), make sure the error is not specific to a particular configuration. Try switching between different configurations and check if the error persists.

If the issue persists, you can try cleaning your solution. Go to the "Build" menu and select "Clean Solution." After that, rebuild your solution.

If none of the above steps resolve the issue, you can try repairing or reinstalling Visual Studio to ensure that all necessary components and settings are in place.
Rahul@puna 19-May-23 8:56am    
Had tried all these. But issue is still there. To me it looks like something related with driver project. Like I mentioned for non-driver (such as console application, I am not getting this issue.)
Not sure what is it related with.
Andre Oosthuizen 19-May-23 9:26am    
I am truly sorry then, as I mentioned this is not my field at all. I will play some more when time allows and will see if maybe I can get a solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900