This commit is contained in:
		
							parent
							
								
									dd8970758a
								
							
						
					
					
						commit
						0ca48ba694
					
				@ -1,8 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="ProjectModuleManager">
 | 
			
		||||
    <modules>
 | 
			
		||||
      <module fileurl="file://$PROJECT_DIR$/.idea/modules/TVPN.main.iml" filepath="$PROJECT_DIR$/.idea/modules/TVPN.main.iml" />
 | 
			
		||||
    </modules>
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										580
									
								
								src/main/cpp/.idea/editor.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										580
									
								
								src/main/cpp/.idea/editor.xml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,580 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="BackendCodeEditorSettings">
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
 | 
			
		||||
    <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexRemoved" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
 | 
			
		||||
    <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexRemoved" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
@ -1,4 +1,7 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="CMakePythonSetting">
 | 
			
		||||
    <option name="pythonIntegrationState" value="YES" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
 | 
			
		||||
</project>
 | 
			
		||||
@ -15,8 +15,7 @@ set(JNI_INCLUDE_DIR2 "${JAVA_HOME}/include/win32")
 | 
			
		||||
include_directories(${JNI_INCLUDE_DIR} ${JNI_INCLUDE_DIR2})
 | 
			
		||||
 | 
			
		||||
# Add the source file that includes your JNI C wrapper code
 | 
			
		||||
add_library(wireguard_wrapper SHARED wireguard_wrapper.c
 | 
			
		||||
        example.c)
 | 
			
		||||
add_library(wireguard_wrapper SHARED wireguard_wrapper.c)
 | 
			
		||||
 | 
			
		||||
#target_link_libraries(wireguard_wrapper PRIVATE Rpcrt4)
 | 
			
		||||
target_link_libraries(wireguard_wrapper ws2_32 rpcrt4)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										8
									
								
								src/main/go/.idea/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/main/go/.idea/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
# Default ignored files
 | 
			
		||||
/shelf/
 | 
			
		||||
/workspace.xml
 | 
			
		||||
# Editor-based HTTP Client requests
 | 
			
		||||
/httpRequests/
 | 
			
		||||
# Datasource local storage ignored files
 | 
			
		||||
/dataSources/
 | 
			
		||||
/dataSources.local.xml
 | 
			
		||||
							
								
								
									
										4
									
								
								src/main/go/.idea/vcs.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/main/go/.idea/vcs.xml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,4 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="VcsDirectoryMappings" defaultProject="true" />
 | 
			
		||||
</project>
 | 
			
		||||
							
								
								
									
										13
									
								
								src/main/go/go.mod
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/main/go/go.mod
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
module git.nevets.tech/Steven/TVPN
 | 
			
		||||
 | 
			
		||||
go 1.23.2
 | 
			
		||||
 | 
			
		||||
require (
 | 
			
		||||
	golang.org/x/sys v0.26.0
 | 
			
		||||
	golang.zx2c4.com/wireguard/windows v0.5.3
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
require (
 | 
			
		||||
	golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
 | 
			
		||||
	golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2 // indirect
 | 
			
		||||
)
 | 
			
		||||
							
								
								
									
										8
									
								
								src/main/go/go.sum
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/main/go/go.sum
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M=
 | 
			
		||||
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 | 
			
		||||
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
 | 
			
		||||
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 | 
			
		||||
golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2 h1:GLw7MR8AfAG2GmGcmVgObFOHXYypgGjnGno25RDwn3Y=
 | 
			
		||||
golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2/go.mod h1:EFNZuWvGYxIRUEX+K8UmCFwYmZjqcrnq15ZuVldZkZ0=
 | 
			
		||||
golang.zx2c4.com/wireguard/windows v0.5.3 h1:On6j2Rpn3OEMXqBq00QEDC7bWSZrPIHKIus8eIuExIE=
 | 
			
		||||
golang.zx2c4.com/wireguard/windows v0.5.3/go.mod h1:9TEe8TJmtwyQebdFwAkEWOPr3prrtqm+REGFifP60hI=
 | 
			
		||||
							
								
								
									
										45
									
								
								src/main/go/main.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/main/go/main.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,45 @@
 | 
			
		||||
package main
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"crypto/rand"
 | 
			
		||||
	"golang.org/x/crypto/curve25519"
 | 
			
		||||
	"golang.org/x/sys/windows"
 | 
			
		||||
	"golang.zx2c4.com/wireguard/windows/conf"
 | 
			
		||||
	"golang.zx2c4.com/wireguard/windows/tunnel"
 | 
			
		||||
	"log"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"unsafe"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
//export InstallTunnelService
 | 
			
		||||
func InstallTunnelService(confPath string) {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//export CreateTunnelService
 | 
			
		||||
func CreateTunnelService(confFile16 *uint16) bool {
 | 
			
		||||
	confFile := windows.UTF16PtrToString(confFile16)
 | 
			
		||||
	conf.PresetRootDirectory(filepath.Dir(confFile))
 | 
			
		||||
	tunnel.UseFixedGUIDInsteadOfDeterministic = true
 | 
			
		||||
	err := tunnel.Run(confFile)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		log.Printf("Service run error: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
	return err == nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//export GenerateKeyPair
 | 
			
		||||
func GenerateKeypair(publicKey, privateKey *byte) {
 | 
			
		||||
	publicKeyArray := (*[32]byte)(unsafe.Pointer(publicKey))
 | 
			
		||||
	privateKeyArray := (*[32]byte)(unsafe.Pointer(privateKey))
 | 
			
		||||
	n, err := rand.Read(privateKeyArray[:])
 | 
			
		||||
	if err != nil || n != len(privateKeyArray) {
 | 
			
		||||
		panic("Unable to generate random bytes")
 | 
			
		||||
	}
 | 
			
		||||
	privateKeyArray[0] &= 248
 | 
			
		||||
	privateKeyArray[31] = (privateKeyArray[31] & 127) | 64
 | 
			
		||||
 | 
			
		||||
	curve25519.ScalarBaseMult(publicKeyArray, privateKeyArray)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func main() {}
 | 
			
		||||
							
								
								
									
										117
									
								
								src/main/go/service/install.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								src/main/go/service/install.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,117 @@
 | 
			
		||||
/* SPDX-License-Identifier: MIT
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Modified by Steven Tracey
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package service
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"errors"
 | 
			
		||||
	"golang.org/x/sys/windows"
 | 
			
		||||
	"golang.org/x/sys/windows/svc"
 | 
			
		||||
	"golang.org/x/sys/windows/svc/mgr"
 | 
			
		||||
	"golang.zx2c4.com/wireguard/windows/conf"
 | 
			
		||||
	"os"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var cachedServiceManager *mgr.Mgr
 | 
			
		||||
 | 
			
		||||
func serviceManager() (*mgr.Mgr, error) {
 | 
			
		||||
	if cachedServiceManager != nil {
 | 
			
		||||
		return cachedServiceManager, nil
 | 
			
		||||
	}
 | 
			
		||||
	m, err := mgr.Connect()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	cachedServiceManager = m
 | 
			
		||||
	return cachedServiceManager, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func InstallTunnel(configPath string) error {
 | 
			
		||||
	m, err := serviceManager()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	path, err := os.Executable()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	name, err := conf.NameFromPath(configPath)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	serviceName, err := conf.ServiceNameOfTunnel(name)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	service, err := m.OpenService(serviceName)
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		status, err := service.Query()
 | 
			
		||||
		if err != nil && err != windows.ERROR_SERVICE_MARKED_FOR_DELETE {
 | 
			
		||||
			service.Close()
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		if status.State != svc.Stopped && err != windows.ERROR_SERVICE_MARKED_FOR_DELETE {
 | 
			
		||||
			service.Close()
 | 
			
		||||
			return errors.New("Tunnel already installed and running")
 | 
			
		||||
		}
 | 
			
		||||
		err = service.Delete()
 | 
			
		||||
		service.Close()
 | 
			
		||||
		if err != nil && err != windows.ERROR_SERVICE_MARKED_FOR_DELETE {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		for {
 | 
			
		||||
			service, err = m.OpenService(serviceName)
 | 
			
		||||
			if err != nil && err != windows.ERROR_SERVICE_MARKED_FOR_DELETE {
 | 
			
		||||
				break
 | 
			
		||||
			}
 | 
			
		||||
			service.Close()
 | 
			
		||||
			time.Sleep(time.Second / 3)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	config := mgr.Config{
 | 
			
		||||
		ServiceType:  windows.SERVICE_WIN32_OWN_PROCESS,
 | 
			
		||||
		StartType:    mgr.StartAutomatic,
 | 
			
		||||
		ErrorControl: mgr.ErrorNormal,
 | 
			
		||||
		Dependencies: []string{"Nsi", "TcpIp"},
 | 
			
		||||
		DisplayName:  "WireGuard Tunnel: " + name,
 | 
			
		||||
		SidType:      windows.SERVICE_SID_TYPE_UNRESTRICTED,
 | 
			
		||||
	}
 | 
			
		||||
	service, err = m.CreateService(serviceName, path, config, "/tunnelservice", configPath)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err = service.Start()
 | 
			
		||||
	go trackTunnelService(name, service) // Pass off reference to handle.
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func UninstallTunnel(name string) error {
 | 
			
		||||
	m, err := serviceManager()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	serviceName, err := conf.ServiceNameOfTunnel(name)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	service, err := m.OpenService(serviceName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	service.Control(svc.Stop)
 | 
			
		||||
	err = service.Delete()
 | 
			
		||||
	err2 := service.Close()
 | 
			
		||||
	if err != nil && err != windows.ERROR_SERVICE_MARKED_FOR_DELETE {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	return err2
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										398
									
								
								src/main/go/service/ipc_client.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										398
									
								
								src/main/go/service/ipc_client.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,398 @@
 | 
			
		||||
/* SPDX-License-Identifier: MIT
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Modified by Steven Tracey
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package service
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/gob"
 | 
			
		||||
	"errors"
 | 
			
		||||
	"os"
 | 
			
		||||
	"sync"
 | 
			
		||||
 | 
			
		||||
	"golang.zx2c4.com/wireguard/windows/conf"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type Tunnel struct {
 | 
			
		||||
	Name string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type TunnelState int
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	TunnelUnknown TunnelState = iota
 | 
			
		||||
	TunnelStarted
 | 
			
		||||
	TunnelStopped
 | 
			
		||||
	TunnelStarting
 | 
			
		||||
	TunnelStopping
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type NotificationType int
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	TunnelChangeNotificationType NotificationType = iota
 | 
			
		||||
	TunnelsChangeNotificationType
 | 
			
		||||
	ManagerStoppingNotificationType
 | 
			
		||||
	UpdateFoundNotificationType
 | 
			
		||||
	UpdateProgressNotificationType
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type MethodType int
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	StoredConfigMethodType MethodType = iota
 | 
			
		||||
	RuntimeConfigMethodType
 | 
			
		||||
	StartMethodType
 | 
			
		||||
	StopMethodType
 | 
			
		||||
	WaitForStopMethodType
 | 
			
		||||
	DeleteMethodType
 | 
			
		||||
	StateMethodType
 | 
			
		||||
	GlobalStateMethodType
 | 
			
		||||
	CreateMethodType
 | 
			
		||||
	TunnelsMethodType
 | 
			
		||||
	QuitMethodType
 | 
			
		||||
	UpdateStateMethodType
 | 
			
		||||
	UpdateMethodType
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	rpcEncoder *gob.Encoder
 | 
			
		||||
	rpcDecoder *gob.Decoder
 | 
			
		||||
	rpcMutex   sync.Mutex
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type TunnelChangeCallback struct {
 | 
			
		||||
	cb func(tunnel *Tunnel, state, globalState TunnelState, err error)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var tunnelChangeCallbacks = make(map[*TunnelChangeCallback]bool)
 | 
			
		||||
 | 
			
		||||
type TunnelsChangeCallback struct {
 | 
			
		||||
	cb func()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var tunnelsChangeCallbacks = make(map[*TunnelsChangeCallback]bool)
 | 
			
		||||
 | 
			
		||||
type ManagerStoppingCallback struct {
 | 
			
		||||
	cb func()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var managerStoppingCallbacks = make(map[*ManagerStoppingCallback]bool)
 | 
			
		||||
 | 
			
		||||
func InitializeIPCClient(reader, writer, events *os.File) {
 | 
			
		||||
	rpcDecoder = gob.NewDecoder(reader)
 | 
			
		||||
	rpcEncoder = gob.NewEncoder(writer)
 | 
			
		||||
	go func() {
 | 
			
		||||
		decoder := gob.NewDecoder(events)
 | 
			
		||||
		for {
 | 
			
		||||
			var notificationType NotificationType
 | 
			
		||||
			err := decoder.Decode(¬ificationType)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			switch notificationType {
 | 
			
		||||
			case TunnelChangeNotificationType:
 | 
			
		||||
				var tunnel string
 | 
			
		||||
				err := decoder.Decode(&tunnel)
 | 
			
		||||
				if err != nil || len(tunnel) == 0 {
 | 
			
		||||
					continue
 | 
			
		||||
				}
 | 
			
		||||
				var state TunnelState
 | 
			
		||||
				err = decoder.Decode(&state)
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					continue
 | 
			
		||||
				}
 | 
			
		||||
				var globalState TunnelState
 | 
			
		||||
				err = decoder.Decode(&globalState)
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					continue
 | 
			
		||||
				}
 | 
			
		||||
				var errStr string
 | 
			
		||||
				err = decoder.Decode(&errStr)
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					continue
 | 
			
		||||
				}
 | 
			
		||||
				var retErr error
 | 
			
		||||
				if len(errStr) > 0 {
 | 
			
		||||
					retErr = errors.New(errStr)
 | 
			
		||||
				}
 | 
			
		||||
				if state == TunnelUnknown {
 | 
			
		||||
					continue
 | 
			
		||||
				}
 | 
			
		||||
				t := &Tunnel{tunnel}
 | 
			
		||||
				for cb := range tunnelChangeCallbacks {
 | 
			
		||||
					cb.cb(t, state, globalState, retErr)
 | 
			
		||||
				}
 | 
			
		||||
			case TunnelsChangeNotificationType:
 | 
			
		||||
				for cb := range tunnelsChangeCallbacks {
 | 
			
		||||
					cb.cb()
 | 
			
		||||
				}
 | 
			
		||||
			case ManagerStoppingNotificationType:
 | 
			
		||||
				for cb := range managerStoppingCallbacks {
 | 
			
		||||
					cb.cb()
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func rpcDecodeError() error {
 | 
			
		||||
	var str string
 | 
			
		||||
	err := rpcDecoder.Decode(&str)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	if len(str) == 0 {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	return errors.New(str)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (t *Tunnel) StoredConfig() (c conf.Config, err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(StoredConfigMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcEncoder.Encode(t.Name)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecoder.Decode(&c)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (t *Tunnel) RuntimeConfig() (c conf.Config, err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(RuntimeConfigMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcEncoder.Encode(t.Name)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecoder.Decode(&c)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (t *Tunnel) Start() (err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(StartMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcEncoder.Encode(t.Name)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (t *Tunnel) Stop() (err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(StopMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcEncoder.Encode(t.Name)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (t *Tunnel) Toggle() (oldState TunnelState, err error) {
 | 
			
		||||
	oldState, err = t.State()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		oldState = TunnelUnknown
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	if oldState == TunnelStarted {
 | 
			
		||||
		err = t.Stop()
 | 
			
		||||
	} else if oldState == TunnelStopped {
 | 
			
		||||
		err = t.Start()
 | 
			
		||||
	}
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (t *Tunnel) WaitForStop() (err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(WaitForStopMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcEncoder.Encode(t.Name)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (t *Tunnel) Delete() (err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(DeleteMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcEncoder.Encode(t.Name)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (t *Tunnel) State() (tunnelState TunnelState, err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(StateMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcEncoder.Encode(t.Name)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecoder.Decode(&tunnelState)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCClientGlobalState() (tunnelState TunnelState, err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(GlobalStateMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecoder.Decode(&tunnelState)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCClientNewTunnel(conf *conf.Config) (tunnel Tunnel, err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(CreateMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcEncoder.Encode(*conf)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecoder.Decode(&tunnel)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCClientTunnels() (tunnels []Tunnel, err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(TunnelsMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecoder.Decode(&tunnels)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCClientQuit(stopTunnelsOnQuit bool) (alreadyQuit bool, err error) {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	err = rpcEncoder.Encode(QuitMethodType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcEncoder.Encode(stopTunnelsOnQuit)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecoder.Decode(&alreadyQuit)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	err = rpcDecodeError()
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCClientUpdate() error {
 | 
			
		||||
	rpcMutex.Lock()
 | 
			
		||||
	defer rpcMutex.Unlock()
 | 
			
		||||
 | 
			
		||||
	return rpcEncoder.Encode(UpdateMethodType)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCClientRegisterTunnelChange(cb func(tunnel *Tunnel, state, globalState TunnelState, err error)) *TunnelChangeCallback {
 | 
			
		||||
	s := &TunnelChangeCallback{cb}
 | 
			
		||||
	tunnelChangeCallbacks[s] = true
 | 
			
		||||
	return s
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (cb *TunnelChangeCallback) Unregister() {
 | 
			
		||||
	delete(tunnelChangeCallbacks, cb)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCClientRegisterTunnelsChange(cb func()) *TunnelsChangeCallback {
 | 
			
		||||
	s := &TunnelsChangeCallback{cb}
 | 
			
		||||
	tunnelsChangeCallbacks[s] = true
 | 
			
		||||
	return s
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (cb *TunnelsChangeCallback) Unregister() {
 | 
			
		||||
	delete(tunnelsChangeCallbacks, cb)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCClientRegisterManagerStopping(cb func()) *ManagerStoppingCallback {
 | 
			
		||||
	s := &ManagerStoppingCallback{cb}
 | 
			
		||||
	managerStoppingCallbacks[s] = true
 | 
			
		||||
	return s
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (cb *ManagerStoppingCallback) Unregister() {
 | 
			
		||||
	delete(managerStoppingCallbacks, cb)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										63
									
								
								src/main/go/service/ipc_driver.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								src/main/go/service/ipc_driver.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,63 @@
 | 
			
		||||
/* SPDX-License-Identifier: MIT
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Modified by Steven Tracey
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package service
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"sync"
 | 
			
		||||
 | 
			
		||||
	"golang.zx2c4.com/wireguard/windows/driver"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type lockedDriverAdapter struct {
 | 
			
		||||
	*driver.Adapter
 | 
			
		||||
	sync.Mutex
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	driverAdapters     = make(map[string]*lockedDriverAdapter)
 | 
			
		||||
	driverAdaptersLock sync.RWMutex
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func findDriverAdapter(tunnelName string) (*lockedDriverAdapter, error) {
 | 
			
		||||
	driverAdaptersLock.RLock()
 | 
			
		||||
	driverAdapter, ok := driverAdapters[tunnelName]
 | 
			
		||||
	if ok {
 | 
			
		||||
		driverAdapter.Lock()
 | 
			
		||||
		driverAdaptersLock.RUnlock()
 | 
			
		||||
		return driverAdapter, nil
 | 
			
		||||
	}
 | 
			
		||||
	driverAdaptersLock.RUnlock()
 | 
			
		||||
	driverAdaptersLock.Lock()
 | 
			
		||||
	defer driverAdaptersLock.Unlock()
 | 
			
		||||
	driverAdapter, ok = driverAdapters[tunnelName]
 | 
			
		||||
	if ok {
 | 
			
		||||
		driverAdapter.Lock()
 | 
			
		||||
		return driverAdapter, nil
 | 
			
		||||
	}
 | 
			
		||||
	driverAdapter = &lockedDriverAdapter{}
 | 
			
		||||
	var err error
 | 
			
		||||
	driverAdapter.Adapter, err = driver.OpenAdapter(tunnelName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	driverAdapters[tunnelName] = driverAdapter
 | 
			
		||||
	driverAdapter.Lock()
 | 
			
		||||
	return driverAdapter, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func releaseDriverAdapter(tunnelName string) {
 | 
			
		||||
	driverAdaptersLock.Lock()
 | 
			
		||||
	defer driverAdaptersLock.Unlock()
 | 
			
		||||
	driverAdapter, ok := driverAdapters[tunnelName]
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	driverAdapter.Lock()
 | 
			
		||||
	delete(driverAdapters, tunnelName)
 | 
			
		||||
	driverAdapter.Unlock()
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										490
									
								
								src/main/go/service/ipc_server.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										490
									
								
								src/main/go/service/ipc_server.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,490 @@
 | 
			
		||||
/* SPDX-License-Identifier: MIT
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Modified by Steven Tracey
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package service
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"encoding/gob"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"log"
 | 
			
		||||
	"os"
 | 
			
		||||
	"sync"
 | 
			
		||||
	"sync/atomic"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"golang.org/x/sys/windows"
 | 
			
		||||
	"golang.org/x/sys/windows/svc"
 | 
			
		||||
 | 
			
		||||
	"golang.zx2c4.com/wireguard/windows/conf"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	managerServices     = make(map[*ManagerService]bool)
 | 
			
		||||
	managerServicesLock sync.RWMutex
 | 
			
		||||
	haveQuit            uint32
 | 
			
		||||
	quitManagersChan    = make(chan struct{}, 1)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type ManagerService struct {
 | 
			
		||||
	events        *os.File
 | 
			
		||||
	eventLock     sync.Mutex
 | 
			
		||||
	elevatedToken windows.Token
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) StoredConfig(tunnelName string) (*conf.Config, error) {
 | 
			
		||||
	conf, err := conf.LoadFromName(tunnelName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	if s.elevatedToken == 0 {
 | 
			
		||||
		conf.Redact()
 | 
			
		||||
	}
 | 
			
		||||
	return conf, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) RuntimeConfig(tunnelName string) (*conf.Config, error) {
 | 
			
		||||
	storedConfig, err := conf.LoadFromName(tunnelName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	driverAdapter, err := findDriverAdapter(tunnelName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	runtimeConfig, err := driverAdapter.Configuration()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		driverAdapter.Unlock()
 | 
			
		||||
		releaseDriverAdapter(tunnelName)
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	conf := conf.FromDriverConfiguration(runtimeConfig, storedConfig)
 | 
			
		||||
	driverAdapter.Unlock()
 | 
			
		||||
	if s.elevatedToken == 0 {
 | 
			
		||||
		conf.Redact()
 | 
			
		||||
	}
 | 
			
		||||
	return conf, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) Start(tunnelName string) error {
 | 
			
		||||
	c, err := conf.LoadFromName(tunnelName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Figure out which tunnels have intersecting addresses/routes and stop those.
 | 
			
		||||
	trackedTunnelsLock.Lock()
 | 
			
		||||
	tt := make([]string, 0, len(trackedTunnels))
 | 
			
		||||
	var inTransition string
 | 
			
		||||
	for t, state := range trackedTunnels {
 | 
			
		||||
		c2, err := conf.LoadFromName(t)
 | 
			
		||||
		if err != nil || !c.IntersectsWith(c2) {
 | 
			
		||||
			// If we can't get the config, assume it doesn't intersect.
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		tt = append(tt, t)
 | 
			
		||||
		if len(t) > 0 && (state == TunnelStarting || state == TunnelUnknown) {
 | 
			
		||||
			inTransition = t
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	trackedTunnelsLock.Unlock()
 | 
			
		||||
	if len(inTransition) != 0 {
 | 
			
		||||
		return fmt.Errorf("Please allow the tunnel ‘%s’ to finish activating", inTransition)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Stop those intersecting tunnels asynchronously.
 | 
			
		||||
	go func() {
 | 
			
		||||
		for _, t := range tt {
 | 
			
		||||
			s.Stop(t)
 | 
			
		||||
		}
 | 
			
		||||
		for _, t := range tt {
 | 
			
		||||
			state, err := s.State(t)
 | 
			
		||||
			if err == nil && (state == TunnelStarted || state == TunnelStarting) {
 | 
			
		||||
				log.Printf("[%s] Trying again to stop zombie tunnel", t)
 | 
			
		||||
				s.Stop(t)
 | 
			
		||||
				time.Sleep(time.Millisecond * 100)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}()
 | 
			
		||||
	// After the stop process has begun, but before it's finished, we install the new one.
 | 
			
		||||
	path, err := c.Path()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	return InstallTunnel(path)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) Stop(tunnelName string) error {
 | 
			
		||||
	err := UninstallTunnel(tunnelName)
 | 
			
		||||
	if err == windows.ERROR_SERVICE_DOES_NOT_EXIST {
 | 
			
		||||
		_, notExistsError := conf.LoadFromName(tunnelName)
 | 
			
		||||
		if notExistsError == nil {
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) WaitForStop(tunnelName string) error {
 | 
			
		||||
	serviceName, err := conf.ServiceNameOfTunnel(tunnelName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	m, err := serviceManager()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	for {
 | 
			
		||||
		service, err := m.OpenService(serviceName)
 | 
			
		||||
		if err == nil || err == windows.ERROR_SERVICE_MARKED_FOR_DELETE {
 | 
			
		||||
			service.Close()
 | 
			
		||||
			time.Sleep(time.Second / 3)
 | 
			
		||||
		} else {
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) Delete(tunnelName string) error {
 | 
			
		||||
	if s.elevatedToken == 0 {
 | 
			
		||||
		return windows.ERROR_ACCESS_DENIED
 | 
			
		||||
	}
 | 
			
		||||
	err := s.Stop(tunnelName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	return conf.DeleteName(tunnelName)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) State(tunnelName string) (TunnelState, error) {
 | 
			
		||||
	serviceName, err := conf.ServiceNameOfTunnel(tunnelName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return 0, err
 | 
			
		||||
	}
 | 
			
		||||
	m, err := serviceManager()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return 0, err
 | 
			
		||||
	}
 | 
			
		||||
	service, err := m.OpenService(serviceName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return TunnelStopped, nil
 | 
			
		||||
	}
 | 
			
		||||
	defer service.Close()
 | 
			
		||||
	status, err := service.Query()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return TunnelUnknown, nil
 | 
			
		||||
	}
 | 
			
		||||
	switch status.State {
 | 
			
		||||
	case svc.Stopped:
 | 
			
		||||
		return TunnelStopped, nil
 | 
			
		||||
	case svc.StopPending:
 | 
			
		||||
		return TunnelStopping, nil
 | 
			
		||||
	case svc.Running:
 | 
			
		||||
		return TunnelStarted, nil
 | 
			
		||||
	case svc.StartPending:
 | 
			
		||||
		return TunnelStarting, nil
 | 
			
		||||
	default:
 | 
			
		||||
		return TunnelUnknown, nil
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) GlobalState() TunnelState {
 | 
			
		||||
	return trackedTunnelsGlobalState()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) Create(tunnelConfig *conf.Config) (*Tunnel, error) {
 | 
			
		||||
	if s.elevatedToken == 0 {
 | 
			
		||||
		return nil, windows.ERROR_ACCESS_DENIED
 | 
			
		||||
	}
 | 
			
		||||
	err := tunnelConfig.Save(true)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	return &Tunnel{tunnelConfig.Name}, nil
 | 
			
		||||
	// TODO: handle already existing situation
 | 
			
		||||
	// TODO: handle already running and existing situation
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) Tunnels() ([]Tunnel, error) {
 | 
			
		||||
	names, err := conf.ListConfigNames()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	tunnels := make([]Tunnel, len(names))
 | 
			
		||||
	for i := 0; i < len(tunnels); i++ {
 | 
			
		||||
		tunnels[i].Name = names[i]
 | 
			
		||||
	}
 | 
			
		||||
	return tunnels, nil
 | 
			
		||||
	// TODO: account for running ones that aren't in the configuration store somehow
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) Quit(stopTunnelsOnQuit bool) (alreadyQuit bool, err error) {
 | 
			
		||||
	if s.elevatedToken == 0 {
 | 
			
		||||
		return false, windows.ERROR_ACCESS_DENIED
 | 
			
		||||
	}
 | 
			
		||||
	if !atomic.CompareAndSwapUint32(&haveQuit, 0, 1) {
 | 
			
		||||
		return true, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Work around potential race condition of delivering messages to the wrong process by removing from notifications.
 | 
			
		||||
	managerServicesLock.Lock()
 | 
			
		||||
	s.eventLock.Lock()
 | 
			
		||||
	s.events = nil
 | 
			
		||||
	s.eventLock.Unlock()
 | 
			
		||||
	delete(managerServices, s)
 | 
			
		||||
	managerServicesLock.Unlock()
 | 
			
		||||
 | 
			
		||||
	if stopTunnelsOnQuit {
 | 
			
		||||
		names, err := conf.ListConfigNames()
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return false, err
 | 
			
		||||
		}
 | 
			
		||||
		for _, name := range names {
 | 
			
		||||
			UninstallTunnel(name)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	quitManagersChan <- struct{}{}
 | 
			
		||||
	return false, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s *ManagerService) ServeConn(reader io.Reader, writer io.Writer) {
 | 
			
		||||
	decoder := gob.NewDecoder(reader)
 | 
			
		||||
	encoder := gob.NewEncoder(writer)
 | 
			
		||||
	for {
 | 
			
		||||
		var methodType MethodType
 | 
			
		||||
		err := decoder.Decode(&methodType)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
		switch methodType {
 | 
			
		||||
		case StoredConfigMethodType:
 | 
			
		||||
			var tunnelName string
 | 
			
		||||
			err := decoder.Decode(&tunnelName)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			config, retErr := s.StoredConfig(tunnelName)
 | 
			
		||||
			if config == nil {
 | 
			
		||||
				config = &conf.Config{}
 | 
			
		||||
			}
 | 
			
		||||
			err = encoder.Encode(*config)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case RuntimeConfigMethodType:
 | 
			
		||||
			var tunnelName string
 | 
			
		||||
			err := decoder.Decode(&tunnelName)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			config, retErr := s.RuntimeConfig(tunnelName)
 | 
			
		||||
			if config == nil {
 | 
			
		||||
				config = &conf.Config{}
 | 
			
		||||
			}
 | 
			
		||||
			err = encoder.Encode(*config)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case StartMethodType:
 | 
			
		||||
			var tunnelName string
 | 
			
		||||
			err := decoder.Decode(&tunnelName)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			retErr := s.Start(tunnelName)
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case StopMethodType:
 | 
			
		||||
			var tunnelName string
 | 
			
		||||
			err := decoder.Decode(&tunnelName)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			retErr := s.Stop(tunnelName)
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case WaitForStopMethodType:
 | 
			
		||||
			var tunnelName string
 | 
			
		||||
			err := decoder.Decode(&tunnelName)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			retErr := s.WaitForStop(tunnelName)
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case DeleteMethodType:
 | 
			
		||||
			var tunnelName string
 | 
			
		||||
			err := decoder.Decode(&tunnelName)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			retErr := s.Delete(tunnelName)
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case StateMethodType:
 | 
			
		||||
			var tunnelName string
 | 
			
		||||
			err := decoder.Decode(&tunnelName)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			state, retErr := s.State(tunnelName)
 | 
			
		||||
			err = encoder.Encode(state)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case GlobalStateMethodType:
 | 
			
		||||
			state := s.GlobalState()
 | 
			
		||||
			err = encoder.Encode(state)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case CreateMethodType:
 | 
			
		||||
			var config conf.Config
 | 
			
		||||
			err := decoder.Decode(&config)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			tunnel, retErr := s.Create(&config)
 | 
			
		||||
			if tunnel == nil {
 | 
			
		||||
				tunnel = &Tunnel{}
 | 
			
		||||
			}
 | 
			
		||||
			err = encoder.Encode(tunnel)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case TunnelsMethodType:
 | 
			
		||||
			tunnels, retErr := s.Tunnels()
 | 
			
		||||
			err = encoder.Encode(tunnels)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		case QuitMethodType:
 | 
			
		||||
			var stopTunnelsOnQuit bool
 | 
			
		||||
			err := decoder.Decode(&stopTunnelsOnQuit)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			alreadyQuit, retErr := s.Quit(stopTunnelsOnQuit)
 | 
			
		||||
			err = encoder.Encode(alreadyQuit)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			err = encoder.Encode(errToString(retErr))
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		default:
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCServerListen(reader, writer, events *os.File, elevatedToken windows.Token) {
 | 
			
		||||
	service := &ManagerService{
 | 
			
		||||
		events:        events,
 | 
			
		||||
		elevatedToken: elevatedToken,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	go func() {
 | 
			
		||||
		managerServicesLock.Lock()
 | 
			
		||||
		managerServices[service] = true
 | 
			
		||||
		managerServicesLock.Unlock()
 | 
			
		||||
		service.ServeConn(reader, writer)
 | 
			
		||||
		managerServicesLock.Lock()
 | 
			
		||||
		service.eventLock.Lock()
 | 
			
		||||
		service.events = nil
 | 
			
		||||
		service.eventLock.Unlock()
 | 
			
		||||
		delete(managerServices, service)
 | 
			
		||||
		managerServicesLock.Unlock()
 | 
			
		||||
	}()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func notifyAll(notificationType NotificationType, adminOnly bool, ifaces ...any) {
 | 
			
		||||
	if len(managerServices) == 0 {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var buf bytes.Buffer
 | 
			
		||||
	encoder := gob.NewEncoder(&buf)
 | 
			
		||||
	err := encoder.Encode(notificationType)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	for _, iface := range ifaces {
 | 
			
		||||
		err = encoder.Encode(iface)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	managerServicesLock.RLock()
 | 
			
		||||
	for m := range managerServices {
 | 
			
		||||
		if m.elevatedToken == 0 && adminOnly {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		go func(m *ManagerService) {
 | 
			
		||||
			m.eventLock.Lock()
 | 
			
		||||
			defer m.eventLock.Unlock()
 | 
			
		||||
			if m.events != nil {
 | 
			
		||||
				m.events.SetWriteDeadline(time.Now().Add(time.Second))
 | 
			
		||||
				m.events.Write(buf.Bytes())
 | 
			
		||||
			}
 | 
			
		||||
		}(m)
 | 
			
		||||
	}
 | 
			
		||||
	managerServicesLock.RUnlock()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func errToString(err error) string {
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		return ""
 | 
			
		||||
	}
 | 
			
		||||
	return err.Error()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCServerNotifyTunnelChange(name string, state TunnelState, err error) {
 | 
			
		||||
	notifyAll(TunnelChangeNotificationType, false, name, state, trackedTunnelsGlobalState(), errToString(err))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCServerNotifyTunnelsChange() {
 | 
			
		||||
	notifyAll(TunnelsChangeNotificationType, false)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func IPCServerNotifyManagerStopping() {
 | 
			
		||||
	notifyAll(ManagerStoppingNotificationType, false)
 | 
			
		||||
	time.Sleep(time.Millisecond * 200)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										345
									
								
								src/main/go/service/tunneltracker.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										345
									
								
								src/main/go/service/tunneltracker.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,345 @@
 | 
			
		||||
/* SPDX-License-Identifier: MIT
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Modified by Steven Tracey
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package service
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"golang.zx2c4.com/wireguard/windows/services"
 | 
			
		||||
	"log"
 | 
			
		||||
	"runtime"
 | 
			
		||||
	"sync"
 | 
			
		||||
	"sync/atomic"
 | 
			
		||||
	"syscall"
 | 
			
		||||
	"time"
 | 
			
		||||
	"unsafe"
 | 
			
		||||
 | 
			
		||||
	"golang.org/x/sys/windows"
 | 
			
		||||
	"golang.org/x/sys/windows/svc"
 | 
			
		||||
	"golang.org/x/sys/windows/svc/mgr"
 | 
			
		||||
 | 
			
		||||
	"golang.zx2c4.com/wireguard/windows/conf"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	trackedTunnels     = make(map[string]TunnelState)
 | 
			
		||||
	trackedTunnelsLock = sync.Mutex{}
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func trackedTunnelsGlobalState() (state TunnelState) {
 | 
			
		||||
	state = TunnelStopped
 | 
			
		||||
	trackedTunnelsLock.Lock()
 | 
			
		||||
	defer trackedTunnelsLock.Unlock()
 | 
			
		||||
	for _, s := range trackedTunnels {
 | 
			
		||||
		if s == TunnelStarting {
 | 
			
		||||
			return TunnelStarting
 | 
			
		||||
		} else if s == TunnelStopping {
 | 
			
		||||
			return TunnelStopping
 | 
			
		||||
		} else if s == TunnelStarted || s == TunnelUnknown {
 | 
			
		||||
			state = TunnelStarted
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var serviceTrackerCallbackPtr = windows.NewCallback(func(notifier *windows.SERVICE_NOTIFY) uintptr {
 | 
			
		||||
	return 0
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
type serviceSubscriptionState struct {
 | 
			
		||||
	service *mgr.Service
 | 
			
		||||
	cb      func(status uint32) bool
 | 
			
		||||
	done    sync.WaitGroup
 | 
			
		||||
	once    uint32
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var serviceSubscriptionCallbackPtr = windows.NewCallback(func(notification uint32, context uintptr) uintptr {
 | 
			
		||||
	state := (*serviceSubscriptionState)(unsafe.Pointer(context))
 | 
			
		||||
	if atomic.LoadUint32(&state.once) != 0 {
 | 
			
		||||
		return 0
 | 
			
		||||
	}
 | 
			
		||||
	if notification == 0 {
 | 
			
		||||
		status, err := state.service.Query()
 | 
			
		||||
		if err == nil {
 | 
			
		||||
			notification = svcStateToNotifyState(uint32(status.State))
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if state.cb(notification) && atomic.CompareAndSwapUint32(&state.once, 0, 1) {
 | 
			
		||||
		state.done.Done()
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
func svcStateToNotifyState(s uint32) uint32 {
 | 
			
		||||
	switch s {
 | 
			
		||||
	case windows.SERVICE_STOPPED:
 | 
			
		||||
		return windows.SERVICE_NOTIFY_STOPPED
 | 
			
		||||
	case windows.SERVICE_START_PENDING:
 | 
			
		||||
		return windows.SERVICE_NOTIFY_START_PENDING
 | 
			
		||||
	case windows.SERVICE_STOP_PENDING:
 | 
			
		||||
		return windows.SERVICE_NOTIFY_STOP_PENDING
 | 
			
		||||
	case windows.SERVICE_RUNNING:
 | 
			
		||||
		return windows.SERVICE_NOTIFY_RUNNING
 | 
			
		||||
	case windows.SERVICE_CONTINUE_PENDING:
 | 
			
		||||
		return windows.SERVICE_NOTIFY_CONTINUE_PENDING
 | 
			
		||||
	case windows.SERVICE_PAUSE_PENDING:
 | 
			
		||||
		return windows.SERVICE_NOTIFY_PAUSE_PENDING
 | 
			
		||||
	case windows.SERVICE_PAUSED:
 | 
			
		||||
		return windows.SERVICE_NOTIFY_PAUSED
 | 
			
		||||
	case windows.SERVICE_NO_CHANGE:
 | 
			
		||||
		return 0
 | 
			
		||||
	default:
 | 
			
		||||
		return 0
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func notifyStateToTunState(s uint32) TunnelState {
 | 
			
		||||
	if s&(windows.SERVICE_NOTIFY_STOPPED|windows.SERVICE_NOTIFY_DELETED) != 0 {
 | 
			
		||||
		return TunnelStopped
 | 
			
		||||
	} else if s&(windows.SERVICE_NOTIFY_DELETE_PENDING|windows.SERVICE_NOTIFY_STOP_PENDING) != 0 {
 | 
			
		||||
		return TunnelStopping
 | 
			
		||||
	} else if s&windows.SERVICE_NOTIFY_RUNNING != 0 {
 | 
			
		||||
		return TunnelStarted
 | 
			
		||||
	} else if s&windows.SERVICE_NOTIFY_START_PENDING != 0 {
 | 
			
		||||
		return TunnelStarting
 | 
			
		||||
	} else {
 | 
			
		||||
		return TunnelUnknown
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func trackService(service *mgr.Service, callback func(status uint32) bool) error {
 | 
			
		||||
	var subscription uintptr
 | 
			
		||||
	state := &serviceSubscriptionState{service: service, cb: callback}
 | 
			
		||||
	state.done.Add(1)
 | 
			
		||||
	err := windows.SubscribeServiceChangeNotifications(service.Handle, windows.SC_EVENT_STATUS_CHANGE, serviceSubscriptionCallbackPtr, uintptr(unsafe.Pointer(state)), &subscription)
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		defer windows.UnsubscribeServiceChangeNotifications(subscription)
 | 
			
		||||
		status, err := service.Query()
 | 
			
		||||
		if err == nil {
 | 
			
		||||
			if callback(svcStateToNotifyState(uint32(status.State))) {
 | 
			
		||||
				return nil
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		state.done.Wait()
 | 
			
		||||
		runtime.KeepAlive(state.cb)
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	if !errors.Is(err, windows.ERROR_PROC_NOT_FOUND) {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// TODO: Below this line is Windows 7 compatibility code, which hopefully we can delete at some point.
 | 
			
		||||
 | 
			
		||||
	runtime.LockOSThread()
 | 
			
		||||
	// This line would be fitting but is intentionally commented out:
 | 
			
		||||
	//
 | 
			
		||||
	//     defer runtime.UnlockOSThread()
 | 
			
		||||
	//
 | 
			
		||||
	// The reason is that NotifyServiceStatusChange used queued APC, which winds up messing
 | 
			
		||||
	// with the thread local context, which in turn appears to corrupt Go's own usage of TLS,
 | 
			
		||||
	// leading to crashes sometime later (usually in runtime_unlock()) when the thread is recycled.
 | 
			
		||||
 | 
			
		||||
	const serviceNotifications = windows.SERVICE_NOTIFY_RUNNING | windows.SERVICE_NOTIFY_START_PENDING | windows.SERVICE_NOTIFY_STOP_PENDING | windows.SERVICE_NOTIFY_STOPPED | windows.SERVICE_NOTIFY_DELETE_PENDING
 | 
			
		||||
	notifier := &windows.SERVICE_NOTIFY{
 | 
			
		||||
		Version:        windows.SERVICE_NOTIFY_STATUS_CHANGE,
 | 
			
		||||
		NotifyCallback: serviceTrackerCallbackPtr,
 | 
			
		||||
	}
 | 
			
		||||
	for {
 | 
			
		||||
		err := windows.NotifyServiceStatusChange(service.Handle, serviceNotifications, notifier)
 | 
			
		||||
		switch err {
 | 
			
		||||
		case nil:
 | 
			
		||||
			for {
 | 
			
		||||
				if windows.SleepEx(uint32(time.Second*3/time.Millisecond), true) == windows.WAIT_IO_COMPLETION {
 | 
			
		||||
					break
 | 
			
		||||
				} else if callback(0) {
 | 
			
		||||
					return nil
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		case windows.ERROR_SERVICE_MARKED_FOR_DELETE:
 | 
			
		||||
			// Should be SERVICE_NOTIFY_DELETE_PENDING, but actually, we must release the handle and return here; otherwise it never deletes.
 | 
			
		||||
			if callback(windows.SERVICE_NOTIFY_DELETED) {
 | 
			
		||||
				return nil
 | 
			
		||||
			}
 | 
			
		||||
		case windows.ERROR_SERVICE_NOTIFY_CLIENT_LAGGING:
 | 
			
		||||
			continue
 | 
			
		||||
		default:
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		if callback(svcStateToNotifyState(notifier.ServiceStatus.CurrentState)) {
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func trackTunnelService(tunnelName string, service *mgr.Service) {
 | 
			
		||||
	trackedTunnelsLock.Lock()
 | 
			
		||||
	if _, found := trackedTunnels[tunnelName]; found {
 | 
			
		||||
		trackedTunnelsLock.Unlock()
 | 
			
		||||
		service.Close()
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	defer func() {
 | 
			
		||||
		service.Close()
 | 
			
		||||
		log.Printf("[%s] Tunnel service tracker finished", tunnelName)
 | 
			
		||||
	}()
 | 
			
		||||
	trackedTunnels[tunnelName] = TunnelUnknown
 | 
			
		||||
	trackedTunnelsLock.Unlock()
 | 
			
		||||
	defer func() {
 | 
			
		||||
		trackedTunnelsLock.Lock()
 | 
			
		||||
		delete(trackedTunnels, tunnelName)
 | 
			
		||||
		trackedTunnelsLock.Unlock()
 | 
			
		||||
	}()
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < 20; i++ {
 | 
			
		||||
		if i > 0 {
 | 
			
		||||
			time.Sleep(time.Second / 5)
 | 
			
		||||
		}
 | 
			
		||||
		if status, err := service.Query(); err != nil || status.State != svc.Stopped {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	checkForDisabled := func() (shouldReturn bool) {
 | 
			
		||||
		config, err := service.Config()
 | 
			
		||||
		if err == windows.ERROR_SERVICE_MARKED_FOR_DELETE || (err != nil && config.StartType == windows.SERVICE_DISABLED) {
 | 
			
		||||
			log.Printf("[%s] Found disabled service via timeout, so deleting", tunnelName)
 | 
			
		||||
			service.Delete()
 | 
			
		||||
			trackedTunnelsLock.Lock()
 | 
			
		||||
			trackedTunnels[tunnelName] = TunnelStopped
 | 
			
		||||
			trackedTunnelsLock.Unlock()
 | 
			
		||||
			IPCServerNotifyTunnelChange(tunnelName, TunnelStopped, nil)
 | 
			
		||||
			return true
 | 
			
		||||
		}
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
	if checkForDisabled() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	lastState := TunnelUnknown
 | 
			
		||||
	err := trackService(service, func(status uint32) bool {
 | 
			
		||||
		state := notifyStateToTunState(status)
 | 
			
		||||
		var tunnelError error
 | 
			
		||||
		if state == TunnelStopped {
 | 
			
		||||
			serviceStatus, err := service.Query()
 | 
			
		||||
			if err == nil {
 | 
			
		||||
				if serviceStatus.Win32ExitCode == uint32(windows.ERROR_SERVICE_SPECIFIC_ERROR) {
 | 
			
		||||
					maybeErr := services.Error(serviceStatus.ServiceSpecificExitCode)
 | 
			
		||||
					if maybeErr != services.ErrorSuccess {
 | 
			
		||||
						tunnelError = maybeErr
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					switch serviceStatus.Win32ExitCode {
 | 
			
		||||
					case uint32(windows.NO_ERROR), uint32(windows.ERROR_SERVICE_NEVER_STARTED):
 | 
			
		||||
					default:
 | 
			
		||||
						tunnelError = syscall.Errno(serviceStatus.Win32ExitCode)
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			if tunnelError != nil {
 | 
			
		||||
				service.Delete()
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if state != lastState {
 | 
			
		||||
			trackedTunnelsLock.Lock()
 | 
			
		||||
			trackedTunnels[tunnelName] = state
 | 
			
		||||
			trackedTunnelsLock.Unlock()
 | 
			
		||||
			IPCServerNotifyTunnelChange(tunnelName, state, tunnelError)
 | 
			
		||||
			lastState = state
 | 
			
		||||
		}
 | 
			
		||||
		if state == TunnelUnknown && checkForDisabled() {
 | 
			
		||||
			return true
 | 
			
		||||
		}
 | 
			
		||||
		return state == TunnelStopped
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil && !checkForDisabled() {
 | 
			
		||||
		trackedTunnelsLock.Lock()
 | 
			
		||||
		trackedTunnels[tunnelName] = TunnelStopped
 | 
			
		||||
		trackedTunnelsLock.Unlock()
 | 
			
		||||
		IPCServerNotifyTunnelChange(tunnelName, TunnelStopped, fmt.Errorf("Unable to continue monitoring service, so stopping: %w", err))
 | 
			
		||||
		service.Control(svc.Stop)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func trackExistingTunnels() error {
 | 
			
		||||
	m, err := serviceManager()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	names, err := conf.ListConfigNames()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	for _, name := range names {
 | 
			
		||||
		trackedTunnelsLock.Lock()
 | 
			
		||||
		if _, found := trackedTunnels[name]; found {
 | 
			
		||||
			trackedTunnelsLock.Unlock()
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		trackedTunnelsLock.Unlock()
 | 
			
		||||
		serviceName, err := conf.ServiceNameOfTunnel(name)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		service, err := m.OpenService(serviceName)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		go trackTunnelService(name, service)
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var servicesSubscriptionWatcherCallbackPtr = windows.NewCallback(func(notification uint32, context uintptr) uintptr {
 | 
			
		||||
	trackExistingTunnels()
 | 
			
		||||
	return 0
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
func watchNewTunnelServices() error {
 | 
			
		||||
	m, err := serviceManager()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	var subscription uintptr
 | 
			
		||||
	err = windows.SubscribeServiceChangeNotifications(m.Handle, windows.SC_EVENT_DATABASE_CHANGE, servicesSubscriptionWatcherCallbackPtr, 0, &subscription)
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		// We probably could do:
 | 
			
		||||
		//     defer windows.UnsubscribeServiceChangeNotifications(subscription)
 | 
			
		||||
		// and then terminate after some point, but instead we just let this go forever; it's process-lived.
 | 
			
		||||
		return trackExistingTunnels()
 | 
			
		||||
	}
 | 
			
		||||
	if !errors.Is(err, windows.ERROR_PROC_NOT_FOUND) {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// TODO: Below this line is Windows 7 compatibility code, which hopefully we can delete at some point.
 | 
			
		||||
	go func() {
 | 
			
		||||
		runtime.LockOSThread()
 | 
			
		||||
		notifier := &windows.SERVICE_NOTIFY{
 | 
			
		||||
			Version:        windows.SERVICE_NOTIFY_STATUS_CHANGE,
 | 
			
		||||
			NotifyCallback: serviceTrackerCallbackPtr,
 | 
			
		||||
		}
 | 
			
		||||
		for {
 | 
			
		||||
			err := windows.NotifyServiceStatusChange(m.Handle, windows.SERVICE_NOTIFY_CREATED, notifier)
 | 
			
		||||
			if err == nil {
 | 
			
		||||
				windows.SleepEx(windows.INFINITE, true)
 | 
			
		||||
				if notifier.ServiceNames != nil {
 | 
			
		||||
					windows.LocalFree(windows.Handle(unsafe.Pointer(notifier.ServiceNames)))
 | 
			
		||||
					notifier.ServiceNames = nil
 | 
			
		||||
				}
 | 
			
		||||
				trackExistingTunnels()
 | 
			
		||||
			} else if err == windows.ERROR_SERVICE_NOTIFY_CLIENT_LAGGING {
 | 
			
		||||
				continue
 | 
			
		||||
			} else {
 | 
			
		||||
				time.Sleep(time.Second * 3)
 | 
			
		||||
				trackExistingTunnels()
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}()
 | 
			
		||||
	return trackExistingTunnels()
 | 
			
		||||
}
 | 
			
		||||
@ -34,7 +34,7 @@ public class WireGuardJNI {
 | 
			
		||||
    public native int initializeWireGuard(String configFilePath);
 | 
			
		||||
    public native void cleanup();
 | 
			
		||||
 | 
			
		||||
    public native String getWGVersion();
 | 
			
		||||
    public native long getWGVersion();
 | 
			
		||||
    public native long parseConfig(WGConf conf);
 | 
			
		||||
 | 
			
		||||
    // Other methods for WireGuard interaction can be added here if needed
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user