| 
					
				 | 
			
			
				@@ -282,6 +282,7 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this->Makefile->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   this->NsightTegra = gg->IsNsightTegra(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   this->Android = gg->TargetsAndroid(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  this->WindowsKernelMode = gg->TargetsWindowsKernelModeDriver(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   auto scanProp = target->GetProperty("CXX_SCAN_FOR_MODULES"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   for (auto const& config : this->Configurations) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (scanProp.IsSet()) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1434,7 +1435,11 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         switch (this->GeneratorTarget->GetType()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           case cmStateEnums::SHARED_LIBRARY: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           case cmStateEnums::MODULE_LIBRARY: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            configType = "DynamicLibrary"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (this->WindowsKernelMode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              configType = "Driver"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              configType = "DynamicLibrary"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           case cmStateEnums::OBJECT_LIBRARY: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           case cmStateEnums::STATIC_LIBRARY: 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1479,6 +1484,10 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } else if (this->Android) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this->WriteAndroidConfigurationValues(e1, c); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (this->WindowsKernelMode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this->WriteMSDriverConfigurationValues(e1, c); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1605,6 +1614,14 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   oh.OutputFlagMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+void cmVisualStudio10TargetGenerator::WriteMSDriverConfigurationValues( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  Elem& e1, std::string const&) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // FIXME: Introduce a way for project code to control these. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  e1.Element("DriverType", "KMDF"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  e1.Element("DriverTargetPlatform", "Universal"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesCommon( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   Elem& e1, std::string const& config) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3214,9 +3231,13 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (!this->MSTools) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  if (this->WindowsKernelMode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (this->ProjectType == VsProjectType::csproj) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   // static libraries and things greater than modules do not need 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   // to set this option 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY || 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3684,6 +3705,10 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   e2.Element("ScanSourceForModuleDependencies", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				              this->ScanSourceForModuleDependencies[configName] ? "true" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                                : "false"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  if (this->WindowsKernelMode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    e2.Element("WppEnabled", "true"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    e2.Element("WppRecorderEnabled", "true"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 bool cmVisualStudio10TargetGenerator::ComputeRcOptions() 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4819,6 +4844,10 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this->WriteMasmOptions(e1, c); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this->WriteNasmOptions(e1, c); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (this->WindowsKernelMode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      Elem(e1, "DriverSign").Element("FileDigestAlgorithm", "sha256"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //    output midl flags       <Midl></Midl> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     this->WriteMidlOptions(e1, c); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // write events 
			 |