зеркало из https://github.com/dotnet/wpf.git
Onboarding new build infrastructure (#473)
This PR onboards a new shared build infrastrucutre - primarily props + targets - that are shared between this repo and WPF's internal build.
This commit is contained in:
Родитель
8eab7500c2
Коммит
031b79d9ae
|
@ -0,0 +1,162 @@
|
|||
# editorconfig.org
|
||||
|
||||
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Default settings:
|
||||
# A newline ending every file
|
||||
# Use 4 spaces as indentation
|
||||
[*]
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[project.json]
|
||||
indent_size = 2
|
||||
|
||||
# C# files
|
||||
[*.cs]
|
||||
# New line preferences
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
csharp_new_line_between_query_expression_clauses = true
|
||||
|
||||
# Indentation preferences
|
||||
csharp_indent_block_contents = true
|
||||
csharp_indent_braces = false
|
||||
csharp_indent_case_contents = true
|
||||
csharp_indent_switch_labels = true
|
||||
csharp_indent_labels = one_less_than_current
|
||||
|
||||
# avoid this. unless absolutely necessary
|
||||
dotnet_style_qualification_for_field = false:suggestion
|
||||
dotnet_style_qualification_for_property = false:suggestion
|
||||
dotnet_style_qualification_for_method = false:suggestion
|
||||
dotnet_style_qualification_for_event = false:suggestion
|
||||
|
||||
# only use var when it's obvious what the variable type is
|
||||
csharp_style_var_for_built_in_types = false:none
|
||||
csharp_style_var_when_type_is_apparent = false:none
|
||||
csharp_style_var_elsewhere = false:suggestion
|
||||
|
||||
# use language keywords instead of BCL types
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
|
||||
dotnet_style_predefined_type_for_member_access = true:suggestion
|
||||
|
||||
# name all constant fields using PascalCase
|
||||
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
|
||||
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
|
||||
|
||||
dotnet_naming_symbols.constant_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.constant_fields.required_modifiers = const
|
||||
|
||||
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
||||
|
||||
# static fields should have s_ prefix
|
||||
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
|
||||
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
|
||||
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
|
||||
|
||||
dotnet_naming_symbols.static_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.static_fields.required_modifiers = static
|
||||
|
||||
dotnet_naming_style.static_prefix_style.required_prefix = s_
|
||||
dotnet_naming_style.static_prefix_style.capitalization = camel_case
|
||||
|
||||
# internal and private fields should be _camelCase
|
||||
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
|
||||
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
|
||||
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
|
||||
|
||||
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
|
||||
|
||||
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
|
||||
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
|
||||
|
||||
# Code style defaults
|
||||
dotnet_sort_system_directives_first = true
|
||||
csharp_preserve_single_line_blocks = true
|
||||
csharp_preserve_single_line_statements = false
|
||||
|
||||
# Expression-level preferences
|
||||
dotnet_style_object_initializer = true:suggestion
|
||||
dotnet_style_collection_initializer = true:suggestion
|
||||
dotnet_style_explicit_tuple_names = true:suggestion
|
||||
dotnet_style_coalesce_expression = true:suggestion
|
||||
dotnet_style_null_propagation = true:suggestion
|
||||
|
||||
# Expression-bodied members
|
||||
csharp_style_expression_bodied_methods = false:none
|
||||
csharp_style_expression_bodied_constructors = false:none
|
||||
csharp_style_expression_bodied_operators = false:none
|
||||
csharp_style_expression_bodied_properties = true:none
|
||||
csharp_style_expression_bodied_indexers = true:none
|
||||
csharp_style_expression_bodied_accessors = true:none
|
||||
|
||||
# Pattern matching
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||
csharp_style_inlined_variable_declaration = true:suggestion
|
||||
|
||||
# Null checking preferences
|
||||
csharp_style_throw_expression = true:suggestion
|
||||
csharp_style_conditional_delegate_call = true:suggestion
|
||||
|
||||
# Space preferences
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_after_colon_in_inheritance_clause = true
|
||||
csharp_space_after_comma = true
|
||||
csharp_space_after_dot = false
|
||||
csharp_space_after_keywords_in_control_flow_statements = true
|
||||
csharp_space_after_semicolon_in_for_statement = true
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_space_around_declaration_statements = do_not_ignore
|
||||
csharp_space_before_colon_in_inheritance_clause = true
|
||||
csharp_space_before_comma = false
|
||||
csharp_space_before_dot = false
|
||||
csharp_space_before_open_square_brackets = false
|
||||
csharp_space_before_semicolon_in_for_statement = false
|
||||
csharp_space_between_empty_square_brackets = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||
csharp_space_between_parentheses = false
|
||||
csharp_space_between_square_brackets = false
|
||||
|
||||
# C++ Files
|
||||
[*.{cpp,h,in}]
|
||||
curly_bracket_next_line = true
|
||||
indent_brace_style = Allman
|
||||
|
||||
# Xml project files
|
||||
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
|
||||
indent_size = 2
|
||||
|
||||
# Xml build files
|
||||
[*.builds]
|
||||
indent_size = 2
|
||||
|
||||
# Xml files
|
||||
[*.{xml,stylecop,resx,ruleset}]
|
||||
indent_size = 2
|
||||
|
||||
# Xml config files
|
||||
[*.{props,targets,config,nuspec}]
|
||||
indent_size = 2
|
||||
|
||||
# Shell scripts
|
||||
[*.sh]
|
||||
end_of_line = lf
|
||||
[*.{cmd, bat}]
|
||||
end_of_line = crlf
|
|
@ -26,6 +26,7 @@ bld/
|
|||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
.vscode/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
|
|
|
@ -1,15 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
|
||||
<Import Project="SystemResources.props"/>
|
||||
<!-- Normalize $(TestWpfArcadeSdkPath) by appending a '\' to it if one is missing -->
|
||||
<PropertyGroup Condition="'$(TestWpfArcadeSdkPath)'!=''">
|
||||
<WpfArcadeSdkPath>$(TestWpfArcadeSdkPath)</WpfArcadeSdkPath>
|
||||
<WpfArcadeSdkPath Condition="!$(WpfArcadeSdkPath.EndsWith('\'))">$(TestWpfArcadeSdkPath)\</WpfArcadeSdkPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(CopyrightNetFoundation)' != ''">
|
||||
<Copyright>$(CopyrightNetFoundation)</Copyright>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PropertyGroup Condition="'$(TestWpfArcadeSdkPath)'=='' And Exists('$(MSBuildThisFileDirectory)eng\WpfArcadeSdk\')">
|
||||
<WpfArcadeSdkPath>$(MSBuildThisFileDirectory)eng\WpfArcadeSdk\</WpfArcadeSdkPath>
|
||||
</PropertyGroup>
|
||||
<!-- Select Sdk.props from test location or eng\WpfArcadeSdk\. If neither exists, then fall back to the use of one
|
||||
obtained using MSBuild's Sdk resolver -->
|
||||
<PropertyGroup Condition="Exists('$(WpfArcadeSdkPath)')">
|
||||
<WpfArcadeSdkProps>$(WpfArcadeSdkPath)Sdk\Sdk.props</WpfArcadeSdkProps>
|
||||
<WpfArcadeSdkTargets>$(WpfArcadeSdkPath)Sdk\Sdk.targets</WpfArcadeSdkTargets>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PublishWindowsPdb>true</PublishWindowsPdb>
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(WpfArcadeSdkProps)"
|
||||
Condition="Exists('$(WpfArcadeSdkProps)') And Exists('$(WpfArcadeSdkTargets)')"/>
|
||||
|
||||
<Import Sdk="Microsoft.DotNet.Arcade.Wpf.Sdk"
|
||||
Project="Sdk.props"
|
||||
Condition="!Exists('$(WpfArcadeSdkProps)') Or !Exists('$(WpfArcadeSdkTargets)')"/>
|
||||
</Project>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)Packaging.targets" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)Publishing.targets" />
|
||||
|
||||
<Import Project="$(WpfArcadeSdkTargets)"
|
||||
Condition="Exists('$(WpfArcadeSdkProps)') And Exists('$(WpfArcadeSdkTargets)')"/>
|
||||
|
||||
<Import Sdk="Microsoft.DotNet.Arcade.Wpf.Sdk"
|
||||
Project="Sdk.targets"
|
||||
Condition="!Exists('$(WpfArcadeSdkProps)') Or !Exists('$(WpfArcadeSdkTargets)')"/>
|
||||
</Project>
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 137 KiB |
|
@ -0,0 +1,71 @@
|
|||
# Packaging
|
||||
|
||||
Packaging is implemented in the following files:
|
||||
|
||||
```
|
||||
$(WpfArcadeSdkToolsDir)\Packaging.props
|
||||
$(WpfArcadeSdkToolsDir)\Packaging.targets
|
||||
$(RepoRoot)\packaging\**\*
|
||||
│
|
||||
├───Microsoft.DotNet.Arcade.Wpf.Sdk
|
||||
│ Microsoft.DotNet.Arcade.Wpf.Sdk.ArchNeutral.csproj
|
||||
│
|
||||
├───Microsoft.DotNet.Wpf.DncEng
|
||||
│ Microsoft.DotNet.Wpf.DncEng.ArchNeutral.csproj
|
||||
│ Microsoft.DotNet.Wpf.DncEng.csproj
|
||||
│
|
||||
└───Microsoft.DotNet.Wpf.GitHub
|
||||
Microsoft.DotNet.Wpf.GitHub.ArchNeutral.csproj
|
||||
Microsoft.DotNet.Wpf.GitHub.csproj
|
||||
|
||||
```
|
||||
|
||||
- The `ArchNeutral` packages are built only during the `x86` (i.e., `AnyCPU`) build phase
|
||||
- Normally, the `ArchNeutral` packages will contain a `runtime.json` file that incorporates the *Bait & Switch* technique for referencing RID-specific packages automatically.
|
||||
- `runtime.json` functionality is turned off when a packaging project requests so by setting `$(PlatformIndependentPackage)=true`.
|
||||
- See [Improve documentation - bait and switch pattern, other #1282 ](https://github.com/NuGet/docs.microsoft.com-nuget/issues/1282)
|
||||
|
||||
|
||||
- The packages that are not `ArchNeutral` are architecture-specific, and will produce packages containing the RID (`win-x86`, `win-x64`) as a prefix
|
||||
- The arch-specific packages are produced in each of the build phases.
|
||||
|
||||
#### Package Names
|
||||
|
||||
There are two packages produced out of this repo, a *transport* package and an *MsBuild Sdk* package:
|
||||
|
||||
- `Microsoft.DotNet.Wpf.Github`
|
||||
- This contains assemblies and corresponding reference binaries that are currently built out of this repo ([https://www.github.com/dotnet/wpf](https://www.github.com/dotnet/wpf)).
|
||||
- `Microsoft.DotNet.Arcade.Wpf.Sdk`
|
||||
- This is an *MsBuild Sdk*, and is and extension to [Microsoft.DotNet.Arcade.Sdk](https://www.github.com/dotnet/arcade).
|
||||
- This Sdk contains all the build props, targets and scripts needed to build WPF.
|
||||
- Since WPF's build is split across two repos, we build this Sdk out of one repo, and consume it as an *MsBuild Sdk* in the other repo.
|
||||
|
||||
#### Opting into a package
|
||||
|
||||
- An assembly opts-into a package in `$(WpfArcadeSdkToolsDir)\Packaging.props` by simply setting the `PackageName` property, for e.g., like this:
|
||||
|
||||
`<PackageName Condition="'$(MSBuildProjectName)'=='WpfGfx'">$(DncEngTransportPackageName)</PackageName>`
|
||||
|
||||
In practice, this is not needed. *Shipping* assemblies are already enumerated in detail within `$(WpfArcadeSdkToolsDir)ShippingProjects.props`, and each one of them is marked for packaging correctly within `Packaging.props` based on its `$(RepoLocation)` value (possible values are `{Internal, External}`)
|
||||
|
||||
- These package names that various assembly projects can opt to be packaged into are defined in `$(WpfArcadeSdkToolsDir)\Packaging.props`. The project names under `$(RepoRoot)\packaging\` must match these.
|
||||
|
||||
#### How Packaging Works
|
||||
|
||||
##### Preparing Package Assets (*`PreparePackageAssets`* target)
|
||||
|
||||
- *`PreparePackageAssets`* target is defined in `$(WpfArcadeSdkToolsDir)Packaging.targets`
|
||||
- It runs after *`Build`*, and copies all project outputs, symbols, reference assemblies, satellite assemblies, and content files (defined in *`@(PackageContent)`* `ItemGroup`) to `$(ArtifactsPackagingDir)$(PackageName)\lib\$(TargetFrameworkOrRuntimeIdentifier)\`
|
||||
- If `@(PackagingAssemblyContent)` is populated, then only those files from `$(OutDir)` would be copied and packaged further - and none others would be included.
|
||||
- At the end of this target, all files that need to be packed would have been laid out in the right folder hierarchy, and ready to be packed.
|
||||
|
||||
##### Populate the `@(Content)` itemgroup with custom lsit of package-assets (*`CreateContentFolder`* target)
|
||||
|
||||
- *`CreateContentFolder`* is defined in `$(WpfArcadeSdkToolsDir)Packaging.targets`
|
||||
- It runs just before *`GenerateNuspec`* target, and populates `@(Content)` with files that were copied during *`PreparePackageAssets`*
|
||||
- This is consume by NuGet `PackTask` to create the package.
|
||||
|
||||
##### Create a Nuget Package
|
||||
|
||||
- The projects under `$(RepoRoot)\packaging` are the only ones with `$(IsPackable)=true`
|
||||
- The layout of the generated package is identical to the layout under `$(ArtifactsPackagindir)$(PackageName)\`
|
|
@ -0,0 +1,53 @@
|
|||
# Solution and Project Configuration
|
||||
|
||||
Solutions configurations are mapped to Project configurations in the following manner.
|
||||
|
||||
<font face="consolas">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Solution</th>
|
||||
<th>Managed Projects</th>
|
||||
<th>Native Projects</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Debug|AnyCPU</td>
|
||||
<td>Debug|AnyCPU</td>
|
||||
<td>Debug|<font color="red">Win32</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Debug|x86</td>
|
||||
<td>Debug|<font color="red">AnyCPU</font></td>
|
||||
<td>Debug|<font color="blue">Win32</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Debug|x64</td>
|
||||
<td>Debug|x64</td>
|
||||
<td>Debug|x64</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Release|AnyCPU</td>
|
||||
<td>Release|AnyCPU</td>
|
||||
<td>Release|<font color="red">Win32</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Release|x86</td>
|
||||
<td>Release|<font color="red">AnyCPU</red></td>
|
||||
<td>Release|<font color="blue">Win32</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Release|x64</td>
|
||||
<td>Release|x64</td>
|
||||
<td>Release|x64</td>
|
||||
</tr>
|
||||
</table>
|
||||
</font>
|
||||
|
||||
|
||||
- `AnyCPU` **solution** configuration is intended for developer-builds only.
|
||||
- Official build would *always* specify `x86` or `x64` solution configurations explicitly.
|
||||
- Native projects should map `AnyCPU` solution-configuration to `x86` project configuration
|
||||
- Managed projects should map `x86` solution-configuration to `AnyCPU` project configuration
|
||||
- Use Solution->Properties->Configuration view to ensure that the mapping between solution-configuration and project configuration is consistent for every possible configuration.
|
||||
- Note that packaging projects under `nupkg` folder have only one (`AnyCPU`) configuration
|
||||
|
||||
![](images/configurations.png)
|
|
@ -1,10 +1,22 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28010.2048
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28407.52
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Xaml", "src\Microsoft.DotNet.Wpf\src\System.Xaml\System.Xaml.csproj", "{9AC36357-34B7-40A1-95CA-FE9F46D089A7}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packaging", "packaging", "{0159B0F1-0626-4BED-8D1B-CBFF4F12C369}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.DotNet.Wpf.GitHub", "Microsoft.DotNet.Wpf.GitHub", "{BF20132A-191F-4D34-9A1B-831772A6DFCF}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Wpf.GitHub", "packaging\Microsoft.DotNet.Wpf.GitHub\Microsoft.DotNet.Wpf.GitHub.csproj", "{C847934A-828C-4EBB-A004-B0E97C8313F4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Wpf.GitHub.ArchNeutral", "packaging\Microsoft.DotNet.Wpf.GitHub\Microsoft.DotNet.Wpf.GitHub.ArchNeutral.csproj", "{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.DotNet.Arcade.Wpf.Sdk", "Microsoft.DotNet.Arcade.Wpf.Sdk", "{8A2ABE39-2D50-48CA-AC32-078BBA32757A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Arcade.Wpf.Sdk.ArchNeutral", "packaging\Microsoft.DotNet.Arcade.Wpf.Sdk\Microsoft.DotNet.Arcade.Wpf.Sdk.ArchNeutral.csproj", "{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -27,11 +39,54 @@ Global
|
|||
{9AC36357-34B7-40A1-95CA-FE9F46D089A7}.Release|x64.Build.0 = Release|x64
|
||||
{9AC36357-34B7-40A1-95CA-FE9F46D089A7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9AC36357-34B7-40A1-95CA-FE9F46D089A7}.Release|x86.Build.0 = Release|Any CPU
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Debug|x64.Build.0 = Debug|x64
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Release|x64.ActiveCfg = Release|x64
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Release|x64.Build.0 = Release|x64
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4}.Release|x86.Build.0 = Release|Any CPU
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Debug|x64.Build.0 = Debug|x64
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Release|x64.ActiveCfg = Release|x64
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Release|x64.Build.0 = Release|x64
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE}.Release|x86.Build.0 = Release|Any CPU
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Debug|x64.Build.0 = Debug|x64
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Release|x64.ActiveCfg = Release|x64
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Release|x64.Build.0 = Release|x64
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{BF20132A-191F-4D34-9A1B-831772A6DFCF} = {0159B0F1-0626-4BED-8D1B-CBFF4F12C369}
|
||||
{C847934A-828C-4EBB-A004-B0E97C8313F4} = {BF20132A-191F-4D34-9A1B-831772A6DFCF}
|
||||
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE} = {BF20132A-191F-4D34-9A1B-831772A6DFCF}
|
||||
{8A2ABE39-2D50-48CA-AC32-078BBA32757A} = {0159B0F1-0626-4BED-8D1B-CBFF4F12C369}
|
||||
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3} = {8A2ABE39-2D50-48CA-AC32-078BBA32757A}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {671D19D1-5F0E-4453-9D18-3A28AC0E8DEF}
|
||||
SolutionGuid = {D4D12991-F531-4FC3-849D-29946BCA818A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos. -->
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="myget-fxlab" value="https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
|
||||
<add key="arcade" value="https://dotnetfeed.blob.core.windows.net/dotnet-tools-internal/index.json" />
|
||||
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
|
||||
<add key="myget-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="dotnet-wd" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
|
||||
<!--
|
||||
Add additional paths here
|
||||
For e.g., if you want to test a locally build nuget package, you can add it like this:
|
||||
-->
|
||||
<!--<add key="local" value="c:\temp\packages" />-->
|
||||
</packageSources>
|
||||
</configuration>
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
<Project>
|
||||
<!--
|
||||
<Target Name="PreparePackageAssets" AfterTargets="Build">
|
||||
<ItemGroup Condition="'$(IncludeInPackage)' != ''">
|
||||
<PackageAsset Include="$(TargetPath)"
|
||||
RelativePath="$(IncludeInPackage)\lib\$(TargetFramework)" />
|
||||
|
||||
<PackageAsset Include="@(DebugSymbolsProjectOutputGroupOutput)"
|
||||
RelativePath="$(IncludeInPackage)\lib\$(TargetFramework)" />
|
||||
|
||||
<PackageAsset Include="@(DocumentationProjectOutputGroupOutput)"
|
||||
RelativePath="$(IncludeInPackage)\lib\$(TargetFramework)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(IncludeAnalyzerInPackage)' != ''">
|
||||
<PackageAsset Include="$(TargetPath)"
|
||||
RelativePath="$(IncludeAnalyzerInPackage)\analyzers\dotnet\cs" />
|
||||
<PackageAsset Include="@(DebugSymbolsProjectOutputGroupOutput)"
|
||||
RelativePath="$(IncludeAnalyzerInPackage)\analyzers\dotnet\cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<Copy SourceFiles="@(PackageAsset)"
|
||||
DestinationFolder="$(ArtifactsPackagesDir)%(PackageAsset.RelativePath)" />
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -0,0 +1,2 @@
|
|||
@echo off
|
||||
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore %*"
|
|
@ -1,14 +1,22 @@
|
|||
# This is a simple wrapper for eng/ci.yml to get around the limitation of
|
||||
# This is a simple wrapper for eng/pipeline.yml to get around the limitation of
|
||||
# user-defined variables not being available in yaml template expressions.
|
||||
|
||||
# Parameters ARE available in template expressions, and parameters can have default values,
|
||||
# so they can be used to control yaml flow.
|
||||
#
|
||||
# TODO:
|
||||
# BuildMsBuildSdkPackages, _BuildMsBuildSdkPackages, _BuildMsBuildSdkPackagesArgs should be removed eventually, when
|
||||
# Microsoft.DotNet.Arcade.Wpf.Sdk is moved from dnceng/dotnet-wpf-int to github/dotnet/wpf.
|
||||
# When that move happens, there would be no need to suppress the Sdk build by default. Currently,
|
||||
# allowing the Sdk to build every time will result in an infinite loop that triggers a dotnet/wpf built,
|
||||
|
||||
variables:
|
||||
|
||||
# clean the local repo on the build agents
|
||||
Build.Repository.Clean: true
|
||||
|
||||
# When set to true in a manual built, it produces and publishes
|
||||
# Microsoft.DotNet.Arcade.Wpf.Sdk
|
||||
BuildMsBuildSdkPackages: false
|
||||
_PublishUsingPipelines: false
|
||||
_DotNetArtifactsCategory: .NETCore
|
||||
|
||||
|
@ -16,6 +24,7 @@ variables:
|
|||
trigger:
|
||||
- master
|
||||
- release/3.0
|
||||
- arcade
|
||||
|
||||
# To be added in the future when VSTS supports this feature
|
||||
# only trigger pull request builds for the master branch
|
||||
|
@ -28,6 +37,6 @@ jobs:
|
|||
parameters:
|
||||
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
# agent pool can't be read from a user-defined variable (Azure DevOps limitation)
|
||||
agentPool: dotnet-internal-temp-vs2019
|
||||
agentPool: dotnet-internal-vs2019-preview
|
||||
# runAsPublic is used in expressions, which can't read from user-defined variables
|
||||
runAsPublic: false
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source="${BASH_SOURCE[0]}"
|
||||
|
||||
# resolve $SOURCE until the file is no longer a symlink
|
||||
while [[ -h $source ]]; do
|
||||
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
|
||||
source="$(readlink "$source")"
|
||||
|
||||
# if $source was a relative symlink, we need to resolve it relative to the path where the
|
||||
# symlink file was located
|
||||
[[ $source != /* ]] && source="$scriptroot/$source"
|
||||
done
|
||||
|
||||
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
|
||||
"$scriptroot/eng/common/build.sh" --build --restore $@
|
|
@ -1,57 +1,77 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Dependencies>
|
||||
<ProductDependencies>
|
||||
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Configuration.ConfigurationManager" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="System.Configuration.ConfigurationManager" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Reflection.Emit" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="System.Reflection.Emit" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Reflection.TypeExtensions" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="System.Security.AccessControl" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Security.AccessControl" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="System.Security.Permissions" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Security.Permissions" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="System.Security.Principal.Windows" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Security.Principal.Windows" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="System.Windows.Extensions" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Windows.Extensions" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Dependency Name="System.CodeDom" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.CodeDom" Version="4.6.0-preview4.19177.9" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>7f5db5154e0cb653275d8dad5bc7030221446c17</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.NETCore.App" Version="3.0.0-preview4-27528-01">
|
||||
<Dependency Name="Microsoft.NETCore.App" Version="3.0.0-preview4-27528-05">
|
||||
<Uri>https://github.com/dotnet/core-setup</Uri>
|
||||
<Sha>afd454e4fa78e615f7501c8eddf24af579f7719d</Sha>
|
||||
<Sha>963e3e430dd51963894b065ee637fb372079f17c</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Reflection.MetadataLoadContext" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
<SourceBuildId>5589</SourceBuildId>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Private.Winforms" Version="4.8.0-preview4.19170.4" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/winforms</Uri>
|
||||
<Sha>666ca26fa9c98fbb86b158d30870bd2350ea6f1c</Sha>
|
||||
<SourceBuildId>6173</SourceBuildId>
|
||||
</Dependency>
|
||||
<Dependency Name="System.Drawing.Common" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
<SourceBuildId>5589</SourceBuildId>
|
||||
</Dependency>
|
||||
<Dependency Name="System.DirectoryServices" Version="4.6.0-preview4.19178.1" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/corefx</Uri>
|
||||
<Sha>82dc96bfbf1d55716e4e0b516bea115644e32cd1</Sha>
|
||||
<SourceBuildId>5589</SourceBuildId>
|
||||
</Dependency>
|
||||
</ProductDependencies>
|
||||
<ToolsetDependencies>
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19177.11">
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19177.2">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>04b492d62263fe2b1523506f92d0fe4c3fd1c4ad</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="1.0.0-beta.19177.11" CoherentParentDependency="Microsoft.NETCore.App">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>69f276904fdd6d8f81404b857f295537894b81d3</Sha>
|
||||
</Dependency>
|
||||
|
|
|
@ -4,35 +4,51 @@
|
|||
<VersionPrefix>4.8.0</VersionPrefix>
|
||||
<PreReleaseVersionLabel>preview4</PreReleaseVersionLabel>
|
||||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||||
<SystemReflectionMetadataLoadContextVersion>4.6.0-preview4.19178.1</SystemReflectionMetadataLoadContextVersion>
|
||||
<MicrosoftPrivateWinformsVersion>4.8.0-preview4.19170.4</MicrosoftPrivateWinformsVersion>
|
||||
<SystemDrawingCommonVersion>4.6.0-preview4.19178.1</SystemDrawingCommonVersion>
|
||||
<SystemDirectoryServicesVersion>4.6.0-preview4.19178.1</SystemDirectoryServicesVersion>
|
||||
</PropertyGroup>
|
||||
<!-- NuGet Package Versions -->
|
||||
<PropertyGroup>
|
||||
<!-- Packages that come from https://github.com/dotnet/corefx -->
|
||||
<MicrosoftWin32RegistryPackageVersion>4.6.0-preview4.19177.9</MicrosoftWin32RegistryPackageVersion>
|
||||
<SystemConfigurationConfigurationManagerPackageVersion>4.6.0-preview4.19177.9</SystemConfigurationConfigurationManagerPackageVersion>
|
||||
<SystemDiagnosticsEventLogPackageVersion>4.6.0-preview4.19177.9</SystemDiagnosticsEventLogPackageVersion>
|
||||
<SystemReflectionEmitPackageVersion>4.6.0-preview4.19177.9</SystemReflectionEmitPackageVersion>
|
||||
<SystemReflectionTypeExtensionsPackageVersion>4.6.0-preview4.19177.9</SystemReflectionTypeExtensionsPackageVersion>
|
||||
<SystemSecurityAccessControlPackageVersion>4.6.0-preview4.19177.9</SystemSecurityAccessControlPackageVersion>
|
||||
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-preview4.19177.9</SystemSecurityCryptographyXmlPackageVersion>
|
||||
<SystemSecurityPermissionsPackageVersion>4.6.0-preview4.19177.9</SystemSecurityPermissionsPackageVersion>
|
||||
<SystemSecurityPrincipalWindowsPackageVersion>4.6.0-preview4.19177.9</SystemSecurityPrincipalWindowsPackageVersion>
|
||||
<SystemWindowsExtensionsPackageVersion>4.6.0-preview4.19177.9</SystemWindowsExtensionsPackageVersion>
|
||||
<SystemCodeDomPackageVersion>4.6.0-preview4.19177.9</SystemCodeDomPackageVersion>
|
||||
<MicrosoftWin32RegistryPackageVersion>4.6.0-preview4.19178.1</MicrosoftWin32RegistryPackageVersion>
|
||||
<SystemConfigurationConfigurationManagerPackageVersion>4.6.0-preview4.19178.1</SystemConfigurationConfigurationManagerPackageVersion>
|
||||
<SystemDiagnosticsEventLogPackageVersion>4.6.0-preview4.19178.1</SystemDiagnosticsEventLogPackageVersion>
|
||||
<SystemReflectionEmitPackageVersion>4.6.0-preview4.19178.1</SystemReflectionEmitPackageVersion>
|
||||
<SystemReflectionTypeExtensionsPackageVersion>4.6.0-preview4.19176.11</SystemReflectionTypeExtensionsPackageVersion>
|
||||
<SystemSecurityAccessControlPackageVersion>4.6.0-preview4.19178.1</SystemSecurityAccessControlPackageVersion>
|
||||
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-preview4.19178.1</SystemSecurityCryptographyXmlPackageVersion>
|
||||
<SystemSecurityPermissionsPackageVersion>4.6.0-preview4.19178.1</SystemSecurityPermissionsPackageVersion>
|
||||
<SystemSecurityPrincipalWindowsPackageVersion>4.6.0-preview4.19178.1</SystemSecurityPrincipalWindowsPackageVersion>
|
||||
<SystemWindowsExtensionsPackageVersion>4.6.0-preview4.19178.1</SystemWindowsExtensionsPackageVersion>
|
||||
<SystemCodeDomPackageVersion>4.6.0-preview4.19178.1</SystemCodeDomPackageVersion>
|
||||
<!-- Packages that come from https://github.com/dotnet/arcade -->
|
||||
<MicrosoftDotNetCodeAnalysisPackageVersion>1.0.0-beta.19177.11</MicrosoftDotNetCodeAnalysisPackageVersion>
|
||||
<!-- Packages that come from https://github.com/dotnet/corefxlab -->
|
||||
<SystemReflectionTypeLoaderPackageVersion>0.1.0-preview2-181205-2</SystemReflectionTypeLoaderPackageVersion>
|
||||
<!-- Maintain System.CodeDom PackageVersion at 4.4.0. See https://github.com/Microsoft/msbuild/issues/3627 -->
|
||||
<SystemCodeDomPackageVersionForPresentationBuildTasks>4.4.0</SystemCodeDomPackageVersionForPresentationBuildTasks>
|
||||
<!-- Other Packages that require manual updating-->
|
||||
<AccessibilityPackageVersion>4.6.0-alpha-27128-8</AccessibilityPackageVersion>
|
||||
<MicrosoftBuildFrameworkPackageVersion>15.9.20</MicrosoftBuildFrameworkPackageVersion>
|
||||
<MicrosoftBuildUtilitiesCorePackageVersion>15.9.20</MicrosoftBuildUtilitiesCorePackageVersion>
|
||||
<StrawberryPerlVersion>5.28.1.1-1</StrawberryPerlVersion>
|
||||
<XUnitRunnerConsoleVersion>2.4.0</XUnitRunnerConsoleVersion>
|
||||
<XUnitRunnerVisualStudioVersion>2.4.0</XUnitRunnerVisualStudioVersion>
|
||||
<XUnitVersion>2.4.0</XUnitVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- This is required to restore System.Reflection.Typeloader successfully -->
|
||||
<RestoreSources>$(RestoreSources);https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json</RestoreSources>
|
||||
<RestoreSources>
|
||||
$(RestoreSources);
|
||||
https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json;
|
||||
https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json
|
||||
</RestoreSources>
|
||||
</PropertyGroup>
|
||||
<!--Package names-->
|
||||
<PropertyGroup>
|
||||
<SystemReflectionMetadataLoadContextPackage>System.Reflection.MetadataLoadContext</SystemReflectionMetadataLoadContextPackage>
|
||||
<MicrosoftPrivateWinformsPackage>Microsoft.Private.Winforms</MicrosoftPrivateWinformsPackage>
|
||||
<SystemDrawingCommonPackage>System.Drawing.Common</SystemDrawingCommonPackage>
|
||||
<SystemDirectoryServicesPackage>System.DirectoryServices</SystemDirectoryServicesPackage>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
<Project>
|
||||
<!-- Importing Arcade's Sdk.props should always be the first thing we do. However this is not a hard rule,
|
||||
it's just a convention for ensuring correctness and consistency in our build environment. If anything
|
||||
does need to be imported before, it should be documented why it is needed. -->
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
|
||||
|
||||
<PropertyGroup>
|
||||
<WpfArcadeSdkRoot>$([System.IO.Directory]::GetParent("$(MSBuildThisFileDirectory.TrimEnd('\'))"))\</WpfArcadeSdkRoot>
|
||||
<WpfArcadeSdkToolsDir>$(WpfArcadeSdkRoot)tools\</WpfArcadeSdkToolsDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)FolderPaths.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)ShippingProjects.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<GenTraceSources>$(WpfArcadeSdkToolsDir)AvTrace\GenTraceSources.pl</GenTraceSources>
|
||||
<GenXmlStringTable>$(WpfArcadeSdkToolsDir)GenXmlStringTable.pl</GenXmlStringTable>
|
||||
|
||||
<PublishWindowsPdb Condition="'$(IsShipping)'=='' And '$(IsPackagingProject)'!='true'">true</PublishWindowsPdb>
|
||||
|
||||
<LangVersion Condition="'$(LangVersion)'==''">8.0</LangVersion>
|
||||
<CLSCompliant Condition="'$(CLSCompliant)'==''">true</CLSCompliant>
|
||||
<IncludeDllSafeSearchPathAttribute Condition="'$(IncludeDllSafeSearchPathAttribute )'==''">true</IncludeDllSafeSearchPathAttribute>
|
||||
|
||||
<StrongNameKeyId Condition="'$(StrongNameKeyId)'=='' And '$(IsTestProject)'!='true'">Open</StrongNameKeyId>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)SystemResources.props"/>
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)TargetFrameworks.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)VersionSuffix.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)GenerateProgramFileForTests.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)ReferenceAssembly.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)ExtendedAssemblyInfo.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)Packaging.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)ProjectReferences.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)CodeAnalysis.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)Redist.props" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)Pbt.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<DebugType>full</DebugType>
|
||||
<PerlCommand>"$(RepoRoot).tools\native\bin\strawberry-perl\$(StrawberryPerlVersion)\portableshell.bat"</PerlCommand>
|
||||
|
||||
<WpfCppProps>$(WpfArcadeSdkToolsDir)Wpf.Cpp.props</WpfCppProps>
|
||||
<GenerateModuleDefinitionFileTargets>$(WpfArcadeSdkToolsDir)GenerateModuleDefinitionFile.targets</GenerateModuleDefinitionFileTargets>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<NoTargetsProps>$(WpfArcadeSdkToolsDir)NoTargets.props</NoTargetsProps>
|
||||
<NoTargetsTargets>$(WpfArcadeSdkToolsDir)NoTargets.targets</NoTargetsTargets>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
Temporarily suppress NU3027
|
||||
https://github.com/dotnet/arcade/issues/2304
|
||||
-->
|
||||
<NoWarn>$(NoWarn);NU3027</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- When an Sdk-style project sets NoTargets=true, it will produce no assemblies -->
|
||||
<Import Project="$(NoTargetsProps)" Condition="'$(NoTargets)'=='true'"/>
|
||||
</Project>
|
|
@ -0,0 +1,22 @@
|
|||
<Project>
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)InlineTasks.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)ShippingProjects.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)GenerateProgramFileForTests.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)GenerateAvTraceMessages.targets"/>
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)Packaging.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)Publishing.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)ReferenceAssembly.targets"/>
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)ProjectReferences.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)SdkReferences.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)FixupProjectReferences.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)ExtendedAssemblyInfo.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)Redist.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)WpfProjectReference.targets" />
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)Wpf.Cpp.targets" Condition="'$(MSBuildProjectExtension)'=='.vcxproj'"/>
|
||||
<Import Project="$(NoTargetsTargets)" Condition="'$(NoTargets)'=='true'"/>
|
||||
|
||||
<!-- PresentationBuildTasks related targets files -->
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)Pbt.targets" Condition="'$(InternalMarkupCompilation)'=='true'"/>
|
||||
<Import Project="$(WpfArcadeSdkToolsDir)NoInternalTypeHelper.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,136 @@
|
|||
########################################################
|
||||
# Generate the enum used for retrieving wrapper classes for managed debug tracing.
|
||||
#
|
||||
# This scripts reads an input file with the trace information,
|
||||
# and generates a cs file with the enum containing trace area values.
|
||||
#
|
||||
########################################################
|
||||
use File::Copy;
|
||||
use Getopt::Std;
|
||||
|
||||
sub usage()
|
||||
{
|
||||
print "Usage: $0 -i [Inputfile1,Inputfile2,...] -o [output.cs] \n\n";
|
||||
}
|
||||
|
||||
#hash to store all the arguements.
|
||||
my %args
|
||||
;
|
||||
#error header.
|
||||
my $error_msg = "GenTraceSources.pl: error:";
|
||||
|
||||
#get the switches values.
|
||||
getopts('i:o:', \%args);
|
||||
|
||||
#all these switches are required.
|
||||
|
||||
my $outfile = $args{o};
|
||||
my @inputfilelist = split(/,/, $args{i});
|
||||
|
||||
print "\n";
|
||||
|
||||
|
||||
#
|
||||
# The header for the file
|
||||
#
|
||||
|
||||
my $header = <<"END_OF_HEADER";
|
||||
//-------------------------------------------------------------------------------
|
||||
// <copyright from='2006' to='2006' company='Microsoft Corporation'>
|
||||
// Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
// Information Contained Herein is Proprietary and Confidential.
|
||||
// </copyright>
|
||||
//
|
||||
// This file is generated from AvTraceMessages.txt by gentracesources.pl - do not modify this file directly
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
using MS.Internal;
|
||||
|
||||
namespace System.Diagnostics
|
||||
{
|
||||
/// <summary>Access point for TraceSources</summary>
|
||||
public static partial class PresentationTraceSources
|
||||
{
|
||||
END_OF_HEADER
|
||||
|
||||
|
||||
#
|
||||
# The footer for the file
|
||||
#
|
||||
|
||||
my $footer = <<"END_OF_FOOTER";
|
||||
}
|
||||
}//endof namespace
|
||||
END_OF_FOOTER
|
||||
|
||||
|
||||
#
|
||||
# Initialize the output file
|
||||
#
|
||||
|
||||
open(OUT, '>'.$outfile) or die "$error_msg Cannot create $outfile. $!\n";
|
||||
|
||||
print OUT $header or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
{
|
||||
# Now we read the trace areas from the files
|
||||
|
||||
for $inputfile (@inputfilelist)
|
||||
{
|
||||
|
||||
open(IN, $inputfile) or die "$error_msg Cannot open $inputfile. $!\n";
|
||||
|
||||
|
||||
# Loop through the strings
|
||||
|
||||
my $traceArea;
|
||||
my $traceClass;
|
||||
my $traceName;
|
||||
my $traceSourceName;
|
||||
|
||||
while ($stringIn = <IN>)
|
||||
{
|
||||
chomp;
|
||||
|
||||
# Find the beginning of a section, with the trace source name
|
||||
# and the name of the trace area.
|
||||
# E.g. "[System.Windows.ComponentModel.Events,RoutedEvent]"
|
||||
|
||||
if (($traceName, $traceArea, $traceClass) = ($stringIn =~ /^\[(.*),(.*),(.*)\]/))
|
||||
{
|
||||
# append "Source" for the TraceSource name
|
||||
$traceSourceName = $traceArea."Source";
|
||||
|
||||
# Write out the property
|
||||
|
||||
print OUT
|
||||
"
|
||||
/// <summary>$traceSourceName for $traceArea</summary>
|
||||
public static TraceSource $traceSourceName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_$traceSourceName == null)
|
||||
{
|
||||
_$traceSourceName = CreateTraceSource(\"$traceName\");
|
||||
}
|
||||
return _$traceSourceName;
|
||||
}
|
||||
}
|
||||
internal static TraceSource _$traceSourceName;
|
||||
"
|
||||
or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#close files
|
||||
close (IN) or die "$error_msg Cannot close $infile. $!\n";
|
||||
}
|
||||
}
|
||||
|
||||
print OUT "\n".$footer or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
#close files
|
||||
close (OUT) or die "$error_msg Cannot close $outfile. $!\n";
|
||||
|
|
@ -0,0 +1,297 @@
|
|||
########################################################
|
||||
# Generate the wrapper classes for managed debug tracing.
|
||||
#
|
||||
# This scripts reads an input file with the trace information,
|
||||
# and generates a cs file with the wrapper classes.
|
||||
#
|
||||
########################################################
|
||||
use File::Copy;
|
||||
use Getopt::Std;
|
||||
|
||||
sub usage()
|
||||
{
|
||||
print "Usage: $0 -i [Inputfile1] -o [output.cs] \n\n";
|
||||
}
|
||||
|
||||
#hash to store all the arguements.
|
||||
my %args
|
||||
;
|
||||
#error header.
|
||||
my $error_msg = "GenTraceStrings.pl: error:";
|
||||
|
||||
#get the switches values.
|
||||
getopts('i:o:', \%args);
|
||||
|
||||
#all these switches are required.
|
||||
|
||||
my $outfile = $args{o};
|
||||
my $inputfile = $args{i};
|
||||
|
||||
print "\n";
|
||||
|
||||
|
||||
#
|
||||
# The header for the file
|
||||
#
|
||||
|
||||
my $header = <<"END_OF_HEADER";
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace MS.Internal
|
||||
{
|
||||
END_OF_HEADER
|
||||
|
||||
|
||||
#
|
||||
# The footer for the file
|
||||
#
|
||||
|
||||
my $footer = <<"END_OF_FOOTER";
|
||||
}//endof namespace
|
||||
END_OF_FOOTER
|
||||
|
||||
|
||||
#
|
||||
# The footer section for each class
|
||||
#
|
||||
|
||||
my $classFooter = <<"END_OF_FOOTER";
|
||||
|
||||
// Send a single trace output
|
||||
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, params object[] parameters )
|
||||
{
|
||||
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, parameters );
|
||||
}
|
||||
|
||||
// these help delay allocation of object array
|
||||
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
|
||||
{
|
||||
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
|
||||
}
|
||||
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
|
||||
{
|
||||
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1 } );
|
||||
}
|
||||
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1, object p2 )
|
||||
{
|
||||
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2 } );
|
||||
}
|
||||
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1, object p2, object p3 )
|
||||
{
|
||||
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2, p3 } );
|
||||
}
|
||||
|
||||
// Send a singleton "activity" trace (really, this sends the same trace as both a Start and a Stop)
|
||||
static public void TraceActivityItem( AvTraceDetails traceDetails, params Object[] parameters )
|
||||
{
|
||||
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, parameters );
|
||||
}
|
||||
|
||||
// these help delay allocation of object array
|
||||
static public void TraceActivityItem( AvTraceDetails traceDetails )
|
||||
{
|
||||
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
|
||||
}
|
||||
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
|
||||
{
|
||||
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1 } );
|
||||
}
|
||||
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1, object p2 )
|
||||
{
|
||||
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2 } );
|
||||
}
|
||||
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1, object p2, object p3 )
|
||||
{
|
||||
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2, p3 } );
|
||||
}
|
||||
|
||||
// Is tracing enabled here?
|
||||
static public bool IsEnabled
|
||||
{
|
||||
get { return _avTrace != null && _avTrace.IsEnabled; }
|
||||
}
|
||||
|
||||
// Is there a Tracesource? (See comment on AvTrace.IsEnabledOverride.)
|
||||
static public bool IsEnabledOverride
|
||||
{
|
||||
get { return _avTrace.IsEnabledOverride; }
|
||||
}
|
||||
|
||||
// Re-read the configuration for this trace source
|
||||
static public void Refresh()
|
||||
{
|
||||
_avTrace.Refresh();
|
||||
}
|
||||
|
||||
}//endof class $srclass
|
||||
END_OF_FOOTER
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Initialize the output file
|
||||
#
|
||||
|
||||
open(OUT, '>'.$outfile) or die "$error_msg Cannot create $outfile. $!\n";
|
||||
|
||||
print OUT $header or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
|
||||
|
||||
{
|
||||
# Now we read the trace information from the file
|
||||
|
||||
open(IN, $inputfile) or die "$error_msg Cannot open $inputfile. $!\n";
|
||||
|
||||
|
||||
# Loop through the strings
|
||||
|
||||
my $prev_id = 0;
|
||||
my $max_id = 0;
|
||||
my $inClass = 0;
|
||||
my $traceArea;
|
||||
my $traceClass;
|
||||
my $traceName;
|
||||
my $traceSourceName;
|
||||
|
||||
while ($stringIn = <IN>)
|
||||
{
|
||||
chomp;
|
||||
next if ($stringIn =~ /^;/); # ignore all comments
|
||||
next if ($stringIn =~ /^\r/); # ignore newline
|
||||
|
||||
# Handle the beginning of a section, with the trace source name,
|
||||
# the name of the area, and the name of the class to be generated.
|
||||
# E.g. "[System.Windows.ComponentModel.Events,RoutedEvent,TraceRoutedEvent]"
|
||||
|
||||
if (($traceName, $traceArea, $traceClass) = ($stringIn =~ /^\[(.*),(.*),(.*)\]/))
|
||||
{
|
||||
# append "Source" for the property name to be used in PresentationTraceSources
|
||||
|
||||
$traceSourceName = $traceArea."Source";
|
||||
|
||||
# Write out the class header
|
||||
|
||||
print OUT
|
||||
"
|
||||
static internal partial class $traceClass
|
||||
{
|
||||
static private AvTrace _avTrace = new AvTrace(
|
||||
delegate() { return PresentationTraceSources.$traceSourceName; },
|
||||
delegate() { PresentationTraceSources._$traceSourceName = null; }
|
||||
);
|
||||
|
||||
"
|
||||
or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
# reset id auto-generation counters
|
||||
$max_id = $prev_id = 0;
|
||||
$inClass = 1;
|
||||
next;
|
||||
}
|
||||
|
||||
# Check for the end of a section, e.g. "[end]"
|
||||
|
||||
if ($stringIn =~ /^\[end]/)
|
||||
{
|
||||
print OUT $classFooter or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
$inClass = 0;
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
# Handle a line within a section, which has the trace strings
|
||||
# E.g. MyEvent=AUTO,FORMAT,{"Basic message or format string", "Param1", "Param2"}
|
||||
|
||||
if (($name, $id, $shouldFormat, $labels) = ($stringIn =~ /^(\w+)=(\w*)\,(\w*)\,(.*)/))
|
||||
{
|
||||
$inClass or die "Trace string '$stringIn' is not inside a section.";
|
||||
|
||||
# auto-generate id if int is not specified
|
||||
if ($id =~ /^\d+$/)
|
||||
{
|
||||
$max_id = $id if $id > $max_id;
|
||||
}
|
||||
elsif ($id == "" || $id == "AUTO")
|
||||
{
|
||||
$id = ++$max_id;
|
||||
}
|
||||
elsif ($id == "PREVIOUS")
|
||||
{
|
||||
$id = $prev_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
die "invalid id '$id' for trace string.";
|
||||
}
|
||||
|
||||
if ($shouldFormat)
|
||||
{
|
||||
# create a method that passes args for the format string
|
||||
|
||||
# TODO: calculate number of parameters and create precise method signature
|
||||
|
||||
print OUT
|
||||
"
|
||||
static AvTraceDetails _$name;
|
||||
static public AvTraceDetails $name(params object[] args)
|
||||
{
|
||||
if ( _$name == null )
|
||||
{
|
||||
_$name = new AvTraceDetails( $id, new string[] $labels );
|
||||
}
|
||||
|
||||
return new AvTraceFormat(_$name, args);
|
||||
}
|
||||
"
|
||||
or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
}
|
||||
elsif ($shouldFormat == "" || $shouldFormat =~ /false/i)
|
||||
{
|
||||
# create a property
|
||||
print OUT
|
||||
"
|
||||
static AvTraceDetails _$name;
|
||||
static public AvTraceDetails $name
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( _$name == null )
|
||||
{
|
||||
_$name = new AvTraceDetails( $id, new string[] $labels );
|
||||
}
|
||||
|
||||
return _$name;
|
||||
}
|
||||
}
|
||||
"
|
||||
or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
die "invalid value '$id' for trace string ShouldFormat boolean.";
|
||||
}
|
||||
|
||||
$prev_id = $id;
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
next if ($stringIn =~ /^$/);
|
||||
|
||||
die "Invalid trace string '$stringIn'";
|
||||
}
|
||||
|
||||
#close files
|
||||
close (IN) or die "$error_msg Cannot close $infile. $!\n";
|
||||
}
|
||||
|
||||
print OUT "\n".$footer or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
#close files
|
||||
close (OUT) or die "$error_msg Cannot close $outfile. $!\n";
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<CodeAnalysisRuleset Condition="'$(IsTestProject)'!='true' AND '$(EnableAnalyzers)'=='true'">$(MSBuildThisFileDirectory)CodeAnalysis\WpfCodeAnalysis.ruleset</CodeAnalysisRuleset>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(IsTestProject)'!='true' AND '$(EnableAnalyzers)'=='true'">
|
||||
<!-- Managed Code Reference analyzers -->
|
||||
<PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisPackageVersion)" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="2.9.0" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" />
|
||||
<PackageReference Include="System.Runtime.Analyzers" Version="1.1.0" />
|
||||
<PackageReference Include="System.Runtime.InteropServices.Analyzers" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="Rules for WPF" Description="Code analysis rules for the WPF code base." ToolsVersion="14.0">
|
||||
<Rules AnalyzerId="Microsoft.NetCore.Analyzers" RuleNamespace="Microsoft.NetCore.Analyzers">
|
||||
<Rule Id="CA1307" Action="None" />
|
||||
<Rule Id="CA1305" Action="None" />
|
||||
</Rules>
|
||||
<Rules AnalyzerId="Microsoft.NetFramework.Analyzers" RuleNamespace="Microsoft.NetFramework.Analyzers">
|
||||
<Rule Id="CA2235" Action="None" />
|
||||
</Rules>
|
||||
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
|
||||
<Rule Id="CA1822" Action="None" />
|
||||
<Rule Id="CA1801" Action="None" />
|
||||
<Rule Id="CA1812" Action="None" />
|
||||
<Rule Id="CA1304" Action="None" />
|
||||
</Rules>
|
||||
<Rules AnalyzerId="Microsoft.CodeQuality.CSharp.Analyzers" RuleNamespace="Microsoft.CodeQuality.CSharp.Analyzers">
|
||||
<Rule Id="CA1001" Action="None" />
|
||||
</Rules>
|
||||
<Rules AnalyzerId="System.Runtime.CSharp.Analyzers" RuleNamespace="System.Runtime.CSharp.Analyzers">
|
||||
<Rule Id="CA2213" Action="None" />
|
||||
</Rules>
|
||||
</RuleSet>
|
|
@ -0,0 +1,23 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<PreparePackageAssetsDependsOn Condition="'$(IsRedistProject)'=='true'">
|
||||
$(PreparePackageAssetsDependsOn);
|
||||
CopyRedistFile
|
||||
</PreparePackageAssetsDependsOn>
|
||||
</PropertyGroup>
|
||||
<!--
|
||||
Target used by projects under \src\Microsoft.DotNet.Wpf\redist\
|
||||
-->
|
||||
<Target Name="CopyRedistFile"
|
||||
AfterTargets="Build"
|
||||
Outputs="$(TargetPath)"
|
||||
Condition="'$(IsRedistProject)'=='true'">
|
||||
|
||||
<Error Condition="!Exists($(RedistSourcePath))"
|
||||
Text="RedistSourcePath='$(RedistSourcePath)' is not defined or it doesn't exist- cannot copy redistributable file to '$(TargetPath)'" />
|
||||
|
||||
<Delete Condition="Exists('$(TargetPath)')" Files="$(TargetPath)" />
|
||||
<Copy SourceFiles="$(RedistSourcePath)"
|
||||
DestinationFiles="$(TargetPath)" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,50 @@
|
|||
<Project>
|
||||
<!-- Defines [assembly:] Attributes that is to be stamped onto assemblies -->
|
||||
<ItemGroup>
|
||||
<ExtendedAssemblyInfo Include="CLSCompliant"
|
||||
Condition="'$(CLSCompliant)'=='true'">
|
||||
<Parameter1>true</Parameter1>
|
||||
<IsLiteral1>true</IsLiteral1>
|
||||
</ExtendedAssemblyInfo>
|
||||
|
||||
<ExtendedAssemblyInfo Include="ComVisible"
|
||||
Condition="'$(AssemblyComVisible)'!=''">
|
||||
<Parameter1>$(AssemblyComVisible)</Parameter1>
|
||||
<IsLiteral1>true</IsLiteral1>
|
||||
</ExtendedAssemblyInfo>
|
||||
|
||||
<ExtendedAssemblyInfo Include="DefaultDllImportSearchPaths"
|
||||
Condition="'$(IncludeDllSafeSearchPathAttribute)'=='true'">
|
||||
<Parameter1>DllImportSearchPath.AssemblyDirectory | DllImportSearchPath.System32</Parameter1>
|
||||
<IsLiteral1>true</IsLiteral1>
|
||||
</ExtendedAssemblyInfo>
|
||||
|
||||
<ExtendedAssemblyInfo Include="AssemblyDefaultAlias">
|
||||
<Parameter1>$(AssemblyName)</Parameter1>
|
||||
</ExtendedAssemblyInfo>
|
||||
|
||||
<ExtendedAssemblyInfo Include="AssemblyDescription"
|
||||
Condition="'$(AssemblyDescription)'!=''">
|
||||
<Parameter1>$(AssemblyDescription)</Parameter1>
|
||||
</ExtendedAssemblyInfo>
|
||||
|
||||
<!--
|
||||
AssemblyMetadata will be defined in InitializeAssemblyAttributeInformation Target, and
|
||||
incorporated into ExtendedAssemblyInfo in CoreGenerateExtendedAssemblyInfo Target
|
||||
|
||||
When defined, it would typically look like this:
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyMetadata Include=".NETCoreAssembly">
|
||||
<Value></Value>
|
||||
</AssemblyMetadata>
|
||||
<AssemblyMetadata Include="Serviceable">
|
||||
<Value>True</Value>
|
||||
</AssemblyMetadata>
|
||||
<AssemblyMetadata Include="PreferInbox">
|
||||
<Value>True</Value>
|
||||
</AssemblyMetadata>
|
||||
</ItemGroup>
|
||||
-->
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,330 @@
|
|||
<Project>
|
||||
|
||||
<!--
|
||||
Microsoft.NET.DefaultAssemblyInfo.targets initializes $(Version) based on $(VersionPrefix) (which is defined in eng\Versions.props)
|
||||
Tish is part of the .NET Core SDK and primarily defined for C# today. We reuses this here for C++/CLI
|
||||
-->
|
||||
<Import Sdk="Microsoft.Net.Sdk" Project="..\targets\Microsoft.NET.DefaultAssemblyInfo.targets" Condition="'$(MSBuildProjectExtension)'=='.vcxproj'"/>
|
||||
|
||||
<!--
|
||||
Defines [assembly: AssemblyMetadata()] attributes
|
||||
These must be defined in a Target because they depend on source-control information being
|
||||
initialized first
|
||||
-->
|
||||
<Target Name="InitializeAssemblyAttributeInformation"
|
||||
DependsOnTargets="_InitializeAssemblyVersion;_InitializeSourceControlInformationFromSourceControlManager"
|
||||
Condition="'$(SourceControlInformationFeatureSupported)' == 'true'">
|
||||
<PropertyGroup>
|
||||
<AssemblyTitle Condition="'$(AssemblyTitle)'==''">$(AssemblyName)</AssemblyTitle>
|
||||
|
||||
<AssemblyDescription Condition="'$(Description)'==''">$(AssemblyTitle)</AssemblyDescription>
|
||||
<AssemblyDescription Condition="'$(Description)'!=''">$(Description)</AssemblyDescription>
|
||||
|
||||
<AssemblyInformationalVersion Condition="'$(InformationalVersion)'!=''">$(InformationalVersion)</AssemblyInformationalVersion>
|
||||
<AssemblyInformationalVersion Condition="'$(InformationalVersion)'=='' and '$(Version)'!=''">$(Version)</AssemblyInformationalVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyMetadata Include="FileVersion" Condition="'$(FileVersion)'!=''">
|
||||
<Value>$(FileVersion)</Value>
|
||||
</AssemblyMetadata>
|
||||
|
||||
<AssemblyMetadata Include="BuiltBy" Condition="'$(COMPUTERNAME)'!=''">
|
||||
<Value>$(COMPUTERNAME)</Value>
|
||||
</AssemblyMetadata>
|
||||
|
||||
<AssemblyMetadata Include="Repository" Condition="'$(ScmRepositoryUrl)'!=''">
|
||||
<Value>$(ScmRepositoryUrl)</Value>
|
||||
</AssemblyMetadata>
|
||||
|
||||
<AssemblyMetadata Include="Commit" Condition="'$(SourceRevisionId)'!=''">
|
||||
<Value>$(SourceRevisionId)</Value>
|
||||
</AssemblyMetadata>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
Immediately after GenerateAssemblyInfo target runs, use the value of $(GeneratedAssemblyInfoFile),
|
||||
which is typically of the form Projectname.AssemblyInfo.cs, and create $(GeneratedExtendedAssemblyInfoFile)
|
||||
in the form Projectname.AssemblyInfo.Extended.cs
|
||||
-->
|
||||
<Target Name="CreateGenerateAssemblyInfoFileProperty"
|
||||
AfterTargets="GenerateAssemblyInfo">
|
||||
<ItemGroup>
|
||||
<_GeneratedAssemblyInfoFile Remove="@(_GeneratedAssemblyInfoFile)" />
|
||||
<_GeneratedAssemblyInfoFile Include="$(GeneratedAssemblyInfoFile)" />
|
||||
|
||||
<!-- Change .extension to Extended.extension -->
|
||||
<_GeneratedExtendedAssemblyInfoFile Remove="@(_GeneratedExtendedAssemblyInfoFile)" />
|
||||
<_GeneratedExtendedAssemblyInfoFile Include="%(_GeneratedAssemblyInfoFile.RootDir)%(_GeneratedAssemblyInfoFile.Directory)%(_GeneratedAssemblyInfoFile.Filename).Extended%(_GeneratedAssemblyInfoFile.Extension)" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GeneratedExtendedAssemblyInfoFile>@(_GeneratedExtendedAssemblyInfoFile)</GeneratedExtendedAssemblyInfoFile>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="GenerateExtendedAssemblyInfo"
|
||||
BeforeTargets="CoreCompile"
|
||||
DependsOnTargets="CreateGenerateAssemblyInfoFileProperty;InitializeAssemblyAttributeInformation"
|
||||
Condition="'$(GenerateAssemblyInfo)' == 'true'">
|
||||
|
||||
<CallTarget Targets="CoreGenerateExtendedAssemblyInfo" />
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
Define an inline MSBuild Task to parse @(ExtendedAssemblyInfo) ItemGroup
|
||||
|
||||
Input:
|
||||
|
||||
An ItemGroup containing assembly-level Attribute information.
|
||||
Typical format for ExtendedAssemblyInfo looks like this:
|
||||
|
||||
<ItemGroup>
|
||||
<ExtendedAssemblyInfo Include="AttributeType">
|
||||
<Parameter1>true</Parameter1>
|
||||
<IsLiteral1>true</IsLiteral1>
|
||||
|
||||
<Parameter2>https://www.microsoft.com</Parameter2>
|
||||
</ExtendedAssemblyInfo>
|
||||
</ItemGroup>
|
||||
|
||||
Attribute Type: The type (full type name) is specified as the identity element (Include=)
|
||||
Parameters: Parameters are specified in metadata values Parameter1, Parameter2, Parameter3, etc.
|
||||
Parameters are treated as strings by default.
|
||||
Literal parameters (for e.g., numbers, boolean literals, enums etc.) should be indicated as IsLiteral=true corresponding to the parameter position.
|
||||
For e.g., for Parameter6, indicate it as <IsLiteral6>true</IsLiteral>
|
||||
Output:
|
||||
|
||||
ItemGroup of fully resolved C# Attribute definitions that are ready to be used in a source file.
|
||||
-->
|
||||
<UsingTask TaskName="ParseExtendedAssemblyInfo"
|
||||
TaskFactory="CodeTaskFactory"
|
||||
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
|
||||
<ParameterGroup>
|
||||
<ExtendedAssemblyInfo ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
|
||||
<Result ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Using Namespace="System" />
|
||||
<Using Namespace="System.Collections" />
|
||||
<Using Namespace="System.Collections.Generic" />
|
||||
<Using Namespace="System.Globalization" />
|
||||
<Using Namespace="System.Linq" />
|
||||
<Using Namespace="System.Text.RegularExpressions" />
|
||||
<Reference Include="System.Linq" />
|
||||
<Reference Include="System.Core" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
if (ExtendedAssemblyInfo.Length > 0)
|
||||
{
|
||||
Result = new TaskItem[ExtendedAssemblyInfo.Length];
|
||||
for (int i = 0; i < ExtendedAssemblyInfo.Length; i++)
|
||||
{
|
||||
ITaskItem item = ExtendedAssemblyInfo[i];
|
||||
string attr = item.GetMetadata("Identity"); // This is the Attribute type
|
||||
|
||||
List<string> parameters = new List<string>();
|
||||
|
||||
var metadataNames = item.MetadataNames.Cast<string>().ToList(); // Obtain all the Metadata names
|
||||
|
||||
// Parameter names are of the form Parameter1, Parameter2, etc.
|
||||
// Parameter0 is not allowed.
|
||||
var parameterNames = metadataNames.Where((m) => Regex.IsMatch(m, @"Parameter\d+", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant));
|
||||
parameterNames = parameterNames.Where((m) => !m.Equals("Parameter0", StringComparison.InvariantCultureIgnoreCase));
|
||||
|
||||
// Order the parameter names in ascending order, then iterate through them
|
||||
var parameterNamesAscending = parameterNames.OrderBy((m) => Int32.Parse(m.Replace("Parameter", string.Empty)));
|
||||
foreach (var parameter in parameterNamesAscending)
|
||||
{
|
||||
string paramValue = item.GetMetadata(parameter);
|
||||
|
||||
bool isLiteral = false;
|
||||
string isLiteralMetadataName = parameter.Replace("Parameter", "IsLiteral");
|
||||
if (metadataNames.Contains(isLiteralMetadataName))
|
||||
{
|
||||
Boolean.TryParse(item.GetMetadata(isLiteralMetadataName), out isLiteral);
|
||||
}
|
||||
|
||||
if (isLiteral)
|
||||
{
|
||||
// The parameter is a literal, include it as-is
|
||||
parameters.Add(paramValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The parameter is NOT a litera, included it surrounded by double-quotes
|
||||
parameters.Add("\"" + paramValue + "\""); ;
|
||||
}
|
||||
}
|
||||
|
||||
// Separate the parameters by commas
|
||||
string p = string.Join<string>(",", parameters);
|
||||
|
||||
// Construct the resolved attribute declaration
|
||||
// [assembly: <attributeType> <comma-separated list of attribute parameters>]
|
||||
// For e.g.,
|
||||
// [assembly: ComVisible(true)]
|
||||
// [assembly: MetadataAttribute("Servicing","true")]
|
||||
// Save the result and continue
|
||||
string assemblyAttribute = string.Format("[assembly: {0}({1})]", attr, p);
|
||||
Result[i] = new TaskItem(assemblyAttribute);
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
|
||||
<!--
|
||||
Generates additional assembly-level attributes after MSBuild supplied GenerateAssemblyInfo target runs
|
||||
Input:
|
||||
ExtendedAssemblyInfo ItemGroup (see documentation for ParseExtendedAssemblyInfo Task)
|
||||
Output:
|
||||
Generates $(GeneratedExtendedAssemblyInfoFile), which is of the form Projectname.AssemblyInfo.Extended.cs. See
|
||||
documentation for CreateGenerateAssemblyInfoFileProperty Target for additional details.
|
||||
This file is included in the current build automatically and compiled.
|
||||
Remarks:
|
||||
i. The following namespaces are automatically included. Attributes from these namespaces do not have to be fully
|
||||
qualified:
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
ii. Only C# code-generation is supported as of this time. If VB support is desired, then update GenerateExtendedAssemblyInfo Target
|
||||
with the relevant logic for VB.
|
||||
|
||||
Example:
|
||||
Input:
|
||||
<ItemGroup>
|
||||
<ExtendedAssemblyInfo Include="ComVisible">
|
||||
<Parameter1>true</Parameter1>
|
||||
<IsLiteral1>true</IsLiteral1>
|
||||
</ExtendedAssemblyInfo>
|
||||
|
||||
<ExtendedAssemblyInfo Include="DefaultDllImportSearchPaths">
|
||||
<Parameter1>DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory</Parameter1>
|
||||
<IsLiteral1>true</IsLiteral1>
|
||||
</ExtendedAssemblyInfo>
|
||||
|
||||
<ExtendedAssemblyInfo Include="AssemblyMetadata">
|
||||
<Parameter1>.NETFramework</Parameter1>
|
||||
<Parameter2/>
|
||||
</ExtendedAssemblyInfo>
|
||||
|
||||
<ExtendedAssemblyInfo Include="AssemblyMetadata">
|
||||
<Parameter1>Serviceable</Parameter1>
|
||||
<Parameter2>true</Parameter2>
|
||||
</ExtendedAssemblyInfo>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Generated file contents:
|
||||
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool
|
||||
// Target: GenerateExtendedAssemblyInfo
|
||||
// Filename: AssemblyInfoGenerator.targets
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
[assembly: ComVisible(true)]
|
||||
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
|
||||
[assembly: AssemblyMetadata(".NETFramework","")]
|
||||
[assembly: AssemblyMetadata("Serviceable","true")]
|
||||
|
||||
// <auto-generated />
|
||||
-->
|
||||
<Target Name="CoreGenerateExtendedAssemblyInfo"
|
||||
Condition="('$(Language)'=='VB' or '$(Language)'=='C#') and '@(ExtendedAssemblyInfo)'!=''"
|
||||
Outputs="$(GeneratedExtendedAssemblyInfoFile)">
|
||||
|
||||
<Error Condition="'$(Language)'=='VB'"
|
||||
Text="ExtendedAssemblyInfo generation for VB has not been implemented yet" />
|
||||
|
||||
<Error Condition="'$(GeneratedExtendedAssemblyInfoFile)'==''"
|
||||
Text="GeneratedExtendedAssemblyInfoFile MSBuild property is empty - can not generate ExtendedAssemblyInfo" />
|
||||
|
||||
<!--
|
||||
If there is any AssemblyMetadata defined, then incorporate it
|
||||
into ExtendedAssembyInfo
|
||||
-->
|
||||
<ItemGroup>
|
||||
<_ExtendedAssemblyMetadata Remove="@(_ExtendedAssemblyMetadata)" />
|
||||
<_ExtendedAssemblyMetadata Include="@(AssemblyMetadata)"
|
||||
Condition="'@(AssemblyMetadata)'!=''"
|
||||
AttributeName="AssemblyMetadata">
|
||||
<Parameter1>%(Identity)</Parameter1>
|
||||
<Parameter2>%(Value)</Parameter2>
|
||||
</_ExtendedAssemblyMetadata>
|
||||
|
||||
<ExtendedAssemblyInfo Include="@(_ExtendedAssemblyMetadata->'%(AttributeName)')"
|
||||
Condition="'@(_ExtendedAssemblyMetadata)'!=''" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="$(GeneratedExtendedAssemblyInfoFile)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ParseExtendedAssemblyInfo ExtendedAssemblyInfo="@(ExtendedAssemblyInfo)">
|
||||
<Output ItemName="ExtendedAttributeInfo" TaskParameter="Result" />
|
||||
</ParseExtendedAssemblyInfo>
|
||||
|
||||
<ItemGroup>
|
||||
<ExtendedAssemblyInfoFileContent Remove="@(ExtendedAssemblyInfoFileContent )" />
|
||||
<ExtendedAssemblyInfoFileContent Include="Comments">
|
||||
<Text>
|
||||
<![CDATA[
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool
|
||||
// Target: GenerateExtendedAssemblyInfo
|
||||
// Filename: $(MSBuildThisFile)
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
]]>
|
||||
</Text>
|
||||
</ExtendedAssemblyInfoFileContent>
|
||||
<ExtendedAssemblyInfoFileContent Include="Usings">
|
||||
<Text>
|
||||
<![CDATA[
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
]]>
|
||||
</Text>
|
||||
</ExtendedAssemblyInfoFileContent>
|
||||
<ExtendedAssemblyInfoFileContent Include="Attributes" Text="%(ExtendedAttributeInfo.Identity)"/>
|
||||
<ExtendedAssemblyInfoFileContent Include="Postscript">
|
||||
<Text>
|
||||
<![CDATA[
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated />
|
||||
//------------------------------------------------------------------------------
|
||||
]]>
|
||||
</Text>
|
||||
</ExtendedAssemblyInfoFileContent>
|
||||
</ItemGroup>
|
||||
|
||||
<Delete Condition="Exists('$(GeneratedExtendedAssemblyInfoFile)')" Files="$(GeneratedExtendedAssemblyInfoFile)" />
|
||||
<WriteLinesToFile Lines="@(ExtendedAssemblyInfoFileContent->'%(Text)')"
|
||||
File="$(GeneratedExtendedAssemblyInfoFile)"
|
||||
Overwrite="true" />
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="$(GeneratedExtendedAssemblyInfoFile)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,48 @@
|
|||
<Project>
|
||||
<!-- This workaround fixes an issue with ResolveAssemblyReferences task where it
|
||||
removes a reference to *project* WindowsBase.dll because *sdk reference*
|
||||
WindowsBase.dll exists in the list of references it resolves. -->
|
||||
<Target Name="FixupProjectReferences" AfterTargets="ResolveAssemblyReferences">
|
||||
<CallTarget Targets="ResolveProjectReferences" />
|
||||
<ItemGroup>
|
||||
<ReferencePath Remove="@(_ResolvedNativeProjectReferencePaths)" />
|
||||
<ReferencePath Include="@(_ResolvedNativeProjectReferencePaths)" />
|
||||
|
||||
<ReferencePath Remove="@(_ResolvedProjectReferencePaths)" />
|
||||
<ReferencePath Include="@(_ResolvedProjectReferencePaths)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FilteredReferencePath Remove="@(FilteredReferencePath)" />
|
||||
</ItemGroup>
|
||||
<RemoveDuplicates Inputs="@(ReferencePath)">
|
||||
<Output TaskParameter="Filtered" ItemName="FilteredReferencePath"/>
|
||||
</RemoveDuplicates>
|
||||
<ItemGroup>
|
||||
<ReferencePath Remove="@(ReferencePath)" />
|
||||
<ReferencePath Include="@(FilteredReferencePath)" />
|
||||
</ItemGroup>
|
||||
<RemoveDuplicates Inputs="@(ProjectReference)">
|
||||
<Output TaskParameter="Filtered" ItemName="FilteredProjectReference"/>
|
||||
</RemoveDuplicates>
|
||||
<ItemGroup>
|
||||
<ProjectReference Remove="@(ProjectReference)" />
|
||||
<ProjectReference Include="@(FilteredProjectReference)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
<Target Name="DeDuplicateProjectReferenceWithConfiguration" AfterTargets="AssignProjectConfiguration">
|
||||
<RemoveDuplicates Inputs="@(ProjectReferenceWithConfiguration)">
|
||||
<Output TaskParameter="Filtered" ItemName="_filteredProjectReferenceWithConfiguration"/>
|
||||
</RemoveDuplicates>
|
||||
<ItemGroup>
|
||||
<ProjectReferenceWithConfiguration Remove="@(ProjectReferenceWithConfiguration)" />
|
||||
<ProjectReferenceWithConfiguration Include="@(_filteredProjectReferenceWithConfiguration)" />
|
||||
</ItemGroup>
|
||||
<RemoveDuplicates Inputs="@(_ProjectReferenceWithConfiguration)">
|
||||
<Output TaskParameter="Filtered" ItemName="_filtered_ProjectReferenceWithConfiguration"/>
|
||||
</RemoveDuplicates>
|
||||
<ItemGroup>
|
||||
<_ProjectReferenceWithConfiguration Remove="@(_ProjectReferenceWithConfiguration)" />
|
||||
<_ProjectReferenceWithConfiguration Include="@(_filtered_ProjectReferenceWithConfiguration)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,7 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<WpfCycleBreakersDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\cycle-breakers\</WpfCycleBreakersDir>
|
||||
<WpfSourceDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\src\</WpfSourceDir>
|
||||
<WpfSharedDir>$(WpfSourceDir)shared\</WpfSharedDir>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,427 @@
|
|||
########################################################
|
||||
# Generate the XmlStringTable handling class.
|
||||
# This tool generates enums for xml strings that are
|
||||
# used to index into the xml string table
|
||||
# The entries in the xml string table:
|
||||
# Index Name String Value Type
|
||||
# This tool also generates XML Name table
|
||||
########################################################
|
||||
use File::Copy;
|
||||
use Getopt::Std;
|
||||
|
||||
########################################################
|
||||
# usage: Print out usage
|
||||
########################################################
|
||||
|
||||
sub usage()
|
||||
{
|
||||
print "Usage: $0 -n [Namespacefile] -x [XmlStringfile] -e [fullenumclassname] -c [fullxmlstringclassname] -o [output.cs]\n\n";
|
||||
print "Example: perl $0 -n XmlNamespaceStringTable.txt -x xmlStringTable.txt -e XmlNamespaceId -c MS.Internal.IO.Packaging.XmlStringTable\n";
|
||||
}
|
||||
|
||||
########################################################
|
||||
# Variables
|
||||
########################################################
|
||||
|
||||
#hash to store all the arguements.
|
||||
my %args
|
||||
;
|
||||
#error header.
|
||||
my $error_msg = "GenXmlStringTable.pl: error:";
|
||||
|
||||
|
||||
##########################################################
|
||||
# get the switches values do some minimum validataion
|
||||
##########################################################
|
||||
|
||||
getopts('c:e:n:o:x:', \%args);
|
||||
|
||||
#all these switches are required.
|
||||
if (!$args{c} || !$args{e} || !$args{n} || !$args{o} | !$args{x})
|
||||
{
|
||||
usage();
|
||||
exit;
|
||||
}
|
||||
|
||||
my $outfile = $args{o};
|
||||
my $fullxmlnsenumclassname = $args{e};
|
||||
my $fullxmlstrclassname = $args{c};
|
||||
my $xmlnsfile = $args{n};
|
||||
my $xmlstrfile = $args{x};
|
||||
|
||||
########################################################
|
||||
# Print out switch value information
|
||||
########################################################
|
||||
|
||||
print "\n";
|
||||
print "Xml namespaces file: $xmlnsfile\n";
|
||||
print "Xml strings file: $xmlstrfile\n";
|
||||
print "Output .cs file: $outfile\n";
|
||||
print "Enum class name for all strings: $fullxmlnsenumclassname\n";
|
||||
print "Xml string table class name: $fullxmlstrclassname\n";
|
||||
|
||||
|
||||
########################################################
|
||||
# Parse class names and their namespaces
|
||||
########################################################
|
||||
|
||||
#extract the namespace and enum class name
|
||||
my ($enumnamespace, $enumsrclass) = ($fullxmlnsenumclassname =~ /^(.+)\.(.+)$/);
|
||||
my $srid = $srclass."ID";
|
||||
|
||||
#extract the namespace and table class name
|
||||
my ($tablenamespace, $tablesrclass) = ($fullxmlstrclassname =~ /^(.+)\.(.+)$/);
|
||||
my $srid = $srclass."ID";
|
||||
|
||||
########################################################
|
||||
# Print out class information
|
||||
########################################################
|
||||
|
||||
print "enum namespace: $enumnamespace\n";
|
||||
print "enum class name: $enumsrclass\n\n";
|
||||
|
||||
print "xml string table namespace: $tablenamespace\n";
|
||||
print "xml string class name: $tablesrclass\n";
|
||||
|
||||
########################################################
|
||||
# Count all xml namespaces and xml strings
|
||||
########################################################
|
||||
|
||||
# Need to start from 1 since the first item is NotDefined
|
||||
my $tableSize = 1;
|
||||
|
||||
open(IN, $xmlnsfile) or die "$error_msg Cannot open $infile. $!\n";
|
||||
|
||||
while ($string = <IN>)
|
||||
{
|
||||
if ($string =~ /^(\w+)=/o)
|
||||
{
|
||||
$tableSize += 1;
|
||||
}
|
||||
}
|
||||
|
||||
#### close files
|
||||
close (IN) or die "$error_msg Cannot close $infile. $!\n";
|
||||
|
||||
|
||||
open(IN, $xmlstrfile) or die "$error_msg Cannot open $infile. $!\n";
|
||||
|
||||
while ($string = <IN>)
|
||||
{
|
||||
if ($string =~ /^(\w+)=/o)
|
||||
{
|
||||
$tableSize += 1;
|
||||
}
|
||||
}
|
||||
|
||||
#### close files
|
||||
close (IN) or die "$error_msg Cannot close $infile. $!\n";
|
||||
|
||||
|
||||
########################################################
|
||||
# Header of the generated cs file
|
||||
# 1. Copyright information
|
||||
# 2. Begining of the enum class
|
||||
########################################################
|
||||
|
||||
my $header = <<"END_OF_HEADER";
|
||||
//-------------------------------------------------------------------------------
|
||||
// <copyright from='1999' to='2005' company='Microsoft Corporation'>
|
||||
// Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
// Information Contained Herein is Proprietary and Confidential.
|
||||
// </copyright>
|
||||
//
|
||||
// This file is generated from $xmlnsfile and $xmlstrfile by GenXmlStringTable.pl
|
||||
// - do not modify this file directly
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Diagnostics;
|
||||
using System.Xml;
|
||||
|
||||
using $enumnamespace;
|
||||
|
||||
namespace $enumnamespace
|
||||
{
|
||||
|
||||
//an enums for xml string identifiers.
|
||||
internal enum $enumsrclass : int
|
||||
{
|
||||
NotDefined = 0,
|
||||
END_OF_HEADER
|
||||
|
||||
|
||||
########################################################
|
||||
# Middle part of the generated cs file
|
||||
# 1. Closing brakets for the enum class and the namespace
|
||||
# 2. Begining of the enum class
|
||||
# 3. Begining of the string table class
|
||||
########################################################
|
||||
|
||||
my $tableclassheader = <<"END_OF_TABLE_CLASS_HEADER";
|
||||
} // end of enum $enumsrclass
|
||||
} // end of namespace
|
||||
|
||||
namespace $tablenamespace
|
||||
{
|
||||
internal static class $tablesrclass
|
||||
{
|
||||
static $tablesrclass()
|
||||
{
|
||||
Object str;
|
||||
|
||||
END_OF_TABLE_CLASS_HEADER
|
||||
|
||||
########################################################
|
||||
# Footer of the generated cs file
|
||||
# 1. Helper functions for the xml string table
|
||||
# 2. Definition of the item entry in the xml string table
|
||||
# 3. Private member variables
|
||||
# 4. Closing brakets for the xml string class and the namespace
|
||||
########################################################
|
||||
|
||||
my $footer = <<"END_OF_FOOTER";
|
||||
}
|
||||
|
||||
internal static $enumsrclass GetEnumOf(Object xmlString)
|
||||
{
|
||||
Debug.Assert(xmlString is String);
|
||||
|
||||
// Index 0 is reserved for NotDefined and doesn't have a table entry
|
||||
// so start from 1
|
||||
for (int i = 1; i < _xmlstringtable.GetLength(0) ; ++i)
|
||||
{
|
||||
if (Object.ReferenceEquals(_xmlstringtable[i].Name, xmlString))
|
||||
{
|
||||
return ((PackageXmlEnum) i);
|
||||
}
|
||||
}
|
||||
|
||||
return PackageXmlEnum.NotDefined;
|
||||
}
|
||||
|
||||
internal static string GetXmlString($enumsrclass id)
|
||||
{
|
||||
CheckIdRange(id);
|
||||
|
||||
return (string) _xmlstringtable[(int) id].Name;
|
||||
}
|
||||
|
||||
internal static Object GetXmlStringAsObject($enumsrclass id)
|
||||
{
|
||||
CheckIdRange(id);
|
||||
|
||||
return _xmlstringtable[(int) id].Name;
|
||||
}
|
||||
|
||||
internal static $enumsrclass GetXmlNamespace($enumsrclass id)
|
||||
{
|
||||
CheckIdRange(id);
|
||||
|
||||
return _xmlstringtable[(int) id].Namespace;
|
||||
}
|
||||
|
||||
internal static string GetValueType($enumsrclass id)
|
||||
{
|
||||
CheckIdRange(id);
|
||||
|
||||
return _xmlstringtable[(int) id].ValueType;
|
||||
}
|
||||
|
||||
internal static NameTable NameTable
|
||||
{
|
||||
get
|
||||
{
|
||||
return _nameTable;
|
||||
}
|
||||
}
|
||||
|
||||
#if false
|
||||
internal static IEqualityComparer EqualityComparer
|
||||
{
|
||||
get
|
||||
{
|
||||
return _referenceComparer;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private static void CheckIdRange($enumsrclass id)
|
||||
{
|
||||
// Index 0 is reserved for NotDefined and doesn't have a table entry
|
||||
if ((int) id <= 0 || (int) id >= $tableSize)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
}
|
||||
}
|
||||
|
||||
internal static NameTable CloneNameTable()
|
||||
{
|
||||
NameTable nameTable = new NameTable();
|
||||
|
||||
// Index 0 is reserved for NotDefined and doesn't have a table entry
|
||||
for (int i=1; i<$tableSize; ++i)
|
||||
{
|
||||
nameTable.Add((string)_xmlstringtable[i].Name);
|
||||
}
|
||||
|
||||
return nameTable;
|
||||
}
|
||||
|
||||
private struct XmlStringTableStruct
|
||||
{
|
||||
private Object _nameString;
|
||||
private $enumsrclass _namespace;
|
||||
private string _valueType;
|
||||
|
||||
internal XmlStringTableStruct(Object nameString, $enumsrclass ns, string valueType)
|
||||
{
|
||||
_nameString = nameString;
|
||||
_namespace = ns;
|
||||
_valueType = valueType;
|
||||
}
|
||||
|
||||
internal Object Name { get { return (String) _nameString; } }
|
||||
internal $enumsrclass Namespace { get { return _namespace; } }
|
||||
internal string ValueType { get { return _valueType; } }
|
||||
}
|
||||
|
||||
#if false
|
||||
// The Hashtable comparer that takes advantage of the fact
|
||||
// that we know the object identities of all keys to find.
|
||||
private class ReferenceComparer : IEqualityComparer
|
||||
{
|
||||
// Perform reference comparison.
|
||||
// Explicit implementation to avoid conflict with object.Equals.
|
||||
bool IEqualityComparer.Equals(object x, object y)
|
||||
{
|
||||
return object.ReferenceEquals(x, y);
|
||||
}
|
||||
|
||||
// Hash on object identity.
|
||||
public int GetHashCode(object obj)
|
||||
{
|
||||
return System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(obj);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
private static XmlStringTableStruct[] _xmlstringtable = new XmlStringTableStruct[$tableSize];
|
||||
private static NameTable _nameTable = new NameTable();
|
||||
#if false
|
||||
private static ReferenceComparer _referenceComparer = new ReferenceComparer();
|
||||
#endif
|
||||
} //endof class $tablesrclass
|
||||
|
||||
} // end of namespace
|
||||
|
||||
END_OF_FOOTER
|
||||
|
||||
|
||||
########################################################
|
||||
#
|
||||
# Generate cs file
|
||||
#
|
||||
########################################################
|
||||
|
||||
#### open output c# file.
|
||||
|
||||
open(OUT, '>'.$outfile) or die "$error_msg Cannot create $outfile. $!\n";
|
||||
|
||||
########################################################
|
||||
# Write out the predefined header
|
||||
########################################################
|
||||
|
||||
print OUT $header or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
########################################################
|
||||
# Read in all xml namespace list and declare them in the enum class
|
||||
########################################################
|
||||
|
||||
open(IN, $xmlnsfile) or die "$error_msg Cannot open $infile. $!\n";
|
||||
|
||||
while ($string = <IN>)
|
||||
{
|
||||
if ($string =~ /^(\w+)=/o)
|
||||
{
|
||||
print OUT " $1,\n" or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
}
|
||||
}
|
||||
|
||||
#### close files
|
||||
close (IN) or die "$error_msg Cannot close $infile. $!\n";
|
||||
|
||||
########################################################
|
||||
# Read in all xml strings and declare them in the enum class
|
||||
########################################################
|
||||
|
||||
open(IN, $xmlstrfile) or die "$error_msg Cannot open $infile. $!\n";
|
||||
|
||||
while ($string = <IN>)
|
||||
{
|
||||
if ($string =~ /^(\w+)=/o)
|
||||
{
|
||||
print OUT " $1,\n" or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
}
|
||||
}
|
||||
|
||||
#### close files
|
||||
close (IN) or die "$error_msg Cannot close $infile. $!\n";
|
||||
|
||||
|
||||
########################################################
|
||||
# Write out the end of the enum class and the start of the xml string table
|
||||
########################################################
|
||||
|
||||
print OUT $tableclassheader or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
|
||||
########################################################
|
||||
# Add all the xml namespaces to the xml string table
|
||||
########################################################
|
||||
|
||||
open(IN, $xmlnsfile) or die "$error_msg Cannot open $infile. $!\n";
|
||||
|
||||
#### insert all namespaces and prefixes strings
|
||||
|
||||
while ($string = <IN>)
|
||||
{
|
||||
if ($string =~ /^(\w+)=(\S+)/o)
|
||||
{
|
||||
print OUT " str = _nameTable.Add(\"$2\");\n" or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
print OUT " _xmlstringtable[(int) $enumsrclass.$1] = new XmlStringTableStruct(str, $enumsrclass.NotDefined, null);\n" or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
}
|
||||
}
|
||||
|
||||
print OUT "\n" or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
########################################################
|
||||
# Add all the xml strings to the xml string table
|
||||
########################################################
|
||||
|
||||
open(IN, $xmlstrfile) or die "$error_msg Cannot open $infile. $!\n";
|
||||
|
||||
#### insert all xml strings
|
||||
|
||||
while ($string = <IN>)
|
||||
{
|
||||
if ($string =~ /^(\w+)=(\S+)\s+(\S+)(?:\s+(\S+))?/o)
|
||||
{
|
||||
print OUT " str = _nameTable.Add(\"$2\");\n" or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
print OUT " _xmlstringtable[(int) $enumsrclass.$1] = new XmlStringTableStruct(str, $enumsrclass.$3, \"$4\");\n" or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
}
|
||||
}
|
||||
|
||||
########################################################
|
||||
# Write out the end of the xml string table
|
||||
########################################################
|
||||
|
||||
print OUT "\n".$footer or die "$error_msg Cannot write to $outfile. $! \n";
|
||||
|
||||
#### close files
|
||||
|
||||
close (OUT) or die "$error_msg Cannot close $outfile. $!\n";
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<Project>
|
||||
<Target
|
||||
Name="GenerateAvTraceMessages"
|
||||
BeforeTargets="CoreCompile"
|
||||
Condition="'$(AvTraceMessages)'!=''"
|
||||
Inputs="$(AvTraceMessages)"
|
||||
Outputs="$(IntermediateOutputPath)AvTraceMessages.cs">
|
||||
<Error Condition="!Exists($(PerlCommand.Replace('"','')))" Text="Perl is not found: PerlCommand=$(PerlCommand)" />
|
||||
<MakeDir Condition="!Exists('$(IntermediateOutputPath)')" Directories="$(IntermediateOutputPath)" />
|
||||
<Message Text="Generating $(IntermeidateOutputPath)AvTraceMessages.cs from $(AvTraceMessages)"/>
|
||||
<Exec
|
||||
Command="$(PerlCommand) $(MSBuildThisFileDirectory)AvTrace\GenTraceStrings.pl -o $(IntermediateOutputPath)AvTraceMessages.cs -i $(AvTraceMessages)"
|
||||
StandardErrorImportance="normal"
|
||||
Outputs="$(IntermediateOutputPath)AvTraceMessages.cs">
|
||||
<Output TaskParameter="Outputs" ItemName="Compile"/>
|
||||
</Exec>
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,85 @@
|
|||
<Project ToolsVersion="14.0" InitialTargets="GenerateModuleDefinitionFile;IncludeModuleDefinitionInputFileInCompilationListInVSBuild" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- When building inside VS, we are having trouble running the CL task directly, so use a two-step process to generate the module definition -->
|
||||
<UseTwoStepModuleDefinitionGenerator Condition="'$(BuildingInsideVisualStudio)'=='true'">true</UseTwoStepModuleDefinitionGenerator>
|
||||
<UseTwoStepModuleDefinitionGenerator Condition="'$(BuildingInsideVisualStudio)'!='true'">false</UseTwoStepModuleDefinitionGenerator>
|
||||
|
||||
<!-- When building inside Arcade SDK, calling the CL task seems to always fail. Always use two-step module def generation for now -->
|
||||
<UseTwoStepModuleDefinitionGenerator>true</UseTwoStepModuleDefinitionGenerator>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Create the Module Definition File -->
|
||||
|
||||
<!-- Create the module definition file -->
|
||||
<!-- PresentationNative.def has C++ style single line comments -->
|
||||
<!-- We will use the C++ preprocessor to strip out the comments and produce -->
|
||||
<!---$(IntermediateOutputPath)PresentationNative.i sans any comments -->
|
||||
<Target
|
||||
Name="GenerateModuleDefinitionFile"
|
||||
Condition="'$(UseTwoStepModuleDefinitionGenerator)'=='false'"
|
||||
BeforeTargets="Build"
|
||||
Inputs="$(ModuleDefinitionInputFile)"
|
||||
Outputs="$(IntermediateOutputPath)$(ModuleDefinitionOutputFile)">
|
||||
<MakeDir Condition="!Exists('$(IntermediateOutputPath)')" Directories="$(IntermediateOutputPath)" />
|
||||
<CL
|
||||
Sources="$(ModuleDefinitionInputFile)"
|
||||
PreprocessOutputPath="$(IntermediateOutputPath)$(ModuleDefinitionOutputFile)"
|
||||
CompileAs="CompileAsCpp"
|
||||
PreprocessToFile="true"
|
||||
PreprocessSuppressLineNumbers="true"
|
||||
WarningLevel="TurnOffAllWarnings"
|
||||
AdditionalIncludeDirectories="$(AdditionalIncludeDirectories);$(WpfSharedDir)\inc"
|
||||
AdditionalOptions="$(AdditionalOptions) /DDLL_NAME=$(TargetName)"/>
|
||||
</Target>
|
||||
|
||||
|
||||
<!-- Include the Module definition file to the ClCompile list, and mark it for preprocessing only -->
|
||||
<!-- This should be done before Build. This step will generate a $(ModuleDefinitionOutputFile) in -->
|
||||
<!-- the same directory as $(ModuleDefinitionInputFile). This file will have to be moved to -->
|
||||
<!-- $(IntermediateOutputPath) before it can be used -->
|
||||
<Target
|
||||
Name="IncludeModuleDefinitionInputFileInCompilationListInVSBuild"
|
||||
Condition="'$(UseTwoStepModuleDefinitionGenerator)'=='true'"
|
||||
BeforeTargets="Build">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(ModuleDefinitionInputFile)">
|
||||
<PreCompiledHeader>NotUsing</PreCompiledHeader>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
||||
<PreProcessToFile>true</PreProcessToFile>
|
||||
<PreProcessSuppressLineNumbers>true</PreProcessSuppressLineNumbers>
|
||||
<AdditionalOptions>$(AdditionalOptions) /DDLL_NAME=$(TargetName)</AdditionalOptions>
|
||||
|
||||
<ForcedIncludeFiles/>
|
||||
<ObjectFileName/>
|
||||
<LinkCompiled>false</LinkCompiled>
|
||||
<LibCompiled>false</LibCompiled>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- Move the Module definition file to $(IntermediateOutputPath) -->
|
||||
<Target
|
||||
Name="GenerateModuleDefinitionFileInVSBuild"
|
||||
Condition="'$(UseTwoStepModuleDefinitionGenerator)'=='true'"
|
||||
BeforeTargets="Link" AfterTargets="Build"
|
||||
Inputs="$(ModuleDefinitionOutputFile)" Outputs="$(IntermediateOutputPath)$(ModuleDefinitionOutputFile)">
|
||||
<MakeDir Condition="!Exists('$(IntermediateOutputPath)')" Directories="$(IntermediateOutputPath)" />
|
||||
<Move
|
||||
SourceFiles="$(ModuleDefinitionOutputFile)"
|
||||
DestinationFolder="$(IntermediateOutputPath)"
|
||||
OverwriteReadOnlyFiles="true" />
|
||||
</Target>
|
||||
|
||||
<!-- Make sure that the temporary $(ModuleDefinitionOutputFile) is cleaned up when the 'Clean' target is run -->
|
||||
<Target
|
||||
Name="CleanTemporaryModuleFile"
|
||||
Condition="'$(BuildingInsideVisualStudio)'=='true'"
|
||||
BeforeTargets="Clean">
|
||||
<Delete
|
||||
Condition="Exists('$(ModuleDefinitionOutputFile)')"
|
||||
Files="$(ModuleDefinitionOutputFile)"/>
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<Project>
|
||||
<PropertyGroup Condition="'$(GenerateProgramFile)'==''">
|
||||
<GenerateProgramFile>false</GenerateProgramFile>
|
||||
<GenerateProgramFile Condition="'$(IsTestProject)'=='true' And '$(InternalMarkupCompilation)'!='true'">true</GenerateProgramFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,16 @@
|
|||
<Project>
|
||||
<Target Name="EnsureProgramFileIsGeneratedOnlyForTests"
|
||||
Condition="'$(IsTestProject)'=='true' And '$(GenerateProgramFile)'!='true'"
|
||||
BeforeTargets="CoreCompile">
|
||||
<PropertyGroup>
|
||||
<GenerateProgramFile Condition="'$(InternalMarkupCompilation)'!='true'">true</GenerateProgramFile>
|
||||
<GenerateProgramFile Condition="'$(InternalMarkupCompilation)'=='true'">false</GenerateProgramFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- The natural execution of GenerateProgramFile would have been skipped because
|
||||
$(GenerateProgramFile) was initially false - call it again
|
||||
-->
|
||||
<CallTarget Targets="PrepareForBuild;CoreGenerateProgramFile"
|
||||
Condition="'$(GenerateProgramFile)'=='true'" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,84 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<TaskFactoryToUse Condition="'$(MSBuildProjectExtension)'!='.vcxproj'">RoslynCodeTaskFactory</TaskFactoryToUse>
|
||||
<TaskFactoryToUse Condition="'$(MSBuildProjectExtension)'=='.vcxproj'">CodeTaskFactory</TaskFactoryToUse>
|
||||
|
||||
<TaskFactoryAssemblyToUse Condition="'$(MSBuildProjectExtension)'!='.vcxproj'">$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll</TaskFactoryAssemblyToUse>
|
||||
<TaskFactoryAssemblyToUse Condition="'$(MSBuildProjectExtension)'=='.vcxproj'">$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll</TaskFactoryAssemblyToUse>
|
||||
</PropertyGroup>
|
||||
|
||||
<UsingTask TaskName="FilterItem1ByItem2"
|
||||
TaskFactory="$(TaskFactoryToUse)"
|
||||
AssemblyFile="$(TaskFactoryAssemblyToUse)">
|
||||
<ParameterGroup>
|
||||
<Item1 ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
|
||||
<Item2 ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
|
||||
<Metadata2 ParameterType="System.String" Required="true" />
|
||||
<PreserveItem1Metadata ParameterType="System.Boolean" />
|
||||
<PreserveItem2Metadata ParameterType="System.Boolean" />
|
||||
<TreatItemsAsPaths ParameterType="System.Boolean" />
|
||||
<Result ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
|
||||
<UnmatchedReferences ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Using Namespace="System" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
var result = new List<TaskItem>();
|
||||
var unmatched = new List<TaskItem>();
|
||||
|
||||
foreach (var item1 in Item1)
|
||||
{
|
||||
bool matched = false;
|
||||
foreach (var item2 in Item2)
|
||||
{
|
||||
if (item2.MetadataNames.Cast<string>().Contains(Metadata2))
|
||||
{
|
||||
string str1 = item1.ItemSpec;
|
||||
string str2 = item2.GetMetadata(Metadata2);
|
||||
|
||||
bool cmp =
|
||||
!TreatItemsAsPaths ?
|
||||
str1.Equals(str2, StringComparison.OrdinalIgnoreCase)
|
||||
: Path.Equals(str1, str2);
|
||||
|
||||
if (cmp)
|
||||
{
|
||||
var resultItem = new TaskItem(item2.GetMetadata(Metadata2));
|
||||
if (PreserveItem1Metadata)
|
||||
{
|
||||
var metadata = item1.CloneCustomMetadata();
|
||||
foreach (object m in metadata.Keys)
|
||||
{
|
||||
resultItem.SetMetadata((string)m, (string)metadata[m]);
|
||||
}
|
||||
}
|
||||
|
||||
if (PreserveItem2Metadata)
|
||||
{
|
||||
var metadata = item2.CloneCustomMetadata();
|
||||
foreach (object m in metadata.Keys)
|
||||
{
|
||||
resultItem.SetMetadata((string)m, (string)metadata[m]);
|
||||
}
|
||||
}
|
||||
|
||||
result.Add(resultItem);
|
||||
matched = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!matched)
|
||||
{
|
||||
unmatched.Add(new TaskItem(item1));
|
||||
}
|
||||
}
|
||||
|
||||
Result = result.ToArray();
|
||||
UnmatchedReferences = unmatched.ToArray();
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
</Project>
|
|
@ -0,0 +1,17 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="_UpdateGeneratedFiles" AfterTargets="MarkupCompilePass1">
|
||||
<ItemGroup Condition="'$(NoInternalTypeHelper)' == 'true'">
|
||||
<!-- The internal type helper is generated deriving from InternalTypeHelper and generates "protected override" members,
|
||||
this doesn't work for PresentationUI which has internals visible to WindowsBase and sees the actual members are "protected internal"
|
||||
just omit this generated helper as it is not used -->
|
||||
<Compile Remove="@(Compile)" Condition="'%(FileName)%(Extension)' == 'GeneratedInternalTypeHelper.g.cs'" />
|
||||
<_GeneratedCodeFiles Remove="@(_GeneratedCodeFiles)" Condition="'%(FileName)%(Extension)' == 'GeneratedInternalTypeHelper.g.cs'" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- When building the temporary assembly we can't run the resource generation targets since those would
|
||||
leak global properties into project references, so instead just pass the compile items down -->
|
||||
<_GeneratedCodeFiles Include="@(EmbeddedResource->'%(StronglyTypedFileName)');" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Licensed under the MIT license.
|
||||
|
||||
https://github.com/Microsoft/MSBuildSdks/tree/master/src/NoTargets
|
||||
-->
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<Import Project="$(CustomBeforeNoTargetsProps)" Condition=" '$(CustomBeforeNoTargetsProps)' != '' And Exists('$(CustomBeforeNoTargetsProps)') " />
|
||||
<Import Project="$(CustomAfterNoTargetsProps)" Condition=" '$(CustomAfterNoTargetsProps)' != '' And Exists('$(CustomAfterNoTargetsProps)') " />
|
||||
|
||||
<!--
|
||||
Set LanguageTargets to Microsoft.Common.targets for any project that the SDK won't (.proj, .noproj, etc)
|
||||
https://github.com/dotnet/sdk/blob/50ddfbb91be94d068514e8f4b0ce1052156364a0/src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.targets#L28
|
||||
|
||||
We can't default LanguageTargets it is set in the SDK and immediately imported. So we can only default
|
||||
it if we know the SDK won't. Projects probably won't load in Visual Studio but will build from the
|
||||
command-line just fine.
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<LanguageTargets Condition=" '$(LanguageTargets)' == '' And '$(MSBuildProjectExtension)' != '.csproj' And '$(MSBuildProjectExtension)' != '.vbproj' And '$(MSBuildProjectExtension)' != '.fsproj' ">$(MSBuildToolsPath)\Microsoft.Common.targets</LanguageTargets>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Licensed under the MIT license.
|
||||
|
||||
https://github.com/Microsoft/MSBuildSdks/tree/master/src/NoTargets
|
||||
-->
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<Import Project="$(CustomBeforeNoTargets)" Condition="'$(CustomBeforeNoTargets)' != '' and Exists('$(CustomBeforeNoTargets)')" />
|
||||
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" Condition=" '$(CommonTargetsPath)' == '' " />
|
||||
|
||||
<ItemGroup>
|
||||
<IntermediateAssembly Remove="@(IntermediateAssembly)" />
|
||||
<IntermediateRefAssembly Remove="@(IntermediateRefAssembly)" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
This property must be overridden to remove a few targets that compile assemblies
|
||||
-->
|
||||
<CoreBuildDependsOn>
|
||||
BuildOnlySettings;
|
||||
PrepareForBuild;
|
||||
PreBuildEvent;
|
||||
ResolveReferences;
|
||||
GetTargetPath;
|
||||
PrepareForRun;
|
||||
IncrementalClean;
|
||||
PostBuildEvent
|
||||
</CoreBuildDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(CustomAfterNoTargets)" Condition="'$(CustomAfterNoTargets)' != '' and Exists('$(CustomAfterNoTargets)')" />
|
||||
</Project>
|
|
@ -0,0 +1,67 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<ArtifactsPackagingDir Condition="'$(ArtifactsPackagingDir)'=='' and $(Platform.EndsWith('64'))">$(ArtifactsDir)packaging\$(Configuration)\$(Platform)\</ArtifactsPackagingDir>
|
||||
<ArtifactsPackagingDir Condition="'$(ArtifactsPackagingDir)'=='' and !$(Platform.EndsWith('64'))">$(ArtifactsDir)packaging\$(Configuration)\</ArtifactsPackagingDir>
|
||||
|
||||
<!-- We like using RID prefix when generating nuget package names -->
|
||||
<PackageRuntimeIdentifierPrefix Condition="'$(Platform)'!='AnyCPU' and '$(Platform)'!='Win32'">runtime.win-$(Platform)</PackageRuntimeIdentifierPrefix>
|
||||
<PackageRuntimeIdentifierPrefix Condition="'$(Platform)'=='AnyCPU' or '$(Platform)'=='Win32'">runtime.win-x86</PackageRuntimeIdentifierPrefix>
|
||||
|
||||
<!-- By default, everything is set to $(IsPackable) = false -->
|
||||
<!-- We have a few special projects that are used to orchestrate packaging -->
|
||||
<!-- that will have $(IsPackable) = true -->
|
||||
<IsPackable Condition="'$(IsPackable)'==''">false</IsPackable>
|
||||
|
||||
|
||||
<!-- This repo builds a transport package - we don't ship from here -->
|
||||
<IsShippingPackage>false</IsShippingPackage>
|
||||
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<Copyright Condition="'$(CopyrightNetFoundation)' != ''">$(CopyrightNetFoundation)</Copyright>
|
||||
|
||||
<PackageRequireLicenseAcceptance Condition="'$(PackageRequireLicenseAcceptance)'!=''">false</PackageRequireLicenseAcceptance>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GitHubTransportPackageName>Microsoft.DotNet.Wpf.GitHub</GitHubTransportPackageName>
|
||||
<DncEngTransportPackageName>Microsoft.DotNet.Wpf.DncEng</DncEngTransportPackageName>
|
||||
|
||||
<!-- When ready to go live, remove .private suffix -->
|
||||
<WindowsDesktopSdkPackageName>Microsoft.NET.Sdk.WindowsDesktop</WindowsDesktopSdkPackageName>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
$(RepoLocation) is defined in ShippingProjects.props
|
||||
Values can be:
|
||||
Internal
|
||||
External
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<!-- Built out of internal repo -->
|
||||
<PackageName Condition="'$(RepoLocation)'=='Internal'">$(DncEngTransportPackageName)</PackageName>
|
||||
|
||||
<!-- Built out of https://www.github.com/dotnet/wpf -->
|
||||
<PackageName Condition="'$(RepoLocation)'=='External'">$(GitHubTransportPackageName)</PackageName>
|
||||
|
||||
<!-- Built out of https://www.github.com/dotnet/wpf -->
|
||||
<PackageName Condition="'$(RepoLocation)'=='WindowsDesktopSdk'">$(WindowsDesktopSdkPackageName)</PackageName>
|
||||
|
||||
<RepositoryUrl Condition="'$(RepoLocation)'=='Internal'">https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
||||
<!-- Projects that consume our packages should not be forced to consume our dependencies as well -->
|
||||
<!-- Set PrivateAssets=All to mark contentfiles;analyzers;build as private -->
|
||||
<ItemDefinitionGroup>
|
||||
<PackageReference>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Do not copy Nuget references to output folder -->
|
||||
<!-- This will in turn prevent packaging of nuget-referneces into the transport packages -->
|
||||
<CopyLocalLockFileAssemblies Condition="'$(IsTestProject)'!='true'">false</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,378 @@
|
|||
<Project InitialTargets="EnsureCreateContentFolderRunsBeforeNuspecDependsOn">
|
||||
<!-- Dummy 'Pack' target for 'vcxproj' -->
|
||||
<Target Name="Pack" Condition="'$(MSBuildProjectExtension)'=='.vcxproj'" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Projects can override the name of the 'lib' folder to something else - for e.g., 'tools'-->
|
||||
<LibFolder Condition="'$(LibFolder)'==''">lib</LibFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageName Condition="'$(CreateArchNeutralPackage)'!='true'">$(PackageRuntimeIdentifierPrefix).$(PackageName)</PackageName>
|
||||
<NormalizedPackageName>$(PackageName.Replace('$(PackageRuntimeIdentifierPrefix).',''))</NormalizedPackageName>
|
||||
<NuspecPackageId>$(PackageName)</NuspecPackageId>
|
||||
<DevelopmentDependency Condition="'$(MsBuildSdkPackage)'=='true'">true</DevelopmentDependency>
|
||||
<PackageType Condition="'$(MsBuildSdkPackage)'=='true'">MSBuildSdk</PackageType>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
Target: PreparePackageAssets
|
||||
Copies packages assets for a project to artifacts\packaging\$(Configuration)\$(PackageName)\
|
||||
and prepares it for packaging then Target=Pack is executed
|
||||
|
||||
Important properties and items:
|
||||
$(PackageName): Name of the package
|
||||
This target will only run for projects that specify $(PackageName)
|
||||
|
||||
@(PackagingContent): Additional content specified by projects
|
||||
Place under content\ in the package by default
|
||||
Placement in package can be altered by specifying a SubFolder attribute
|
||||
<PackagingContent Include="foo.xml" SubFolder="xmls" /> would result in
|
||||
foo.xml being packaged under content\xmls
|
||||
|
||||
'root' is a special prefix-value for the attribute SubFolder, and it will result
|
||||
in the placement of the file in the root of the package.
|
||||
- <PackagingContent Include="THIRD-PARTY-NOTICES.TXT" SubFolder="root"/>
|
||||
will result in "THIRD-PARTY-NOTICES.TXT" to be placed at the root
|
||||
of the package.
|
||||
<PackagingContent Include"sdk\*.props" Subfolder="root\sdk" /> will result in
|
||||
relevant *.props files to be placed under the 'sdk' sub-folder in the package.
|
||||
|
||||
@(PackagingAssemblyContent) -
|
||||
A way to specify which files under $(OutDir) should be packaged.
|
||||
If this list is set, then we will only carry assemblies specified in this set
|
||||
an no others.
|
||||
$(ExcludeRefAssemblies) - true/false to include/exclude ref assemblies from packaging.
|
||||
default is true.
|
||||
$(ExcludePdbs) - true/false to include/exclude PDB's from packaging
|
||||
default is true
|
||||
$(PreparePackageAssetsDependsOn):
|
||||
List of targets that PreparePackageAssets would depend on
|
||||
This is an extensibility point
|
||||
|
||||
Packaging projects ($(IsPackagingProject) == true) also have $(PackageName) - do not attempt
|
||||
to prepare DLL, EXE, PDB etc. assets for those projects. Only prepare content (PackageAsset)
|
||||
assets for packaging projects
|
||||
-->
|
||||
<Target Name="PreparePackageAssets"
|
||||
AfterTargets="Build"
|
||||
DependsOnTargets="$(PreparePackageAssetsDependsOn)"
|
||||
Condition="'$(PackageName)'!=''">
|
||||
|
||||
<!-- Identify $(TargetFrameworkOrRuntimeIdentifier) property -->
|
||||
<PropertyGroup>
|
||||
<TargetFrameworkOrRuntimeIdentifier Condition="'$(TargetFrameworkOrRuntimeIdentifier)'=='' and '$(TargetFramework)'!=''">$(TargetFramework)</TargetFrameworkOrRuntimeIdentifier>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(MSBuildProjectExtension)'=='.vcxproj' and '$(TargetFrameworkOrRuntimeIdentifier)'==''">
|
||||
<TargetFrameworkOrRuntimeIdentifier Condition="'$(Platform)'=='AnyCPU' or '$(Platform)'=='x86' or '$(Platform)'=='Win32'">win-x86</TargetFrameworkOrRuntimeIdentifier>
|
||||
<TargetFrameworkOrRuntimeIdentifier Condition="'$(Platform)'=='x64'">win-x64</TargetFrameworkOrRuntimeIdentifier>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
Instead of showing an error when $(TargetFrameworkOrRuntimeIdentifier) cannot be identified
|
||||
we simply do no further work
|
||||
|
||||
Include all the DLL's, EXE's and PDB's under lib\
|
||||
Include all reference assemblies under ref\
|
||||
Include all content files under content\
|
||||
|
||||
@(PackageAsset) evaluation should be done after $(PreparePackageAssetsDependsOn) targets have completed running. To ensure
|
||||
delayed evaluation, use CreateItem tasks.
|
||||
|
||||
The CreateItem tasks below is equivalent to this:
|
||||
|
||||
<ItemGroup Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true'">
|
||||
<PackageAsset Include="$(OutDir)*.dll" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\lib\$(TargetFrameworkOrRuntimeIdentifier)"/>
|
||||
<PackageAsset Include="$(OutDir)*.exe" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\lib\$(TargetFrameworkOrRuntimeIdentifier)"/>
|
||||
<PackageAsset Include="$(OutDir)*.pdb" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\lib\$(TargetFrameworkOrRuntimeIdentifier)"/>
|
||||
<PackageAsset Include="$(ReferenceAssemblyDir)*.dll" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\ref\$(TargetFrameworkOrRuntimeIdentifier)"/>
|
||||
</ItemGroup>
|
||||
-->
|
||||
<CreateItem Include="$(OutDir)*.dll"
|
||||
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)"
|
||||
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'==''">
|
||||
<Output ItemName="PackageAsset" TaskParameter="Include"/>
|
||||
</CreateItem>
|
||||
<CreateItem Include="$(OutDir)*.exe"
|
||||
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)"
|
||||
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'==''">
|
||||
<Output ItemName="PackageAsset" TaskParameter="Include"/>
|
||||
</CreateItem>
|
||||
<CreateItem Include="$(OutDir)*.pdb"
|
||||
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)"
|
||||
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludePdbs)'!='true' and '@(PackagingAssemblyContent)'==''">
|
||||
<Output ItemName="PackageAsset" TaskParameter="Include"/>
|
||||
</CreateItem>
|
||||
<CreateItem Include="$(ReferenceAssemblyDir)*.dll"
|
||||
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\$(TargetFrameworkOrRuntimeIdentifier)"
|
||||
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludeRefAssemblies)'!='true'">
|
||||
<Output ItemName="PackageAsset" TaskParameter="Include"/>
|
||||
</CreateItem>
|
||||
|
||||
<CreateItem Include="$(OutDir)%(PackagingAssemblyContent.Identity)"
|
||||
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)"
|
||||
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'!=''">
|
||||
<Output ItemName="PackageAsset" TaskParameter="Include"/>
|
||||
</CreateItem>
|
||||
<!--
|
||||
$(XlfLanguages) is defined by XliffTasks.
|
||||
The conversion of .resx files to .xlf files, and the building of resource assemblies (.resources.dll) and
|
||||
culture-specific satellite assemblies (<culture>\*.resources.dll) are done immediately after Build, as part of
|
||||
CreateSatelliteAssemblies.
|
||||
|
||||
Include satellite assemblies into the package if $(XlfLanguages) is defined. They are included under a relative path
|
||||
that is the same as their respective culture identifier (for e.g., 'fr', 'zh-Hans' etc.)
|
||||
-->
|
||||
<ItemGroup Condition="'$(XlfLanguages)'!=''">
|
||||
<PackageAssetCultures Remove="$(PackageAssetCultures)" />
|
||||
<PackageAssetCultures Include="$(XlfLanguages)" />
|
||||
|
||||
<PackageAsset Include="$(OutDir)%(PackageAssetCultures.Identity)\*.dll" RelativePath="$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)\%(PackageAssetCultures.Identity)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!=''">
|
||||
|
||||
<!-- %(PackagingContent.SubFolder) not StartsWith 'root' -->
|
||||
<PackageAsset Condition="'%(PackagingContent.SubFolder)'!='' And !$([System.String]::Copy("%(PackagingContent.SubFolder)").StartsWith("root"))"
|
||||
Include="%(PackagingContent.Identity)"
|
||||
RelativePath="$(ArtifactsPackagingDir)$(NormalizedPackageName)\content\%(PackagingContent.SubFolder)"/>
|
||||
|
||||
<PackageAsset Condition="'%(PackagingContent.SubFolder)'==''"
|
||||
Include="%(PackagingContent.Identity)"
|
||||
RelativePath="$(ArtifactsPackagingDir)$(NormalizedPackageName)\content"/>
|
||||
|
||||
<!--
|
||||
%(PackagingContent.SubFolder) StartsWith 'root'
|
||||
Package content under sub-folder %(PackagingContent.SubFolder).TrimLeft('root')
|
||||
|
||||
Keep track of such sub-folders that exist immediately under root in a special ItemGroup - PackagingRootFolderSubFolders
|
||||
PackagingRootFolderSubFolders will be used later in CreateContentFolder
|
||||
|
||||
Implementation Note:
|
||||
SubFolder string looks like this: "root\subfolder1\subfolder2"
|
||||
%(SubFolder).SubString(4) ~= "\subfolder1\subfolder2"
|
||||
%(SubFolder).SubString(5) ~= "subfolder1\subfolder2"
|
||||
|
||||
When concatenating next to $(ArtifactsPackagingDir)$(PackageName),
|
||||
- use %(SubFolder).SubString(4)
|
||||
- do not insert a directory separator character (\) between them
|
||||
- this has the benefit of working seamlessly when %(SubFolder) == "root"
|
||||
|
||||
When SubFolder name must be extracted,
|
||||
- use %(SubFolder).SubString(5)
|
||||
- In GenerateNuspec target, we have special-case logic to deal with files directly under the root folder,
|
||||
so we only need to keep track of sub-folder names.
|
||||
-->
|
||||
<PackageAsset Condition="$([System.String]::Copy("%(PackagingContent.SubFolder)").StartsWith("root"))"
|
||||
Include="%(PackagingContent.Identity)"
|
||||
RelativePath="$(ArtifactsPackagingDir)$(NormalizedPackageName)$([System.String]::Copy('%(PackagingContent.SubFolder)').SubString(4))"/>
|
||||
|
||||
<PackagingRootFolderSubFolders Condition="$([System.String]::Copy("%(PackagingContent.SubFolder)").StartsWith("root\"))"
|
||||
Include="$([System.String]::Copy('%(PackagingContent.SubFolder)').SubString(5))">
|
||||
<PackageName>$(NormalizedPackageName)</PackageName>
|
||||
</PackagingRootFolderSubFolders>
|
||||
</ItemGroup>
|
||||
|
||||
<MakeDir Condition="!Exists('%(PackageAsset.RelativePath')" Directories="@(PackageAsset->'%(RelativePath)')" />
|
||||
<Copy Condition="(@(PackageAsset->Count()) > 0) And !Exists('%(PackageAsset.RelativePath)\%(PackageAsset.Filename)%(PackageAsset.Extension)')"
|
||||
SourceFiles="@(PackageAsset)"
|
||||
DestinationFolder="%(PackageAsset.RelativePath)" />
|
||||
</Target>
|
||||
|
||||
<!-- Target: CreateContentFolder -->
|
||||
<!-- Dynamically populates @(Content) for packaging -->
|
||||
<!--
|
||||
This target is only run for projects which specify $(IsPackable) = true
|
||||
By convention, NO WPF projects will specify $(IsPackable) = true
|
||||
WPF projects will opt into PreparePackageAssets target by specifying $(PackageName)
|
||||
Special packaging-only projects will be used to orchestrate the actual packaging
|
||||
|
||||
Also, if an "ArchNeutral" package sets $(IncludeAssembliesInArchNeutralPackage)=true,
|
||||
then it will include 'lib\**\*' files in it anyway.
|
||||
This can be combined with $(PlatformIndependentPackage)=true (which controls the generation
|
||||
of runtime.json file) to generate an AnyCPU Sdk package containing ref + lib assemblies alongwith
|
||||
all the props and targets.
|
||||
|
||||
The following properties are of interest to this target
|
||||
$(PackageName): The name of the package
|
||||
$(PackageVersion): The package version
|
||||
$(Authors): Authors
|
||||
$(PackageDescription): Description
|
||||
$(TargetCulture): culture/language of the build. If not specified (or '*'), then $(NeutralLanguage) will be used instead
|
||||
$(RepositoryUrl): Repo Url
|
||||
$(PackageRequireLicenseAcceptance): true/false indicating whether license file acceptance is required
|
||||
$(MsBuildSdkPackage): true/false indicating whether the nupkg is an MSBuild SDK package. When set to true, the nuspec produces
|
||||
additional content indicating that the package is an Sdk.
|
||||
|
||||
We expect to find $(DefaultPackageLicenseFile) (typically defined as 'LICENSE.TXT' in nupkg\Directory.Build.props) at the
|
||||
root of the packaging content folder . If a $(DefaultPackageLicenseFile) file is not found, we will fallback to
|
||||
$(PackageLicenseExpression) license (typically defined as 'MIT')
|
||||
|
||||
When building a nupkg for a bait-and-switch package ($(CreateArchNeutralPackage)==true), the following changes are
|
||||
made:
|
||||
Package name : A RID is not prefixed onto the package name
|
||||
Files - : Only ref\ and root-level content files are included
|
||||
|
||||
Microsoft.DotNet.Arcade.Sdk\tools\WorkArounds.targets - InitializeStandardNuspecProperties populates $(_CommonMetadataElements)
|
||||
with the following metadata information:
|
||||
id
|
||||
description
|
||||
version
|
||||
authors
|
||||
requireLicenseAcceptance
|
||||
license type=
|
||||
projectUrl
|
||||
copyright
|
||||
developmentDependency
|
||||
serviceable
|
||||
repository type= url= commit=
|
||||
In effect, it provides us with all the relevant package metadata we need. We can simply reuse that
|
||||
information here within <metadata>
|
||||
-->
|
||||
<Target Condition="'$(PackageName)'!='' and '$(IsPackable)'=='true'"
|
||||
Name="CreateContentFolder">
|
||||
<!-- Use $(TargetCulture) or fallback to $(NeutralLanguage) -->
|
||||
<PropertyGroup>
|
||||
<BuildCulture Condition="'$(TargetCulture)'!='' and '$(TargetCulture)'!='*'">$(TargetCulture)</BuildCulture>
|
||||
<BuildCulture Condition="'$(BuildCulture)'==''">$(NeutralLanguage)</BuildCulture>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Used to test whether there are any files immediately under $(ArtifactsPackagingDir)$(PackageName) -->
|
||||
<!-- ('@(RootFolderContents)'=='') would be False when there are files available to be packed -->
|
||||
<ItemGroup>
|
||||
<RootFolderContents Remove="@(RootFolderContents)" />
|
||||
<RootFolderContents Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\*.*"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\**\*.dll"
|
||||
Condition="('$(CreateArchNeutralPackage)'!='true' Or '$(IncludeAssembliesInArchNeutralPackage)'== 'true') and Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\')" >
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>$(LibFolder)</PackagePath>
|
||||
</Content>
|
||||
|
||||
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\**\*.exe"
|
||||
Condition="('$(CreateArchNeutralPackage)'!='true' Or '$(IncludeAssembliesInArchNeutralPackage)'== 'true') and Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\')" >
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>$(LibFolder)</PackagePath>
|
||||
</Content>
|
||||
|
||||
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\**\*.pdb"
|
||||
Condition="('$(CreateArchNeutralPackage)'!='true' Or '$(IncludeAssembliesInArchNeutralPackage)'== 'true') and Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\')" >
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>$(LibFolder)</PackagePath>
|
||||
</Content>
|
||||
|
||||
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\**\*.dll"
|
||||
Condition="Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\')">
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>ref</PackagePath>
|
||||
</Content>
|
||||
|
||||
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\content\**\*.*"
|
||||
Condition="('$(CreateArchNeutralPackage)'!='true' Or '$(IncludeAssembliesInArchNeutralPackage)'== 'true') and Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\content\')" >
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>content</PackagePath>
|
||||
</Content>
|
||||
|
||||
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\*.*"
|
||||
Exclude="$(ArtifactsPackagingDir)$(NormalizedPackageName)\runtime.json"
|
||||
Condition="'$(CreateArchNeutralPackage)'!='true' and '@(RootFolderContents)'!=''" >
|
||||
<Pack>true</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</Content>
|
||||
|
||||
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\*.*"
|
||||
Condition="'$(CreateArchNeutralPackage)'=='true' and '@(RootFolderContents)'!=''" >
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>.</PackagePath>
|
||||
</Content>
|
||||
|
||||
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\%(PackagingRootFolderSubFolders.Identity)\*.*"
|
||||
Condition="'@(PackagingRootFolderSubFolders)'!=''">
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>%(PackagingRootFolderSubFolders.Identity)</PackagePath>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
We can't reliably insert CreatecontentFolder
|
||||
at the head of GenerateNuspecDependsOn during
|
||||
static imports of props/targets, so we do it
|
||||
dynamically from within a target
|
||||
-->
|
||||
<Target Name="EnsureCreateContentFolderRunsBeforeNuspecDependsOn">
|
||||
<PropertyGroup>
|
||||
<GenerateNuspecDependsOn>
|
||||
CreateContentFolder;
|
||||
$(GenerateNuspecDependsOn)
|
||||
</GenerateNuspecDependsOn>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<!-- Create version.txt containing latest commit ID -->
|
||||
<Target Name="GenerateVersionFileWithRepositoryCommit"
|
||||
Condition="'$(RepositoryCommit)'!='' and '$(IsPackable)'=='true' and '$(CreateArchNeutralPackage)'=='true' and !Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\version.txt')"
|
||||
BeforeTargets="CreateContentFolder"
|
||||
Outputs="$(ArtifactsPackagingDir)$(NormalizedPackageName)\version.txt">
|
||||
<ItemGroup>
|
||||
<RepoCommitVersionFileLines Remove="@(RepoCommitVersionFileLines)" />
|
||||
<RepoCommitVersionFileLines Include="$(RepositoryCommit)" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RepoCommitVersionFileDir>$(ArtifactsPackagingDir)$(NormalizedPackageName)\</RepoCommitVersionFileDir>
|
||||
<RepoCommitVersionFile>$(RepoCommitVersionFileDir)version.txt</RepoCommitVersionFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<MakeDir Condition="!Exists('$(RepoCommitVersionFileDir)')" Directories="$(RepoCommitVersionFileDir)" />
|
||||
<WriteLinesToFile Lines="@(RepoCommitVersionFileLines)" File="$(RepoCommitVersionFile)"/>
|
||||
</Target>
|
||||
|
||||
<!-- Generate runtime.json for embedding in the arch-neutral package that uses the Bait & Switch technique -->
|
||||
<Target Name="GenerateRuntimeJson"
|
||||
Condition="'$(IsPackable)'=='true' and '$(CreateArchNeutralPackage)'=='true' and '$(PlatformIndependentPackage)'!='true'"
|
||||
BeforeTargets="CreateContentFolder"
|
||||
Outputs="$(ArtifactsPackagingDir)$(NormalizedPackageName)\runtime.json">
|
||||
|
||||
<ItemGroup>
|
||||
<RuntimeJsonLine Remove="@(RuntimeJsonLine)" />
|
||||
<RuntimeJsonLine Include="Json">
|
||||
<Text>
|
||||
<![CDATA[{
|
||||
"runtimes": {
|
||||
"win-x64": {
|
||||
"$(NormalizedPackageName)": {
|
||||
"runtime.win-x64.$(PackageName)": "$(PackageVersion)"
|
||||
}
|
||||
},
|
||||
"win-x86": {
|
||||
"$(NormalizedPackageName)": {
|
||||
"runtime.win-x86.$(PackageName)": "$(PackageVersion)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></Text>
|
||||
</RuntimeJsonLine>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<RuntimeJson Remove="@(RuntimeJson)" />
|
||||
<RuntimeJson Include="@(RuntimeJsonLine->'%(Text)')" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<RuntimeJsonFileDir>$(ArtifactsPackagingDir)$(NormalizedPackageName)\</RuntimeJsonFileDir>
|
||||
<RuntimeJsonFile>$(RuntimeJsonFileDir)runtime.json</RuntimeJsonFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<MakeDir Condition="!Exists('$(ArtifactsPackagingDir)')" Directories="$(ArtifactsPackagingDir)" />
|
||||
<Delete Condition="Exists('$(RuntimeJsonFile)')" Files="$(RuntimeJsonFile)" />
|
||||
<WriteLinesToFile Lines="@(RuntimeJson)" File="$(RuntimeJsonFile)"/>
|
||||
</Target>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,11 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<PbtTfm Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp2.1</PbtTfm>
|
||||
<PbtTfm Condition="'$(MSBuildRuntimeType)'!='Core'">net472</PbtTfm>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PbtDir>$(ArtifactsTmpDir)PresentationBuildTasks\$(PbtTfm)\</PbtDir>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,78 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
This should be defined before Microsoft.WinFx.targets in imported.
|
||||
It's OK if there is no DLL realized at this location - we just need to have the property define.
|
||||
|
||||
It is also OK for a DLL to NOT exist at the time <UsingTask> is encountered against this assembly path.
|
||||
We must ensure that an actual DLL exists at this location prior to the very first execution of a Task from within this assembly.
|
||||
-->
|
||||
<_PresentationBuildTasksAssembly Condition="'$(InternalMarkupCompilation)'=='true'">$(PbtDir)PresentationBuildTasks.dll</_PresentationBuildTasksAssembly>
|
||||
</PropertyGroup>
|
||||
<!--
|
||||
Internal PBT compilation requires that we use <NetCoreReference>
|
||||
This is so that the copy of ref\WindowsBase.dll inherited from Microsoft.NetCore.App
|
||||
does not make its way through to markup-compilation.
|
||||
|
||||
In addition to this, our codebase requires that all references to Microsoft.NetCore.App
|
||||
be explicitly enumerated through the use of <NetCoreReference> to avoid inadvertent additions
|
||||
to assembly references during code-changes.
|
||||
-->
|
||||
<ItemGroup Condition="'$(InternalMarkupCompilation)'=='true'">
|
||||
<NetCoreReference Include="mscorlib" />
|
||||
<NetCoreReference Include="System.Runtime" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(InternalMarkupCompilation)'=='true'">
|
||||
<PrepareResourceNamesDependsOn>
|
||||
$(PrepareResourceNamesDependsOn);
|
||||
EnsurePbtPath
|
||||
</PrepareResourceNamesDependsOn>
|
||||
|
||||
<MarkupCompilePass1DependsOn>
|
||||
$(MarkupCompilePass1DependsOn);
|
||||
EnsurePbtPath
|
||||
</MarkupCompilePass1DependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
This target ensures that
|
||||
(a) PresentationBuildTasks.dll is built locally
|
||||
(b) The TFM of the assembly matches the build toolset currently being used (netcore vs netframework)
|
||||
(c) The assembly is placed at $(_PresentationBuildTasksAssembly)
|
||||
(d) This is all done prior to the first ever use of a task from within this assembly by Microsoft.WinFx.targets
|
||||
-->
|
||||
<Target Name="EnsurePbtPath"
|
||||
Condition="'$(InternalMarkupCompilation)'=='true'"
|
||||
DependsOnTargets="$(EnsurePbtPathDependsOn)"
|
||||
BeforeTargets="ResolveProjectReferences">
|
||||
<MakeDir Condition="!Exists('$(PbtDir)')"
|
||||
Directories="$(PbtDir)" />
|
||||
|
||||
<MSBuild Projects="$(WpfSourceDir)PresentationBuildTasks\PresentationBuildTasks.csproj"
|
||||
Condition="!Exists('$(_PresentationBuildTasksAssembly)')"
|
||||
Properties="CopyTransitiveReferences=true;PublishDir=$(PbtDir);TargetFramework=$(PbtTfm);Platform=AnyCPU"
|
||||
Targets="Clean;Build;Publish" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PreventResourcesSourceGenerationForPbtGeneratedResource"
|
||||
AfterTargets="MainResourcesGeneration"
|
||||
Condition="'$(InternalMarkupCompilation)'=='true'">
|
||||
<!--
|
||||
Add the following metadata to $(IntermediateOutputPath)$(_ResourceNameInMainAssembly) within @(EmbeddedResource)
|
||||
<XlfInput>false</XlfInput>
|
||||
<GenerateSource>false</GenerateSource
|
||||
|
||||
This ensures that PBT generated resources are not inadvertently picked up by Xlf source generator.
|
||||
-->
|
||||
<ItemGroup Condition="'$(_ResourceNameInMainAssembly)'!=''">
|
||||
<EmbeddedResource Condition="'%(EmbeddedResource.Identity)'=='$(IntermediateOutputPath)$(_ResourceNameInMainAssembly)'">
|
||||
<XlfInput>false</XlfInput>
|
||||
<GenerateSource>false</GenerateSource>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Import Project="$(WpfSourceDir)PresentationBuildTasks\Microsoft.WinFX.targets"
|
||||
Condition="'$(InternalMarkupCompilation)'=='true'"/>
|
||||
</Project>
|
|
@ -0,0 +1,21 @@
|
|||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<CopyTransitiveReferences>false</CopyTransitiveReferences>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<DisableTransitiveProjectReferences Condition="'$(DisableTransitiveProjectReferences)'==''">true</DisableTransitiveProjectReferences>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
Private = False
|
||||
Build against the reference, but do not copy it to the output directory
|
||||
-->
|
||||
<ItemDefinitionGroup Condition="'$(IsShipping)'=='true' and '$(CopyTransitiveReferences)'=='false'">
|
||||
<ProjectReference>
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,15 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<PrepareForRunDependsOn>
|
||||
ClearReferenceCopyLocalPaths;
|
||||
$(PrepareForRunDependsOn)
|
||||
</PrepareForRunDependsOn>
|
||||
</PropertyGroup>
|
||||
<Target Name="ClearReferenceCopyLocalPaths"
|
||||
Returns="@(ReferenceCopyLocalPaths)"
|
||||
Condition="'$(CopyLocalLockFileAssemblies)'!='true'">
|
||||
<ItemGroup>
|
||||
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,15 @@
|
|||
<Project>
|
||||
<!--
|
||||
Properties used with redist binaries
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<VCRuntimeDllBaseName>vcruntime</VCRuntimeDllBaseName>
|
||||
<VCRuntimeVersion>140</VCRuntimeVersion>
|
||||
|
||||
<MSVCPDllBaseName>msvcp</MSVCPDllBaseName>
|
||||
<MSVCPVersion>140</MSVCPVersion>
|
||||
|
||||
<D3DCompilerDllBaseName>D3DCompiler</D3DCompilerDllBaseName>
|
||||
<D3DCompilerVersion>_47</D3DCompilerVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,28 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<PreparePackageAssetsDependsOn Condition="'$(IsRedistProject)'=='true'">
|
||||
$(PreparePackageAssetsDependsOn);
|
||||
CopyRedistFile
|
||||
</PreparePackageAssetsDependsOn>
|
||||
</PropertyGroup>
|
||||
<!--
|
||||
Target used by projects under \src\Microsoft.DotNet.Wpf\redist\
|
||||
-->
|
||||
<Target Name="CopyRedistFile"
|
||||
AfterTargets="Build"
|
||||
Returns="$(TargetPath);@(AdditionalRedistFile->'%(Destination)')"
|
||||
Condition="'$(IsRedistProject)'=='true'">
|
||||
|
||||
<Error Condition="!Exists($(RedistSourcePath))"
|
||||
Text="RedistSourcePath='$(RedistSourcePath)' is not defined or it doesn't exist- cannot copy redistributable file to '$(TargetPath)'" />
|
||||
|
||||
<Delete Condition="Exists('$(TargetPath)')" Files="$(TargetPath)" />
|
||||
<Copy SourceFiles="$(RedistSourcePath)"
|
||||
DestinationFiles="$(TargetPath)" />
|
||||
|
||||
<Delete Condition="Exists('%(AdditionalRedistFile.Destination)')"
|
||||
Files="%(AdditionalRedistFile.Destination)" />
|
||||
<Copy SourceFiles="@(AdditionalRedistFile)"
|
||||
DestinationFolder="%(AdditionalRedistFile.Destination)" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
|
||||
<ArtifactsReferenceAssemblyDir Condition="'$(ArtifactsReferenceAssemblyDir)'==''">$(ArtifactsDir)ref\</ArtifactsReferenceAssemblyDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(IsShipping)'!='false' and '$(IsPackagingProject)'!='true' and '$(IsRedistProject)'!='true'">
|
||||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,46 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<CoreBuildDependsOn>
|
||||
EnsureReferenceDestination;
|
||||
$(CoreBuildDependsOn)
|
||||
</CoreBuildDependsOn>
|
||||
<ResolveReferencesDependsOn>
|
||||
EnsureReferenceDestination;
|
||||
$(ResolveReferencesDependsOn)
|
||||
</ResolveReferencesDependsOn>
|
||||
</PropertyGroup>
|
||||
<Target Name="EnsureReferenceDestination" >
|
||||
<!-- Create and export properties used in Reference assembly generation -->
|
||||
<!-- -->
|
||||
<!-- $(ArtifactsReferenceAssemblyDir) = $(ArtifactsDir)ref\ -->
|
||||
<!-- $(BaseReferenceAssemblyDir) = $(ArtifactsReferenceAssemblyDir)$(AssemblyName)\ -->
|
||||
<!-- $(ReferenceAssemblyDir) = $(BaseReferenceAssemblyDir)$(Configuration)$(TargetFramework)\ -->
|
||||
<!-- -->
|
||||
<!-- $(TargetRefPath) = $(ReferenceAssemblyDir)\<AssemblyName> -->
|
||||
<CreateProperty Condition="'$(ArtifactsReferenceAssemblyDir)'==''" Value="$(ArtifactsDir)ref\">
|
||||
<Output PropertyName="ArtifactsReferenceAssemblyDir" TaskParameter="Value"/>
|
||||
</CreateProperty>
|
||||
|
||||
<CreateProperty Condition="'$(BaseReferenceAssemblyDir)'==''" Value="$(ArtifactsReferenceAssemblyDir)$(AssemblyName)\">
|
||||
<Output PropertyName="BaseReferenceAssemblyDir" TaskParameter="Value"/>
|
||||
</CreateProperty>
|
||||
|
||||
<CreateProperty Condition="'$(ReferenceAssemblyDir)'==''" Value="$(BaseReferenceAssemblyDir)$(Configuration)\$(TargetFramework)\">
|
||||
<Output PropertyName="ReferenceAssemblyDir" TaskParameter="Value"/>
|
||||
</CreateProperty>
|
||||
|
||||
<MakeDir Condition="'$(ProduceReferenceAssembly)'=='true' and !Exists('$(ReferenceAssemblyDir)')" Directories="$(ReferenceAssemblyDir)" />
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Conditioning this on '$(ProduceReferenceAssembly)'=='true' ensures that the next <Error> task will never trigger when -->
|
||||
<!-- reference-assembly generation is not requested -->
|
||||
<RefAssemblies Condition="'$(ProduceReferenceAssembly)'=='true'" Include="@(IntermediateRefAssembly->'$(ReferenceAssemblyDir)%(Filename)%(Extension)')" />
|
||||
</ItemGroup>
|
||||
|
||||
<Error Condition="@(RefAssemblies->Count()) > 1" Text="More than one reference assembly is produced at the same time!" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetRefPath>@(RefAssemblies)</TargetRefPath>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,20 @@
|
|||
<Project>
|
||||
<!--
|
||||
C++ linker is not good at trucking along reousrces from a library all the way to a DLL
|
||||
In order to do this, we have to explicitly include compiled .res files as an input to the linker
|
||||
This target is a helper that to assist with this workaround
|
||||
Incorporate the res files like this:
|
||||
<AdditionalLinkerInputs Include="resource.res" />
|
||||
When "IncorporateAdditionalLinkerInputs" target runs, it will ensure that all resources mentioned in @(AdditionalLinkerInputs)
|
||||
are included when the final DLL is linked.
|
||||
-->
|
||||
<Target Name="IncorporateAdditionalLinkerInputs" BeforeTargets="GetResolvedLinkLibs" Condition="'@(AdditionalLinkerInputs)'!=''">
|
||||
<ItemGroup>
|
||||
<LibFullPath Include="@(AdditionalLinkerInputs)">
|
||||
<ProjectType>$(ConfigurationType)</ProjectType>
|
||||
<FileType>lib</FileType>
|
||||
<ResolveableAssembly>false</ResolveableAssembly>
|
||||
</LibFullPath>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,139 @@
|
|||
<Project>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="$(MicrosoftPrivateWinformsPackage)"
|
||||
Version="$(MicrosoftPrivateWinformsVersion)"
|
||||
ExcludeAssets="All"
|
||||
GeneratePathProperty="True"
|
||||
Condition="'$(MSBuildProjectExtension)'!='.vcxproj' And $(TargetFramework.StartsWith('netcoreapp3')) And '$(NoAutoMicrosoftPrivateWinformsReference)'!='true'"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Target
|
||||
Name="LimitNetCoreAppReferences"
|
||||
AfterTargets="ResolveAssemblyReferences"
|
||||
Returns="@(ReferencePath)"
|
||||
Condition="'@(NetCoreReference)'!='' and '@(ReferencePath)' != ''">
|
||||
|
||||
|
||||
<!--
|
||||
Example
|
||||
<NetCoreReference Include="Microsoft.CSharp" />
|
||||
-->
|
||||
|
||||
<!-- Save Microsoft.NETCore.App assemblies, and remove those from @(ReferencePath) -->
|
||||
<ItemGroup>
|
||||
<_netCoreAppSdkReference Remove="@(_netCoreAppSdkReference)" />
|
||||
<_netCoreAppSdkReference Include="@(ReferencePath)" Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.NETCore.App'"/>
|
||||
|
||||
<ReferencePath Remove="@(_netCoreAppSdkReference)" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Transform _netCoreAppSdkReference's Identity to its FileName. This will help us do a Remove against @(NetCoreReference) directly -->
|
||||
<ItemGroup>
|
||||
<_netCoreAppSdkUnwantedRefNormalized Remove="@(_netCoreAppSdkUnwantedRefNormalized)" />
|
||||
<_netCoreAppSdkUnwantedRefNormalized Include="@(_netCoreAppSdkReference->'%(FileName)')" />
|
||||
<_netCoreAppSdkUnwantedRefNormalized Remove="@(NetCoreReference)" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Convert the Identity metadata of _netCoreAppSdkUnwantedRefNormalized back to it's Original value -->
|
||||
<ItemGroup>
|
||||
<_netCoreAppSdkUnwantedRef Remove="@(_netCoreAppSdkUnwantedRef)" />
|
||||
<_netCoreAppSdkUnwantedRef Include="@(_netCoreAppSdkUnwantedRefNormalized->'%(OriginalItemSpec)')" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Reconstruct ReferencePath, but this time exclude the unwanted references out -->
|
||||
<ItemGroup>
|
||||
<ReferencePath
|
||||
Include="@(_netCoreAppSdkReference)"
|
||||
Exclude="@(_netCoreAppSdkUnwantedRef)"/>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target
|
||||
Name="LimitWindowsDekstopAppReferences"
|
||||
AfterTargets="ResolveAssemblyReferences"
|
||||
Returns="@(ReferencePath)"
|
||||
Condition="'@(WindowsDesktopReference)'!='' and '@(ReferencePath)' != ''">
|
||||
<!--
|
||||
Example
|
||||
<WindowsDesktopReference Include="PresentationCore" />
|
||||
-->
|
||||
|
||||
<!-- Save Microsoft.WindowsDesktop.App assemblies, and remove those from @(ReferencePath) -->
|
||||
<ItemGroup>
|
||||
<_windowsDesktopAppSdkReference Remove="@(_windowsDesktopAppSdkReference)" />
|
||||
<_windowsDesktopAppSdkReference Include="@(ReferencePath)" Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.WindowsDesktop.App'"/>
|
||||
|
||||
<ReferencePath Remove="@(_windowsDesktopAppSdkReference)" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Transform _windowsDesktopAppSdkReference's Identity to its FileName. This will help us do a Remove against @(NetCoreReference) directly -->
|
||||
<ItemGroup>
|
||||
<_windowsDesktopAppSdkUnwantedRefNormalized Remove="@(_windowsDesktopAppSdkUnwantedRefNormalized)" />
|
||||
<_windowsDesktopAppSdkUnwantedRefNormalized Include="@(_windowsDesktopAppSdkReference->'%(FileName)')" />
|
||||
<_windowsDesktopAppSdkUnwantedRefNormalized Remove="@(WindowsDesktopReference)" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Convert the Identity metadata of _windowsDesktopAppSdkUnwantedRefNormalized back to it's Original value -->
|
||||
<ItemGroup>
|
||||
<_windowsDesktopAppSdkUnwantedRef Remove="@(_windowsDesktopAppSdkUnwantedRef)" />
|
||||
<_windowsDesktopAppSdkUnwantedRef Include="@(_windowsDesktopAppSdkUnwantedRefNormalized->'%(OriginalItemSpec)')" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Reconstruct ReferencePath, but this time exclude the unwanted references out -->
|
||||
<ItemGroup>
|
||||
<ReferencePath
|
||||
Include="@(_windowsDesktopAppSdkReference)"
|
||||
Exclude="@(_windowsDesktopAppSdkUnwantedRef)"/>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyReferencesDependsOn>
|
||||
ResolveMicrosoftDotNetWpfGitHubReferences;
|
||||
ResolveWinFormsReferences;
|
||||
$(ResolveAssemblyReferencesDependsOn)
|
||||
</ResolveAssemblyReferencesDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target
|
||||
Name="ResolveMicrosoftDotNetWpfGitHubReferences"
|
||||
Returns="@(ReferencePath)"
|
||||
Condition="'@(MicrosoftDotNetWpfGitHubReference)'!='' and $(TargetFramework.StartsWith('netcoreapp3')) and '$(DoNotLimitMicrosoftDotNetWpfGitHubReferences)'!='true'">
|
||||
<!--
|
||||
In your project, Add a references to WPF GitHub transport package like this:
|
||||
<ItemGroup>
|
||||
<MicrosoftDotNetWpfGitHubReference Include="System.Xaml" />
|
||||
</ItemGroup>
|
||||
|
||||
It will get translated into something like this:
|
||||
<ItemGroup>
|
||||
<Reference Include="C:\Users\username\.nuget\packages\microsoft.dotnet.wpf.github\4.8.0-preview4.19174.2\ref\netcoreapp3.0\System.Xaml.dll" />
|
||||
</ItemGroup>
|
||||
-->
|
||||
<ItemGroup>
|
||||
<Reference Include="$(PkgMicrosoft_DotNet_Wpf_GitHub)\ref\$(TargetFramework)\%(MicrosoftDotNetWpfGitHubReference.Identity).dll"
|
||||
Condition="Exists('$(PkgMicrosoft_DotNet_Wpf_GitHub)\ref\$(TargetFramework)\%(MicrosoftDotNetWpfGitHubReference.Identity).dll')"/>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
|
||||
<!--
|
||||
In your project, Add a references to WinForms transport package like this:
|
||||
<ItemGroup>
|
||||
<MicrosoftPrivateWinFormsReference Include="Accessbility" />
|
||||
</ItemGroup>
|
||||
|
||||
It will get translated into something like this:
|
||||
<ItemGroup>
|
||||
<Reference Include="C:\Users\username\.nuget\packages\microsoft.private.winforms\4.8.0-preview4.19170.4\lib\netcoreapp3.0\Accessibility.dll" />
|
||||
</ItemGroup>
|
||||
-->
|
||||
<Target Name="ResolveWinFormsReferences"
|
||||
Condition="'@(MicrosoftPrivateWinFormsReference)'!='' And $(TargetFramework.StartsWith('netcoreapp3'))">
|
||||
<ItemGroup>
|
||||
<Reference Include="$(PkgMicrosoft_Private_Winforms)\ref\$(TargetFramework)\%(MicrosoftPrivateWinFormsReference.Identity).dll"
|
||||
Condition="Exists('$(PkgMicrosoft_Private_Winforms)\ref\$(TargetFramework)\%(MicrosoftPrivateWinFormsReference.Identity).dll')"/>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,75 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<ExternalShippingProjects>
|
||||
System.Xaml
|
||||
</ExternalShippingProjects>
|
||||
|
||||
<InternalShippingProjects>
|
||||
PresentationBuildTasks;
|
||||
PresentationCore;
|
||||
DirectWriteForwarder;
|
||||
PresentationCore-CommonResources;
|
||||
PresentationFramework;
|
||||
PresentationFramework-SystemCore;
|
||||
PresentationFramework-SystemData;
|
||||
PresentationFramework-SystemDrawing;
|
||||
PresentationFramework-SystemXml;
|
||||
PresentationFramework-SystemXmlLinq;
|
||||
PresentationUI;
|
||||
ReachFramework;
|
||||
System.Printing;
|
||||
System.Windows.Controls.Ribbon;
|
||||
System.Windows.Input.Manipulations;
|
||||
System.Windows.Presentation;
|
||||
PresentationFramework.Aero;
|
||||
PresentationFramework.Aero2;
|
||||
PresentationFramework.AeroLite;
|
||||
PresentationFramework.Classic;
|
||||
PresentationFramework.Luna;
|
||||
PresentationFramework.Royale;
|
||||
UIAutomationClient;
|
||||
UIAutomationClientSideProviders;
|
||||
UIAutomationProvider;
|
||||
UIAutomationTypes;
|
||||
WindowsBase;
|
||||
WindowsFormsIntegration;
|
||||
PenImc;
|
||||
PresentationNative;
|
||||
WpfGfx;
|
||||
D3DCompiler;
|
||||
VCRuntime
|
||||
</InternalShippingProjects>
|
||||
|
||||
<ShippingProjects>
|
||||
$(ExternalShippingProjects);
|
||||
$(InternalShippingProjects)
|
||||
</ShippingProjects>
|
||||
|
||||
<ExcludeFromXlfLocalization>
|
||||
PresentationBuildTasks;
|
||||
D3DCompiler;
|
||||
VCRuntime
|
||||
</ExcludeFromXlfLocalization>
|
||||
|
||||
<WindowsDesktopSdkProject>
|
||||
PresentationBuildTasks
|
||||
</WindowsDesktopSdkProject>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IsShipping>false</IsShipping>
|
||||
<IsShipping Condition="$(ShippingProjects.Contains('$(MSBuildProjectName)'))">true</IsShipping>
|
||||
<IsShipping Condition="'$(IsPackagingProject)'=='true'">true</IsShipping>
|
||||
|
||||
<EnableXlfLocalization>false</EnableXlfLocalization>
|
||||
<EnableXlfLocalization Condition="'$(IsShipping)'=='true' And !$(ExcludeFromXlfLocalization.Contains('$(MSBuildProjectName)'))">true</EnableXlfLocalization>
|
||||
|
||||
<RepoLocation Condition="$(InternalShippingProjects.Contains('$(MSBuildProjectName)'))">Internal</RepoLocation>
|
||||
<RepoLocation Condition="$(ExternalShippingProjects.Contains('$(MSBuildProjectName)'))">External</RepoLocation>
|
||||
|
||||
<!-- WindowsDesktopSdk overrides Internal, External etc. -->
|
||||
<RepoLocation Condition="$(WindowsDesktopSdkProject.Contains('$(MSBuildProjectName)'))">WindowsDesktopSdk</RepoLocation>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,8 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<LibFolder Condition="'$(PackageName)'=='$(WindowsDesktopSdkPackageName)'">tools</LibFolder>
|
||||
<ExcludeRefAssemblies Condition="'$(PackageName)'=='$(WindowsDesktopSdkPackageName)'">true</ExcludeRefAssemblies>
|
||||
<ExcludePdbs Condition="'$(PackageName)'=='$(WindowsDesktopSdkPackageName)'">true</ExcludePdbs>
|
||||
<IncludeAssembliesInArchNeutralPackage Condition="'$(PackageName)'=='$(WindowsDesktopSdkPackageName)'">true</IncludeAssembliesInArchNeutralPackage>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,5 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<DefineConstants Condition="$(TargetFramework.StartsWith('net4'))">$(DefineConstants);NETFX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,5 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<WpfVersionSuffix>_cor3</WpfVersionSuffix>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,329 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
|
||||
<!-- v142 = Visual Studio 2019 -->
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
|
||||
<!-- 17134 is Windows 10 v1803 (RS4) SDK -->
|
||||
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
|
||||
|
||||
<ConfigurationType Condition="'$(ConfigurationType)'==''">DynamicLibrary</ConfigurationType>
|
||||
|
||||
<!-- Windows 10 installation location is often not reliably set in msbuild -->
|
||||
<Windows10SdkPath Condition="Exists('$(WindowsSdkDir_10)')">$(WindowsSdkDir_10)</Windows10SdkPath>
|
||||
<Windows10SdkPath Condition="'$(Windows10SdkPath'=='' and Exists('$(WindowsSdkDir)')">$(WindowsSdkDir)</Windows10SdkPath>
|
||||
<Windows10SdkPath Condition="'$(Windows10SdkPath)'==''">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots@KitsRoot10)</Windows10SdkPath>
|
||||
|
||||
<Architecture Condition="'$(Platform)'=='x64' or '$(Platform)'=='x86' or '$(Platform)'=='arm' or '$(Platform)'=='arm64'">$(Platform)</Architecture>
|
||||
<Architecture Condition="'$(Platform)'=='Win32'">x86</Architecture>
|
||||
<Architecture Condition="'$(Architecture)'==''">x64</Architecture>
|
||||
|
||||
<TraceWpp>$(Windows10SdkPath)bin\$(WindowsTargetPlatformVersion)\$(Architecture)\tracewpp.exe</TraceWpp>
|
||||
|
||||
<GenerateAssemblyInfo>$(ManagedCxx)</GenerateAssemblyInfo>
|
||||
<BuildProjectReferences>true</BuildProjectReferences>
|
||||
|
||||
<WinNt Condition="'$(WinNt)' == ''">1</WinNt>
|
||||
<!-- Win32Ie = _WIN32_IE_IE70 (0x0700) -->
|
||||
<Win32Ie Condition="'$(Win32Ie)' == ''">0x0700</Win32Ie>
|
||||
<!-- Win32WinNt = _WIN32_WINNT_WIN10 (0x0A00) -->
|
||||
<Win32WinNt Condition="'$(Win32WinNt)' == ''">0x0A00</Win32WinNt>
|
||||
<!-- NtddiVersion = NTDDI_WIN10_RS4 (0x0A000005)-->
|
||||
<NtddiVersion Condition="'$(NtddiVersion)'==''">0x0A000005</NtddiVersion>
|
||||
<!-- WinVer = WINVER -->
|
||||
<WinVer Condition="'$(WinVer)'==''">$(Win32WinNt)</WinVer>
|
||||
|
||||
<!-- Enables Spectre Mitigations -->
|
||||
<!-- Optional - for future use -->
|
||||
<!-- <SpectreMitigation>Spectre</SpectreMitigation> -->
|
||||
|
||||
<WppConfigDir>$(MsBuildThisFileDirectory)WppConfig\</WppConfigDir>
|
||||
|
||||
<CopyBuildOutputToOutputDirectory Condition="'$(Configuration)'=='StaticLibrary'">false</CopyBuildOutputToOutputDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ManagedCxx Condition="'$(CLRSupport)'!='true'">false</ManagedCxx>
|
||||
<ManagedCxx Condition="'$(CLRSupport)'=='true'">true</ManagedCxx>
|
||||
<ManagedCxx Condition="'$(CLRSupport)'=='pure'">true</ManagedCxx>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(ManagedCxx)' == 'true'">
|
||||
<!-- This is usually set by the Microsoft.NETFramework.CurrentVersion.props file,
|
||||
but, since we don't include that for C++\CLI builds, we need to do it here. -->
|
||||
<TargetFrameworkSDKToolsDirectory Condition="'$(TargetFrameworkSDKToolsDirectory)' == ''">$(SDK40ToolsPath)</TargetFrameworkSDKToolsDirectory>
|
||||
<TargetFrameworkSDKToolsDirectory Condition="'$(Platform)' == 'x64'">$(TargetFrameworkSDKToolsDirectory)$(Platform)\</TargetFrameworkSDKToolsDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(ManagedCxx)'=='true'">false</LinkIncremental>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(ManagedCxx)'=='true'">
|
||||
<!-- Works around a bug in the C++ compiler where we get the error
|
||||
'System::ReadOnlySpan::default': could not import member. -->
|
||||
<ManagedCxxSuppressions>$(ManagedCxxSuppressions);4679</ManagedCxxSuppressions>
|
||||
<!-- Type referenced was expected in unreferenced assembly 'NETCore-Assembly',
|
||||
type defined in current translation unit used instead. -->
|
||||
<ManagedCxxSuppressions>$(ManagedCxxSuppressions);4691</ManagedCxxSuppressions>
|
||||
<!-- It applies to PrivateImplementationDetails, which is not something WPF generates
|
||||
but is conflicting in ReachFramework and PresentationCoreCSharp. This is safe to
|
||||
suppress as we don't directly use this type. -->
|
||||
<ManagedCxxSuppressions>$(ManagedCxxSuppressions);4945</ManagedCxxSuppressions>
|
||||
<!-- Type marked as obsolete. -->
|
||||
<ManagedCxxSuppressions>$(ManagedCxxSuppressions);4947</ManagedCxxSuppressions>
|
||||
<!-- Type marked as #pragma deprecated. -->
|
||||
<ManagedCxxSuppressions>$(ManagedCxxSuppressions);4995</ManagedCxxSuppressions>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<UsePrivateFrontEnd Condition="'$(UsePrivateFrontEnd)'==''">true</UsePrivateFrontEnd>
|
||||
<!-- Also update in global.json -->
|
||||
<MsvcurtC1xxVersion>0.0.0.3</MsvcurtC1xxVersion>
|
||||
<MsvcurtC1xxToolsPath>$(RepoRoot).tools\native\bin\msvcurt-c1xx\$(MsvcurtC1xxVersion)\$(Architecture)\</MsvcurtC1xxToolsPath>
|
||||
<MsvcurtNetCoreLib>$(MsvcurtC1xxToolsPath)msvcurt$(LibSuffix)_netcore.lib</MsvcurtNetCoreLib>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(UsePrivateFrontEnd)'=='true' And '$(ManagedCxx)'=='true' and '$(ExplicitCrts)'=='true'">
|
||||
<Link>
|
||||
<AdditionalDependencies>%(AdditionalDependencies);$(MsvcurtNetCoreLib)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<!-- Set up standard libraries for Native C++ projects -->
|
||||
<PropertyGroup>
|
||||
<!-- Explicitly set up CRT and VC runtime libraries -->
|
||||
<!-- set /p:ExplicitCrts=false to disable this behavior -->
|
||||
<ExplicitCrts Condition="'$(ExplicitCrts)'==''">true</ExplicitCrts>
|
||||
|
||||
<!-- Use Static UCRT in Debug builds only -->
|
||||
<UseStaticUCRT Condition="('$(UseStaticUCRT)'=='') and ('$(Configuration)'=='Debug')">true</UseStaticUCRT>
|
||||
<UseStaticUCRT Condition="('$(UseStaticUCRT)'=='') and ('$(Configuration)'=='Release')">false</UseStaticUCRT>
|
||||
|
||||
<!-- Always use Static VC Runtime -->
|
||||
<UseStaticVCRT Condition="'$(UseStaticVCRT)'==''">true</UseStaticVCRT>
|
||||
|
||||
<!-- Set up Directories -->
|
||||
<VcrtLibDir>$(VCToolsInstallDir)lib\$(Architecture)\</VcrtLibDir>
|
||||
<UcrtLibDir>$(UniversalCRTSdkDir)Lib\$(WindowsTargetPlatformVersion)\UCRT\$(Architecture)\</UcrtLibDir>
|
||||
|
||||
<LibSuffix Condition="'$(Configuration)'=='Debug'">d</LibSuffix>
|
||||
|
||||
<!-- Always link to oldnames.lib and legacy_stdio_wide_specifiers.lib -->
|
||||
<OldNamesLib>oldnames.lib</OldNamesLib>
|
||||
<LegacyStdioWideSpecifiersLib>legacy_stdio_wide_specifiers.lib</LegacyStdioWideSpecifiersLib>
|
||||
|
||||
<!-- For use with /MT[d] -->
|
||||
<StaticUCRTLibrary Condition="'$(UseStaticUCRT)'=='true'">libucrt$(LibSuffix).lib</StaticUCRTLibrary>
|
||||
<StaticVCRTLibrary Condition="'$(UseStaticVCRT)'=='true'">libvcruntime$(LibSuffix).lib</StaticVCRTLibrary>
|
||||
<StaticCRTStartupLibrary Condition="'$(UseStaticVCRT)'=='true'">libcmt$(LibSuffix).lib</StaticCRTStartupLibrary>
|
||||
<StaticStandardCppLibrary Condition="'$(UseStaticVCRT)'=='true'">libcpmt$(LibSuffix).lib</StaticStandardCppLibrary>
|
||||
|
||||
<!-- For use with /MD[d] -->
|
||||
<DynamicUCRTLibrary Condition="'$(UseStaticUCRT)'!='true'">ucrt$(LibSuffix).lib</DynamicUCRTLibrary>
|
||||
<DynamicVCRTLibrary Condition="'$(UseStaticVCRT)'!='true'">vcruntime$(LibSuffix).lib</DynamicVCRTLibrary>
|
||||
<DynamicCRTStartupLibrary Condition="'$(UseStaticVCRT)'!='true'">msvcrt$(LibSuffix).lib</DynamicCRTStartupLibrary>
|
||||
<DynamicStandardCppLibrary Condition="'$(UseStaticVCRT)'!='true'">msvcprt$(LibSuffix).lib</DynamicStandardCppLibrary>
|
||||
|
||||
<DisallowLibClause Condition="'$(StaticUCRTLibrary)'!=''">$(DisallowLibClause) /disallowlib:ucrt$(LibSuffix).lib</DisallowLibClause>
|
||||
<DisallowLibClause Condition="'$(StaticVCRTLibrary)'!=''">$(DisallowLibClause) /disallowlib:vcruntime$(LibSuffix).lib</DisallowLibClause>
|
||||
<DisallowLibClause Condition="'$(StaticCRTStartupLibrary)'!=''">$(DisallowLibClause) /disallowlib:msvcrt$(LibSuffix).lib</DisallowLibClause>
|
||||
<DisallowLibClause Condition="'$(StaticStandardCppLibrary)'!=''">$(DisallowLibClause) /disallowlib:msvcprt$(LibSuffix).lib</DisallowLibClause>
|
||||
<DisallowLibClause Condition="'$(DynamicUCRTLibrary)'!=''">$(DisallowLibClause) /disallowlib:libucrt$(LibSuffix).lib</DisallowLibClause>
|
||||
<DisallowLibClause Condition="'$(DynamicVCRTLibrary)'!=''">$(DisallowLibClause) /disallowlib:libvcruntime$(LibSuffix).lib</DisallowLibClause>
|
||||
<DisallowLibClause Condition="'$(DynamicCRTStartupLibrary)'!=''">$(DisallowLibClause) /disallowlib:libcmt$(LibSuffix).lib</DisallowLibClause>
|
||||
<DisallowLibClause Condition="'$(DynamicStandardCppLibrary)'!=''">$(DisallowLibClause) /disallowlib:libcpmt$(LibSuffix).lib</DisallowLibClause>
|
||||
|
||||
<!--
|
||||
When linking to vcruntime140.dll, rename and link to vcruntime140_cor3.dll
|
||||
Caveats:
|
||||
- Supported only on Release builds
|
||||
- WPF will carry a privatized copy of vcruntime with it - renamed with suffix _cor3
|
||||
- Debug builds normally link to Static VCRT by default, and linking to a privatized vcruntime is not required
|
||||
- Managed C++ assemblies that utilize /clr:pure always link to vcruntime implicitly, and should employ this
|
||||
DLL renaming at link time and reference the privatized copy of vcruntime.
|
||||
- It is in fact possible to create private builds of WPF that links to debug builds of redistributable vcruntime. We do not support
|
||||
linking to a privatized copy of vcruntime140d.dll here. Such build should simply copy over the debug version of vcruntime DLL's
|
||||
to the appropriate location for testing purposes.
|
||||
-->
|
||||
<DllRenameClause Condition="('$(UseStaticVCRT)'!='true' or '$(CLRSupport)'=='pure') And '$(Configuration)'=='Release'">/dllrename:$(VCRuntimeDllBaseName)$(VCRuntimeVersion)$(LibSuffix)=$(VCRuntimeDllBaseName)$(VCRuntimeVersion)$(LibSuffix)$(WpfVersionSuffix)</DllRenameClause>
|
||||
|
||||
|
||||
<StandardLibrariesForNativeCpp Condition="'$(ManagedCxx)'=='false'">$(StaticUCRTLibrary);$(StaticVCRTLibrary);$(StaticCRTStartupLibrary);$(StaticStandardCppLibrary);$(DynamicUCRTLibrary);$(DynamicVCRTLibrary);$(DynamicCRTStartupLibrary);$(DynamicStandardCppLibrary)</StandardLibrariesForNativeCpp>
|
||||
<StandardLibrariesForNativeCpp Condition="'$(ManagedCxx)'=='false'">$(StandardLibrariesForNativeCpp);$(OldNamesLib);$(LegacyStdioWideSpecifiersLib)</StandardLibrariesForNativeCpp>
|
||||
|
||||
<!-- These runtime libs should not have their default lib requests included during link. Instead, just use the explicitly intended libraries from this section -->
|
||||
<NoDefaultLibClauseForRuntimeLibs>$(NoDefaultLibClauseForRuntimeLibs) /nodefaultlib:ucrt$(LibSuffix).lib /nodefaultlib:libucrt$(LibSuffix).lib /nodefaultlib:msvcrt$(LibSuffix).lib /nodefaultlib:libcmt$(LibSuffix).lib</NoDefaultLibClauseForRuntimeLibs>
|
||||
|
||||
<!-- Disable managed incremental builds to disable MetaGen task, which currently fails -->
|
||||
<EnableManagedIncrementalBuild Condition="'$(ManagedCxx)'=='true'">false</EnableManagedIncrementalBuild>
|
||||
|
||||
<!-- Do not enable this - see GenerateTargetFrameworkMonikerAttribute2 target in Wpf.Cpp.targets for additional information -->
|
||||
<GenerateTargetFrameworkAttribute Condition="'$(ManagedCxx)'=='true'">false</GenerateTargetFrameworkAttribute>
|
||||
|
||||
<!-- When CLRSupport == True, we want the outputs to be redirected to
|
||||
$(BaseOutputPath)$(Configuration)\$(TargetFramework)\ -->
|
||||
<OutDir Condition="'$(ManagedCxx)' == 'true' and !$(Architecture.EndsWith('64'))">$(BaseOutputPath)$(Configuration)\$(TargetFramework)\</OutDir>
|
||||
<OutDir Condition="'$(ManagedCxx)' == 'true' and $(Architecture.EndsWith('64'))">$(BaseOutputPath)$(Architecture)\$(Configuration)\$(TargetFramework)\</OutDir>
|
||||
|
||||
<IntermediateOutputPath Condition="'$(ManagedCxx)'=='true' and !$(Architecture.EndsWith('64'))">$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\</IntermediateOutputPath>
|
||||
<IntermediateOutputPath Condition="'$(ManagedCxx)'=='true' and $(Architecture.EndsWith('64'))">$(BaseIntermediateOutputPath)$(Architecture)\$(Configuration)\$(TargetFramework)\</IntermediateOutputPath>
|
||||
|
||||
<ProduceReferenceAssembly Condition="'$(ManagedCxx)'=='true'">false</ProduceReferenceAssembly>
|
||||
<ProduceReferenceAssembly Condition="'$(ManagedCxx)'=='true'">false</ProduceReferenceAssembly>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ComputeCompileInputsTargets Condition="$(ManagedCxx) == 'true'">
|
||||
$(ComputeCompileInputsTargets);
|
||||
SetMscorlibAdditionalUsingDirectory;
|
||||
</ComputeCompileInputsTargets>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<!-- Common suppressions -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);$(ManagedCxxSuppressions);4960;4961;4603;4627;4838;4456;4457;4458;4459;4091</DisableSpecificWarnings>
|
||||
|
||||
<!-- STRICT gets us stricter type declarations from Windows headers. -->
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_UNICODE;UNICODE;_WINDOWS;STRICT;_WIN32_WINNT=$(Win32WinNt);_WIN32_IE=$(Win32Ie);WINNT=$(WinNt);WINVER=$(WinVer)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(ConfigurationType)'=='StaticLibrary'">%(PreprocessorDefinitions);_LIB;</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions);SAL_NO_ATTRIBUTE_DECLARATIONS</PreprocessorDefinitions>
|
||||
|
||||
<!-- There is a bug in VS2019 that prevents us from using ArgIterator, and therefore simple functions like printf -->
|
||||
<!-- The fix is coming soon - remove this as soon as the fix makes it into the builds -->
|
||||
<!-- Also remove all references to ARGITERATOR_SUPPORTED macro from the codebase -->
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions);ARGITERATOR_SUPPORTED=0</PreprocessorDefinitions>
|
||||
|
||||
<!-- $(Architecture) - x86 | x64 | arm | arm64 -->
|
||||
<PreprocessorDefinitions Condition="'$(Architecture)'=='x64'">%(PreprocessorDefinitions);_AMD64_;</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Architecture)'=='x86'">%(PreprocessorDefinitions);_X86_;</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Architecture)'=='arm'">%(PreprocessorDefinitions);_ARM_;</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Architecture)'=='arm64'">%(PreprocessorDefinitions);_ARM64_;</PreprocessorDefinitions>
|
||||
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
|
||||
<!--
|
||||
Disambiguate the PDB produced by the compiler with a -compile suffix, so that the PDB
|
||||
produced by the linker is not accidentally clobbered by this one.
|
||||
-->
|
||||
<ProgramDatabaseFileName>$(IntermediateOutputPath)$(TargetName)-compile.pdb</ProgramDatabaseFileName>
|
||||
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<ExceptionHandling>Async</ExceptionHandling>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<InlineFunctionExpansion Condition="'$(Configuration)'!='Debug'">OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<IntrinsicFunctions Condition="'$(Configuration)'!='Debug'">true</IntrinsicFunctions>
|
||||
|
||||
<TreatWChar_tAsBuiltInType Condition="'$(ManagedCxx)'=='false'">false</TreatWChar_tAsBuiltInType>
|
||||
|
||||
<ConformanceMode Condition="'$(ManagedCxx)'=='true'">true</ConformanceMode>
|
||||
<ConformanceMode Condition="'$(ManagedCxx)'=='true'">false</ConformanceMode>
|
||||
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
|
||||
<ControlFlowGuard Condition="('$(ManagedCxx)'=='false') and ('$(Configuration)'!='Debug')">Guard</ControlFlowGuard>
|
||||
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
|
||||
|
||||
<!-- WPF builds have historically used StdCall by default for all x86 native C++ builds -->
|
||||
<CallingConvention Condition="('$(ManagedCxx)'=='false') And ('$(Architecture)'=='x86')">StdCall</CallingConvention>
|
||||
|
||||
|
||||
<AdditionalIncludeDirectories Condition="Exists('$(WpfSharedDir)inc\')">%(AdditionalIncludeDirectories);$(WpfSharedDir)inc\</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="Exists('$(WpfCommonDir)inc\')">%(AdditionalIncludeDirectories);$(WpfCommonDir)inc\</AdditionalIncludeDirectories>
|
||||
|
||||
<ForcedIncludeFiles>ddbanned.h</ForcedIncludeFiles>
|
||||
|
||||
<!-- See https://developercommunity.visualstudio.com/content/problem/297504/all-cppwinrt-code-fails-to-build-from-abi-and-to-a.html -->
|
||||
<!--<AdditionalOptions>/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>-->
|
||||
<!--<ConformanceMode>false</ConformanceMode>-->
|
||||
|
||||
<AdditionalOptions Condition="'$(ManagedCxx)'=='true'">%(AdditionalOptions) /clr:netcore</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
||||
<GenerateDebugInformation Condition="'$(ManagedCxx)'=='false'">true</GenerateDebugInformation>
|
||||
<GenerateDebugInformation Condition="'$(ManagedCxx)'=='true'">DebugFull</GenerateDebugInformation>
|
||||
|
||||
<AdditionalOptions Condition="('$(ManagedCxx)'=='false') and ('$(Configuration)'=='Release')">%(AdditionalOptions) /DEBUGTYPE:CV,PDATA,FIXUP</AdditionalOptions>
|
||||
|
||||
<!-- Suppress LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library -->
|
||||
<!-- Some C++ files only define symbols conditionally based on certain macro values, which are in turn dependent on architecture of debug vs. release build status. -->
|
||||
<!-- This can lead to LNK4221 being generated under some configurations. -->
|
||||
<AdditionalOptions Condition="'$(ManagedCxx)'=='false'">/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(ManagedCxx)'=='false'">%(AdditionalOptions) /MACHINE:$(Architecture)</AdditionalOptions>
|
||||
<TargetMachine>Machine$(Architecture)</TargetMachine>
|
||||
|
||||
|
||||
<AdditionalLibraryDirectories Condition="('$(ManagedCxx)'=='false') and ('$(ExplicitCrts)'=='true')">$(VcrtLibDir);$(UcrtLibDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies Condition="('$(ManagedCxx)'=='false') and ('$(ExplicitCrts)'=='true')">%(AdditionalDependencies);$(StandardLibrariesForNativeCpp)</AdditionalDependencies>
|
||||
<AdditionalOptions Condition="('$(ManagedCxx)'=='false') and ('$(ExplicitCrts)'=='true')">%(AdditionalOptions) $(NoDefaultLibClauseForRuntimeLibs) $(DisallowLibClause)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(DllRenameClause)'!=''">%(AdditionalOptions) $(DllRenameClause)</AdditionalOptions>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
<AdditionalOptions Condition="'$(ManagedCxx)'=='true'">%(AdditionalOptions) /keyfile:$(AssemblyOriginatorKeyFile) /delaysign</AdditionalOptions>
|
||||
|
||||
<ProgramDatabaseFileName>$(IntermediateOutputPath)$(TargetName).pdb</ProgramDatabaseFileName>
|
||||
</Link>
|
||||
<Lib>
|
||||
<!-- Suppress LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library -->
|
||||
<!-- Some C++ files only define symbols conditionally based on certain macro values, which are in turn dependent on architecture of debug vs. release build status. -->
|
||||
<!-- This can lead to LNK4221 being generated under some configurations. -->
|
||||
<AdditionalOptions Condition="'$(ManagedCxx)'=='false'">/ignore:4221 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(ManagedCxx)'=='false'">%(AdditionalOptions) /MACHINE:$(Architecture)</AdditionalOptions>
|
||||
</Lib>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(IntermediateOutputPath)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
||||
<PreprocessorDefinitions Condition="'$(ManagedCxx)'=='false'">%(PreprocessorDefinitions);DBG=1</PreprocessorDefinitions>
|
||||
<RuntimeLibrary Condition="('$(ManagedCxx)'=='false') and ('$(UseStaticVCRT)'=='true')">MultiThreadedDebug</RuntimeLibrary>
|
||||
<RuntimeLibrary Condition="('$(ManagedCxx)'=='false') and ('$(UseStaticVCRT)'=='false')">MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
||||
<RuntimeLibrary Condition="('$(ManagedCxx)'=='false') and ('$(UseStaticVCRT)'=='true')">MultiThreaded</RuntimeLibrary>
|
||||
<RuntimeLibrary Condition="('$(ManagedCxx)'=='false') and ('$(UseStaticVCRT)'=='false')">MultiThreadedDLL</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(LinkRepro)'=='true'">
|
||||
<Link>
|
||||
<AdditionalOptions>%(AdditionalOptions) /linkrepro:$(IntermediateOutputPath)LinkRepro</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
|
@ -0,0 +1,333 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<NativeVersionFile Condition="'$(NativeVersionFile)'==''">$(IntermediateOutputPath)NativeVersion.rc</NativeVersionFile>
|
||||
<NativeVersionFileDirectory>$([System.IO.Path]::GetDirectoryName($(NativeVersionFile)))</NativeVersionFileDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<FrontEndPath Condition="'$(VCToolArchitecture)'=='Native32Bit'">$(MsvcurtC1xxToolsPath)HostX86\c1xx.dll</FrontEndPath>
|
||||
<FrontEndPath Condition="'$(VCToolArchitecture)'=='Native64Bit'">$(MsvcurtC1xxToolsPath)HostX64\c1xx.dll</FrontEndPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(UsePrivateFrontEnd)'=='true' And '$(ManagedCxx)'=='true' And '$(FrontEndPath)'!=''">
|
||||
<ClCompile>
|
||||
<AdditionalOptions>%(AdditionalOptions) /Bx"$(FrontEndPath)"</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>%(AdditionalOptions) /fe:"$(FrontEndPath)"</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(NativeVersionFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(NativeVersionFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<!--
|
||||
Support for /linkrepro
|
||||
-->
|
||||
<ItemDefinitionGroup Condition="'$(LinkRepro)'=='true'">
|
||||
<Link>
|
||||
<AdditionalOptions>%(AdditionalOptions) /linkrepro:$(IntermediateOutputPath)LinkRepro</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(LinkRepro)'=='true'">
|
||||
<BeforeLinkTargets>
|
||||
$(BeforeLinkTargets);
|
||||
CreateLinkReproFolder
|
||||
</BeforeLinkTargets>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CreateLinkReproFolder"
|
||||
Condition="'$(LinkRepro)'=='true'"
|
||||
Returns="$(LinkReproFolder)">
|
||||
<PropertyGroup>
|
||||
<LinkReproFolder>$(IntermediateOutputPath)LinkRepro\</LinkReproFolder>
|
||||
</PropertyGroup>
|
||||
<RemoveDir Condition="Exists('$(LinkReproFolder)')"
|
||||
Directories="$(LinkReproFolder)" />
|
||||
<MakeDir Directories="$(LinkReproFolder)" />
|
||||
<Message Text="LINK_REPRO files will be created at $(LinkReproFolder)"
|
||||
Importance="high" />
|
||||
</Target>
|
||||
|
||||
|
||||
<Target Name="CreateNativeVersionFile" BeforeTargets="ResourceCompile" Outputs="$(NativeVersionFile)" Condition="!Exists('$(NativeVersionFile)')">
|
||||
<CallTarget Targets="GenerateNativeVersionFile" />
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
This target is a replacement for GenerateTargetFrameworkMonikerAttribute defined in Microsoft.BuildSteps.Targets
|
||||
We needed to ensure a few preconditions for this target, which necessitated a custom version to be written
|
||||
- this target has to execute prior to SetMscorlibAdditionalUsingDirectory
|
||||
InitializeAssemblyAttributeInformation (defined in ExtendedAssemblyInfo.targets) must run prior to this target, to ensure that $(FileVersion) is populated
|
||||
Additional assembly scope attributes besides TargetFrameworkAttribute are added here
|
||||
-->
|
||||
<Target Name="GenerateTargetFrameworkMonikerAttribute2"
|
||||
Condition="'$(ManagedCxx)'=='true'"
|
||||
BeforeTargets="SetMscorlibAdditionalUsingDirectory"
|
||||
DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths;InitializeAssemblyAttributeInformation"
|
||||
Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)">
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyInfoFile Include="Always">
|
||||
<Text>
|
||||
<![CDATA[
|
||||
#using <mscorlib.dll>
|
||||
|
||||
using namespace System;
|
||||
using namespace System::Reflection;
|
||||
using namespace System::Runtime::InteropServices;
|
||||
using namespace System::Runtime::Versioning;
|
||||
|
||||
[assembly:AssemblyTitle("$(AssemblyTitle)")];
|
||||
[assembly:AssemblyDescription("$(AssemblyDescription)")];
|
||||
[assembly:AssemblyDefaultAlias("$(AssemblyName)")];
|
||||
[assembly:AssemblyCompany("$(Company)")];
|
||||
[assembly:AssemblyProduct("$(Product)")];
|
||||
[assembly:AssemblyCopyright("$(Copyright)")];
|
||||
[assembly:AssemblyVersion("$(AssemblyVersion)")];
|
||||
[assembly:AssemblyFileVersion("$(FileVersion)")];
|
||||
[assembly:AssemblyInformationalVersion("$(AssemblyInformationalVersion)")];
|
||||
[assembly:TargetFramework("$(TargetFrameworkMoniker)", FrameworkDisplayName="$(TargetFrameworkMonikerDisplayName)")];
|
||||
]]>
|
||||
</Text>
|
||||
</AssemblyInfoFile>
|
||||
<AssemblyInfoFile Include="CLSCompliantAttribute" Condition="'$(CLSCompliant)'=='true'">
|
||||
<Text>
|
||||
<![CDATA[
|
||||
[assembly:CLSCompliant(true)];
|
||||
]]>
|
||||
</Text>
|
||||
</AssemblyInfoFile>
|
||||
<AssemblyInfoFile Include="COMVisibleAttribute" Condition="'$(AssemblyComVisible)'!=''">
|
||||
<Text>
|
||||
<![CDATA[
|
||||
[assembly:ComVisible($(AssemblyComVisible))];
|
||||
]]>
|
||||
</Text>
|
||||
</AssemblyInfoFile>
|
||||
<AssemblyInfoFile Include="AssemblyMetadataAttribute" Condition="'$(SkipFrameworkAssemblyMetadata)'!='true' and '@(AssemblyMetadata)'!=''">
|
||||
<Text>
|
||||
<![CDATA[
|
||||
[assembly:AssemblyMetadata("%(AssemblyMetadata.Identity)", "%(AssemblyMetadata.Value)")];
|
||||
]]>
|
||||
</Text>
|
||||
</AssemblyInfoFile>
|
||||
<AssemblyInfoFile Include="DllSafeSearchPathAttribute" Condition="'$(IncludeDllSafeSearchPathAttribute)'=='true'">
|
||||
<Text>
|
||||
<![CDATA[
|
||||
[assembly:DefaultDllImportSearchPathsAttribute(DllImportSearchPath::AssemblyDirectory | DllImportSearchPath::System32)];
|
||||
]]>
|
||||
</Text>
|
||||
</AssemblyInfoFile>
|
||||
</ItemGroup>
|
||||
|
||||
<Delete Condition="Exists('$(TargetFrameworkMonikerAssemblyAttributesPath)')"
|
||||
Files="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
|
||||
|
||||
<WriteLinesToFile Lines="@(AssemblyInfoFile->'%(Text)')"
|
||||
File="$(TargetFrameworkMonikerAssemblyAttributesPath)"
|
||||
Overwrite="true" />
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)">
|
||||
<!-- The appropriate CompileAsManaged setting will automatically be set depending on the current CLRSupport value -->
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- Remove mscorlib from AdditionalExplicitAssemblyReferences -->
|
||||
<Target Name="RemoveMscoreLib"
|
||||
AfterTargets="_PrepareForReferenceResolution"
|
||||
DependsOnTargets="$(RemoveMscoreLibDependsOn)"
|
||||
Condition="('$(ManagedCxx)'=='true') and $(TargetFramework.StartsWith('netcoreapp'))">
|
||||
<ItemGroup>
|
||||
<_AdditionalExplicitAssemblyReferences Include="$(AdditionalExplicitAssemblyReferences)" />
|
||||
<_AdditionalExplicitAssemblyReferences Remove="mscorlib" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<AdditionalExplicitAssemblyReferences>@(_AdditionalExplicitAssemblyReferences)</AdditionalExplicitAssemblyReferences>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<!-- Add the directory where mscorlib is located to AdditionalUsingDirectories -->
|
||||
<Target Name="SetMscorlibAdditionalUsingDirectory" DependsOnTargets="ResolveAssemblyReferences"
|
||||
Condition="('$(ManagedCxx)'=='true') and ('$(SetMscorlibAdditionalUsingDirectory)' != 'true')" >
|
||||
<PropertyGroup>
|
||||
<_mscorlibDirectory Condition="'%(ReferencePath.FileName)%(ReferencePath.Extension)' == 'mscorlib.dll'">%(ReferencePath.RootDir)%(ReferencePath.Directory)</_mscorlibDirectory>
|
||||
</PropertyGroup>
|
||||
<Error Condition="'$(_mscorlibDirectory)' == ''" Text="Could not locate mscorlib.dll" />
|
||||
<ItemGroup>
|
||||
<CLCompile>
|
||||
<AdditionalUsingDirectories>%(CLCompile.AdditionalUsingDirectories);$(_mscorlibDirectory)</AdditionalUsingDirectories>
|
||||
</CLCompile>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<PropertyGroup Condition="'$(ManagedCxx)'=='true'">
|
||||
<ResolveReferencesDependsOn>
|
||||
CppCliHelper;
|
||||
$(ResolveReferencesDependsOn)
|
||||
</ResolveReferencesDependsOn>
|
||||
<EnsureWpfProjectReferenceDependsOn>
|
||||
$(EnsureWpfProjectReferenceDependsOn);
|
||||
CppCliHelper
|
||||
</EnsureWpfProjectReferenceDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
Helper for building C++/CLI projects
|
||||
|
||||
C++/CLI doe not have Sdk support for build on .NET Core
|
||||
We use existing support for C# to discover Nuget packages, and pass it along to
|
||||
the C++ compiler.
|
||||
|
||||
A simple C# project is generated dynamically. It contains PackageReferences for common packages
|
||||
that are used in WPF's C++/CLI projects. There are only two such projects - DirectWriteForwarder
|
||||
and System.Printing - which makes it unnecessary to create a flexible and parametrized target. This
|
||||
can remain a simple and one-size-fits-all target for now.
|
||||
|
||||
If additional Nuget references need to be discovered and passed along for builds (for existing, or new) of
|
||||
C++/CLI projects, they just need to be added to the vcxproj project file like this:
|
||||
|
||||
<AdditionalPackageReference Include="Microsoft.Win32.Registry" Version="<version>" />
|
||||
-->
|
||||
<Target Name="CppCliHelper"
|
||||
Returns="@(Reference)"
|
||||
Condition="'$(ManagedCxx)' == 'true'">
|
||||
|
||||
<PropertyGroup>
|
||||
<CppCliHelperProject>$(IntermediateOutputPath)CppCliSupport\CppClrSupport_$(MSBuildProjectName).csproj</CppCliHelperProject>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CppClrSupportProject Include="Project">
|
||||
<!--
|
||||
In the CDATA section that follows,
|
||||
%40 ~= @
|
||||
%25 ~= %
|
||||
%3B ~= ;
|
||||
%24 ~= $
|
||||
-->
|
||||
<Text>
|
||||
<![CDATA[
|
||||
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="EnumerateAdditionalNugetReference">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<Platforms>AnyCPU%3Bx64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="$(MicrosoftDotNetWpfGitHubPackage)" Version="$(MicrosoftDotNetWpfGitHubVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Ensure that LimitMicrosoftDotNetWpfGitHubReferences target doesn't run -->
|
||||
<PropertyGroup>
|
||||
<DoNotLimitMicrosoftDotNetWpfGitHubReferences>true</DoNotLimitMicrosoftDotNetWpfGitHubReferences>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="EnumerateAdditionalNugetReference"
|
||||
BeforeTargets="_GenerateRestoreGraph"
|
||||
Condition="'%24(AdditionalPackages)'!=''"
|
||||
Returns="%40(PackageReference)">
|
||||
<ItemGroup>
|
||||
<_AdditionalPackages Remove="%40(_AdditionalPackages)" />
|
||||
<_AdditionalPackages Include="%24(AdditionalPackages)" />
|
||||
|
||||
<PackageReference Include="%24([System.String]::Copy('%25(_AdditionalPackages.Identity)').Split('+')[0])"
|
||||
Version="%24([System.String]::Copy('%25(_AdditionalPackages.Identity)').Split('+')[1])" />
|
||||
|
||||
<AdditionalNugetIds Remove="%40(AdditionalNugetIds)" />
|
||||
<AdditionalNugetIds Include="%24([System.String]::Copy('%25(_AdditionalPackages.Identity)').Split('+')[0])" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target
|
||||
Name="IdentifyNugetReferences"
|
||||
AfterTargets="ResolveAssemblyReferences"
|
||||
Returns="%40(NugetReferencesForCppCli)">
|
||||
|
||||
<!-- Save Microsoft.NETCore.App assemblies and return them -->
|
||||
<ItemGroup>
|
||||
<NugetReferencesForCppCli Remove="%40(NugetReferencesForCppCli)" />
|
||||
<NugetReferencesForCppCli Include="%40(ReferencePath)" Condition="'%25(ReferencePath.NuGetPackageId)'=='Microsoft.NETCore.App'"/>
|
||||
<NugetReferencesForCppCli Include="%40(ReferencePath)" Condition="'%25(ReferencePath.NuGetPackageId)'=='Microsoft.DotNet.Wpf.Github'"/>
|
||||
</ItemGroup>
|
||||
<FilterItem1ByItem2 Item1="%40(ReferencePath->'%25(NuGetPackageId)')"
|
||||
PreserveItem1Metadata="true"
|
||||
Item2="%40(AdditionalNugetIds)"
|
||||
Metadata2="Identity">
|
||||
<Output ItemName="_NugetReferencesForCppCli" TaskParameter="Result" />
|
||||
</FilterItem1ByItem2>
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<NugetReferencesForCppCli Include="%40(_NugetReferencesForCppCli->'%25(OriginalItemSpec)')" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
]]>
|
||||
</Text>
|
||||
</CppClrSupportProject>
|
||||
</ItemGroup>
|
||||
|
||||
<MakeDir Condition="!Exists('$(IntermediateOutputPath)CppCliSupport\')"
|
||||
Directories="$(IntermediateOutputPath)CppCliSupport\" />
|
||||
|
||||
<WriteLinesToFile Lines="%(CppClrSupportProject.Text)"
|
||||
File="$(CppCliHelperProject)"
|
||||
Overwrite="true"/>
|
||||
|
||||
<!--
|
||||
Do not build - just ask ResolveReferences + IdentifyNetCoreReferences for the information
|
||||
we are looking for, namely the list of .NET Core Sdk references.
|
||||
-->
|
||||
<ItemGroup>
|
||||
<ProjectToBuild Remove="@(ProjectToBuild)" />
|
||||
<ProjectToBuild Include="$(CppCliHelperProject)">
|
||||
<AdditionalProperties>AdditionalPackages=@(AdditionalPackageReference->'%(Identity)+%(Version)')</AdditionalProperties>
|
||||
</ProjectToBuild>
|
||||
</ItemGroup>
|
||||
<MSBuild Projects="@(ProjectToBuild)"
|
||||
Targets="Restore;ResolveReferences;IdentifyNugetReferences"
|
||||
Properties="TargetFramework=$(TargetFramework);Platform=$(Architecture);RuntimeIdentifier=win-$(Architecture)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="NugetReferencesForCppCli" />
|
||||
</MSBuild>
|
||||
|
||||
<!--
|
||||
Add the newly discovered list of .NET core references to $(AdditionalExplicitAssemblyReferences)
|
||||
-->
|
||||
<ItemGroup Condition="'$(CopyTransitiveReferences)'=='false'">
|
||||
<Reference Include="@(NugetReferencesForCppCli)">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(CopyTransitiveReferences)'!='false'">
|
||||
<Reference Include="@(NugetReferencesForCppCli)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<PropertyGroup Condition="'$(LinkRepro)'=='true'">
|
||||
<BeforeLinkTargets>
|
||||
$(BeforeLinkTargets);
|
||||
EnsureLinkReproFolder
|
||||
</BeforeLinkTargets>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="EnsureLinkReproFolder">
|
||||
<RemoveDir Condition="Exists('$(IntermediateOutputPath)LinkRepro\')" Directories="$(IntermediateOutputPath)LinkRepro\" />
|
||||
<MakeDir Directories="$(IntermediateOutputPath)LinkRepro\" />
|
||||
</Target>
|
||||
|
||||
<!-- Disable the portions of MSBuild that insist on a targeting pack directory to represent a target framework -->
|
||||
<Import Project="..\targets\Microsoft.NET.DisableStandardFrameworkResolution.targets" Sdk="Microsoft.NET.Sdk"
|
||||
Condition="'$(ManagedCxx)'=='true'" />
|
||||
|
||||
<Import Project="$(MSBuildThisFileDirectory)ResourceLinking.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,152 @@
|
|||
<Project>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="$(MicrosoftDotNetWpfGitHubPackage)"
|
||||
Version="$(MicrosoftDotNetWpfGitHubVersion)"
|
||||
ExcludeAssets="All"
|
||||
GeneratePathProperty="True"
|
||||
Condition="'$(MSBuildProjectExtension)'!='.vcxproj' And $(TargetFramework.StartsWith('netcoreapp3')) And '$(NoAutoMicrosoftDotNetWpfGitHubPackageReference)'!='true'"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<WpfProjectPath Include="System.Xaml" ProjectPath="$(WpfSourceDir)System.Xaml\System.Xaml.csproj" />
|
||||
<WpfProjectPath Include="WindowsBase" ProjectPath="$(WpfSourceDir)WindowsBase\WindowsBase.csproj" />
|
||||
<WpfProjectPath Include="PresentationCore-CommonResources" ProjectPath="$(WpfSourceDir)PresentationCore-CommonResources\PresentationCore-CommonResources.csproj" />
|
||||
<WpfProjectPath Include="DirectWriteForwarder" ProjectPath="$(WpfSourceDir)DirectWriteForwarder\DirectWriteForwarder.vcxproj" />
|
||||
<WpfProjectPath Include="System.Windows.Input.Manipulations" ProjectPath="$(WpfSourceDir)System.Windows.Input.Manipulations\System.Windows.Input.Manipulations.csproj" />
|
||||
<WpfProjectPath Include="WindowsFormsIntegration" ProjectPath="$(WpfSourceDir)WindowsFormsIntegration\WindowsFormsIntegration.csproj" />
|
||||
|
||||
<WpfProjectPath Include="PresentationCore" ProjectPath="$(WpfSourceDir)PresentationCore\PresentationCore.csproj" />
|
||||
<WpfProjectPath Include="PresentationFramework" ProjectPath="$(WpfSourceDir)PresentationFramework\PresentationFramework.csproj" />
|
||||
<WpfProjectPath Include="PresentationUI" ProjectPath="$(WpfSourceDir)PresentationUI\PresentationUI.csproj" />
|
||||
<WpfProjectPath Include="ReachFramework" ProjectPath="$(WpfSourceDir)ReachFramework\ReachFramework.csproj" />
|
||||
<WpfProjectPath Include="System.Printing" ProjectPath="$(WpfSourceDir)System.Printing\System.Printing.csproj" />
|
||||
<WpfProjectPath Include="System.Windows.Controls.Ribbon" ProjectPath="$(WpfSourceDir)System.Windows.Controls.Ribbon\System.Windows.Controls.Ribbon.csproj" />
|
||||
<WpfProjectPath Include="System.Windows.Presentation" ProjectPath="$(WpfSourceDir)System.Windows.Presentation\System.Windows.Presentation.csproj" />
|
||||
|
||||
<WpfProjectPath Include="PresentationBuildTasks" ProjectPath="$(WpfSourceDir)PresentationBuildTasks\PresentationBuildTasks.csproj" />
|
||||
|
||||
<WpfProjectPath Include="PresentationFramework.Aero" ProjectPath="$(WpfSourceDir)Themes\PresentationFramework.Aero\PresentationFramework.Aero.csproj" />
|
||||
<WpfProjectPath Include="PresentationFramework.Aero2" ProjectPath="$(WpfSourceDir)Themes\PresentationFramework.Aero2\PresentationFramework.Aero2.csproj" />
|
||||
<WpfProjectPath Include="PresentationFramework.AeroLite" ProjectPath="$(WpfSourceDir)Themes\PresentationFramework.AeroLite\PresentationFramework.AeroLite.csproj" />
|
||||
<WpfProjectPath Include="PresentationFramework.Classic" ProjectPath="$(WpfSourceDir)Themes\PresentationFramework.Classic\PresentationFramework.Classic.csproj" />
|
||||
<WpfProjectPath Include="PresentationFramework.Luna" ProjectPath="$(WpfSourceDir)Themes\PresentationFramework.Luna\PresentationFramework.Luna.csproj" />
|
||||
<WpfProjectPath Include="PresentationFramework.Royale" ProjectPath="$(WpfSourceDir)Themes\PresentationFramework.Royale\PresentationFramework.Royale.csproj" />
|
||||
|
||||
<WpfProjectPath Include="UIAutomationTypes" ProjectPath="$(WpfSourceDir)UIAutomation\UIAutomationTypes\UIAutomationTypes.csproj" />
|
||||
<WpfProjectPath Include="UIAutomationProvider" ProjectPath="$(WpfSourceDir)UIAutomation\UIAutomationProvider\UIAutomationProvider.csproj" />
|
||||
<WpfProjectPath Include="UIAutomationClient" ProjectPath="$(WpfSourceDir)UIAutomation\UIAutomationClient\UIAutomationClient.csproj" />
|
||||
<WpfProjectPath Include="UIAutomationClientSideProviders" ProjectPath="$(WpfSourceDir)UIAutomation\UIAutomationClientSideProviders\UIAutomationClientSideProviders.csproj" />
|
||||
|
||||
|
||||
<WpfProjectPath Include="PresentationNative_cor3" ProjectPath="$(WpfSourceDir)PresentationNative\dll\PresentationNative.vcxproj" />
|
||||
<WpfProjectPath Include="WpfGfx_cor3" ProjectPath="@(WpfSourceDir)WpfGfx\core\dll\WpfGfx.vcxproj" />
|
||||
<WpfProjectPath Include="PenImc_cor3" ProjectPath="$(WpfSourceDir)PenImc\dll\PenImc.vcxproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PrepareForBuildDependsOn>
|
||||
EnsureWpfProjectReference;
|
||||
$(PrepareForBuildDependsOn)
|
||||
</PrepareForBuildDependsOn>
|
||||
<CoreBuildDependsOn>
|
||||
EnsureWpfProjectReference;
|
||||
$(CoreBuildDependsOn)
|
||||
</CoreBuildDependsOn>
|
||||
<CoreCompileDependsOn>
|
||||
EnsureWpfProjectReference;
|
||||
$(CoreCompileDependsOn)
|
||||
</CoreCompileDependsOn>
|
||||
<ResolveReferencesDependsOn>
|
||||
EnsureWpfProjectReference;
|
||||
$(ResolveReferencesDependsOn)
|
||||
</ResolveReferencesDependsOn>
|
||||
<MarkupCompilePass1DependsOn>
|
||||
EnsureWpfProjectReference;
|
||||
$(MarkupCompilePass1DependsOn)
|
||||
</MarkupCompilePass1DependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
||||
<Target Name="EnsureWpfProjectReference"
|
||||
DependsOnTargets="$(EnsureWpfProjectReferenceDependsOn)"
|
||||
BeforeTargets="ResolveProjectReferences"
|
||||
Returns="@(ProjectReference);@(MicrosoftDotNetWpfGitHubReference)">
|
||||
<!--
|
||||
For each @(WpfProjectReference) that is found locally, include it directly into @(ProjectReference)
|
||||
-->
|
||||
<ItemGroup>
|
||||
<_wpfProjectPath Include="@(WpfProjectPath)">
|
||||
<AssemblyName>%(WpfProjectPath.Identity)</AssemblyName>
|
||||
</_wpfProjectPath>
|
||||
<_wpfProjectPathAvailableLocally Include="@(WpfProjectPath)"
|
||||
Condition="Exists('%(ProjectPath)')" />
|
||||
</ItemGroup>
|
||||
|
||||
<FilterItem1ByItem2 Item1="@(ProjectReference)"
|
||||
PreserveItem1Metadata="true"
|
||||
Item2="@(_wpfProjectPathAvailableLocally)"
|
||||
Metadata2="ProjectPath"
|
||||
TreatItemsAsPaths="true">
|
||||
<Output ItemName="_wpfProjectReference" TaskParameter="Result" />
|
||||
<Output ItemName="_unmatchedProjectReference" TaskParameter="UnmatchedReferences" />
|
||||
</FilterItem1ByItem2>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="@(_wpfProjectReference)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_unmatchedProjectReferenceWithConfiguration Remove="@(_unmatchedProjectReferenceWithConfiguration)" />
|
||||
<_unmatched_ProjectReferenceWithConfiguration Remove="@(_unmatched_ProjectReferenceWithConfiguration)" />
|
||||
</ItemGroup>
|
||||
<FilterItem1ByItem2 Item1="@(ProjectReferenceWithConfiguration)"
|
||||
PreserveItem1Metadata="true"
|
||||
Item2="@(_wpfProjectPathAvailableLocally)"
|
||||
Metadata2="ProjectPath"
|
||||
TreatItemsAsPaths="true">
|
||||
<Output ItemName="_unmatchedProjectReferenceWithConfiguration" TaskParameter="UnmatchedReferences" />
|
||||
</FilterItem1ByItem2>
|
||||
<FilterItem1ByItem2 Item1="@(_ProjectReferenceWithConfiguration)"
|
||||
PreserveItem1Metadata="true"
|
||||
Item2="@(_wpfProjectPathAvailableLocally)"
|
||||
Metadata2="ProjectPath"
|
||||
TreatItemsAsPaths="true">
|
||||
<Output ItemName="_unmatched_ProjectReferenceWithConfiguration" TaskParameter="UnmatchedReferences" />
|
||||
</FilterItem1ByItem2>
|
||||
<ItemGroup>
|
||||
<ProjectReferenceWithConfiguration Remove="@(_unmatchedProjectReferenceWithConfiguration)" />
|
||||
<_ProjectReferenceWithConfiguration Remove="@(_unmatched_ProjectReferenceWithConfiguration)" />
|
||||
<_MSBuildProjectReferenceNonExistent Remove="@(_unmatchedProjectReferenceWithConfiguration)" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<FilterItem1ByItem2 Item1="@(_unmatchedProjectReference)"
|
||||
PreserveItem1Metadata="true"
|
||||
Item2="@(WpfProjectPath)"
|
||||
Metadata2="ProjectPath"
|
||||
TreatItemsAsPaths="true">
|
||||
<Output ItemName="_wpfUnmatchedProjectReference" TaskParameter="Result" />
|
||||
</FilterItem1ByItem2>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Remove="@(_wpfUnmatchedProjectReference)"/>
|
||||
</ItemGroup>
|
||||
|
||||
<FilterItem1ByItem2 Item1="@(_wpfProjectPath->'%(ProjectPath)')"
|
||||
PreserveItem1Metadata="true"
|
||||
Item2="@(_wpfUnmatchedProjectReference)"
|
||||
PreserveItem2Metadata="true"
|
||||
Metadata2="Identity"
|
||||
TreatItemsAsPaths="true">
|
||||
<Output ItemName="_microsoftDotNetWpfGitHubReference" TaskParameter="Result" />
|
||||
</FilterItem1ByItem2>
|
||||
|
||||
<ItemGroup>
|
||||
<MicrosoftDotNetWpfGitHubReference Include="@(_microsoftDotNetWpfGitHubReference->'%(AssemblyName)')" />
|
||||
</ItemGroup>
|
||||
|
||||
<Message Text="ProjectReference: @(ProjectReference)" />
|
||||
<Message Text="MicrosoftDotNetWpfGitHubReference: @(MicrosoftDotNetWpfGitHubReference)" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,21 @@
|
|||
# Nominal timestamp: 2004/11/17-21:38:31
|
||||
#
|
||||
# Auto-generated from winmain-450k-newerupdatedlist.txt dated 2004/10/20
|
||||
# with additional 13288 files from Vikram dated 2004/11/06
|
||||
# See DavePr or LisaGra or RajeshM or JFeltis for questions.
|
||||
#
|
||||
FILE r1defwpp.ini
|
||||
$TAG ENGR
|
||||
$MODULE: build_tools_wppconfig
|
||||
$OWNER: jtolman
|
||||
$KEYWORDS:
|
||||
$ENDTAG
|
||||
|
||||
FILE *
|
||||
$TAG ENGR
|
||||
$MODULE: build_tools_wppconfig
|
||||
$OWNER: josesua
|
||||
$KEYWORDS:
|
||||
$ENDTAG
|
||||
|
||||
# checksum: 0020-008292397-00
|
|
@ -0,0 +1,218 @@
|
|||
#
|
||||
# Default types for WPP for users who are using TCHAR's and have Unicode defined.
|
||||
# 2004 Revision 0.0
|
||||
#
|
||||
|
||||
# our basic arithmetic types
|
||||
|
||||
DEFINE_SIMPLE_TYPE( XINT64, signed __int64, ItemLongLongX, "I64x", x, 8);
|
||||
DEFINE_SIMPLE_TYPE( XXINT64, signed __int64, ItemLongLongXX, "I64X", X, 8);
|
||||
DEFINE_SIMPLE_TYPE( OINT64, signed __int64, ItemLongLongO, "I64o", o, 8);
|
||||
|
||||
DEFINE_SIMPLE_TYPE( SBYTE, signed char, ItemChar, "c", c, 1);
|
||||
DEFINE_SIMPLE_TYPE( SSHORT, signed short, ItemShort, "hd", h, 2);
|
||||
DEFINE_SIMPLE_TYPE( SINT, signed int, ItemLong, "d", d, 4);
|
||||
DEFINE_SIMPLE_TYPE( SLONG, signed long, ItemLong, "ld", l, 4);
|
||||
DEFINE_SIMPLE_TYPE( SINT64, signed __int64, ItemLongLong, "I64d", i, 8);
|
||||
|
||||
DEFINE_SIMPLE_TYPE( UBYTE, unsigned char, ItemChar, "c", C, 1);
|
||||
DEFINE_SIMPLE_TYPE( USHORT, unsigned short, ItemShort, "hu", H, 2);
|
||||
DEFINE_SIMPLE_TYPE( UINT, unsigned int, ItemLong, "u", D, 4);
|
||||
DEFINE_SIMPLE_TYPE( ULONG, unsigned long, ItemLong, "lu", L, 4);
|
||||
DEFINE_SIMPLE_TYPE( UINT64, unsigned __int64, ItemULongLong, "I64u", I, 8);
|
||||
|
||||
|
||||
|
||||
DEFINE_SIMPLE_TYPE( DOUBLE, double, ItemDouble, "s", g, 8);
|
||||
|
||||
# arch dependent types
|
||||
|
||||
DEFINE_SIMPLE_TYPE( SLONGPTR, LONG_PTR, ItemPtr, "Id", p, 6);
|
||||
DEFINE_SIMPLE_TYPE( ULONGPTR, ULONG_PTR, ItemPtr, "Iu", P, 6);
|
||||
DEFINE_SIMPLE_TYPE( PTR, const void*, ItemPtr, "p", q, 6);
|
||||
DEFINE_SIMPLE_TYPE( HANDLE, const void*, ItemPtr, "p", Q, 6);
|
||||
|
||||
# predefined constants
|
||||
|
||||
DEFINE_SIMPLE_TYPE( COMPNAME,,, "__COMPNAME__",,);
|
||||
DEFINE_SIMPLE_TYPE( FILE,,, "__FILE__",,);
|
||||
DEFINE_SIMPLE_TYPE( LINE,,, "__LINE__",,);
|
||||
DEFINE_SIMPLE_TYPE( FUNC,,, "%!FUNC!",,); // traceprt now understands %!FUNC!
|
||||
DEFINE_SIMPLE_TYPE( LEVEL,,, "%!LEVEL!",,); // and %!LEVEL%
|
||||
|
||||
DEFINE_SIMPLE_TYPE( STDPREFIX,,, "%0",,);
|
||||
DEFINE_SIMPLE_TYPE( MOD,,, "%1!s!",,);
|
||||
DEFINE_SIMPLE_TYPE( TYP,,, "%2!s!",,);
|
||||
DEFINE_SIMPLE_TYPE( TID,,, "%3!x!",,);
|
||||
DEFINE_SIMPLE_TYPE( NOW,,, "%4!s!",,);
|
||||
DEFINE_SIMPLE_TYPE( SEQ,,, "%7!x!",,);
|
||||
DEFINE_SIMPLE_TYPE( PID,,, "%8!x!",,);
|
||||
DEFINE_SIMPLE_TYPE( CPU,,, "%9!x!",,);
|
||||
DEFINE_SIMPLE_TYPE( SPACE,,, " ",,);
|
||||
|
||||
DEFINE_SIMPLE_TYPE_PTR(GUID, LPCGUID, ItemGuid, "s", _guid_, 0); // simple type, passed by addr
|
||||
|
||||
DEFINE_FLAVOR( UCHAR, SBYTE, ItemUChar, "c" );
|
||||
DEFINE_FLAVOR( SCHAR, SBYTE, ItemChar, "c" );
|
||||
DEFINE_FLAVOR( BOOLEAN, SBYTE, ItemListByte(FALSE,TRUE), "s");
|
||||
|
||||
|
||||
# all strings require custom processing
|
||||
# Note that in the TCHAR Unicode verions ASTR is wide and WSTR is mapped to single
|
||||
|
||||
DEFINE_CPLX_TYPE(ASTR, WPP_LOGWSTR, LPCWSTR, ItemWString, "s", s, 0);
|
||||
DEFINE_CPLX_TYPE(ARSTR, WPP_LOGASTR, LPCSTR, ItemRString, "s", t, 0);
|
||||
DEFINE_CPLX_TYPE(ARWSTR, WPP_LOGWSTR, LPCWSTR, ItemRWString, "s", S, 0);
|
||||
DEFINE_CPLX_TYPE(WSTR, WPP_LOGASTR, const char *, ItemString, "s", S, 0);
|
||||
DEFINE_CPLX_TYPE(CSTR, WPP_LOGPCSTR, PCSTRING, ItemPString, "s", z, 0, 2);
|
||||
DEFINE_CPLX_TYPE(USTR, WPP_LOGPUSTR, PCUNICODE_STRING,ItemPWString,"s", Z, 0, 2);
|
||||
|
||||
DEFINE_CPLX_TYPE(sid, WPP_LOGPSID, PSID, ItemSid,"s", _sid_, 0);
|
||||
DEFINE_CPLX_TYPE(str, WPP_LOGSTDSTR, const std::string&, ItemString,"s", _str_, 0);
|
||||
|
||||
|
||||
#kludge for printf like statements
|
||||
|
||||
DEFINE_FLAVOR(e, DOUBLE,,);
|
||||
DEFINE_FLAVOR(E, DOUBLE,,);
|
||||
DEFINE_FLAVOR(f, DOUBLE,,);
|
||||
DEFINE_FLAVOR(g, DOUBLE,,);
|
||||
DEFINE_FLAVOR(G, DOUBLE,,);
|
||||
|
||||
DEFINE_FLAVOR(c, SBYTE,,);
|
||||
DEFINE_FLAVOR(hc, SBYTE,,);
|
||||
DEFINE_FLAVOR(lc, SSHORT,,);
|
||||
DEFINE_FLAVOR(wc, SSHORT,,);
|
||||
DEFINE_FLAVOR(C, SSHORT,,);
|
||||
|
||||
DEFINE_FLAVOR(s, ASTR,,);
|
||||
DEFINE_FLAVOR(hs, ASTR,,);
|
||||
DEFINE_FLAVOR(S, WSTR,,);
|
||||
DEFINE_FLAVOR(ws, WSTR,,);
|
||||
DEFINE_FLAVOR(ls, ASTR,,);
|
||||
|
||||
DEFINE_FLAVOR(hi, SSHORT,,);
|
||||
DEFINE_FLAVOR(hd, SSHORT,,);
|
||||
DEFINE_FLAVOR(hu, USHORT,,"u");
|
||||
DEFINE_FLAVOR(hx, USHORT,,"x");
|
||||
DEFINE_FLAVOR(hX, USHORT,,"X");
|
||||
DEFINE_FLAVOR(ho, USHORT,,"o");
|
||||
|
||||
DEFINE_FLAVOR(Id, ULONGPTR,,"Id");
|
||||
DEFINE_FLAVOR(Iu, ULONGPTR,,"Iu");
|
||||
DEFINE_FLAVOR(Ix, ULONGPTR,,"Ix");
|
||||
DEFINE_FLAVOR(IX, ULONGPTR,,"IX");
|
||||
DEFINE_FLAVOR(Io, ULONGPTR,,"Io");
|
||||
|
||||
DEFINE_FLAVOR(i, SINT,,);
|
||||
DEFINE_FLAVOR(d, SINT,,);
|
||||
DEFINE_FLAVOR(u, UINT,,"u");
|
||||
DEFINE_FLAVOR(x, UINT,,"x");
|
||||
DEFINE_FLAVOR(X, UINT,,"X");
|
||||
DEFINE_FLAVOR(o, UINT,,"o");
|
||||
DEFINE_FLAVOR(cccc, SINT, ItemChar4, "s");
|
||||
|
||||
DEFINE_FLAVOR(li, SLONG,,);
|
||||
DEFINE_FLAVOR(ld, SLONG,,);
|
||||
DEFINE_FLAVOR(lu, ULONG,,"u");
|
||||
DEFINE_FLAVOR(lx, ULONG,,"x");
|
||||
DEFINE_FLAVOR(lX, ULONG,,"X");
|
||||
DEFINE_FLAVOR(lo, ULONG,,"o");
|
||||
|
||||
DEFINE_FLAVOR(I64d, SINT64,,);
|
||||
DEFINE_FLAVOR(I64u, UINT64,,);
|
||||
DEFINE_FLAVOR(I64x, XINT64,,"I64x");
|
||||
DEFINE_FLAVOR(I64X, XXINT64,,"I64X");
|
||||
DEFINE_FLAVOR(I64o, OINT64,,"I64o");
|
||||
|
||||
DEFINE_FLAVOR(p, PTR,,);
|
||||
|
||||
DEFINE_FLAVOR(Z, USTR,,);
|
||||
DEFINE_FLAVOR(wZ, USTR,,);
|
||||
DEFINE_FLAVOR(z, CSTR,,);
|
||||
DEFINE_FLAVOR(hZ, CSTR,,);
|
||||
|
||||
# default formats for those who don't care to provide their own strings
|
||||
|
||||
DEFINE_FLAVOR(XBYTE, SBYTE,, "02x");
|
||||
DEFINE_FLAVOR(OBYTE, SBYTE,, "o");
|
||||
|
||||
DEFINE_FLAVOR(XSHORT, SSHORT,, "04hX");
|
||||
DEFINE_FLAVOR(OSHORT, SSHORT,, "ho");
|
||||
|
||||
DEFINE_FLAVOR(XINT, SINT,, "08x");
|
||||
DEFINE_FLAVOR(OINT, SINT,, "o");
|
||||
|
||||
DEFINE_FLAVOR(XLONG, SLONG,, "08lX");
|
||||
DEFINE_FLAVOR(OLONG, SLONG,, "lo");
|
||||
|
||||
|
||||
DEFINE_FLAVOR(XLONGPTR, SLONGPTR,,"Ix");
|
||||
DEFINE_FLAVOR(OLONGPTR, SLONGPTR,,"Ox");
|
||||
|
||||
# special formats
|
||||
|
||||
DEFINE_FLAVOR(IPADDR, UINT, ItemIPAddr, "s");
|
||||
DEFINE_FLAVOR(PORT, USHORT, ItemPort, "s");
|
||||
DEFINE_FLAVOR(STATUS, SINT, ItemNTSTATUS, "s");
|
||||
DEFINE_FLAVOR(WINERROR, UINT, ItemWINERROR, "s");
|
||||
DEFINE_FLAVOR(HRESULT, SINT, ItemHRESULT, "s");
|
||||
|
||||
DEFINE_FLAVOR(ipaddr,IPADDR,,);
|
||||
DEFINE_FLAVOR(port,PORT,,);
|
||||
DEFINE_FLAVOR(status,STATUS,,);
|
||||
DEFINE_FLAVOR(hresult,HRESULT,,);
|
||||
DEFINE_FLAVOR(winerr,WINERROR,,);
|
||||
DEFINE_FLAVOR(guid,GUID,,);
|
||||
|
||||
# time related stuff
|
||||
|
||||
DEFINE_FLAVOR(TIMESTAMP, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(TIME, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(DATE, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(WAITTIME, SINT64, ItemTimestamp, "s");
|
||||
|
||||
DEFINE_FLAVOR(due, SINT64, ItemWaitTime, "s");
|
||||
DEFINE_FLAVOR(delta, SINT64, ItemTimeDelta, "s");
|
||||
DEFINE_FLAVOR(datetime, SINT64, ItemTimestamp, "s");
|
||||
|
||||
# enumeration types
|
||||
|
||||
DEFINE_FLAVOR(ItemListByte, SBYTE, ItemListByte, "s");
|
||||
DEFINE_FLAVOR(ItemListShort, SSHORT, ItemListShort,"s");
|
||||
DEFINE_FLAVOR(ItemListLong, SLONG, ItemListLong, "s");
|
||||
|
||||
DEFINE_FLAVOR(ItemSetByte, UBYTE, ItemSetByte, "s");
|
||||
DEFINE_FLAVOR(ItemSetShort, USHORT, ItemSetShort,"s");
|
||||
DEFINE_FLAVOR(ItemSetLong, ULONG, ItemSetLong, "s");
|
||||
DEFINE_FLAVOR(ItemEnum, ULONG, ItemEnum, "s");
|
||||
|
||||
DEFINE_FLAVOR(CLSID, GUID, ItemCLSID, "s");
|
||||
DEFINE_FLAVOR(LIBID, GUID, ItemLIBID, "s");
|
||||
DEFINE_FLAVOR(IID, GUID, ItemIID, "s");
|
||||
|
||||
CUSTOM_TYPE(b1, ItemSetByte(1,2,3,4,5,6,7,8) );
|
||||
CUSTOM_TYPE(b2, ItemSetShort(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) );
|
||||
CUSTOM_TYPE(b4, ItemSetLong(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) );
|
||||
|
||||
|
||||
CUSTOM_TYPE(bool, ItemListLong(false,true) );
|
||||
CUSTOM_TYPE(bool16, ItemListShort(false,true) );
|
||||
CUSTOM_TYPE(bool8, ItemListByte(false,true) );
|
||||
|
||||
CUSTOM_TYPE(irql, ItemListByte(Low,APC,DPC) );
|
||||
|
||||
CUSTOM_TYPE(pnpmn, ItemListByte(IRP_MN_START_DEVICE,IRP_MN_QUERY_REMOVE_DEVICE,IRP_MN_REMOVE_DEVICE,IRP_MN_CANCEL_REMOVE_DEVICE,IRP_MN_STOP_DEVICE,IRP_MN_QUERY_STOP_DEVICE,IRP_MN_CANCEL_STOP_DEVICE,IRP_MN_QUERY_DEVICE_RELATIONS,IRP_MN_QUERY_INTERFACE,IRP_MN_QUERY_CAPABILITIES,IRP_MN_QUERY_RESOURCES,IRP_MN_QUERY_RESOURCE_REQUIREMENTS,IRP_MN_QUERY_DEVICE_TEXT,IRP_MN_FILTER_RESOURCE_REQUIREMENTS,IRP_MN_PNP_14,IRP_MN_READ_CONFIG,IRP_MN_WRITE_CONFIG,IRP_MN_EJECT,IRP_MN_SET_LOCK,IRP_MN_QUERY_ID,IRP_MN_QUERY_PNP_DEVICE_STATE,IRP_MN_QUERY_BUS_INFORMATION,IRP_MN_DEVICE_USAGE_NOTIFICATION,IRP_MN_SURPRISE_REMOVAL) );
|
||||
CUSTOM_TYPE(sysctrl, ItemListByte(IRP_MN_QUERY_ALL_DATA,IRP_MN_QUERY_SINGLE_INSTANCE, IRP_MN_CHANGE_SINGLE_INSTANCE, IRP_MN_CHANGE_SINGLE_ITEM, IRP_MN_ENABLE_EVENTS, IRP_MN_DISABLE_EVENTS, IRP_MN_ENABLE_COLLECTION, IRP_MN_DISABLE_COLLECTION, IRP_MN_REGINFO, IRP_MN_EXECUTE_METHOD, IRP_MN_Reserved_0a, IRP_MN_REGINFO_EX) );
|
||||
|
||||
# default tracing macro
|
||||
|
||||
FUNC DoTraceMessage(LEVEL,MSG,...);
|
||||
FUNC DoDebugTrace(TRACELEVEL,MSG,...);
|
||||
|
||||
|
||||
# default prefix (use traceprt default)
|
||||
|
||||
USEPREFIX(*,"%!STDPREFIX!"); // traceprt will add standard prefix
|
||||
|
||||
WPP_FLAGS(-lookfor:WPP_INIT_TRACING); // the same flags that can be passed on the command line to tracewpp
|
|
@ -0,0 +1,192 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
#ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
#define WPP_EVAL(x) x
|
||||
#define WPP_STR(x) #x
|
||||
#define WPP_STRINGIZE(x) WPP_STR(x)
|
||||
#define WPP_GLUE(a, b) a ## b
|
||||
#define WPP_GLUE3(a, b, c) a ## b ## c
|
||||
#define WPP_GLUE4(a, b, c, d) a ## b ## c ## d
|
||||
#define WPP_XGLUE(a, b) WPP_GLUE(a, b)
|
||||
#define WPP_XGLUE3(a, b, c) WPP_GLUE3(a, b, c)
|
||||
#define WPP_XGLUE4(a, b, c, d) WPP_GLUE4(a, b, c, d)
|
||||
|
||||
// template `TemplateFile`
|
||||
//
|
||||
// Defines a set of macro that expand control model specified
|
||||
// with WPP_CONTROL_GUIDS (example shown below)
|
||||
// into an enum of trace levels and required structures that
|
||||
// contain the mask of levels, logger handle and some information
|
||||
// required for registration.
|
||||
//
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// #define WPP_CONTROL_GUIDS \
|
||||
// WPP_DEFINE_CONTROL_GUID(Regular,(81b20fea,73a8,4b62,95bc,354477c97a6f), \
|
||||
// WPP_DEFINE_BIT(Error) \
|
||||
// WPP_DEFINE_BIT(Unusual) \
|
||||
// WPP_DEFINE_BIT(Noise) \
|
||||
// ) \
|
||||
// WPP_DEFINE_CONTROL_GUID(HiFreq,(91b20fea,73a8,4b62,95bc,354477c97a6f), \
|
||||
// WPP_DEFINE_BIT(Entry) \
|
||||
// WPP_DEFINE_BIT(Exit) \
|
||||
// WPP_DEFINE_BIT(ApiCalls) \
|
||||
// WPP_DEFINE_BIT(RandomJunk) \
|
||||
// WPP_DEFINE_BIT(LovePoem) \
|
||||
// )
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_NO_CONTROL_GUIDS)
|
||||
|
||||
#if defined(WPP_DEFAULT_CONTROL_GUID)
|
||||
# if defined(WPP_CONTROL_GUIDS)
|
||||
# pragma message(__FILE__ " : error : WPP_DEFAULT_CONTROL_GUID cannot be used together with WPP_CONTROL_GUIDS")
|
||||
# stop
|
||||
# else
|
||||
# define WPP_CONTROL_GUIDS \
|
||||
WPP_DEFINE_CONTROL_GUID(Default,(WPP_DEFAULT_CONTROL_GUID), \
|
||||
WPP_DEFINE_BIT(Error) \
|
||||
WPP_DEFINE_BIT(Unusual) \
|
||||
WPP_DEFINE_BIT(Noise) \
|
||||
)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_CONTROL_GUIDS)
|
||||
# pragma message(__FILE__ " : error : Please define control model via WPP_CONTROL_GUIDS or WPP_DEFAULT_CONTROL_GUID macros")
|
||||
# pragma message(__FILE__ " : error : don't forget to call WPP_INIT_TRACING and WPP_CLEANUP in your main, DriverEntry or DllInit")
|
||||
# pragma message(__FILE__ " : error : see tracewpp.doc for further information")
|
||||
stop.
|
||||
#endif
|
||||
// a set of macro to convert a guid in a form x(81b20fea,73a8,4b62,95bc,354477c97a6f)
|
||||
// into either a a struct or text string
|
||||
|
||||
#define _WPPW(x) WPP_GLUE(L, x)
|
||||
|
||||
#define WPP_GUID_TEXT(l,w1,w2,w3,ll) #l "-" #w1 "-" #w2 "-" #w3 "-" #ll
|
||||
#define WPP_GUID_WTEXT(l,w1,w2,w3,ll) _WPPW(#l) L"-" _WPPW(#w1) L"-" _WPPW(#w2) L"-" _WPPW(#w3) L"-" _WPPW(#ll)
|
||||
#define WPP_EXTRACT_BYTE(val,n) (((ULONGLONG)(0x ## val) >> (8 * n)) & 0xFF)
|
||||
#define WPP_GUID_STRUCT(l,w1,w2,w3,ll) {0x ## l, 0x ## w1, 0x ## w2,\
|
||||
{WPP_EXTRACT_BYTE(w3, 1), WPP_EXTRACT_BYTE(w3, 0),\
|
||||
WPP_EXTRACT_BYTE(ll, 5), WPP_EXTRACT_BYTE(ll, 4),\
|
||||
WPP_EXTRACT_BYTE(ll, 3), WPP_EXTRACT_BYTE(ll, 2),\
|
||||
WPP_EXTRACT_BYTE(ll, 1), WPP_EXTRACT_BYTE(ll, 0)} }
|
||||
|
||||
#ifndef WPP_FORCEINLINE
|
||||
#if !defined(WPP_OLDCC)
|
||||
#define WPP_FORCEINLINE __forceinline
|
||||
#else
|
||||
#define WPP_FORCEINLINE __inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// define an enum of control block names
|
||||
//////
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) WPP_XGLUE(WPP_CTL_, WPP_EVAL(Name)),
|
||||
enum WPP_CTL_NAMES { WPP_CONTROL_GUIDS WPP_LAST_CTL};
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
|
||||
// define control guids
|
||||
//////
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
|
||||
extern __declspec(selectany) const GUID WPP_XGLUE4(WPP_, ThisDir, _CTLGUID_, WPP_EVAL(Name)) = WPP_GUID_STRUCT Guid;
|
||||
WPP_CONTROL_GUIDS
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
|
||||
// define enums of individual bits
|
||||
/////
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
|
||||
WPP_XGLUE(WPP_BLOCK_START_, WPP_EVAL(Name)) = WPP_XGLUE(WPP_CTL_, WPP_EVAL(Name)) * 0x10000, Bits WPP_XGLUE(WPP_BLOCK_END_, WPP_EVAL(Name)),
|
||||
# define WPP_DEFINE_BIT(Name) WPP_BIT_ ## Name,
|
||||
enum WPP_DEFINE_BIT_NAMES { WPP_CONTROL_GUIDS };
|
||||
# undef WPP_DEFINE_BIT
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
|
||||
#define WPP_MASK(CTL) (1 << ( ((CTL)-1) & 31 ))
|
||||
#define WPP_FLAG_NO(CTL) ( (0xFFFF & ((CTL)-1) ) / 32)
|
||||
#define WPP_CTRL_NO(CTL) ((CTL) >> 16)
|
||||
|
||||
// calculate how many DWORDs we need to get the required number of bits
|
||||
// upper estimate. Sometimes will be off by one
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) | WPP_XGLUE(WPP_BLOCK_END_, WPP_EVAL(Name))
|
||||
enum _WPP_FLAG_LEN_ENUM { WPP_FLAG_LEN = 1 | ((0 WPP_CONTROL_GUIDS) & 0xFFFF) / 32 };
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
|
||||
#ifndef WPP_CB
|
||||
# define WPP_CB WPP_GLOBAL_Control
|
||||
#endif
|
||||
#ifndef WPP_CB_TYPE
|
||||
#define WPP_CB_TYPE WPP_PROJECT_CONTROL_BLOCK
|
||||
#endif
|
||||
|
||||
typedef union {
|
||||
WPP_TRACE_CONTROL_BLOCK Control;
|
||||
UCHAR ReserveSpace[ sizeof(WPP_TRACE_CONTROL_BLOCK) + sizeof(ULONG) * (WPP_FLAG_LEN - 1) ];
|
||||
} WPP_CB_TYPE ;
|
||||
|
||||
|
||||
extern __declspec(selectany) WPP_CB_TYPE *WPP_CB = (WPP_CB_TYPE*)&WPP_CB;
|
||||
|
||||
#define WPP_CONTROL(CTL) (WPP_CB[WPP_CTRL_NO(CTL)].Control)
|
||||
|
||||
#ifndef WPP_USE_TRACE_LEVELS
|
||||
// For historical reasons the use of LEVEL could imply flags, this was a bad choice but very difficult
|
||||
// to undo.
|
||||
#if !defined(WPP_LEVEL_LOGGER)
|
||||
# define WPP_LEVEL_LOGGER(CTL) (WPP_CONTROL(WPP_BIT_ ## CTL).Logger),
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LEVEL_ENABLED)
|
||||
# define WPP_LEVEL_ENABLED(CTL) (WPP_CONTROL(WPP_BIT_ ## CTL).Flags[WPP_FLAG_NO(WPP_BIT_ ## CTL)] & WPP_MASK(WPP_BIT_ ## CTL))
|
||||
#endif
|
||||
#else // #ifndef WPP_USE_TRACE_LEVELS
|
||||
#if !defined(WPP_LEVEL_LOGGER)
|
||||
#define WPP_LEVEL_LOGGER(lvl) (WPP_CONTROL(WPP_BIT_ ## DUMMY).Logger),
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LEVEL_ENABLED)
|
||||
#define WPP_LEVEL_ENABLED(lvl) (WPP_CONTROL(WPP_BIT_ ## DUMMY).Level >= lvl)
|
||||
#endif
|
||||
#endif // #ifndef WPP_USE_TRACE_LEVELS
|
||||
|
||||
#if !defined(WPP_FLAG_LOGGER)
|
||||
# define WPP_FLAG_LOGGER(CTL) (WPP_CONTROL(WPP_BIT_ ## CTL).Logger),
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(WPP_FLAG_ENABLED)
|
||||
# define WPP_FLAG_ENABLED(CTL) (WPP_CONTROL(WPP_BIT_ ## CTL).Flags[WPP_FLAG_NO(WPP_BIT_ ## CTL)] & WPP_MASK(WPP_BIT_ ## CTL))
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGGER_ARG)
|
||||
# define WPP_LOGGER_ARG TRACEHANDLE Logger,
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_GET_LOGGER)
|
||||
# define WPP_GET_LOGGER Logger
|
||||
#endif
|
||||
|
||||
#ifndef WPP_ENABLED
|
||||
# define WPP_ENABLED() 1
|
||||
#endif
|
||||
#ifndef WPP_LOGGER
|
||||
# define WPP_LOGGER() (WPP_CB[0].Control.Logger),
|
||||
#endif
|
||||
|
||||
#endif // WPP_NO_CONTROL_GUIDS
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // #ifndef WPP_ALREADY_INCLUDED
|
||||
|
|
@ -0,0 +1,219 @@
|
|||
#
|
||||
# Default types for WPP
|
||||
#
|
||||
|
||||
# our basic arithmetic types
|
||||
|
||||
DEFINE_SIMPLE_TYPE( XINT64, signed __int64, ItemLongLongX, "I64x", x, 8);
|
||||
DEFINE_SIMPLE_TYPE( XXINT64, signed __int64, ItemLongLongXX, "I64X", X, 8);
|
||||
DEFINE_SIMPLE_TYPE( OINT64, signed __int64, ItemLongLongO, "I64o", o, 8);
|
||||
|
||||
DEFINE_SIMPLE_TYPE( SBYTE, signed char, ItemChar, "c", c, 1);
|
||||
DEFINE_SIMPLE_TYPE( SSHORT, signed short, ItemShort, "hd", h, 2);
|
||||
DEFINE_SIMPLE_TYPE( SINT, signed int, ItemLong, "d", d, 4);
|
||||
DEFINE_SIMPLE_TYPE( SLONG, signed long, ItemLong, "ld", l, 4);
|
||||
DEFINE_SIMPLE_TYPE( SINT64, signed __int64, ItemLongLong, "I64d", i, 8);
|
||||
|
||||
DEFINE_SIMPLE_TYPE( UBYTE, unsigned char, ItemChar, "c", C, 1);
|
||||
DEFINE_SIMPLE_TYPE( USHORT, unsigned short, ItemShort, "hu", H, 2);
|
||||
DEFINE_SIMPLE_TYPE( UINT, unsigned int, ItemLong, "u", D, 4);
|
||||
DEFINE_SIMPLE_TYPE( ULONG, unsigned long, ItemLong, "lu", L, 4);
|
||||
DEFINE_SIMPLE_TYPE( UINT64, unsigned __int64, ItemULongLong, "I64u", I, 8);
|
||||
|
||||
|
||||
|
||||
DEFINE_SIMPLE_TYPE( DOUBLE, double, ItemDouble, "s", g, 8);
|
||||
|
||||
# arch dependent types
|
||||
|
||||
DEFINE_SIMPLE_TYPE( SLONGPTR, LONG_PTR, ItemPtr, "Id", p, 6);
|
||||
DEFINE_SIMPLE_TYPE( ULONGPTR, ULONG_PTR, ItemPtr, "Iu", P, 6);
|
||||
DEFINE_SIMPLE_TYPE( PTR, const void*, ItemPtr, "p", q, 6);
|
||||
DEFINE_SIMPLE_TYPE( HANDLE, const void*, ItemPtr, "p", Q, 6);
|
||||
|
||||
# predefined constants
|
||||
|
||||
DEFINE_SIMPLE_TYPE( COMPNAME,,, "__COMPNAME__",,);
|
||||
DEFINE_SIMPLE_TYPE( FILE,,, "__FILE__",,);
|
||||
DEFINE_SIMPLE_TYPE( LINE,,, "__LINE__",,);
|
||||
DEFINE_SIMPLE_TYPE( FUNC,,, "%!FUNC!",,); // traceprt now understands %!FUNC!
|
||||
DEFINE_SIMPLE_TYPE( LEVEL,,, "%!LEVEL!",,); // and %!LEVEL%
|
||||
|
||||
DEFINE_SIMPLE_TYPE( STDPREFIX,,, "%0",,);
|
||||
DEFINE_SIMPLE_TYPE( MOD,,, "%1!s!",,);
|
||||
DEFINE_SIMPLE_TYPE( TYP,,, "%2!s!",,);
|
||||
DEFINE_SIMPLE_TYPE( TID,,, "%3!x!",,);
|
||||
DEFINE_SIMPLE_TYPE( NOW,,, "%4!s!",,);
|
||||
DEFINE_SIMPLE_TYPE( SEQ,,, "%7!x!",,);
|
||||
DEFINE_SIMPLE_TYPE( PID,,, "%8!x!",,);
|
||||
DEFINE_SIMPLE_TYPE( CPU,,, "%9!x!",,);
|
||||
DEFINE_SIMPLE_TYPE( SPACE,,, " ",,);
|
||||
|
||||
DEFINE_SIMPLE_TYPE_PTR(GUID, LPCGUID, ItemGuid, "s", _guid_, 0); // simple type, passed by addr
|
||||
|
||||
DEFINE_FLAVOR( UCHAR, SBYTE, ItemUChar, "c" );
|
||||
DEFINE_FLAVOR( SCHAR, SBYTE, ItemChar, "c" );
|
||||
DEFINE_FLAVOR( BOOLEAN, SBYTE, ItemListByte(FALSE,TRUE), "s");
|
||||
|
||||
|
||||
# all strings require custom processing
|
||||
|
||||
DEFINE_CPLX_TYPE(ASTR, WPP_LOGASTR, const char*, ItemString, "s", s, 0);
|
||||
DEFINE_CPLX_TYPE(ARSTR, WPP_LOGASTR, LPCSTR, ItemRString, "s", t, 0);
|
||||
DEFINE_CPLX_TYPE(ARWSTR, WPP_LOGWSTR, LPCWSTR, ItemRWString, "s", S, 0);
|
||||
DEFINE_CPLX_TYPE(WSTR, WPP_LOGWSTR, LPCWSTR, ItemWString, "s", S, 0);
|
||||
DEFINE_CPLX_TYPE(CSTR, WPP_LOGPCSTR, PCSTRING, ItemPString, "s", z, 0, 2);
|
||||
DEFINE_CPLX_TYPE(USTR, WPP_LOGPUSTR, PCUNICODE_STRING,ItemPWString,"s", Z, 0, 2);
|
||||
DEFINE_CPLX_TYPE(ANSTR, WPP_LOGPCSTR, PCANSI_STRING, ItemPString, "s", aZ, 0, 2);
|
||||
|
||||
DEFINE_CPLX_TYPE(sid, WPP_LOGPSID, PSID, ItemSid,"s", _sid_, 0);
|
||||
DEFINE_CPLX_TYPE(str, WPP_LOGSTDSTR, const std::string&, ItemString,"s", _str_, 0);
|
||||
|
||||
|
||||
#kludge for printf like statements
|
||||
|
||||
DEFINE_FLAVOR(e, DOUBLE,,);
|
||||
DEFINE_FLAVOR(E, DOUBLE,,);
|
||||
DEFINE_FLAVOR(f, DOUBLE,,);
|
||||
DEFINE_FLAVOR(g, DOUBLE,,);
|
||||
DEFINE_FLAVOR(G, DOUBLE,,);
|
||||
|
||||
DEFINE_FLAVOR(c, SBYTE,,);
|
||||
DEFINE_FLAVOR(hc, SBYTE,,);
|
||||
DEFINE_FLAVOR(lc, SSHORT,,);
|
||||
DEFINE_FLAVOR(wc, SSHORT,,);
|
||||
DEFINE_FLAVOR(C, SSHORT,,);
|
||||
|
||||
DEFINE_FLAVOR(s, ASTR,,);
|
||||
DEFINE_FLAVOR(hs, ASTR,,);
|
||||
DEFINE_FLAVOR(S, WSTR,,);
|
||||
DEFINE_FLAVOR(ws, WSTR,,);
|
||||
DEFINE_FLAVOR(ls, WSTR,,);
|
||||
|
||||
DEFINE_FLAVOR(hi, SSHORT,,);
|
||||
DEFINE_FLAVOR(hd, SSHORT,,);
|
||||
DEFINE_FLAVOR(hu, USHORT,,"u");
|
||||
DEFINE_FLAVOR(hx, USHORT,,"x");
|
||||
DEFINE_FLAVOR(hX, USHORT,,"X");
|
||||
DEFINE_FLAVOR(ho, USHORT,,"o");
|
||||
|
||||
DEFINE_FLAVOR(Id, ULONGPTR,,"Id");
|
||||
DEFINE_FLAVOR(Iu, ULONGPTR,,"Iu");
|
||||
DEFINE_FLAVOR(Ix, ULONGPTR,,"Ix");
|
||||
DEFINE_FLAVOR(IX, ULONGPTR,,"IX");
|
||||
DEFINE_FLAVOR(Io, ULONGPTR,,"Io");
|
||||
|
||||
DEFINE_FLAVOR(i, SINT,,);
|
||||
DEFINE_FLAVOR(d, SINT,,);
|
||||
DEFINE_FLAVOR(u, UINT,,"u");
|
||||
DEFINE_FLAVOR(x, UINT,,"x");
|
||||
DEFINE_FLAVOR(X, UINT,,"X");
|
||||
DEFINE_FLAVOR(o, UINT,,"o");
|
||||
DEFINE_FLAVOR(cccc, SINT, ItemChar4, "s");
|
||||
|
||||
DEFINE_FLAVOR(li, SLONG,,);
|
||||
DEFINE_FLAVOR(ld, SLONG,,);
|
||||
DEFINE_FLAVOR(lu, ULONG,,"u");
|
||||
DEFINE_FLAVOR(lx, ULONG,,"x");
|
||||
DEFINE_FLAVOR(lX, ULONG,,"X");
|
||||
DEFINE_FLAVOR(lo, ULONG,,"o");
|
||||
|
||||
DEFINE_FLAVOR(I64d, SINT64,,);
|
||||
DEFINE_FLAVOR(I64u, UINT64,,);
|
||||
DEFINE_FLAVOR(I64x, XINT64,,"I64x");
|
||||
DEFINE_FLAVOR(I64X, XXINT64,,"I64X");
|
||||
DEFINE_FLAVOR(I64o, OINT64,,"I64o");
|
||||
|
||||
DEFINE_FLAVOR(p, PTR,,);
|
||||
|
||||
DEFINE_FLAVOR(Z, ANSTR,,);
|
||||
DEFINE_FLAVOR(wZ, USTR,,);
|
||||
DEFINE_FLAVOR(z, CSTR,,);
|
||||
DEFINE_FLAVOR(hZ, CSTR,,);
|
||||
|
||||
# default formats for those who don't care to provide their own strings
|
||||
|
||||
DEFINE_FLAVOR(XBYTE, SBYTE,, "02x");
|
||||
DEFINE_FLAVOR(OBYTE, SBYTE,, "o");
|
||||
|
||||
DEFINE_FLAVOR(XSHORT, SSHORT,, "04hX");
|
||||
DEFINE_FLAVOR(OSHORT, SSHORT,, "ho");
|
||||
|
||||
DEFINE_FLAVOR(XINT, SINT,, "08x");
|
||||
DEFINE_FLAVOR(OINT, SINT,, "o");
|
||||
|
||||
DEFINE_FLAVOR(XLONG, SLONG,, "08lX");
|
||||
DEFINE_FLAVOR(OLONG, SLONG,, "lo");
|
||||
|
||||
|
||||
DEFINE_FLAVOR(XLONGPTR, SLONGPTR,,"Ix");
|
||||
DEFINE_FLAVOR(OLONGPTR, SLONGPTR,,"Ox");
|
||||
|
||||
# special formats
|
||||
|
||||
DEFINE_FLAVOR(IPADDR, UINT, ItemIPAddr, "s");
|
||||
DEFINE_FLAVOR(PORT, USHORT, ItemPort, "s");
|
||||
DEFINE_FLAVOR(STATUS, SINT, ItemNTSTATUS, "s");
|
||||
DEFINE_FLAVOR(WINERROR, UINT, ItemWINERROR, "s");
|
||||
DEFINE_FLAVOR(HRESULT, SINT, ItemHRESULT, "s");
|
||||
|
||||
DEFINE_FLAVOR(ipaddr,IPADDR,,);
|
||||
DEFINE_FLAVOR(port,PORT,,);
|
||||
DEFINE_FLAVOR(status,STATUS,,);
|
||||
DEFINE_FLAVOR(hresult,HRESULT,,);
|
||||
DEFINE_FLAVOR(winerr,WINERROR,,);
|
||||
DEFINE_FLAVOR(guid,GUID,,);
|
||||
|
||||
# time related stuff
|
||||
|
||||
DEFINE_FLAVOR(TIMESTAMP, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(TIME, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(DATE, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(WAITTIME, SINT64, ItemTimestamp, "s");
|
||||
|
||||
DEFINE_FLAVOR(due, SINT64, ItemWaitTime, "s");
|
||||
DEFINE_FLAVOR(delta, SINT64, ItemTimeDelta, "s");
|
||||
DEFINE_FLAVOR(datetime, SINT64, ItemTimestamp, "s");
|
||||
|
||||
# enumeration types
|
||||
|
||||
DEFINE_FLAVOR(ItemListByte, SBYTE, ItemListByte, "s");
|
||||
DEFINE_FLAVOR(ItemListShort, SSHORT, ItemListShort,"s");
|
||||
DEFINE_FLAVOR(ItemListLong, SLONG, ItemListLong, "s");
|
||||
|
||||
DEFINE_FLAVOR(ItemSetByte, UBYTE, ItemSetByte, "s");
|
||||
DEFINE_FLAVOR(ItemSetShort, USHORT, ItemSetShort,"s");
|
||||
DEFINE_FLAVOR(ItemSetLong, ULONG, ItemSetLong, "s");
|
||||
|
||||
DEFINE_FLAVOR(ItemEnum, ULONG, ItemEnum, "s");
|
||||
|
||||
DEFINE_FLAVOR(CLSID, GUID, ItemCLSID, "s");
|
||||
DEFINE_FLAVOR(LIBID, GUID, ItemLIBID, "s");
|
||||
DEFINE_FLAVOR(IID, GUID, ItemIID, "s");
|
||||
|
||||
|
||||
CUSTOM_TYPE(b1, ItemSetByte(1,2,3,4,5,6,7,8) );
|
||||
CUSTOM_TYPE(b2, ItemSetShort(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) );
|
||||
CUSTOM_TYPE(b4, ItemSetLong(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) );
|
||||
|
||||
|
||||
CUSTOM_TYPE(bool, ItemListLong(false,true) );
|
||||
CUSTOM_TYPE(bool16, ItemListShort(false,true) );
|
||||
CUSTOM_TYPE(bool8, ItemListByte(false,true) );
|
||||
|
||||
CUSTOM_TYPE(irql, ItemListByte(Low,APC,DPC) );
|
||||
|
||||
CUSTOM_TYPE(pnpmn, ItemListByte(IRP_MN_START_DEVICE,IRP_MN_QUERY_REMOVE_DEVICE,IRP_MN_REMOVE_DEVICE,IRP_MN_CANCEL_REMOVE_DEVICE,IRP_MN_STOP_DEVICE,IRP_MN_QUERY_STOP_DEVICE,IRP_MN_CANCEL_STOP_DEVICE,IRP_MN_QUERY_DEVICE_RELATIONS,IRP_MN_QUERY_INTERFACE,IRP_MN_QUERY_CAPABILITIES,IRP_MN_QUERY_RESOURCES,IRP_MN_QUERY_RESOURCE_REQUIREMENTS,IRP_MN_QUERY_DEVICE_TEXT,IRP_MN_FILTER_RESOURCE_REQUIREMENTS,IRP_MN_PNP_14,IRP_MN_READ_CONFIG,IRP_MN_WRITE_CONFIG,IRP_MN_EJECT,IRP_MN_SET_LOCK,IRP_MN_QUERY_ID,IRP_MN_QUERY_PNP_DEVICE_STATE,IRP_MN_QUERY_BUS_INFORMATION,IRP_MN_DEVICE_USAGE_NOTIFICATION,IRP_MN_SURPRISE_REMOVAL) );
|
||||
CUSTOM_TYPE(sysctrl, ItemListByte(IRP_MN_QUERY_ALL_DATA,IRP_MN_QUERY_SINGLE_INSTANCE, IRP_MN_CHANGE_SINGLE_INSTANCE, IRP_MN_CHANGE_SINGLE_ITEM, IRP_MN_ENABLE_EVENTS, IRP_MN_DISABLE_EVENTS, IRP_MN_ENABLE_COLLECTION, IRP_MN_DISABLE_COLLECTION, IRP_MN_REGINFO, IRP_MN_EXECUTE_METHOD, IRP_MN_Reserved_0a, IRP_MN_REGINFO_EX) );
|
||||
|
||||
# default tracing macro
|
||||
|
||||
FUNC DoTraceMessage(LEVEL,MSG,...);
|
||||
FUNC DoDebugTrace(TRACELEVEL,MSG,...);
|
||||
|
||||
|
||||
# default prefix (use traceprt default)
|
||||
|
||||
USEPREFIX(*,"%!STDPREFIX!"); // traceprt will add standard prefix
|
||||
|
||||
WPP_FLAGS(-lookfor:WPP_INIT_TRACING); // the same flags that can be passed on the command line to tracewpp
|
|
@ -0,0 +1,70 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
// template `TemplateFile`
|
||||
|
||||
`* Dump defintions specified via -D on the command line to WPP *`
|
||||
|
||||
`FORALL def IN MacroDefinitions`
|
||||
#define `def.Name` `def.Alias`
|
||||
`ENDFOR`
|
||||
|
||||
#define WPP_THIS_FILE `SourceFile.CanonicalName`
|
||||
|
||||
#if !defined(WPP_KERNEL_MODE)
|
||||
# include <windows.h>
|
||||
# pragma warning(disable: 4201)
|
||||
# include <wmistr.h>
|
||||
# include <evntrace.h>
|
||||
# define WPP_TRACE TraceMessage
|
||||
#else
|
||||
#define WPP_TRACE WmiTraceMessage
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_PRIVATE)
|
||||
# define WPP_INLINE __inline
|
||||
# define WPP_SELECT_ANY extern "C" __declspec(selectany)
|
||||
#else
|
||||
# define WPP_INLINE static
|
||||
# define WPP_SELECT_ANY static
|
||||
#endif
|
||||
|
||||
__inline TRACEHANDLE WppQueryLogger(__in_opt PCWSTR LoggerName)
|
||||
{
|
||||
{
|
||||
#if defined(WPP_KERNEL_MODE)
|
||||
ULONG ReturnLength ;
|
||||
NTSTATUS Status ;
|
||||
TRACEHANDLE TraceHandle ;
|
||||
UNICODE_STRING Buffer ;
|
||||
|
||||
RtlInitUnicodeString(&Buffer, LoggerName ? LoggerName : L"stdout");
|
||||
|
||||
if ((Status = WmiQueryTraceInformation(TraceHandleByNameClass,
|
||||
(PVOID)&TraceHandle,
|
||||
sizeof(TraceHandle),
|
||||
&ReturnLength,
|
||||
(PVOID)&Buffer)) == STATUS_SUCCESS) {
|
||||
return TraceHandle ;
|
||||
}
|
||||
#else
|
||||
ULONG status;
|
||||
EVENT_TRACE_PROPERTIES LoggerInfo;
|
||||
|
||||
ZeroMemory(&LoggerInfo, sizeof(LoggerInfo));
|
||||
LoggerInfo.Wnode.BufferSize = sizeof(LoggerInfo);
|
||||
LoggerInfo.Wnode.Flags = WNODE_FLAG_TRACED_GUID;
|
||||
|
||||
status = QueryTraceW(0, LoggerName ? LoggerName : L"stdout", &LoggerInfo);
|
||||
if (status == ERROR_SUCCESS || status == ERROR_MORE_DATA) {
|
||||
return (TRACEHANDLE) LoggerInfo.Wnode.HistoricalContext;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,248 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright 1999-2000 Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
// template `TemplateFile`
|
||||
//
|
||||
// Defines a set of macro that expand control model specified
|
||||
// with WPP_CONTROL_GUIDS (example shown below)
|
||||
// into an enum of trace levels and required structures that
|
||||
// contain the mask of levels, logger handle and some information
|
||||
// required for registration.
|
||||
//
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// #define WPP_CONTROL_GUIDS \
|
||||
// WPP_DEFINE_CONTROL_GUID(Regular,(81b20fea,73a8,4b62,95bc,354477c97a6f), \
|
||||
// WPP_DEFINE_BIT(Error) \
|
||||
// WPP_DEFINE_BIT(Unusual) \
|
||||
// WPP_DEFINE_BIT(Noise) \
|
||||
// ) \
|
||||
// WPP_DEFINE_CONTROL_GUID(HiFreq,(91b20fea,73a8,4b62,95bc,354477c97a6f), \
|
||||
// WPP_DEFINE_BIT(Entry) \
|
||||
// WPP_DEFINE_BIT(Exit) \
|
||||
// WPP_DEFINE_BIT(ApiCalls) \
|
||||
// WPP_DEFINE_BIT(RandomJunk) \
|
||||
// WPP_DEFINE_BIT(LovePoem) \
|
||||
// )
|
||||
|
||||
|
||||
#if !defined(WPP_NO_CONTROL_GUIDS)
|
||||
|
||||
#if defined(WPP_DEFAULT_CONTROL_GUID)
|
||||
# if defined(WPP_CONTROL_GUIDS)
|
||||
# pragma message(__FILE__ " : error : WPP_DEFAULT_CONTROL_GUID cannot be used together with WPP_CONTROL_GUIDS")
|
||||
# stop
|
||||
# else
|
||||
# define WPP_CONTROL_GUIDS \
|
||||
WPP_DEFINE_CONTROL_GUID(Default,(WPP_DEFAULT_CONTROL_GUID), \
|
||||
WPP_DEFINE_BIT(Error) \
|
||||
WPP_DEFINE_BIT(Unusual) \
|
||||
WPP_DEFINE_BIT(Noise) \
|
||||
)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_CONTROL_GUIDS)
|
||||
# pragma message(__FILE__ " : error : Please define control model via WPP_CONTROL_GUIDS or WPP_DEFAULT_CONTROL_GUID macros")
|
||||
# pragma message(__FILE__ " : error : don't forget to call WPP_INIT_TRACING and WPP_CLEANUP in your main, DriverEntry or DllInit")
|
||||
# pragma message(__FILE__ " : error : see tracewpp.doc for further information")
|
||||
stop.
|
||||
#endif
|
||||
// a set of macro to convert a guid in a form x(81b20fea,73a8,4b62,95bc,354477c97a6f)
|
||||
// into either a a struct or text string
|
||||
|
||||
#define _WPPW(x) L ## x
|
||||
|
||||
#define WPP_GUID_TEXT(l,w1,w2,w3,ll) #l "-" #w1 "-" #w2 "-" #w3 "-" #ll
|
||||
#define WPP_GUID_WTEXT(l,w1,w2,w3,ll) _WPPW(#l) L"-" _WPPW(#w1) L"-" _WPPW(#w2) L"-" _WPPW(#w3) L"-" _WPPW(#ll)
|
||||
#define WPP_EXTRACT_BYTE(val,n) ( ((0x ## val) >> (8 * n)) & 0xFF )
|
||||
#define WPP_GUID_STRUCT(l,w1,w2,w3,ll) {0x ## l, 0x ## w1, 0x ## w2,\
|
||||
{WPP_EXTRACT_BYTE(w3, 1), WPP_EXTRACT_BYTE(w3, 0), \
|
||||
WPP_EXTRACT_BYTE(ll, 5), WPP_EXTRACT_BYTE(ll, 4), \
|
||||
WPP_EXTRACT_BYTE(ll, 3), WPP_EXTRACT_BYTE(ll, 2), \
|
||||
WPP_EXTRACT_BYTE(ll, 1), WPP_EXTRACT_BYTE(ll, 0)} }
|
||||
|
||||
// define annotation record that will carry control intormation to pdb (in case somebody needs it)
|
||||
__forceinline void WPP_CONTROL_ANNOTATION() {
|
||||
#if !defined(WPP_NO_ANNOTATIONS)
|
||||
#if !defined(WPP_ANSI_ANNOTATION)
|
||||
# define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) __annotation(L"TMC:", WPP_GUID_WTEXT Guid, _WPPW(#Name) Bits);
|
||||
# define WPP_DEFINE_BIT(Name) , _WPPW(#Name)
|
||||
#else
|
||||
# define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) __annotation("TMC:", WPP_GUID_TEXT Guid, #Name Bits);
|
||||
# define WPP_DEFINE_BIT(Name) , #Name
|
||||
#endif
|
||||
WPP_CONTROL_GUIDS
|
||||
# undef WPP_DEFINE_BIT
|
||||
# undef WPP_DEFINE_CONTROL_GUID
|
||||
#endif
|
||||
}
|
||||
|
||||
// define an enum of control block names
|
||||
//////
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) WPP_CTL_ ## Name,
|
||||
enum WPP_CTL_NAMES { WPP_CONTROL_GUIDS WPP_LAST_CTL};
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
|
||||
// define control guids
|
||||
//////
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
|
||||
extern __declspec(selectany) const GUID WPP_ ## ThisDir ## _CTLGUID_ ## Name = WPP_GUID_STRUCT Guid;
|
||||
WPP_CONTROL_GUIDS
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
|
||||
// define enums of individual bits
|
||||
/////
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
|
||||
WPP_BLOCK_START_ ## Name = WPP_CTL_ ## Name * 0x10000, Bits WPP_BLOCK_END_ ## Name,
|
||||
# define WPP_DEFINE_BIT(Name) WPP_BIT_ ## Name,
|
||||
enum WPP_DEFINE_BIT_NAMES { WPP_CONTROL_GUIDS };
|
||||
# undef WPP_DEFINE_BIT
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
|
||||
#define WPP_MASK(CTL) (1 << ( ((CTL)-1) & 31 ))
|
||||
#define WPP_FLAG_NO(CTL) ( (0xFFFF & ((CTL)-1) ) / 32)
|
||||
#define WPP_CTRL_NO(CTL) ((CTL) >> 16)
|
||||
|
||||
// calculate how many DWORDs we need to get the required number of bits
|
||||
// upper estimate. Sometimes will be off by one
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) | WPP_BLOCK_END_ ## Name
|
||||
enum _WPP_FLAG_LEN_ENUM { WPP_FLAG_LEN = 1 | ((0 WPP_CONTROL_GUIDS) & 0xFFFF) / 32 };
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
|
||||
#ifndef WPP_CB
|
||||
# define WPP_CB WPP_GLOBAL_Control
|
||||
#endif
|
||||
#ifndef WPP_CB_TYPE
|
||||
#define WPP_CB_TYPE WPP_PROJECT_CONTROL_BLOCK
|
||||
#endif
|
||||
|
||||
typedef union {
|
||||
WPP_REGISTRATION_BLOCK Registration; // need this only to register
|
||||
WPP_TRACE_CONTROL_BLOCK Control;
|
||||
UCHAR ReserveSpace[ sizeof(WPP_TRACE_CONTROL_BLOCK) + sizeof(ULONG) * (WPP_FLAG_LEN - 1) ];
|
||||
} WPP_CB_TYPE ;
|
||||
|
||||
#define WPP_NEXT(Name) ((WPP_REGISTRATION_BLOCK*) \
|
||||
(WPP_CTL_ ## Name + 1 == WPP_LAST_CTL ? 0:WPP_CB + WPP_CTL_ ## Name + 1))
|
||||
|
||||
// WPP_CONTROL structure has two extra fields in the kernel
|
||||
// mode. We will use WPPKM_NULL to initalize them
|
||||
|
||||
#if defined(WPP_KERNEL_MODE)
|
||||
# define WPPKM_NULL 0,
|
||||
#else
|
||||
# define WPPKM_NULL
|
||||
#endif
|
||||
|
||||
#if defined(WPP_DLL)
|
||||
|
||||
extern __declspec(selectany) WPP_CB_TYPE WPP_CB[WPP_LAST_CTL];
|
||||
|
||||
__inline void WPP_INIT_CONTROL_ARRAY(WPP_CB_TYPE* Arr) {
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
|
||||
Arr->Registration.Next = WPP_NEXT(Name); \
|
||||
Arr->Registration.ControlGuid = &WPP_ ## ThisDir ## _CTLGUID_ ## Name; \
|
||||
Arr->Registration.FriendlyName = L ## #Name; \
|
||||
Arr->Registration.BitNames = Bits; \
|
||||
Arr->Registration.FlagsLen = WPP_FLAG_LEN; \
|
||||
Arr->Registration.RegBlockLen = WPP_LAST_CTL; ++Arr;
|
||||
#define WPP_DEFINE_BIT(BitName) L" " L ## #BitName
|
||||
WPP_CONTROL_GUIDS
|
||||
#undef WPP_DEFINE_BIT
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
}
|
||||
#define WPP_INIT_STATIC_DATA WPP_INIT_CONTROL_ARRAY(WPP_CB)
|
||||
|
||||
#else
|
||||
|
||||
extern __declspec(selectany) WPP_CB_TYPE WPP_CB[WPP_LAST_CTL] = {
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) {{WPPKM_NULL WPP_NEXT(Name), \
|
||||
&WPP_ ## ThisDir ## _CTLGUID_ ## Name, L ## #Name, Bits, WPPKM_NULL WPP_FLAG_LEN, WPP_LAST_CTL}},
|
||||
#define WPP_DEFINE_BIT(BitName) L" " L ## #BitName
|
||||
WPP_CONTROL_GUIDS
|
||||
#undef WPP_DEFINE_BIT
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
};
|
||||
#define WPP_INIT_STATIC_DATA 0
|
||||
|
||||
#endif
|
||||
|
||||
#define WPP_CONTROL(CTL) (WPP_CB[WPP_CTRL_NO(CTL)].Control)
|
||||
#define WPP_REGISTRATION(CTL) (WPP_CB[WPP_CTRL_NO(CTL)].Registration)
|
||||
|
||||
#define WPP_SET_FORWARD_PTR(CTL, FLAGS, PTR) (\
|
||||
(WPP_REGISTRATION(WPP_BIT_ ## CTL ).Options = (FLAGS)),\
|
||||
(WPP_REGISTRATION(WPP_BIT_ ## CTL ).Ptr = (PTR)) )
|
||||
|
||||
#if !defined(WPP_LEVEL_LOGGER)
|
||||
# define WPP_LEVEL_LOGGER(CTL) (WPP_CONTROL(WPP_BIT_ ## CTL).Logger),
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LEVEL_ENABLED)
|
||||
# define WPP_LEVEL_ENABLED(CTL) (WPP_CONTROL(WPP_BIT_ ## CTL).Flags[WPP_FLAG_NO(WPP_BIT_ ## CTL)] & WPP_MASK(WPP_BIT_ ## CTL))
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGGER_ARG)
|
||||
# define WPP_LOGGER_ARG TRACEHANDLE Logger,
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_GET_LOGGER)
|
||||
# define WPP_GET_LOGGER Logger
|
||||
#endif
|
||||
|
||||
#ifndef WPP_ENABLED
|
||||
# define WPP_ENABLED() 1
|
||||
#endif
|
||||
#ifndef WPP_LOGGER
|
||||
# define WPP_LOGGER() (WPP_CB[0].Control.Logger),
|
||||
#endif
|
||||
|
||||
#endif // WPP_NO_CONTROL_GUIDS
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
#if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
VOID WppInitKm(PVOID DrvContext, PVOID InitInfo, PWPP_REGISTRATION_BLOCK Registration);
|
||||
VOID WppCleanupKm(PVOID TraceContext, PWPP_REGISTRATION_BLOCK Registration);
|
||||
#else // #if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
// W2K Compatable versions
|
||||
VOID WppInitKm(PDEVICE_OBJECT pDevObj, PUNICODE_STRING RegistryPath, PWPP_REGISTRATION_BLOCK Registration);
|
||||
VOID WppCleanupKm(PDEVICE_OBJECT pDeviceObject);
|
||||
#endif // #if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
# define WPP_INIT_TRACING(DrvObj, Regpath, InitInfo) (WPP_CONTROL_ANNOTATION(),WPP_INIT_STATIC_DATA,WppInitKm(DrvObj, InitInfo, &WPP_CB[0].Registration))
|
||||
|
||||
# define WPP_CLEANUP(DrvObj, TraceContext) WppCleanupKm(TraceContext, &WPP_CB[0].Registration)
|
||||
|
||||
#else // #if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
# define WPP_INIT_TRACING(DevObj, RegPath) (WPP_CONTROL_ANNOTATION(),WPP_INIT_STATIC_DATA,WppInitKm(DevObj, RegPath, &WPP_CB[0].Registration))
|
||||
|
||||
# define WPP_CLEANUP(DevObj) WppCleanupKm(DevObj)
|
||||
|
||||
NTSTATUS
|
||||
WppTraceCallback(
|
||||
IN UCHAR minorFunction,
|
||||
IN PVOID DataPath,
|
||||
IN ULONG BufferLength,
|
||||
IN PVOID Buffer,
|
||||
IN PVOID Context,
|
||||
OUT PULONG Size
|
||||
) ;
|
||||
|
||||
#define WPP_TRACE_CONTROL(Function,Buffer,BufferSize,ReturnSize) WppTraceCallback(Function,NULL,BufferSize,Buffer,&WPP_CB[0],&ReturnSize);
|
||||
|
||||
#endif // #if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
`**********************************************************************`
|
||||
`* This is a template file for tracewpp preprocessor *`
|
||||
`* If you need to use a custom version of this file in your project *`
|
||||
`* Please clone it from this one and point WPP to it by specifying *`
|
||||
`* -gen:{yourfile} option on RUN_WPP line in your sources file *`
|
||||
`* *`
|
||||
`* Copyright 1999-2000 Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
//`Compiler.Checksum` Generated File. Do not edit.
|
||||
// File created by `Compiler.Name` compiler version `Compiler.Version`-`Compiler.Timestamp`
|
||||
// on `System.Date` at `System.Time` UTC from a template `TemplateFile`
|
||||
|
||||
typedef
|
||||
ULONG
|
||||
(*PFN_WPPTRACEMESSAGE)(
|
||||
IN ULONG64 LoggerHandle,
|
||||
IN ULONG MessageFlags,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
IN ...
|
||||
);
|
||||
|
||||
`INCLUDE km-StorHeader.tpl`
|
||||
`INCLUDE km-StorControl.tpl`
|
||||
`INCLUDE trmacro.tpl`
|
||||
|
||||
`IF FOUND WPP_INIT_TRACING`
|
||||
#define WPPINIT_EXPORT
|
||||
`INCLUDE km-StorInit.tpl`
|
||||
`ENDIF`
|
|
@ -0,0 +1,319 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright 1999-2000 Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
// template `TemplateFile`
|
||||
|
||||
`* Dump the definitions specified via -D on the command line to WPP *`
|
||||
|
||||
`FORALL def IN MacroDefinitions`
|
||||
#define `def.Name` `def.Alias`
|
||||
`ENDFOR`
|
||||
|
||||
#define WPP_THIS_FILE `SourceFile.CanonicalName`
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <wmistr.h>
|
||||
|
||||
#if defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
DEFINE_GUID(WPP_TRACE_CONTROL_NULL_GUID, 0x00000000L, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ULONG
|
||||
__inline
|
||||
NullTraceFunc (
|
||||
IN ULONG64 LoggerHandle,
|
||||
IN ULONG MessageFlags,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
IN ...
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
__declspec(selectany) PFN_WPPTRACEMESSAGE pfnWppTraceMessage = NullTraceFunc;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(_NTRTL_)
|
||||
// fake RTL_TIME_ZONE_INFORMATION //
|
||||
typedef int RTL_TIME_ZONE_INFORMATION;
|
||||
# define _WMIKM_
|
||||
#endif
|
||||
#ifndef WPP_TRACE
|
||||
#define WPP_TRACE pfnWppTraceMessage
|
||||
#endif
|
||||
|
||||
#ifndef WPP_OLDCC
|
||||
#define WPP_OLDCC
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// B O R R O W E D D E F I N I T I O N S
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
# define WPP_LOGGER_ARG ULONG64 Logger,
|
||||
|
||||
#if ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)) && !defined(_M_AMD64)
|
||||
#define NTAPI __stdcall
|
||||
#else
|
||||
#define _cdecl
|
||||
#define NTAPI
|
||||
#endif
|
||||
|
||||
//
|
||||
// Define API decoration for direct importing system DLL references.
|
||||
//
|
||||
|
||||
#if !defined(_NTSYSTEM_)
|
||||
#define NTSYSAPI DECLSPEC_IMPORT
|
||||
#define NTSYSCALLAPI DECLSPEC_IMPORT
|
||||
#else
|
||||
#define NTSYSAPI
|
||||
#if defined(_NTDLLBUILD_)
|
||||
#define NTSYSCALLAPI
|
||||
#else
|
||||
#define NTSYSCALLAPI DECLSPEC_ADDRSAFE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
int __cdecl swprintf (
|
||||
wchar_t *string,
|
||||
const wchar_t *format,
|
||||
...
|
||||
);
|
||||
|
||||
typedef struct _UNICODE_STRING {
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
#ifdef MIDL_PASS
|
||||
[size_is(MaximumLength / 2), length_is((Length) / 2) ] USHORT * Buffer;
|
||||
#else // MIDL_PASS
|
||||
PWSTR Buffer;
|
||||
#endif // MIDL_PASS
|
||||
} UNICODE_STRING;
|
||||
typedef UNICODE_STRING *PUNICODE_STRING;
|
||||
typedef const UNICODE_STRING *PCUNICODE_STRING;
|
||||
|
||||
#define TRACE_MESSAGE_SEQUENCE 1 // Message should include a sequence number
|
||||
#define TRACE_MESSAGE_GUID 2 // Message includes a GUID
|
||||
#define TRACE_MESSAGE_COMPONENTID 4 // Message has no GUID, Component ID instead
|
||||
#define TRACE_MESSAGE_TIMESTAMP 8 // Message includes a timestamp
|
||||
#define TRACE_MESSAGE_PERFORMANCE_TIMESTAMP 16 // *Obsolete* Clock type is controlled by
|
||||
// the logger
|
||||
#define TRACE_MESSAGE_SYSTEMINFO 32 // Message includes system information TID,PID
|
||||
#define TRACE_MESSAGE_FLAG_MASK 0xFFFF // Only the lower 16 bits of flags are
|
||||
// placed in the message those above 16
|
||||
// bits are reserved for local processing
|
||||
#define TRACE_MESSAGE_MAXIMUM_SIZE 8*1024 // the maximum size allowed for a single trace
|
||||
// message
|
||||
|
||||
#define RtlFillMemory(Destination,Length,Fill) StorMemSet((Destination),(Fill),(Length))
|
||||
#define RtlZeroMemory(Destination,Length) StorMemSet((Destination),0,(Length))
|
||||
|
||||
typedef LONG NTSTATUS;
|
||||
|
||||
//
|
||||
// Generic test for success on any status value (non-negative numbers
|
||||
// indicate success).
|
||||
//
|
||||
|
||||
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
|
||||
|
||||
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) // ntsubauth
|
||||
#define STATUS_WMI_GUID_NOT_FOUND ((NTSTATUS)0xC0000295L)
|
||||
#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L)
|
||||
#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL)
|
||||
#define STATUS_INVALID_DEVICE_REQUEST ((NTSTATUS)0xC0000010L)
|
||||
|
||||
typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE;
|
||||
|
||||
typedef enum _TRACE_INFORMATION_CLASS {
|
||||
TraceIdClass,
|
||||
TraceHandleClass,
|
||||
TraceEnableFlagsClass,
|
||||
TraceEnableLevelClass,
|
||||
GlobalLoggerHandleClass,
|
||||
EventLoggerHandleClass,
|
||||
AllLoggerHandlesClass,
|
||||
TraceHandleByNameClass
|
||||
} TRACE_INFORMATION_CLASS;
|
||||
|
||||
typedef PVOID PDEVICE_OBJECT;
|
||||
|
||||
//
|
||||
// Action code for IoWMIRegistrationControl api
|
||||
//
|
||||
|
||||
#define WMIREG_ACTION_REGISTER 1
|
||||
#define WMIREG_ACTION_DEREGISTER 2
|
||||
#define WMIREG_ACTION_REREGISTER 3
|
||||
#define WMIREG_ACTION_UPDATE_GUIDS 4
|
||||
#define WMIREG_ACTION_BLOCK_IRPS 5
|
||||
|
||||
#define REG_DWORD ( 4 ) // 32-bit number
|
||||
|
||||
//
|
||||
// Subroutines for dealing with the Registry
|
||||
//
|
||||
|
||||
typedef NTSTATUS (NTAPI * PRTL_QUERY_REGISTRY_ROUTINE)(
|
||||
IN PWSTR ValueName,
|
||||
IN ULONG ValueType,
|
||||
IN PVOID ValueData,
|
||||
IN ULONG ValueLength,
|
||||
IN PVOID Context,
|
||||
IN PVOID EntryContext
|
||||
);
|
||||
|
||||
typedef struct _RTL_QUERY_REGISTRY_TABLE {
|
||||
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
|
||||
ULONG Flags;
|
||||
PWSTR Name;
|
||||
PVOID EntryContext;
|
||||
ULONG DefaultType;
|
||||
PVOID DefaultData;
|
||||
ULONG DefaultLength;
|
||||
|
||||
} RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
|
||||
|
||||
//
|
||||
// The following flags specify how the Name field of a RTL_QUERY_REGISTRY_TABLE
|
||||
// entry is interpreted. A NULL name indicates the end of the table.
|
||||
//
|
||||
|
||||
#define RTL_QUERY_REGISTRY_SUBKEY 0x00000001 // Name is a subkey and remainder of
|
||||
// table or until next subkey are value
|
||||
// names for that subkey to look at.
|
||||
|
||||
#define RTL_QUERY_REGISTRY_TOPKEY 0x00000002 // Reset current key to original key for
|
||||
// this and all following table entries.
|
||||
|
||||
#define RTL_QUERY_REGISTRY_REQUIRED 0x00000004 // Fail if no match found for this table
|
||||
// entry.
|
||||
|
||||
#define RTL_QUERY_REGISTRY_NOVALUE 0x00000008 // Used to mark a table entry that has no
|
||||
// value name, just wants a call out, not
|
||||
// an enumeration of all values.
|
||||
|
||||
#define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010 // Used to suppress the expansion of
|
||||
// REG_MULTI_SZ into multiple callouts or
|
||||
// to prevent the expansion of environment
|
||||
// variable values in REG_EXPAND_SZ
|
||||
|
||||
#define RTL_QUERY_REGISTRY_DIRECT 0x00000020 // QueryRoutine field ignored. EntryContext
|
||||
// field points to location to store value.
|
||||
// For null terminated strings, EntryContext
|
||||
// points to UNICODE_STRING structure that
|
||||
// that describes maximum size of buffer.
|
||||
// If .Buffer field is NULL then a buffer is
|
||||
// allocated.
|
||||
//
|
||||
|
||||
#define RTL_QUERY_REGISTRY_DELETE 0x00000040 // Used to delete value keys after they
|
||||
// are queried.
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
||||
NTSYSAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlQueryRegistryValues(
|
||||
IN ULONG RelativeTo,
|
||||
IN PCWSTR Path,
|
||||
IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||
IN PVOID Context,
|
||||
IN OPTIONAL PVOID Environment
|
||||
);
|
||||
#endif
|
||||
|
||||
//
|
||||
// The following values for the RelativeTo parameter determine what the
|
||||
// Path parameter to RtlQueryRegistryValues is relative to.
|
||||
//
|
||||
|
||||
#define RTL_REGISTRY_ABSOLUTE 0 // Path is a full path
|
||||
#define RTL_REGISTRY_SERVICES 1 // \Registry\Machine\System\CurrentControlSet\Services
|
||||
#define RTL_REGISTRY_CONTROL 2 // \Registry\Machine\System\CurrentControlSet\Control
|
||||
#define RTL_REGISTRY_WINDOWS_NT 3 // \Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion
|
||||
#define RTL_REGISTRY_DEVICEMAP 4 // \Registry\Machine\Hardware\DeviceMap
|
||||
#define RTL_REGISTRY_USER 5 // \Registry\User\CurrentUser
|
||||
#define RTL_REGISTRY_MAXIMUM 6
|
||||
#define RTL_REGISTRY_HANDLE 0x40000000 // Low order bits are registry handle
|
||||
#define RTL_REGISTRY_OPTIONAL 0x80000000 // Indicates the key node is optional
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
__inline TRACEHANDLE WppQueryLogger(__in_opt PWSTR LoggerName)
|
||||
|
||||
{
|
||||
#ifndef WPP_TRACE_W2K_COMPATABILITY
|
||||
ULONG ReturnLength;
|
||||
NTSTATUS Status;
|
||||
TRACEHANDLE TraceHandle;
|
||||
UNICODE_STRING Buffer;
|
||||
|
||||
StorRtlInitUnicodeString(&Buffer, LoggerName ? LoggerName : L"stdout");
|
||||
|
||||
|
||||
if ((Status = StorWmiQueryTraceInformation(TraceHandleByNameClass,
|
||||
(PVOID)&TraceHandle,
|
||||
sizeof(TraceHandle),
|
||||
&ReturnLength,
|
||||
(PVOID)&Buffer)) != STATUS_SUCCESS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return TraceHandle;
|
||||
#else
|
||||
return (TRACEHANDLE) 0;
|
||||
#endif // #ifdef WPP_TRACE_W2K_COMPATABILITY
|
||||
|
||||
}
|
||||
|
||||
typedef NTSTATUS (*WMIENTRY_NEW)(
|
||||
IN UCHAR ActionCode,
|
||||
IN PVOID DataPath,
|
||||
IN ULONG BufferSize,
|
||||
IN OUT PVOID Buffer,
|
||||
IN PVOID Context,
|
||||
OUT PULONG Size
|
||||
);
|
||||
|
||||
typedef struct _WPP_TRACE_CONTROL_BLOCK
|
||||
{
|
||||
WMIENTRY_NEW Callback;
|
||||
struct _WPP_TRACE_CONTROL_BLOCK *Next;
|
||||
|
||||
__int64 Logger;
|
||||
UCHAR FlagsLen; UCHAR Level; USHORT Reserved;
|
||||
ULONG Flags[1];
|
||||
} WPP_TRACE_CONTROL_BLOCK, *PWPP_TRACE_CONTROL_BLOCK;
|
||||
|
||||
typedef struct _WPP_REGISTRATION_BLOCK
|
||||
{
|
||||
WMIENTRY_NEW Callback;
|
||||
struct _WPP_REGISTRATION_BLOCK *Next;
|
||||
|
||||
LPCGUID ControlGuid;
|
||||
LPCWSTR FriendlyName;
|
||||
LPCWSTR BitNames;
|
||||
PUNICODE_STRING RegistryPath;
|
||||
|
||||
UCHAR FlagsLen, RegBlockLen;
|
||||
} WPP_REGISTRATION_BLOCK, *PWPP_REGISTRATION_BLOCK;
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,410 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright 1999-2001 Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
// template `TemplateFile`
|
||||
//
|
||||
// Defines a set of functions that simplifies
|
||||
// kernel mode registration for tracing
|
||||
//
|
||||
|
||||
#if !defined(WppDebug)
|
||||
# define WppDebug(a,b)
|
||||
#endif
|
||||
|
||||
#define WMIREG_FLAG_CALLBACK 0x80000000 // not exposed in DDK
|
||||
|
||||
|
||||
#ifndef WPPINIT_EXPORT
|
||||
# define WPPINIT_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
WPPINIT_EXPORT
|
||||
NTSTATUS
|
||||
WppTraceCallback(
|
||||
IN UCHAR minorFunction,
|
||||
IN PVOID DataPath,
|
||||
IN ULONG BufferLength,
|
||||
IN PVOID Buffer,
|
||||
IN PVOID Context,
|
||||
OUT PULONG Size
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Callback routine for IoWMIRegistrationControl.
|
||||
|
||||
Arguments:
|
||||
|
||||
Return Value:
|
||||
|
||||
status
|
||||
|
||||
Comments:
|
||||
|
||||
if return value is STATUS_BUFFER_TOO_SMALL and BufferLength >= 4,
|
||||
then first ulong of buffer contains required size
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
{
|
||||
WPP_PROJECT_CONTROL_BLOCK *cb = (WPP_PROJECT_CONTROL_BLOCK*)Context;
|
||||
NTSTATUS status = STATUS_SUCCESS;
|
||||
#if defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
static LPCGUID regGuid = NULL;
|
||||
#endif
|
||||
|
||||
UNREFERENCED_PARAMETER(DataPath);
|
||||
|
||||
WppDebug(0,("WppTraceCallBack 0x%08X %p\n", minorFunction, Context));
|
||||
|
||||
*Size = 0;
|
||||
|
||||
switch(minorFunction)
|
||||
{
|
||||
case IRP_MN_REGINFO:
|
||||
{
|
||||
PWMIREGINFOW wmiRegInfo;
|
||||
PCUNICODE_STRING regPath;
|
||||
PWCHAR stringPtr;
|
||||
ULONG registryPathOffset;
|
||||
ULONG bufferNeeded;
|
||||
|
||||
#if defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
|
||||
wmiRegInfo = (PWMIREGINFO)Buffer;
|
||||
|
||||
// Replace the null with the driver's trace control GUID
|
||||
// regGuid is initialized the first time, so the GUID is saved for the next
|
||||
// IRP_MN_REGINFO call
|
||||
if (regGuid == NULL) {
|
||||
regGuid = cb->Registration.ControlGuid;
|
||||
}
|
||||
|
||||
if (wmiRegInfo->GuidCount >= 1) {
|
||||
// Replace the null trace GUID with the driver's trace control GUID
|
||||
wmiRegInfo->WmiRegGuid[wmiRegInfo->GuidCount-1].Guid = *regGuid;
|
||||
wmiRegInfo->WmiRegGuid[wmiRegInfo->GuidCount-1].Flags =
|
||||
WMIREG_FLAG_TRACE_CONTROL_GUID | WMIREG_FLAG_TRACED_GUID;
|
||||
*Size= wmiRegInfo->BufferSize;
|
||||
status = STATUS_SUCCESS;
|
||||
#ifdef WPP_GLOBALLOGGER
|
||||
// Check if Global logger is active
|
||||
StorWppInitGlobalLogger(
|
||||
cb->Registration.ControlGuid,
|
||||
(PTRACEHANDLE)&cb->Control.Logger,
|
||||
&cb->Control.Flags[0],
|
||||
&cb->Control.Level);
|
||||
#endif //#ifdef WPP_GLOBALLOGGER
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
regPath = cb->Registration.RegistryPath;
|
||||
|
||||
if (regPath == NULL)
|
||||
{
|
||||
// No registry path specified. This is a bad thing for
|
||||
// the device to do, but is not fatal
|
||||
|
||||
registryPathOffset = 0;
|
||||
bufferNeeded = FIELD_OFFSET(WMIREGINFOW, WmiRegGuid)
|
||||
+ 1 * sizeof(WMIREGGUIDW);
|
||||
}
|
||||
else {
|
||||
registryPathOffset = FIELD_OFFSET(WMIREGINFOW, WmiRegGuid)
|
||||
+ 1 * sizeof(WMIREGGUIDW);
|
||||
|
||||
bufferNeeded = registryPathOffset +
|
||||
regPath->Length + sizeof(USHORT);
|
||||
}
|
||||
|
||||
if (bufferNeeded <= BufferLength)
|
||||
{
|
||||
RtlZeroMemory(Buffer, BufferLength);
|
||||
|
||||
wmiRegInfo = (PWMIREGINFO)Buffer;
|
||||
wmiRegInfo->BufferSize = bufferNeeded;
|
||||
wmiRegInfo->RegistryPath = registryPathOffset;
|
||||
wmiRegInfo->GuidCount = 1;
|
||||
|
||||
#if defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
wmiRegInfo->WmiRegGuid[0].Guid = *regGuid;
|
||||
#else
|
||||
wmiRegInfo->WmiRegGuid[0].Guid = *cb->Registration.ControlGuid;
|
||||
|
||||
#endif // #ifdef WPP_TRACE_W2K_COMPATABILITY
|
||||
|
||||
wmiRegInfo->WmiRegGuid[0].Flags =
|
||||
WMIREG_FLAG_TRACE_CONTROL_GUID | WMIREG_FLAG_TRACED_GUID;
|
||||
|
||||
if (regPath != NULL) {
|
||||
stringPtr = (PWCHAR)((PUCHAR)Buffer + registryPathOffset);
|
||||
*stringPtr++ = regPath->Length;
|
||||
StorMoveMemory(stringPtr, regPath->Buffer, regPath->Length);
|
||||
|
||||
}
|
||||
status = STATUS_SUCCESS;
|
||||
*Size = bufferNeeded;
|
||||
} else {
|
||||
status = STATUS_BUFFER_TOO_SMALL;
|
||||
if (BufferLength >= sizeof(ULONG)) {
|
||||
*((PULONG)Buffer) = bufferNeeded;
|
||||
*Size = sizeof(ULONG);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WPP_GLOBALLOGGER
|
||||
// Check if Global logger is active
|
||||
StorWppInitGlobalLogger(
|
||||
cb->Registration.ControlGuid,
|
||||
(PTRACEHANDLE)&cb->Control.Logger,
|
||||
&cb->Control.Flags[0],
|
||||
&cb->Control.Level);
|
||||
#endif //#ifdef WPP_GLOBALLOGGER
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case IRP_MN_ENABLE_EVENTS:
|
||||
case IRP_MN_DISABLE_EVENTS:
|
||||
{
|
||||
PWNODE_HEADER Wnode = (PWNODE_HEADER)Buffer;
|
||||
ULONG Level;
|
||||
ULONG ReturnLength ;
|
||||
|
||||
if (cb == NULL )
|
||||
{
|
||||
status = STATUS_WMI_GUID_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
|
||||
if (BufferLength >= sizeof(WNODE_HEADER)) {
|
||||
status = STATUS_SUCCESS;
|
||||
|
||||
if (minorFunction == IRP_MN_DISABLE_EVENTS) {
|
||||
cb->Control.Level = 0;
|
||||
cb->Control.Flags[0] = 0;
|
||||
cb->Control.Logger = 0;
|
||||
} else {
|
||||
TRACEHANDLE lh;
|
||||
lh = (TRACEHANDLE)( Wnode->HistoricalContext );
|
||||
cb->Control.Logger = lh;
|
||||
#if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
if ((status = StorWmiQueryTraceInformation(
|
||||
TraceEnableLevelClass,
|
||||
&Level,
|
||||
sizeof(Level),
|
||||
&ReturnLength,
|
||||
(PVOID)Wnode)) == STATUS_SUCCESS)
|
||||
{
|
||||
cb->Control.Level = (UCHAR)Level;
|
||||
}
|
||||
|
||||
status = StorWmiQueryTraceInformation(
|
||||
TraceEnableFlagsClass,
|
||||
&cb->Control.Flags[0],
|
||||
sizeof(cb->Control.Flags[0]),
|
||||
&ReturnLength,
|
||||
(PVOID)Wnode);
|
||||
#else // #ifndef WPP_TRACE_W2K_COMPATABILITY
|
||||
cb->Control.Flags[0] = WmiGetLoggerEnableFlags(lh) ;
|
||||
cb->Control.Level = (UCHAR)WmiGetLoggerEnableLevel(lh) ;
|
||||
WppDebug(0,("Enable/Disable Logger = %p, Flags = 0x%8x, Level = %x08X\n",
|
||||
cb->Control.Logger,cb->Control.Flags[0],cb->Control.Level));
|
||||
#endif // #ifndef WPP_TRACE_W2K_COMPATABILITY
|
||||
}
|
||||
} else {
|
||||
status = STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case IRP_MN_ENABLE_COLLECTION:
|
||||
case IRP_MN_DISABLE_COLLECTION:
|
||||
{
|
||||
status = STATUS_SUCCESS;
|
||||
break;
|
||||
}
|
||||
|
||||
case IRP_MN_QUERY_ALL_DATA:
|
||||
case IRP_MN_QUERY_SINGLE_INSTANCE:
|
||||
case IRP_MN_CHANGE_SINGLE_INSTANCE:
|
||||
case IRP_MN_CHANGE_SINGLE_ITEM:
|
||||
case IRP_MN_EXECUTE_METHOD:
|
||||
{
|
||||
status = STATUS_INVALID_DEVICE_REQUEST;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
status = STATUS_INVALID_DEVICE_REQUEST;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
// DbgPrintEx(XX_FLTR, DPFLTR_TRACE_LEVEL,
|
||||
// "%!FUNC!(%!SYSCTRL!) => %!status! (size = %d)", minorFunction, status, *Size);
|
||||
return(status);
|
||||
}
|
||||
|
||||
WPPINIT_EXPORT
|
||||
void WppInitKm(
|
||||
IN PVOID DriverObject,
|
||||
IN PVOID InitInfo,
|
||||
IN OUT WPP_REGISTRATION_BLOCK* WppReg
|
||||
)
|
||||
{
|
||||
if (StorInitTracing(InitInfo) == STATUS_SUCCESS) {
|
||||
|
||||
pfnWppTraceMessage = (PFN_WPPTRACEMESSAGE) StorWmiTraceMessage;
|
||||
|
||||
while(WppReg) {
|
||||
|
||||
WPP_TRACE_CONTROL_BLOCK *cb = (WPP_TRACE_CONTROL_BLOCK*)WppReg;
|
||||
NTSTATUS status ;
|
||||
|
||||
WppReg -> Callback = WppTraceCallback;
|
||||
WppReg -> RegistryPath = NULL;
|
||||
cb -> FlagsLen = WppReg -> FlagsLen;
|
||||
cb -> Level = 0;
|
||||
cb -> Flags[0] = 0;
|
||||
status = StorIoWMIRegistrationControl(
|
||||
(PDEVICE_OBJECT)WppReg,
|
||||
WMIREG_ACTION_REGISTER | WMIREG_FLAG_CALLBACK
|
||||
);
|
||||
WppDebug(0,("IoWMIRegistrationControl status = %08X\n"));
|
||||
WppReg = WppReg->Next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
WPPINIT_EXPORT
|
||||
void WppCleanupKm(
|
||||
PVOID TraceContext,
|
||||
WPP_REGISTRATION_BLOCK* WppReg
|
||||
)
|
||||
{
|
||||
StorCleanupTracing(TraceContext);
|
||||
while (WppReg) {
|
||||
StorIoWMIRegistrationControl(
|
||||
(PDEVICE_OBJECT)WppReg,
|
||||
WMIREG_ACTION_DEREGISTER | WMIREG_FLAG_CALLBACK
|
||||
);
|
||||
WppReg = WppReg -> Next;
|
||||
}
|
||||
}
|
||||
#else // #if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
WPPINIT_EXPORT
|
||||
void WppCleanupKm(
|
||||
PDEVICE_OBJECT pDO
|
||||
)
|
||||
{
|
||||
IoWMIRegistrationControl(pDO, WMIREG_ACTION_DEREGISTER );
|
||||
}
|
||||
#endif // #if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
|
||||
#if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
#define WPP_SYSTEMCONTROL(PDO)
|
||||
#define WPP_SYSTEMCONTROL2(PDO, offset)
|
||||
#else // #if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
|
||||
ULONG_PTR WPP_Global_NextDeviceOffsetInDeviceExtension = -1;
|
||||
|
||||
#define WPP_SYSTEMCONTROL(PDO) \
|
||||
PDO->MajorFunction[ IRP_MJ_SYSTEM_CONTROL ] = WPPSystemControlDispatch;
|
||||
#define WPP_SYSTEMCONTROL2(PDO, offset) \
|
||||
WPP_SYSTEMCONTROL(PDO); WPP_Global_NextDeviceOffsetInDeviceExtension = (ULONG_PTR)offset;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif __cplusplus
|
||||
|
||||
// Routine to handle the System Control in W2K
|
||||
NTSTATUS
|
||||
WPPSystemControlDispatch(
|
||||
__in PDEVICE_OBJECT pDO,
|
||||
__in PIRP Irp
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif __cplusplus
|
||||
|
||||
|
||||
#ifdef ALLOC_PRAGMA
|
||||
#pragma alloc_text( PAGE, WPPSystemControlDispatch)
|
||||
#endif // ALLOC_PRAGMA
|
||||
|
||||
// Routine to handle the System Control in W2K
|
||||
NTSTATUS
|
||||
WPPSystemControlDispatch(
|
||||
__in PDEVICE_OBJECT pDO,
|
||||
__in PIRP Irp
|
||||
)
|
||||
{
|
||||
|
||||
PIO_STACK_LOCATION irpSp = IoGetCurrentIrpStackLocation(Irp);
|
||||
ULONG BufferSize = irpSp->Parameters.WMI.BufferSize;
|
||||
PVOID Buffer = irpSp->Parameters.WMI.Buffer;
|
||||
ULONG ReturnSize = 0;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
PWNODE_HEADER Wnode=NULL;
|
||||
HANDLE ThreadHandle;
|
||||
|
||||
WppDebug(0,("WPPSYSTEMCONTROL\n"));
|
||||
|
||||
if (pDO == (PDEVICE_OBJECT)irpSp->Parameters.WMI.ProviderId) {
|
||||
#if defined(WPP_TRACE_W2K_COMPATABILITY)
|
||||
//To differentiate between the case where wmilib has already filled in parts of the buffer
|
||||
if (irpSp->MinorFunction == IRP_MN_REGINFO) RtlZeroMemory(Buffer, BufferSize);
|
||||
#endif
|
||||
Status = WppTraceCallback((UCHAR)(irpSp->MinorFunction),
|
||||
NULL,
|
||||
BufferSize,
|
||||
Buffer,
|
||||
&WPP_CB[0],
|
||||
&ReturnSize);
|
||||
|
||||
WppDebug(0,("WPPSYSTEMCONTROL Status 0x%08X\n",Status));
|
||||
|
||||
Irp->IoStatus.Status = Status;
|
||||
Irp->IoStatus.Information = ReturnSize;
|
||||
IoCompleteRequest( Irp, IO_NO_INCREMENT );
|
||||
return Status;
|
||||
|
||||
} else if (WPP_Global_NextDeviceOffsetInDeviceExtension != -1) {
|
||||
|
||||
ULONG_PTR t;
|
||||
|
||||
WppDebug(0,("WPPSYSTEMCONTROL - not for us\n"));
|
||||
|
||||
//
|
||||
// Set current stack back one.
|
||||
//
|
||||
IoSkipCurrentIrpStackLocation( Irp );
|
||||
//
|
||||
// Pass the call to the next driver.
|
||||
//
|
||||
t = (ULONG_PTR)pDO->DeviceExtension;
|
||||
t += WPP_Global_NextDeviceOffsetInDeviceExtension;
|
||||
return IoCallDriver(*(PDEVICE_OBJECT*)t,Irp);
|
||||
|
||||
} else {
|
||||
|
||||
//unable to pass down -- what to do?
|
||||
//don't change irp status - IO defaults to failure
|
||||
return Irp->IoStatus.Status;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // #if !defined(WPP_TRACE_W2K_COMPATABILITY)
|
|
@ -0,0 +1 @@
|
|||
`INCLUDE km-default.tpl`
|
|
@ -0,0 +1,119 @@
|
|||
`**********************************************************************`
|
||||
`* This is a template file for tracewpp preprocessor *`
|
||||
`* If you need to use a custom version of this file in your project *`
|
||||
`* Please clone it from this one and point WPP to it by specifying *`
|
||||
`* -gen:{yourfile} option on RUN_WPP line in your sources file *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
//`Compiler.Checksum` Generated File. Do not edit.
|
||||
// File created by `Compiler.Name` compiler version `Compiler.Version`-`Compiler.Timestamp`
|
||||
// on `System.Date` at `System.Time` UTC from a template `TemplateFile`
|
||||
|
||||
//
|
||||
// Define anything which is needs but missing from
|
||||
// older versions of the DDK.
|
||||
//
|
||||
#include <evntrace.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <wmistr.h>
|
||||
|
||||
#if !defined(TRACE_LEVEL_NONE)
|
||||
#define TRACE_LEVEL_NONE 0
|
||||
#define TRACE_LEVEL_CRITICAL 1
|
||||
#define TRACE_LEVEL_FATAL 1
|
||||
#define TRACE_LEVEL_ERROR 2
|
||||
#define TRACE_LEVEL_WARNING 3
|
||||
#define TRACE_LEVEL_INFORMATION 4
|
||||
#define TRACE_LEVEL_VERBOSE 5
|
||||
#define TRACE_LEVEL_RESERVED6 6
|
||||
#define TRACE_LEVEL_RESERVED7 7
|
||||
#define TRACE_LEVEL_RESERVED8 8
|
||||
#define TRACE_LEVEL_RESERVED9 9
|
||||
#endif
|
||||
|
||||
#if !defined(TRACE_INFORMATION_CLASS_DEFINE)
|
||||
typedef enum _TRACE_INFORMATION_CLASS {
|
||||
TraceIdClass,
|
||||
TraceHandleClass,
|
||||
TraceEnableFlagsClass,
|
||||
TraceEnableLevelClass,
|
||||
GlobalLoggerHandleClass,
|
||||
EventLoggerHandleClass,
|
||||
AllLoggerHandlesClass,
|
||||
TraceHandleByNameClass
|
||||
} TRACE_INFORMATION_CLASS;
|
||||
|
||||
#define TRACE_MESSAGE_SEQUENCE 1
|
||||
#define TRACE_MESSAGE_GUID 2
|
||||
#define TRACE_MESSAGE_COMPONENTID 4
|
||||
#define TRACE_MESSAGE_TIMESTAMP 8
|
||||
#define TRACE_MESSAGE_PERFORMANCE_TIMESTAMP 16
|
||||
#define TRACE_MESSAGE_SYSTEMINFO 32
|
||||
|
||||
#endif // !defined(TRACE_INFORMATION_CLASS_DEFINE)
|
||||
|
||||
|
||||
//
|
||||
// Advanced tracing APIs (XP and later) will be indirectly called.
|
||||
//
|
||||
typedef
|
||||
LONG
|
||||
(*PFN_WPPQUERYTRACEINFORMATION) (
|
||||
IN TRACE_INFORMATION_CLASS TraceInformationClass,
|
||||
OUT PVOID TraceInformation,
|
||||
IN ULONG TraceInformationLength,
|
||||
OUT PULONG RequiredLength OPTIONAL,
|
||||
IN PVOID Buffer OPTIONAL
|
||||
);
|
||||
|
||||
typedef
|
||||
LONG
|
||||
(*PFN_WPPTRACEMESSAGE)(
|
||||
IN ULONG64 LoggerHandle,
|
||||
IN ULONG MessageFlags,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
IN ...
|
||||
);
|
||||
|
||||
`INCLUDE km-header.tpl`
|
||||
`INCLUDE control.tpl`
|
||||
`INCLUDE tracemacro.tpl`
|
||||
|
||||
`IF FOUND WPP_INIT_TRACING`
|
||||
#define WPPINIT_EXPORT
|
||||
`INCLUDE km-init.tpl`
|
||||
`ENDIF`
|
||||
|
||||
//
|
||||
// Tracing Macro name redefinition
|
||||
//
|
||||
|
||||
// NoMsgArgs
|
||||
|
||||
`FORALL f IN Funcs WHERE !DoubleP && !MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name` WPP_(CALL)
|
||||
`ENDFOR`
|
||||
|
||||
`FORALL f IN Funcs WHERE DoubleP && !MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name`(ARGS) WPP_(CALL) ARGS
|
||||
`ENDFOR`
|
||||
|
||||
|
||||
// MsgArgs
|
||||
|
||||
`FORALL f IN Funcs WHERE MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name`(`f.FixedArgs` MSGARGS) WPP_(CALL)(`f.FixedArgs` MSGARGS)
|
||||
`ENDFOR`
|
||||
|
||||
`FORALL r IN Reorder`
|
||||
#undef WPP_R`r.Name`
|
||||
#define WPP_R`r.Name`(`r.Arguments`) `r.Permutation`
|
||||
`ENDFOR`
|
||||
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
// template `TemplateFile`
|
||||
#ifdef WPP_THIS_FILE
|
||||
// included twice
|
||||
# define WPP_ALREADY_INCLUDED
|
||||
# undef WPP_THIS_FILE
|
||||
#endif // #ifdef WPP_THIS_FILE
|
||||
|
||||
#define WPP_THIS_FILE `SourceFile.CanonicalName`
|
||||
|
||||
#ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
`* Dump the definitions specified via -D on the command line to WPP *`
|
||||
|
||||
`FORALL def IN MacroDefinitions`
|
||||
#define `def.Name` `def.Alias`
|
||||
`ENDFOR`
|
||||
|
||||
#define WPP_THIS_FILE `SourceFile.CanonicalName`
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum _WPP_TRACE_API_SUITE {
|
||||
WppTraceDisabledSuite,
|
||||
WppTraceWin2K,
|
||||
WppTraceWinXP,
|
||||
WppTraceTraceLH,
|
||||
WppTraceMaxSuite
|
||||
} WPP_TRACE_API_SUITE;
|
||||
|
||||
|
||||
__declspec(selectany) PFN_WPPQUERYTRACEINFORMATION pfnWppQueryTraceInformation = NULL;
|
||||
__declspec(selectany) PFN_WPPTRACEMESSAGE pfnWppTraceMessage = NULL;
|
||||
__declspec(selectany) WPP_TRACE_API_SUITE WPPTraceSuite = WppTraceDisabledSuite;
|
||||
|
||||
|
||||
#if !defined(_NTRTL_)
|
||||
#if !defined(_NTHAL_)
|
||||
// fake RTL_TIME_ZONE_INFORMATION //
|
||||
typedef int RTL_TIME_ZONE_INFORMATION;
|
||||
#endif
|
||||
# define _WMIKM_
|
||||
#endif
|
||||
#ifndef WPP_TRACE
|
||||
#define WPP_TRACE pfnWppTraceMessage
|
||||
#endif
|
||||
|
||||
|
||||
VOID
|
||||
WppLoadTracingSupport(
|
||||
VOID
|
||||
);
|
||||
|
||||
LONG
|
||||
WppTraceCallback(
|
||||
__in UCHAR MinorFunction,
|
||||
__in_opt PVOID DataPath,
|
||||
__in ULONG BufferLength,
|
||||
__inout_bcount(BufferLength) PVOID Buffer,
|
||||
__in PVOID Context,
|
||||
__out PULONG Size
|
||||
);
|
||||
#if !defined(WPP_TRACE_CONTROL_NULL_GUID)
|
||||
DEFINE_GUID(WPP_TRACE_CONTROL_NULL_GUID, 0x00000000L, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
#endif
|
||||
#define WPP_TRACE_CONTROL(Function,Buffer,BufferSize,ReturnSize) WppTraceCallback(Function,NULL,BufferSize,Buffer,&WPP_CB[0],&ReturnSize);
|
||||
|
||||
|
||||
__inline ULONG64 WppQueryLogger(__in_opt PCWSTR LoggerName)
|
||||
{
|
||||
|
||||
if (WppTraceWinXP == WPPTraceSuite) {
|
||||
|
||||
ULONG ReturnLength ;
|
||||
LONG Status ;
|
||||
ULONG64 TraceHandle ;
|
||||
UNICODE_STRING Buffer ;
|
||||
|
||||
RtlInitUnicodeString(&Buffer, LoggerName ? LoggerName : L"stdout");
|
||||
|
||||
Status = pfnWppQueryTraceInformation(
|
||||
TraceHandleByNameClass,
|
||||
(PVOID)&TraceHandle,
|
||||
sizeof(TraceHandle),
|
||||
&ReturnLength,
|
||||
(PVOID)&Buffer
|
||||
);
|
||||
if (Status != STATUS_SUCCESS) {
|
||||
return (ULONG64)0 ;
|
||||
}
|
||||
|
||||
return TraceHandle ;
|
||||
} else {
|
||||
return (ULONG64) 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
typedef LONG (*WMIENTRY_NEW)(
|
||||
__in UCHAR MinorFunction,
|
||||
__in_opt PVOID DataPath,
|
||||
__in ULONG BufferLength,
|
||||
__inout_bcount(BufferLength) PVOID Buffer,
|
||||
__in PVOID Context,
|
||||
__out PULONG Size
|
||||
);
|
||||
|
||||
typedef struct _WPP_TRACE_CONTROL_BLOCK
|
||||
{
|
||||
WMIENTRY_NEW Callback;
|
||||
LPCGUID ControlGuid;
|
||||
struct _WPP_TRACE_CONTROL_BLOCK *Next;
|
||||
__int64 Logger;
|
||||
PUNICODE_STRING RegistryPath;
|
||||
UCHAR FlagsLen;
|
||||
UCHAR Level;
|
||||
USHORT Reserved;
|
||||
ULONG Flags[1];
|
||||
} WPP_TRACE_CONTROL_BLOCK, *PWPP_TRACE_CONTROL_BLOCK;
|
||||
|
||||
VOID WppCleanupKm(__in_opt PDEVICE_OBJECT pDeviceObject);
|
||||
#define WPP_CLEANUP(DrvObj) WppCleanupKm((PDEVICE_OBJECT) DrvObj)
|
||||
|
||||
#define WPP_IsValidSid RtlValidSid
|
||||
#define WPP_GetLengthSid RtlLengthSid
|
||||
|
||||
//
|
||||
// Callback routine to be defined by the driver, which will be called from WPP callback
|
||||
// WPP will pass current valued of : GUID, Logger, Enable, Flags, and Level
|
||||
//
|
||||
// To activate driver must define WPP_PRIVATE_ENABLE_CALLBACK in their code, sample below
|
||||
// #define WPP_PRIVATE_ENABLE_CALLBACK MyPrivateCallback;
|
||||
//
|
||||
typedef
|
||||
VOID
|
||||
(*PFN_WPP_PRIVATE_ENABLE_CALLBACK)(
|
||||
__in LPCGUID Guid,
|
||||
__in __int64 Logger,
|
||||
__in BOOLEAN Enable,
|
||||
__in ULONG Flags,
|
||||
__in UCHAR Level);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // #ifndef WPP_ALREADY_INCLUDED
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,13 @@
|
|||
`**********************************************************************`
|
||||
`* This is a template file for tracewpp preprocessor *`
|
||||
`* If you need to use a custom version of this file in your project *`
|
||||
`* Please clone it from this one and point WPP to it by specifying *`
|
||||
`* -gen:{yourfile} option on RUN_WPP line in your sources file *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
//`Compiler.Checksum` Generated File. Do not edit.
|
||||
// File created by `Compiler.Name` compiler version `Compiler.Version`-`Compiler.Timestamp`
|
||||
// on `System.Date` at `System.Time` UTC from a template `TemplateFile`
|
||||
|
||||
`INCLUDE km-default.tpl`
|
|
@ -0,0 +1,15 @@
|
|||
// Generated File. Do not edit.
|
||||
// File created by `Compiler.Name` compiler version `Compiler.Version`-`Compiler.Timestamp`
|
||||
// on `System.Date` at `System.Time` UTC
|
||||
|
||||
`FORALL Guid IN TraceGuids`
|
||||
`Guid.Text` `Guid.Comment`
|
||||
`FORALL Msg in Guid.Messages`
|
||||
#typev `Msg.Name` `Msg.MsgNo` "`Msg.Text`"
|
||||
{
|
||||
`FORALL Arg IN Msg.Arguments`
|
||||
`Arg.Name`, `Arg.MofType` // `Arg.No`
|
||||
`ENDFOR Arg`
|
||||
}
|
||||
`ENDFOR Msg`
|
||||
`ENDFOR Guid`
|
|
@ -0,0 +1,89 @@
|
|||
#
|
||||
# Default types for WPP
|
||||
#
|
||||
|
||||
# our basic arithmetic types
|
||||
|
||||
DEFINE_SIMPLE_TYPE( SBYTE, signed char, ItemChar, "d");
|
||||
DEFINE_SIMPLE_TYPE( SSHORT, signed short, ItemShort, "hd");
|
||||
DEFINE_SIMPLE_TYPE( SINT, signed int, ItemInt, "d");
|
||||
DEFINE_SIMPLE_TYPE( SLONG, signed long, ItemLong, "ld");
|
||||
DEFINE_SIMPLE_TYPE( SINT64, signed _int64, ItemLongLong, "I64d");
|
||||
|
||||
DEFINE_FLAVOR( UCHAR, SBYTE, ItemUChar, "c" );
|
||||
DEFINE_FLAVOR( SCHAR, SBYTE, ItemChar, "c" );
|
||||
DEFINE_FLAVOR( BOOLEAN, SBYTE, ItemListByte(FALSE,TRUE), "s");
|
||||
|
||||
# arch dependent types
|
||||
|
||||
DEFINE_SIMPLE_TYPE( SLONGPTR, void*, ItemPtr, "p");
|
||||
DEFINE_SIMPLE_TYPE( PTR, void*, ItemPtr, "p");
|
||||
DEFINE_SIMPLE_TYPE( HANDLE, void*, ItemPtr, "p");
|
||||
|
||||
# all strings require custom processing
|
||||
|
||||
DEFINE_CPLX_TYPE(ASTR, WPP_LOGASTR, ItemString, "s");
|
||||
DEFINE_CPLX_TYPE(ARSTR, WPP_LOGASTR, ItemRString, "s");
|
||||
DEFINE_CPLX_TYPE(WSTR, WPP_LOGWSTR, ItemWString, "s");
|
||||
DEFINE_CPLX_TYPE(CSTR, WPP_LOGCSTR, ItemPString, "s");
|
||||
DEFINE_CPLX_TYPE(USTR, WPP_LOGUSTR, ItemPWString, "s");
|
||||
|
||||
# default formats for those who don't care to provide their own strings
|
||||
|
||||
DEFINE_FLAVOR(UBYTE, SBYTE,, "u");
|
||||
DEFINE_FLAVOR(XBYTE, SBYTE,, "02x");
|
||||
DEFINE_FLAVOR(OBYTE, SBYTE,, "o");
|
||||
|
||||
DEFINE_FLAVOR(USHORT, SSHORT, ItemUShort, "hu");
|
||||
DEFINE_FLAVOR(XSHORT, SSHORT,, "04hX");
|
||||
DEFINE_FLAVOR(OSHORT, SSHORT,, "ho");
|
||||
|
||||
DEFINE_FLAVOR(UINT, SINT, ItemUInt, "u");
|
||||
DEFINE_FLAVOR(XINT, SINT,, "08x");
|
||||
DEFINE_FLAVOR(OINT, SINT,, "o");
|
||||
|
||||
DEFINE_FLAVOR(ULONG, SLONG, ItemULong, "lu");
|
||||
DEFINE_FLAVOR(XLONG, SLONG,, "08lX");
|
||||
DEFINE_FLAVOR(OLONG, SLONG,, "lo");
|
||||
|
||||
DEFINE_FLAVOR(UINT64, SINT64,, "i64u");
|
||||
DEFINE_FLAVOR(XINT64, SINT64,, "08i64X");
|
||||
DEFINE_FLAVOR(OINT64, SINT64,, "i64o");
|
||||
|
||||
DEFINE_FLAVOR(ULONGPTR, SLONGPTR,,);
|
||||
DEFINE_FLAVOR(XLONGPTR, SLONGPTR,,);
|
||||
DEFINE_FLAVOR(OLONGPTR, SLONGPTR,,);
|
||||
|
||||
# special formats
|
||||
|
||||
DEFINE_FLAVOR(IPADDR, UINT, ItemIPAddr, "s");
|
||||
DEFINE_FLAVOR(PORT, USHORT, ItemPort, "s");
|
||||
DEFINE_FLAVOR(STATUS, UINT, ItemNTSTATUS, "s");
|
||||
DEFINE_FLAVOR(WINERROR, UINT, ItemWINERROR, "s");
|
||||
DEFINE_FLAVOR(PORT, USHORT, ItemPort, "s");
|
||||
DEFINE_SIMPLE_TYPE(GUID, GUID, ItemGuid, "s");
|
||||
|
||||
# time related stuff
|
||||
|
||||
DEFINE_FLAVOR(TIMESTAMP, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(TIME, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(DATE, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(WAITTIME, SINT64, ItemTimestamp, "s");
|
||||
DEFINE_FLAVOR(TIMEDELTA, SINT64, ItemTimestamp, "s");
|
||||
|
||||
# enumeration types
|
||||
|
||||
DEFINE_FLAVOR(ItemListByte, SBYTE, ItemListByte, "s");
|
||||
DEFINE_FLAVOR(ItemListShort, SSHORT, ItemListShort,"s");
|
||||
DEFINE_FLAVOR(ItemListLong, SLONG, ItemListLong, "s");
|
||||
|
||||
CUSTOM_TYPE(IRQL, ItemListByte(Low,APC,DPC) );
|
||||
|
||||
CUSTOM_TYPE(PNPMN, ItemListByte(IRP_MN_START_DEVICE,IRP_MN_QUERY_REMOVE_DEVICE,IRP_MN_REMOVE_DEVICE,IRP_MN_CANCEL_REMOVE_DEVICE,IRP_MN_STOP_DEVICE,IRP_MN_QUERY_STOP_DEVICE,IRP_MN_CANCEL_STOP_DEVICE,IRP_MN_QUERY_DEVICE_RELATIONS,IRP_MN_QUERY_INTERFACE,IRP_MN_QUERY_CAPABILITIES,IRP_MN_QUERY_RESOURCES,IRP_MN_QUERY_RESOURCE_REQUIREMENTS,IRP_MN_QUERY_DEVICE_TEXT,IRP_MN_FILTER_RESOURCE_REQUIREMENTS,IRP_MN_PNP_14,IRP_MN_READ_CONFIG,IRP_MN_WRITE_CONFIG,IRP_MN_EJECT,IRP_MN_SET_LOCK,IRP_MN_QUERY_ID,IRP_MN_QUERY_PNP_DEVICE_STATE,IRP_MN_QUERY_BUS_INFORMATION,IRP_MN_DEVICE_USAGE_NOTIFICATION,IRP_MN_SURPRISE_REMOVAL) );
|
||||
|
||||
# default tracing macro
|
||||
|
||||
SimpleTrace(MSG,ARG);
|
||||
SimpleTraceEx(GRP,MSG,ARG);
|
||||
|
||||
USEPREFIX(*, "[%9!x!].%3!03x!::%4 [%1] ");
|
|
@ -0,0 +1,23 @@
|
|||
`**********************************************************************`
|
||||
`* This is a template file for tracewpp preprocessor *`
|
||||
`* If you need to use a custom version of this file in your project *`
|
||||
`* Please clone it from this one and point WPP to it by specifying *`
|
||||
`* -gen:{yourfile}outfile option on RUN_WPP line in your sources file *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
//`Compiler.Checksum` Generated File. Do not edit.
|
||||
// File created by `Compiler.Name` compiler version `Compiler.Version`-`Compiler.Timestamp`
|
||||
// on `System.Date` at `System.Time` UTC from a template `TemplateFile`
|
||||
|
||||
// PLEASE NOTE:
|
||||
// Using simple.tpl for production environment without overriding
|
||||
// WPP_ENABLED and WPP_LOGGER macro is NOT RECOMMENDED.
|
||||
//
|
||||
// If WPP_ENABLED is not provided, the logging is always on
|
||||
// If WPP_LOGGER is not provided, traces always go to the logger named stdout (if it is running)
|
||||
//
|
||||
|
||||
`INCLUDE header.tpl`
|
||||
`INCLUDE stdout.tpl`
|
||||
`INCLUDE trmacro.tpl`
|
|
@ -0,0 +1,29 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
// template `TemplateFile`
|
||||
|
||||
`FORALL f IN Funcs`
|
||||
#define WPP`f.GooId`_LOGGER(`f.GooArgs`) // `f.Name`
|
||||
`ENDFOR`
|
||||
|
||||
#ifndef WPP_LOGGER_ARG
|
||||
# define WPP_LOGGER_ARG
|
||||
#endif
|
||||
|
||||
#ifndef WPP_GET_LOGGER
|
||||
#define WPP_GET_LOGGER WppGetLogger()
|
||||
__inline TRACEHANDLE WppGetLogger()
|
||||
{
|
||||
static TRACEHANDLE Logger;
|
||||
if (Logger) {return Logger;}
|
||||
return Logger = WppQueryLogger(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef WPP_ENABLED
|
||||
# define WPP_ENABLED() 1
|
||||
#endif
|
|
@ -0,0 +1,255 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
// template `TemplateFile`
|
||||
// expects:
|
||||
// WPP_THIS_FILE defined (see header.tpl)
|
||||
// WPP_LOGGER_ARG defined
|
||||
// WPP_GET_LOGGER defined
|
||||
// WPP_ENABLED() defined
|
||||
|
||||
#ifndef NO_CHECK_FOR_NULL_STRING
|
||||
#ifndef WPP_CHECK_FOR_NULL_STRING
|
||||
#define WPP_CHECK_FOR_NULL_STRING 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define WPP_EVAL(_value_) _value_
|
||||
#define WPP_(Id) WPP_EVAL(WPP_) ## WPP_EVAL(Id) ## WPP_EVAL(_) ## WPP_EVAL(WPP_THIS_FILE) ## WPP_EVAL(__LINE__)
|
||||
|
||||
#if !defined(WPP_INLINE)
|
||||
#define WPP_INLINE DECLSPEC_NOINLINE __inline
|
||||
#endif
|
||||
|
||||
#else // #ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
#undef WPP_LOCAL_TraceGuids
|
||||
|
||||
#endif // #ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
#if !defined(WPP_NO_ANNOTATIONS)
|
||||
#if !defined(WPP_ANSI_ANNOTATION)
|
||||
`FORALL Msg IN Messages`
|
||||
# define WPP_ANNOTATE_`Msg.Name` __annotation(L"TMF:", L"`Msg.Guid` `CurrentDir` // SRC=`SourceFile.Name` MJ=`ENV MAJORCOMP` MN=`ENV MINORCOMP`", L"#typev `Msg.Name` `Msg.MsgNo` \"`Msg.Text`\" // `Msg.Indent` `Msg.GooPairs`", L"{"`FORALL Arg IN Msg.Arguments`, L"`Arg.Name`, `Arg.MofType` -- `Arg.No`" `ENDFOR Arg`, L"}")
|
||||
`ENDFOR`
|
||||
#else
|
||||
`FORALL Msg IN Messages`
|
||||
# define WPP_ANNOTATE_`Msg.Name` __annotation("TMF:", "`Msg.Guid` `CurrentDir` // SRC=`SourceFile.Name` MJ=`ENV MAJORCOMP` MN=`ENV MINORCOMP`", "#typev `Msg.Name` `Msg.MsgNo` \"`Msg.Text`\" // `Msg.Indent` `Msg.GooPairs`", "{"`FORALL Arg IN Msg.Arguments`, "`Arg.Name`, `Arg.MofType` -- `Arg.No`" `ENDFOR Arg`, "}")
|
||||
`ENDFOR`
|
||||
#endif
|
||||
# define WPP_ANNOTATE(x) WPP_ANNOTATE_ ## x,
|
||||
#else
|
||||
# define WPP_ANNOTATE(x)
|
||||
#endif
|
||||
|
||||
#define WPP_LOCAL_TraceGuids WPP_`SourceFile.CanonicalName`_Traceguids
|
||||
|
||||
#if `TraceGuids.Count`
|
||||
static const GUID WPP_LOCAL_TraceGuids[] = {`FORALL Guid IN TraceGuids` `Guid.Struct`, `ENDFOR`};
|
||||
#endif
|
||||
|
||||
#ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
#if !defined(WPP_TRACE_OPTIONS)
|
||||
enum {WPP_TRACE_OPTIONS = TRACE_MESSAGE_SEQUENCE | TRACE_MESSAGE_GUID
|
||||
| TRACE_MESSAGE_SYSTEMINFO | TRACE_MESSAGE_TIMESTAMP };
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGPAIR)
|
||||
# define WPP_LOGPAIR(_Size, _Addr) (_Addr),((SIZE_T)_Size),
|
||||
#endif
|
||||
|
||||
#define WPP_LOGTYPEVAL(_Type, _Value) WPP_LOGPAIR(sizeof(_Type), &(_Value))
|
||||
#define WPP_LOGTYPEPTR(_Value) WPP_LOGPAIR(sizeof(*(_Value)), (_Value))
|
||||
|
||||
// Marshalling macros.
|
||||
|
||||
#if !defined(WPP_LOGASTR)
|
||||
# if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGASTR(_value) WPP_LOGPAIR(strlen(_value) + 1, _value )
|
||||
# else
|
||||
# define WPP_LOGASTR(_value) WPP_LOGPAIR( (_value)?strlen(_value) + 1:5, (_value)?(_value):"NULL" )
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGWSTR)
|
||||
# if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGWSTR(_value) WPP_LOGPAIR( (wcslen(_value)+1) * sizeof(WCHAR), _value)
|
||||
# else
|
||||
# define WPP_LOGWSTR(_value) WPP_LOGPAIR( (_value)?(((_value)[0] == 0)?7 * sizeof(WCHAR):(wcslen(_value) + 1)* sizeof(WCHAR)):5 * sizeof(WCHAR), (_value)?(((_value)[0] == 0) ? L"<NULL>" : (_value)):L"NULL")
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGPGUID)
|
||||
# define WPP_LOGPGUID(_value) WPP_LOGPAIR( sizeof(GUID), (_value) )
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(WPP_LOGPSID)
|
||||
# if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGPSID(_value) WPP_LOGPAIR( WPP_GetLengthSid(_value), (_value) )
|
||||
# else
|
||||
# define WPP_LOGPSID(_value) WPP_LOGPAIR( (_value)? (WPP_IsValidSid(_value)? \
|
||||
WPP_GetLengthSid(_value):5):5, \
|
||||
(_value)? (WPP_IsValidSid(_value)?\
|
||||
(_value):"NULL"):"NULL")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGCSTR)
|
||||
# define WPP_LOGCSTR(_x) \
|
||||
WPP_LOGPAIR( sizeof((_x).Length), &(_x).Length ) WPP_LOGPAIR( (_x).Length, (_x).Buffer )
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGUSTR)
|
||||
# define WPP_LOGUSTR(_x) \
|
||||
WPP_LOGPAIR( sizeof((_x).Length), &(_x).Length ) WPP_LOGPAIR( (_x).Length, (_x).Buffer )
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGPUSTR)
|
||||
#if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGPUSTR(_x) WPP_LOGUSTR(*(_x))
|
||||
#else
|
||||
# define WPP_LOGPUSTR(_x) WPP_LOGPAIR( sizeof(USHORT), (_x && (*(_x)).Length)? &(*(_x)).Length : L"\5")\
|
||||
WPP_LOGPAIR( (_x && (*(_x)).Buffer)?(*(_x)).Length:5*sizeof(WCHAR), (_x && (*(_x)).Buffer)?(*(_x)).Buffer:L"NULL")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGPCSTR)
|
||||
#if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGPCSTR(_x) WPP_LOGCSTR(*(_x))
|
||||
#else
|
||||
# define WPP_LOGPCSTR(_x) WPP_LOGPAIR( sizeof(USHORT), (_x && (*(_x)).Length)? &(*(_x)).Length : L"\5")\
|
||||
WPP_LOGPAIR( (_x && (*(_x)).Buffer)?(*(_x)).Length:5*sizeof(char), (_x && (*(_x)).Buffer)?((const char *)(*(_x)).Buffer):"NULL")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGSTDSTR)
|
||||
#define WPP_LOGSTDSTR(_value) WPP_LOGPAIR( (_value).size()+1, (_value).c_str() )
|
||||
#endif
|
||||
|
||||
#endif // #ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
|
||||
`FORALL i IN TypeSigSet WHERE !UnsafeArgs`
|
||||
#ifndef WPP_SF_`i.Name`_def
|
||||
# define WPP_SF_`i.Name`_def
|
||||
WPP_INLINE void WPP_SF_`i.Name`(WPP_LOGGER_ARG unsigned short id, LPCGUID TraceGuid`i.Arguments`)
|
||||
{ WPP_TRACE(WPP_GET_LOGGER, WPP_TRACE_OPTIONS, (LPGUID)TraceGuid, id, `i.LogArgs` 0); }
|
||||
#endif // #ifndef WPP_SF_`i.Name`_def
|
||||
`ENDFOR`
|
||||
|
||||
`FORALL i IN TypeSigSet WHERE UnsafeArgs`
|
||||
#ifndef WPP_SF_`i.Name`_def
|
||||
# define WPP_SF_`i.Name`_def
|
||||
WPP_INLINE void WPP_SF_`i.Name`(WPP_LOGGER_ARG unsigned short id, LPCGUID TraceGuid, ...) {
|
||||
va_list ap; va_start(ap, TraceGuid); UNREFERENCED_PARAMETER(ap);
|
||||
{
|
||||
`i.DeclVars`
|
||||
WPP_TRACE(WPP_GET_LOGGER, WPP_TRACE_OPTIONS, (LPGUID)TraceGuid, id, `i.LogArgs` 0);
|
||||
|
||||
}
|
||||
}
|
||||
#endif // #ifndef WPP_SF_`i.Name`_def
|
||||
`ENDFOR`
|
||||
#ifndef WPP_POST
|
||||
# define WPP_POST()
|
||||
#endif
|
||||
|
||||
#ifndef WPP_PRE
|
||||
# define WPP_PRE()
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WPP_DEBUG
|
||||
`FORALL i IN Messages WHERE !MsgArgs`
|
||||
#ifndef WPP`i.GooId`_POST
|
||||
# define WPP`i.GooId`_POST(`i.GooArgs`)
|
||||
#endif
|
||||
#ifndef WPP`i.GooId`_PRE
|
||||
# define WPP`i.GooId`_PRE(`i.GooArgs`)
|
||||
#endif
|
||||
#define WPP_CALL_`i.Name`(`i.FixedArgs``i.MacroArgs`) \
|
||||
WPP`i.GooId`_PRE(`i.GooVals`) \
|
||||
WPP_ANNOTATE(`i.Name`) \
|
||||
( ( \
|
||||
(WPP_CB != (WPP_CB_TYPE*)&WPP_CB) && `i.MsgVal`WPP`i.GooId`_ENABLED(`i.GooVals`) ? \
|
||||
WPP_DEBUG((`i.DbgMacroArgs`)), \
|
||||
WPP_SF_`i.TypeSig`(WPP`i.GooId`_LOGGER(`i.GooVals`) `i.MsgNo`, \
|
||||
WPP_LOCAL_TraceGuids+0`i.MacroExprs`), 1:0 \
|
||||
) ) \
|
||||
WPP`i.GooId`_POST(`i.GooVals`)
|
||||
`ENDFOR`
|
||||
#else
|
||||
`FORALL i IN Messages WHERE !MsgArgs`
|
||||
#ifndef WPP`i.GooId`_POST
|
||||
# define WPP`i.GooId`_POST(`i.GooArgs`)
|
||||
#endif
|
||||
#ifndef WPP`i.GooId`_PRE
|
||||
# define WPP`i.GooId`_PRE(`i.GooArgs`)
|
||||
#endif
|
||||
#define WPP_CALL_`i.Name`(`i.FixedArgs``i.MacroArgs`) \
|
||||
WPP`i.GooId`_PRE(`i.GooVals`) \
|
||||
WPP_ANNOTATE(`i.Name`) \
|
||||
( ( \
|
||||
(WPP_CB != (WPP_CB_TYPE*)&WPP_CB) && `i.MsgVal`WPP`i.GooId`_ENABLED(`i.GooVals`) ? \
|
||||
WPP_SF_`i.TypeSig`(WPP`i.GooId`_LOGGER(`i.GooVals`) `i.MsgNo`, \
|
||||
WPP_LOCAL_TraceGuids+0`i.MacroExprs`), 1:0 \
|
||||
) ) \
|
||||
WPP`i.GooId`_POST(`i.GooVals`)
|
||||
`ENDFOR`
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WPP_DEBUG
|
||||
`FORALL i IN Messages WHERE MsgArgs`
|
||||
#ifndef WPP`i.GooId`_POST
|
||||
# define WPP`i.GooId`_POST(`i.GooArgs`)
|
||||
#endif
|
||||
#ifndef WPP`i.GooId`_PRE
|
||||
# define WPP`i.GooId`_PRE(`i.GooArgs`)
|
||||
#endif
|
||||
#define WPP_CALL_`i.Name`(`i.FixedArgs` MSGARGS) \
|
||||
WPP`i.GooId`_PRE(`i.GooVals`) \
|
||||
WPP_ANNOTATE(`i.Name`) \
|
||||
(( \
|
||||
(WPP_CB != (WPP_CB_TYPE*)&WPP_CB) && WPP`i.GooId`_ENABLED(`i.GooVals`)? \
|
||||
WPP_SF_`i.TypeSig`(WPP`i.GooId`_LOGGER(`i.GooVals`) `i.MsgNo`,WPP_LOCAL_TraceGuids+0 WPP_R`i.ReorderSig` MSGARGS), \
|
||||
WPP_DEBUG(MSGARGS),1:0 \
|
||||
)) \
|
||||
WPP`i.GooId`_POST(`i.GooVals`)
|
||||
`ENDFOR`
|
||||
#else
|
||||
`FORALL i IN Messages WHERE MsgArgs`
|
||||
#ifndef WPP`i.GooId`_POST
|
||||
# define WPP`i.GooId`_POST(`i.GooArgs`)
|
||||
#endif
|
||||
#ifndef WPP`i.GooId`_PRE
|
||||
# define WPP`i.GooId`_PRE(`i.GooArgs`)
|
||||
#endif
|
||||
#define WPP_CALL_`i.Name`(`i.FixedArgs` MSGARGS) \
|
||||
WPP`i.GooId`_PRE(`i.GooVals`) \
|
||||
WPP_ANNOTATE(`i.Name`) \
|
||||
( \
|
||||
(WPP_CB != (WPP_CB_TYPE*)&WPP_CB) && WPP`i.GooId`_ENABLED(`i.GooVals`)?\
|
||||
WPP_SF_`i.TypeSig`(WPP`i.GooId`_LOGGER(`i.GooVals`) `i.MsgNo`,WPP_LOCAL_TraceGuids+0 WPP_R`i.ReorderSig` MSGARGS),\
|
||||
1:0 \
|
||||
) \
|
||||
WPP`i.GooId`_POST(`i.GooVals`)
|
||||
`ENDFOR`
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
|
@ -0,0 +1,261 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright 1999-2005 Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
#ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
// template `TemplateFile`
|
||||
// expects:
|
||||
// WPP_THIS_FILE defined (see header.tpl)
|
||||
// WPP_LOGGER_ARG defined
|
||||
// WPP_GET_LOGGER defined
|
||||
// WPP_ENABLED() defined
|
||||
|
||||
#ifndef NO_CHECK_FOR_NULL_STRING
|
||||
#ifndef WPP_CHECK_FOR_NULL_STRING
|
||||
#define WPP_CHECK_FOR_NULL_STRING 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#define WPP_EVAL(_value_) _value_
|
||||
#define WPP_(Id) WPP_EVAL(WPP_) ## WPP_EVAL(Id) ## WPP_EVAL(_) ## WPP_EVAL(WPP_THIS_FILE) ## WPP_EVAL(__LINE__)
|
||||
|
||||
#if !defined(WPP_INLINE)
|
||||
# define WPP_INLINE __inline
|
||||
#endif
|
||||
|
||||
#else // #ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
#undef WPP_LOCAL_TraceGuids
|
||||
|
||||
#endif // #ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
|
||||
#if !defined(WPP_NO_ANNOTATIONS)
|
||||
#if !defined(WPP_ANSI_ANNOTATION)
|
||||
`FORALL Msg IN Messages`
|
||||
# define WPP_ANNOTATE_`Msg.Name` __annotation(L"TMF:", L"`Msg.Guid` `CurrentDir` // SRC=`SourceFile.Name` MJ=`ENV MAJORCOMP` MN=`ENV MINORCOMP`", L"#typev `Msg.Name` `Msg.MsgNo` \"`Msg.Text`\" // `Msg.Indent` `Msg.GooPairs`", L"{"`FORALL Arg IN Msg.Arguments`, L"`Arg.Name`, `Arg.MofType` -- `Arg.No`" `ENDFOR Arg`, L"}")
|
||||
`ENDFOR`
|
||||
#else
|
||||
`FORALL Msg IN Messages`
|
||||
# define WPP_ANNOTATE_`Msg.Name` __annotation("TMF:", "`Msg.Guid` `CurrentDir` // SRC=`SourceFile.Name` MJ=`ENV MAJORCOMP` MN=`ENV MINORCOMP`", "#typev `Msg.Name` `Msg.MsgNo` \"`Msg.Text`\" // `Msg.Indent` `Msg.GooPairs`", "{"`FORALL Arg IN Msg.Arguments`, "`Arg.Name`, `Arg.MofType` -- `Arg.No`" `ENDFOR Arg`, "}")
|
||||
`ENDFOR`
|
||||
#endif
|
||||
# define WPP_ANNOTATE(x) WPP_ANNOTATE_ ## x,
|
||||
#else
|
||||
# define WPP_ANNOTATE(x)
|
||||
#endif
|
||||
|
||||
#define WPP_LOCAL_TraceGuids WPP_`SourceFile.CanonicalName`_Traceguids
|
||||
|
||||
#if `TraceGuids.Count`
|
||||
static const GUID WPP_LOCAL_TraceGuids[] = {`FORALL Guid IN TraceGuids` `Guid.Struct`, `ENDFOR`};
|
||||
#endif
|
||||
|
||||
#ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
#if !defined(WPP_TRACE_OPTIONS)
|
||||
enum {WPP_TRACE_OPTIONS = TRACE_MESSAGE_SEQUENCE | TRACE_MESSAGE_GUID
|
||||
| TRACE_MESSAGE_SYSTEMINFO | TRACE_MESSAGE_TIMESTAMP };
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGPAIR)
|
||||
# define WPP_LOGPAIR(_Size, _Addr) (_Addr),((SIZE_T)_Size),
|
||||
#endif
|
||||
|
||||
#define WPP_LOGTYPEVAL(_Type, _Value) WPP_LOGPAIR(sizeof(_Type), &(_Value))
|
||||
#define WPP_LOGTYPEPTR(_Value) WPP_LOGPAIR(sizeof(*(_Value)), (_Value))
|
||||
|
||||
// Marshalling macros.
|
||||
|
||||
#if !defined(WPP_LOGASTR)
|
||||
# if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGASTR(_value) WPP_LOGPAIR(strlen(_value) + 1, _value )
|
||||
# else
|
||||
# define WPP_LOGASTR(_value) WPP_LOGPAIR( (_value)?strlen(_value) + 1:5, (_value)?(_value):"NULL" )
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGWSTR)
|
||||
# if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGWSTR(_value) WPP_LOGPAIR( (wcslen(_value)+1) * sizeof(WCHAR), _value)
|
||||
# else
|
||||
# define WPP_LOGWSTR(_value) WPP_LOGPAIR( (_value)?(((_value)[0] == 0)?7 * sizeof(WCHAR):(wcslen(_value) + 1)* sizeof(WCHAR)):5 * sizeof(WCHAR), (_value)?(((_value)[0] == 0) ? L"<NULL>" : (_value)):L"NULL")
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGPGUID)
|
||||
# define WPP_LOGPGUID(_value) WPP_LOGPAIR( sizeof(GUID), (_value) )
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(WPP_LOGPSID)
|
||||
# if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGPSID(_value) WPP_LOGPAIR( GetLengthSid(_value), (_value) )
|
||||
# else
|
||||
# define WPP_LOGPSID(_value) WPP_LOGPAIR( (_value)? (IsValidSid(_value)? \
|
||||
GetLengthSid(_value):5):5, \
|
||||
(_value)? (IsValidSid(_value)?\
|
||||
(_value):"NULL"):"NULL")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGCSTR)
|
||||
# define WPP_LOGCSTR(_x) \
|
||||
WPP_LOGPAIR( sizeof((_x).Length), &(_x).Length ) WPP_LOGPAIR( (_x).Length, (_x).Buffer )
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGUSTR)
|
||||
# define WPP_LOGUSTR(_x) \
|
||||
WPP_LOGPAIR( sizeof((_x).Length), &(_x).Length ) WPP_LOGPAIR( (_x).Length, (_x).Buffer )
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGPUSTR)
|
||||
#if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGPUSTR(_x) WPP_LOGUSTR(*(_x))
|
||||
#else
|
||||
# define WPP_LOGPUSTR(_x) WPP_LOGPAIR( sizeof(USHORT), (_x && (*(_x)).Length)? &(*(_x)).Length : L"\5")\
|
||||
WPP_LOGPAIR( (_x && (*(_x)).Buffer)?(*(_x)).Length:5*sizeof(WCHAR), (_x && (*(_x)).Buffer)?(*(_x)).Buffer:L"NULL")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGPCSTR)
|
||||
#if !defined(WPP_CHECK_FOR_NULL_STRING)
|
||||
# define WPP_LOGPCSTR(_x) WPP_LOGCSTR(*(_x))
|
||||
#else
|
||||
# define WPP_LOGPCSTR(_x) WPP_LOGPAIR( sizeof(USHORT), (_x && (*(_x)).Length)? &(*(_x)).Length : L"\5")\
|
||||
WPP_LOGPAIR( (_x && (*(_x)).Buffer)?(*(_x)).Length:5*sizeof(char), (_x && (*(_x)).Buffer)?((const char *)(*(_x)).Buffer):"NULL")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(WPP_LOGSTDSTR)
|
||||
#define WPP_LOGSTDSTR(_value) WPP_LOGPAIR( (_value).size()+1, (_value).c_str() )
|
||||
#endif
|
||||
|
||||
#endif // #ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
|
||||
`FORALL i IN TypeSigSet WHERE !UnsafeArgs`
|
||||
#ifndef WPP_SF_`i.Name`_def
|
||||
# define WPP_SF_`i.Name`_def
|
||||
WPP_INLINE void WPP_SF_`i.Name`(WPP_LOGGER_ARG unsigned short id, LPCGUID TraceGuid`i.Arguments`)
|
||||
{ WPP_TRACE(WPP_GET_LOGGER, WPP_TRACE_OPTIONS, (LPGUID)TraceGuid, id, `i.LogArgs` 0); }
|
||||
#endif // #ifndef WPP_SF_`i.Name`_def
|
||||
`ENDFOR`
|
||||
|
||||
`FORALL i IN TypeSigSet WHERE UnsafeArgs`
|
||||
#ifndef WPP_SF_`i.Name`_def
|
||||
# define WPP_SF_`i.Name`_def
|
||||
WPP_INLINE void WPP_SF_`i.Name`(WPP_LOGGER_ARG unsigned short id, LPCGUID TraceGuid, ...) {
|
||||
va_list ap; va_start(ap, TraceGuid); UNREFERENCED_PARAMETER(ap);
|
||||
{
|
||||
`i.DeclVars`
|
||||
WPP_TRACE(WPP_GET_LOGGER, WPP_TRACE_OPTIONS, (LPGUID)TraceGuid, id, `i.LogArgs` 0);
|
||||
|
||||
}
|
||||
}
|
||||
#endif // #ifndef WPP_SF_`i.Name`_def
|
||||
`ENDFOR`
|
||||
#ifndef WPP_POST
|
||||
# define WPP_POST()
|
||||
#endif
|
||||
|
||||
#ifndef WPP_PRE
|
||||
# define WPP_PRE()
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WPP_DEBUG
|
||||
`FORALL i IN Messages WHERE !MsgArgs`
|
||||
#ifndef WPP`i.GooId`_POST
|
||||
# define WPP`i.GooId`_POST(`i.GooArgs`)
|
||||
#endif
|
||||
#ifndef WPP`i.GooId`_PRE
|
||||
# define WPP`i.GooId`_PRE(`i.GooArgs`)
|
||||
#endif
|
||||
#define WPP_CALL_`i.Name`(`i.FixedArgs``i.MacroArgs`) \
|
||||
WPP`i.GooId`_PRE(`i.GooVals`) \
|
||||
WPP_ANNOTATE(`i.Name`) \
|
||||
( ( \
|
||||
`i.MsgVal`WPP`i.GooId`_ENABLED(`i.GooVals`) ? \
|
||||
WPP_DEBUG((`i.MacroArgs`)), \
|
||||
WPP_SF_`i.TypeSig`(WPP`i.GooId`_LOGGER(`i.GooVals`) `i.MsgNo`, \
|
||||
WPP_LOCAL_TraceGuids+0`i.MacroExprs`), 1:0 \
|
||||
) ) \
|
||||
WPP`i.GooId`_POST(`i.GooVals`)
|
||||
`ENDFOR`
|
||||
#else
|
||||
`FORALL i IN Messages WHERE !MsgArgs`
|
||||
#ifndef WPP`i.GooId`_POST
|
||||
# define WPP`i.GooId`_POST(`i.GooArgs`)
|
||||
#endif
|
||||
#ifndef WPP`i.GooId`_PRE
|
||||
# define WPP`i.GooId`_PRE(`i.GooArgs`)
|
||||
#endif
|
||||
#define WPP_CALL_`i.Name`(`i.FixedArgs``i.MacroArgs`) \
|
||||
WPP`i.GooId`_PRE(`i.GooVals`) \
|
||||
WPP_ANNOTATE(`i.Name`) \
|
||||
( ( \
|
||||
`i.MsgVal`WPP`i.GooId`_ENABLED(`i.GooVals`) ? \
|
||||
WPP_SF_`i.TypeSig`(WPP`i.GooId`_LOGGER(`i.GooVals`) `i.MsgNo`, \
|
||||
WPP_LOCAL_TraceGuids+0`i.MacroExprs`), 1:0 \
|
||||
) ) \
|
||||
WPP`i.GooId`_POST(`i.GooVals`)
|
||||
`ENDFOR`
|
||||
#endif
|
||||
|
||||
// NoMsgArgs
|
||||
|
||||
`FORALL f IN Funcs WHERE !DoubleP && !MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name` WPP_(CALL)
|
||||
`ENDFOR`
|
||||
|
||||
`FORALL f IN Funcs WHERE DoubleP && !MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name`(ARGS) WPP_(CALL) ARGS
|
||||
`ENDFOR`
|
||||
|
||||
|
||||
// MsgArgs
|
||||
|
||||
`FORALL f IN Funcs WHERE MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name`(`f.FixedArgs` MSGARGS) WPP_(CALL)(`f.FixedArgs` MSGARGS)
|
||||
`ENDFOR`
|
||||
|
||||
|
||||
#ifdef WPP_DEBUG
|
||||
`FORALL i IN Messages WHERE MsgArgs`
|
||||
#ifndef WPP`i.GooId`_POST
|
||||
# define WPP`i.GooId`_POST(`i.GooArgs`)
|
||||
#endif
|
||||
#ifndef WPP`i.GooId`_PRE
|
||||
# define WPP`i.GooId`_PRE(`i.GooArgs`)
|
||||
#endif
|
||||
#define WPP_CALL_`i.Name`(`i.FixedArgs` MSGARGS) WPP`i.GooId`_PRE(`i.GooVals`) WPP_ANNOTATE(`i.Name`) ((WPP`i.GooId`_ENABLED(`i.GooVals`)?WPP_SF_`i.TypeSig`(WPP`i.GooId`_LOGGER(`i.GooVals`) `i.MsgNo`,WPP_LOCAL_TraceGuids+0 WPP_R`i.ReorderSig` MSGARGS), WPP_DEBUG((MSGARGS),1:0)) \
|
||||
WPP`i.GooId`_POST(`i.GooVals`)
|
||||
`ENDFOR`
|
||||
#else
|
||||
`FORALL i IN Messages WHERE MsgArgs`
|
||||
#ifndef WPP`i.GooId`_POST
|
||||
# define WPP`i.GooId`_POST(`i.GooArgs`)
|
||||
#endif
|
||||
#ifndef WPP`i.GooId`_PRE
|
||||
# define WPP`i.GooId`_PRE(`i.GooArgs`)
|
||||
#endif
|
||||
#define WPP_CALL_`i.Name`(`i.FixedArgs` MSGARGS) WPP`i.GooId`_PRE(`i.GooVals`) WPP_ANNOTATE(`i.Name`) (WPP`i.GooId`_ENABLED(`i.GooVals`)?WPP_SF_`i.TypeSig`(WPP`i.GooId`_LOGGER(`i.GooVals`) `i.MsgNo`,WPP_LOCAL_TraceGuids+0 WPP_R`i.ReorderSig` MSGARGS),1:0) WPP`i.GooId`_POST(`i.GooVals`)
|
||||
`ENDFOR`
|
||||
#endif
|
||||
|
||||
|
||||
`FORALL r IN Reorder`
|
||||
#undef WPP_R`r.Name`
|
||||
#define WPP_R`r.Name`(`r.Arguments`) `r.Permutation`
|
||||
`ENDFOR`
|
||||
|
||||
/// more stuff
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
`**********************************************************************`
|
||||
`* This is a template file for tracewpp preprocessor *`
|
||||
`* If you need to use a custom version of this file in your project *`
|
||||
`* Please clone it from this one and point WPP to it by specifying *`
|
||||
`* -gen:{yourfile} option on RUN_WPP line in your sources file *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
//`Compiler.Checksum` Generated File. Do not edit.
|
||||
// File created by `Compiler.Name` compiler version `Compiler.Version`-`Compiler.Timestamp`
|
||||
// on `System.Date` at `System.Time` UTC from a template `TemplateFile`
|
||||
|
||||
`INCLUDE um-header.tpl`
|
||||
`INCLUDE control.tpl`
|
||||
`INCLUDE tracemacro.tpl`
|
||||
|
||||
`IF FOUND WPP_INIT_TRACING`
|
||||
#define WPPINIT_EXPORT
|
||||
`INCLUDE um-init.tpl`
|
||||
`ENDIF`
|
||||
|
||||
//
|
||||
// Tracing Macro name redefinition
|
||||
//
|
||||
|
||||
// NoMsgArgs
|
||||
|
||||
`FORALL f IN Funcs WHERE !DoubleP && !MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name` WPP_(CALL)
|
||||
`ENDFOR`
|
||||
|
||||
`FORALL f IN Funcs WHERE DoubleP && !MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name`(ARGS) WPP_(CALL) ARGS
|
||||
`ENDFOR`
|
||||
|
||||
|
||||
// MsgArgs
|
||||
|
||||
`FORALL f IN Funcs WHERE MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name`(`f.FixedArgs` MSGARGS) WPP_(CALL)(`f.FixedArgs` MSGARGS)
|
||||
`ENDFOR`
|
||||
|
||||
`FORALL r IN Reorder`
|
||||
#undef WPP_R`r.Name`
|
||||
#define WPP_R`r.Name`(`r.Arguments`) `r.Permutation`
|
||||
`ENDFOR`
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
// template `TemplateFile`
|
||||
#ifdef WPP_THIS_FILE
|
||||
// included twice
|
||||
# define WPP_ALREADY_INCLUDED
|
||||
# undef WPP_THIS_FILE
|
||||
#endif // #ifdef WPP_THIS_FILE
|
||||
|
||||
#define WPP_THIS_FILE `SourceFile.CanonicalName`
|
||||
|
||||
#ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
`* Dump defintions specified via -D on the command line to WPP *`
|
||||
|
||||
`FORALL def IN MacroDefinitions`
|
||||
#define `def.Name` `def.Alias`
|
||||
`ENDFOR`
|
||||
|
||||
#include <windows.h>
|
||||
#include <wmistr.h>
|
||||
#include <evntrace.h>
|
||||
#ifndef WPP_TRACE_W2K_COMPATABILITY
|
||||
#include <sddl.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// LEGACY: This structure was used by Win2k RpcRt4 and cluster tracing
|
||||
|
||||
typedef struct _WPP_WIN2K_CONTROL_BLOCK {
|
||||
TRACEHANDLE Logger;
|
||||
ULONG Flags;
|
||||
ULONG Level;
|
||||
} WPP_WIN2K_CONTROL_BLOCK, *PWPP_WIN2K_CONTROL_BLOCK;
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4201) // nonstandard extension used nameless struct/union
|
||||
|
||||
typedef struct _WPP_TRACE_CONTROL_BLOCK
|
||||
{
|
||||
struct _WPP_TRACE_CONTROL_BLOCK *Next;
|
||||
TRACEHANDLE UmRegistrationHandle;
|
||||
union {
|
||||
TRACEHANDLE Logger;
|
||||
PWPP_WIN2K_CONTROL_BLOCK Win2kCb;
|
||||
PVOID Ptr;
|
||||
struct _WPP_TRACE_CONTROL_BLOCK *Cb;
|
||||
};
|
||||
|
||||
UCHAR FlagsLen;
|
||||
UCHAR Level;
|
||||
USHORT Options;
|
||||
ULONG Flags[1];
|
||||
} WPP_TRACE_CONTROL_BLOCK, *PWPP_TRACE_CONTROL_BLOCK;
|
||||
#pragma warning(pop)
|
||||
|
||||
|
||||
#define WPP_IsValidSid IsValidSid
|
||||
#define WPP_GetLengthSid GetLengthSid
|
||||
|
||||
#ifndef WPP_TRACE
|
||||
#define WPP_TRACE TraceMessage
|
||||
#endif
|
||||
|
||||
enum {
|
||||
WPP_VER_WIN2K_CB_FORWARD_PTR = 0x01,
|
||||
WPP_VER_WHISTLER_CB_FORWARD_PTR = 0x02,
|
||||
WPP_VER_LH_CB_FORWARD_PTR = 0x03
|
||||
};
|
||||
|
||||
VOID WppCleanupUm( VOID );
|
||||
#define WPP_CLEANUP() WppCleanupUm()
|
||||
|
||||
#define WppLoadTracingSupport
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // #ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
|
|
@ -0,0 +1,482 @@
|
|||
`**********************************************************************`
|
||||
`* This is an include template file for tracewpp preprocessor. *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
|
||||
// template `TemplateFile`
|
||||
//
|
||||
// Defines a set of functions that simplifies
|
||||
// User mode registration for tracing
|
||||
//
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// define annotation record that will carry control information to pdb (in case somebody needs it)
|
||||
WPP_FORCEINLINE void WPP_CONTROL_ANNOTATION() {
|
||||
#if !defined(WPP_NO_ANNOTATIONS)
|
||||
#if !defined(WPP_ANSI_ANNOTATION)
|
||||
# define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) __annotation(L"TMC:", WPP_GUID_WTEXT Guid, _WPPW(WPP_STRINGIZE(Name)) Bits);
|
||||
# define WPP_DEFINE_BIT(Name) , _WPPW(#Name)
|
||||
#else
|
||||
# define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) __annotation("TMC:", WPP_GUID_TEXT Guid, WPP_STRINGIZE(Name) Bits);
|
||||
# define WPP_DEFINE_BIT(Name) , #Name
|
||||
#endif
|
||||
WPP_CONTROL_GUIDS
|
||||
# undef WPP_DEFINE_BIT
|
||||
# undef WPP_DEFINE_CONTROL_GUID
|
||||
#endif
|
||||
}
|
||||
|
||||
LPCGUID WPP_REGISTRATION_GUIDS[WPP_LAST_CTL];
|
||||
|
||||
WPP_CB_TYPE WPP_MAIN_CB[WPP_LAST_CTL];
|
||||
|
||||
#define WPP_NEXT(Name) ((WPP_TRACE_CONTROL_BLOCK*) \
|
||||
(WPP_XGLUE(WPP_CTL_, WPP_EVAL(Name)) + 1 == WPP_LAST_CTL ? 0:WPP_MAIN_CB + WPP_XGLUE(WPP_CTL_, WPP_EVAL(Name)) + 1))
|
||||
|
||||
__inline void WPP_INIT_CONTROL_ARRAY(WPP_CB_TYPE* Arr) {
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
|
||||
Arr->Control.Ptr = NULL; \
|
||||
Arr->Control.Next = WPP_NEXT(WPP_EVAL(Name)); \
|
||||
Arr->Control.FlagsLen = WPP_FLAG_LEN; \
|
||||
Arr->Control.Level = WPP_LAST_CTL; \
|
||||
Arr->Control.Options = 0; \
|
||||
Arr->Control.Flags[0] = 0; \
|
||||
++Arr;
|
||||
#define WPP_DEFINE_BIT(BitName) L" " L ## #BitName
|
||||
WPP_CONTROL_GUIDS
|
||||
#undef WPP_DEFINE_BIT
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
}
|
||||
|
||||
#undef WPP_INIT_STATIC_DATA
|
||||
#define WPP_INIT_STATIC_DATA WPP_INIT_CONTROL_ARRAY(WPP_MAIN_CB)
|
||||
|
||||
__inline void WPP_INIT_GUID_ARRAY(LPCGUID* Arr) {
|
||||
#define WPP_DEFINE_CONTROL_GUID(Name,Guid,Bits) \
|
||||
WPP_XGLUE4(*Arr = &WPP_, ThisDir, _CTLGUID_, WPP_EVAL(Name)); \
|
||||
++Arr;
|
||||
WPP_CONTROL_GUIDS
|
||||
#undef WPP_DEFINE_CONTROL_GUID
|
||||
}
|
||||
|
||||
|
||||
|
||||
VOID WppInitUm(__in_opt LPCWSTR AppName);
|
||||
|
||||
#define WPP_INIT_TRACING(AppName) \
|
||||
WppLoadTracingSupport; \
|
||||
(WPP_CONTROL_ANNOTATION(),WPP_INIT_STATIC_DATA, \
|
||||
WPP_INIT_GUID_ARRAY((LPCGUID*)&WPP_REGISTRATION_GUIDS), \
|
||||
WPP_CB= WPP_MAIN_CB, \
|
||||
WppInitUm(AppName))
|
||||
|
||||
|
||||
void WPP_Set_Dll_CB(
|
||||
PWPP_TRACE_CONTROL_BLOCK Control,
|
||||
VOID * DllControlBlock,
|
||||
USHORT Flags)
|
||||
{
|
||||
|
||||
if (*(PVOID*)DllControlBlock != DllControlBlock){
|
||||
Control->Ptr = DllControlBlock;
|
||||
} else {
|
||||
if (Flags == WPP_VER_WHISTLER_CB_FORWARD_PTR ){
|
||||
memset(Control, 0, sizeof(WPP_TRACE_CONTROL_BLOCK));
|
||||
*(PWPP_TRACE_CONTROL_BLOCK*)DllControlBlock = Control;
|
||||
Control->Options = WPP_VER_LH_CB_FORWARD_PTR;
|
||||
|
||||
} else if (Flags == WPP_VER_WIN2K_CB_FORWARD_PTR ) {
|
||||
Control->Ptr = DllControlBlock;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#define WPP_SET_FORWARD_PTR(CTL, FLAGS, PTR) (\
|
||||
(WPP_MAIN_CB[WPP_CTRL_NO(WPP_BIT_ ## CTL )].Control.Options = (FLAGS)));\
|
||||
WPP_Set_Dll_CB(&WPP_MAIN_CB[WPP_CTRL_NO(WPP_BIT_ ## CTL )].Control,(PTR),(USHORT)FLAGS)
|
||||
|
||||
|
||||
#define DEFAULT_LOGGER_NAME L"stdout"
|
||||
|
||||
#if !defined(WppDebug)
|
||||
# define WppDebug(a,b)
|
||||
#endif
|
||||
|
||||
#if !defined(WPPINIT_STATIC)
|
||||
# define WPPINIT_STATIC
|
||||
#endif
|
||||
|
||||
#if !defined(WPPINIT_EXPORT)
|
||||
# define WPPINIT_EXPORT
|
||||
#endif
|
||||
|
||||
#define WPP_GUID_FORMAT "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x"
|
||||
#define WPP_GUID_ELEMENTS(p) \
|
||||
p->Data1, p->Data2, p->Data3,\
|
||||
p->Data4[0], p->Data4[1], p->Data4[2], p->Data4[3],\
|
||||
p->Data4[4], p->Data4[5], p->Data4[6], p->Data4[7]
|
||||
|
||||
#define WPP_MAX_LEVEL 255
|
||||
#define WPP_MAX_FLAGS 0xFFFFFFFF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
__inline TRACEHANDLE WppQueryLogger(__in_opt PCWSTR LoggerName)
|
||||
{
|
||||
ULONG Status;
|
||||
EVENT_TRACE_PROPERTIES LoggerInfo;
|
||||
|
||||
ZeroMemory(&LoggerInfo, sizeof(LoggerInfo));
|
||||
LoggerInfo.Wnode.BufferSize = sizeof(LoggerInfo);
|
||||
LoggerInfo.Wnode.Flags = WNODE_FLAG_TRACED_GUID;
|
||||
|
||||
Status = ControlTraceW(0, LoggerName ? LoggerName : L"stdout", &LoggerInfo, EVENT_TRACE_CONTROL_QUERY);
|
||||
if (Status == ERROR_SUCCESS || Status == ERROR_MORE_DATA) {
|
||||
return (TRACEHANDLE) LoggerInfo.Wnode.HistoricalContext;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#if defined (WPP_GLOBALLOGGER)
|
||||
|
||||
#define WPP_REG_GLOBALLOGGER_FLAGS L"Flags"
|
||||
#define WPP_REG_GLOBALLOGGER_LEVEL L"Level"
|
||||
#define WPP_REG_GLOBALLOGGER_START L"Start"
|
||||
|
||||
#define WPP_TEXTGUID_LEN 38
|
||||
#define WPP_REG_GLOBALLOGGER_KEY L"SYSTEM\\CurrentControlSet\\Control\\Wmi\\GlobalLogger"
|
||||
|
||||
WPPINIT_STATIC
|
||||
void WppIntToHex(
|
||||
__out_ecount(digits) LPWSTR Buf,
|
||||
unsigned int value,
|
||||
int digits
|
||||
)
|
||||
{
|
||||
static LPCWSTR hexDigit = L"0123456789abcdef";
|
||||
while (--digits >= 0) {
|
||||
Buf[digits] = hexDigit[ value & 15 ];
|
||||
value /= 16;
|
||||
}
|
||||
}
|
||||
|
||||
WPPINIT_EXPORT
|
||||
void WppInitGlobalLogger(
|
||||
IN LPCGUID ControlGuid,
|
||||
IN PTRACEHANDLE LoggerHandle,
|
||||
OUT PULONG Flags,
|
||||
__out_ecount(sizeof(UCHAR)) PUCHAR Level )
|
||||
{
|
||||
WCHAR GuidBuf[WPP_TEXTGUID_LEN];
|
||||
ULONG CurrentFlags = 0;
|
||||
ULONG CurrentLevel = 0;
|
||||
DWORD Start = 0;
|
||||
DWORD DataSize ;
|
||||
ULONG Status ;
|
||||
HKEY GloblaLoggerHandleKey;
|
||||
HKEY ValueHandleKey ;
|
||||
|
||||
|
||||
|
||||
WppDebug(0,("WPP checking Global Logger %S",WPP_REG_GLOBALLOGGER_KEY));
|
||||
|
||||
if ((Status = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
(LPWSTR)WPP_REG_GLOBALLOGGER_KEY,
|
||||
0,
|
||||
KEY_READ,
|
||||
&GloblaLoggerHandleKey
|
||||
)) != ERROR_SUCCESS) {
|
||||
WppDebug(0,("GlobalLogger key does not exist (0x%08X)",Status));
|
||||
return ;
|
||||
}
|
||||
|
||||
DataSize = sizeof(DWORD);
|
||||
Status = RegQueryValueExW(GloblaLoggerHandleKey,
|
||||
(LPWSTR)WPP_REG_GLOBALLOGGER_START,
|
||||
0,
|
||||
NULL,
|
||||
(LPBYTE)&Start,
|
||||
&DataSize);
|
||||
if (Status != ERROR_SUCCESS || Start == 0 ) {
|
||||
WppDebug(0,("Global Logger not started (0x%08X)",Status));
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
|
||||
WppDebug(0,("Global Logger exists and is set to be started"));
|
||||
|
||||
{
|
||||
static LPCWSTR hexDigit = L"0123456789abcdef";
|
||||
int i;
|
||||
|
||||
WppIntToHex(GuidBuf, ControlGuid->Data1, 8);
|
||||
GuidBuf[8] = '-';
|
||||
|
||||
WppIntToHex(&GuidBuf[9], ControlGuid->Data2, 4);
|
||||
GuidBuf[13] = '-';
|
||||
|
||||
WppIntToHex(&GuidBuf[14], ControlGuid->Data3, 4);
|
||||
GuidBuf[18] = '-';
|
||||
|
||||
GuidBuf[19] = hexDigit[(ControlGuid->Data4[0] & 0xF0) >> 4];
|
||||
GuidBuf[20] = hexDigit[ControlGuid->Data4[0] & 0x0F ];
|
||||
GuidBuf[21] = hexDigit[(ControlGuid->Data4[1] & 0xF0) >> 4];
|
||||
GuidBuf[22] = hexDigit[ControlGuid->Data4[1] & 0x0F ];
|
||||
GuidBuf[23] = '-';
|
||||
|
||||
for( i=2; i < 8 ; i++ ){
|
||||
GuidBuf[i*2+20] = hexDigit[(ControlGuid->Data4[i] & 0xF0) >> 4];
|
||||
GuidBuf[i*2+21] = hexDigit[ControlGuid->Data4[i] & 0x0F ];
|
||||
}
|
||||
GuidBuf[36] = 0;
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Perform the query
|
||||
//
|
||||
|
||||
if ((Status = RegOpenKeyExW(GloblaLoggerHandleKey,
|
||||
(LPWSTR)GuidBuf,
|
||||
0,
|
||||
KEY_READ,
|
||||
&ValueHandleKey
|
||||
)) != ERROR_SUCCESS) {
|
||||
WppDebug(0,("Global Logger Key not set for this Control Guid %S (0x%08X)",GuidBuf,Status));
|
||||
goto Cleanup;
|
||||
}
|
||||
// Get the Flags Parameter
|
||||
DataSize = sizeof(DWORD);
|
||||
Status = RegQueryValueExW(ValueHandleKey,
|
||||
(LPWSTR)WPP_REG_GLOBALLOGGER_FLAGS,
|
||||
0,
|
||||
NULL,
|
||||
(LPBYTE)&CurrentFlags,
|
||||
&DataSize);
|
||||
if (Status != ERROR_SUCCESS || CurrentFlags == 0 ) {
|
||||
WppDebug(0,("GlobalLogger for %S Flags not set (0x%08X)",GuidBuf,Status));
|
||||
}
|
||||
// Get the levels Parameter
|
||||
DataSize = sizeof(DWORD);
|
||||
Status = RegQueryValueExW(ValueHandleKey,
|
||||
(LPWSTR)WPP_REG_GLOBALLOGGER_LEVEL,
|
||||
0,
|
||||
NULL,
|
||||
(LPBYTE)&CurrentLevel,
|
||||
&DataSize);
|
||||
if (Status != ERROR_SUCCESS || CurrentLevel == 0 ) {
|
||||
WppDebug(0,("GlobalLogger for %S Level not set (0x%08X)",GuidBuf,Status));
|
||||
}
|
||||
|
||||
if (Start==1) {
|
||||
|
||||
if ((*LoggerHandle= WppQueryLogger( L"GlobalLogger")) != (TRACEHANDLE)NULL) {
|
||||
*Flags = CurrentFlags & 0x7FFFFFFF ;
|
||||
*Level = (UCHAR)(CurrentLevel & 0xFF) ;
|
||||
WppDebug(0,("WPP Enabled via Global Logger Flags=0x%08X Level=0x%02X",CurrentFlags,CurrentLevel));
|
||||
} else {
|
||||
WppDebug(0,("GlobalLogger set for start but not running (Flags=0x%08X Level=0x%02X)",CurrentFlags,CurrentLevel));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RegCloseKey(ValueHandleKey);
|
||||
Cleanup:
|
||||
RegCloseKey(GloblaLoggerHandleKey);
|
||||
}
|
||||
#endif //#ifdef WPP_GLOBALLOGGER
|
||||
|
||||
#ifdef WPP_MANAGED_CPP
|
||||
#pragma managed(push, off)
|
||||
#endif
|
||||
|
||||
ULONG
|
||||
WINAPI
|
||||
WppControlCallback(
|
||||
IN WMIDPREQUESTCODE RequestCode,
|
||||
IN PVOID Context,
|
||||
__inout ULONG *InOutBufferSize,
|
||||
__inout PVOID Buffer
|
||||
)
|
||||
{
|
||||
PWPP_TRACE_CONTROL_BLOCK Ctx = (PWPP_TRACE_CONTROL_BLOCK)Context;
|
||||
TRACEHANDLE Logger;
|
||||
UCHAR Level;
|
||||
DWORD Flags;
|
||||
|
||||
*InOutBufferSize = 0;
|
||||
|
||||
switch (RequestCode)
|
||||
{
|
||||
case WMI_ENABLE_EVENTS:
|
||||
{
|
||||
Logger = GetTraceLoggerHandle( Buffer );
|
||||
Level = GetTraceEnableLevel(Logger);
|
||||
Flags = GetTraceEnableFlags(Logger);
|
||||
|
||||
WppDebug(1, ("[WppInit] WMI_ENABLE_EVENTS Ctx %p Flags %x"
|
||||
" Lev %d Logger %I64x\n",
|
||||
Ctx, Flags, Level, Logger) );
|
||||
break;
|
||||
}
|
||||
case WMI_DISABLE_EVENTS:
|
||||
{
|
||||
Logger = 0;
|
||||
Flags = 0;
|
||||
Level = 0;
|
||||
WppDebug(1, ("[WppInit] WMI_DISABLE_EVENTS Ctx 0x%08p\n", Ctx));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return(ERROR_INVALID_PARAMETER);
|
||||
}
|
||||
}
|
||||
if (Ctx->Options & WPP_VER_WIN2K_CB_FORWARD_PTR && Ctx->Win2kCb) {
|
||||
Ctx->Win2kCb->Logger = Logger;
|
||||
Ctx->Win2kCb->Level = Level;
|
||||
Ctx->Win2kCb->Flags = Flags;
|
||||
} else {
|
||||
if (Ctx->Options & WPP_VER_WHISTLER_CB_FORWARD_PTR && Ctx->Cb) {
|
||||
Ctx = Ctx->Cb; // use forwarding address
|
||||
}
|
||||
Ctx->Logger = Logger;
|
||||
Ctx->Level = Level;
|
||||
Ctx->Flags[0] = Flags;
|
||||
|
||||
}
|
||||
return(ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
#ifdef WPP_MANAGED_CPP
|
||||
#pragma managed(pop)
|
||||
#endif
|
||||
|
||||
|
||||
WPPINIT_EXPORT
|
||||
VOID WppInitUm(__in_opt LPCWSTR AppName)
|
||||
{
|
||||
PWPP_TRACE_CONTROL_BLOCK Control = &WPP_CB[0].Control;
|
||||
TRACE_GUID_REGISTRATION TraceRegistration;
|
||||
LPCGUID * RegistrationGuids = (LPCGUID *)&WPP_REGISTRATION_GUIDS;
|
||||
LPCGUID ControlGuid;
|
||||
|
||||
ULONG Status;
|
||||
|
||||
#ifdef WPP_MOF_RESOURCENAME
|
||||
#ifdef WPP_DLL
|
||||
HMODULE hModule = NULL;
|
||||
#endif
|
||||
WCHAR ImagePath[MAX_PATH] = {UNICODE_NULL} ;
|
||||
WCHAR WppMofResourceName[] = WPP_MOF_RESOURCENAME ;
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(AppName);
|
||||
#endif //#ifdef WPP_MOF_RESOURCENAME
|
||||
|
||||
WppDebug(1, ("Registering %ws\n", AppName) );
|
||||
|
||||
for(; Control; Control = Control->Next) {
|
||||
|
||||
ControlGuid = *RegistrationGuids++;
|
||||
TraceRegistration.Guid = ControlGuid;
|
||||
TraceRegistration.RegHandle = 0;
|
||||
|
||||
WppDebug(1,(WPP_GUID_FORMAT " %ws : %d\n",
|
||||
WPP_GUID_ELEMENTS(ControlGuid),
|
||||
AppName,
|
||||
Control->FlagsLen));
|
||||
|
||||
|
||||
#ifdef WPP_MOF_RESOURCENAME
|
||||
if (AppName != NULL) {
|
||||
DWORD Status ;
|
||||
#ifdef WPP_DLL
|
||||
if ((hModule = GetModuleHandleW(AppName)) != NULL) {
|
||||
Status = GetModuleFileNameW(hModule, ImagePath, MAX_PATH) ;
|
||||
ImagePath[MAX_PATH-1] = '\0';
|
||||
if (Status == 0) {
|
||||
WppDebug(1,("RegisterTraceGuids => GetModuleFileName(DLL) Failed 0x%08X\n",GetLastError()));
|
||||
}
|
||||
} else {
|
||||
WppDebug(1,("RegisterTraceGuids => GetModuleHandleW failed for %ws (0x%08X)\n",AppName,GetLastError()));
|
||||
}
|
||||
#else // #ifdef WPP_DLL
|
||||
Status = GetModuleFileNameW(NULL,ImagePath,MAX_PATH);
|
||||
if (Status == 0) {
|
||||
WppDebug(1,("GetModuleFileName(EXE) Failed 0x%08X\n",GetLastError()));
|
||||
}
|
||||
#endif // #ifdef WPP_DLL
|
||||
}
|
||||
WppDebug(1,("registerTraceGuids => registering with WMI, App=%ws, Mof=%ws, ImagePath=%ws\n",AppName,WppMofResourceName,ImagePath));
|
||||
|
||||
Status = RegisterTraceGuidsW( // Always use Unicode
|
||||
#else // ifndef WPP_MOF_RESOURCENAME
|
||||
|
||||
Status = RegisterTraceGuids(
|
||||
#endif // ifndef WPP_MOF_RESOURCENAME
|
||||
|
||||
WppControlCallback,
|
||||
Control, // Context for the callback
|
||||
ControlGuid,
|
||||
1,
|
||||
&TraceRegistration,
|
||||
#ifndef WPP_MOF_RESOURCENAME
|
||||
0, //ImagePath,
|
||||
0, //ResourceName,
|
||||
#else // #ifndef WPP_MOF_RESOURCENAME
|
||||
ImagePath,
|
||||
WppMofResourceName,
|
||||
#endif // #ifndef WPP_MOF_RESOURCENAME
|
||||
&Control->UmRegistrationHandle
|
||||
);
|
||||
|
||||
WppDebug(1, ("RegisterTraceGuid => %d\n", Status) );
|
||||
#if defined (WPP_GLOBALLOGGER)
|
||||
// Check if Global logger is active if we have not been immediately activated
|
||||
|
||||
if (Control->Logger == (TRACEHANDLE)NULL) {
|
||||
WppInitGlobalLogger( ControlGuid, (PTRACEHANDLE)&Control->Logger, &Control->Flags[0], &Control->Level);
|
||||
}
|
||||
#endif //#if defined (WPP_GLOBALLOGGER)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
WPPINIT_EXPORT
|
||||
VOID WppCleanupUm( VOID )
|
||||
{
|
||||
PWPP_TRACE_CONTROL_BLOCK Control;
|
||||
|
||||
if (WPP_CB == (WPP_CB_TYPE*)&WPP_CB){
|
||||
//
|
||||
// WPP_INIT_TRACING macro has not been called
|
||||
//
|
||||
return;
|
||||
}
|
||||
WppDebug(1, ("Cleanup\n") );
|
||||
Control = &WPP_CB[0].Control;
|
||||
for(; Control; Control = Control->Next) {
|
||||
WppDebug(1,("UnRegistering %I64x\n", Control->UmRegistrationHandle) );
|
||||
if (Control->UmRegistrationHandle) {
|
||||
UnregisterTraceGuids(Control->UmRegistrationHandle);
|
||||
Control->UmRegistrationHandle = (TRACEHANDLE)NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
WPP_CB = (WPP_CB_TYPE*)&WPP_CB;
|
||||
}
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
|
@ -0,0 +1,398 @@
|
|||
`**********************************************************************`
|
||||
`* This is a template file for tracewpp preprocessor *`
|
||||
`* If you need to use a custom version of this file in your project *`
|
||||
`* Please clone it from this one and point WPP to it by specifying *`
|
||||
`* -gen:{yourfile} option on RUN_WPP line in your sources file *`
|
||||
`* *`
|
||||
`* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
|
||||
`**********************************************************************`
|
||||
//`Compiler.Checksum` Generated File. Do not edit.
|
||||
// File created by `Compiler.Name` compiler version `Compiler.Version`-`Compiler.Timestamp`
|
||||
// on `System.Date` at `System.Time` UTC from a template `TemplateFile`
|
||||
|
||||
`INCLUDE um-header.tpl`
|
||||
|
||||
#ifndef WPP_ALREADY_INCLUDED
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef
|
||||
ULONG
|
||||
(*PFN_WPPTRACEMESSAGE)(
|
||||
IN TRACEHANDLE LoggerHandle,
|
||||
IN ULONG MessageFlags,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
IN ...
|
||||
);
|
||||
|
||||
|
||||
typedef
|
||||
ULONG
|
||||
(*PFN_WPPTRACEMESSAGEVA)(
|
||||
IN TRACEHANDLE LoggerHandle,
|
||||
IN ULONG MessageFlags,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
IN va_list MessageArgList
|
||||
);
|
||||
|
||||
typedef enum _WPP_TRACE_API_SUITE {
|
||||
WppTraceWin2K,
|
||||
WppTraceWinXP,
|
||||
WppTraceTraceLH,
|
||||
WppTraceMaxSuite
|
||||
} WPP_TRACE_API_SUITE;
|
||||
|
||||
ULONG
|
||||
WppInitTraceFunction(IN TRACEHANDLE LoggerHandle,
|
||||
IN DWORD TraceOptions,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
...
|
||||
);
|
||||
ULONG
|
||||
TraceMessageW2k(IN TRACEHANDLE LoggerHandle,
|
||||
IN DWORD TraceOptions,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
...
|
||||
) ;
|
||||
|
||||
ULONG
|
||||
TraceMessageW2kVa(IN TRACEHANDLE LoggerHandle,
|
||||
IN DWORD TraceOptions,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
IN va_list MessageArgList
|
||||
);
|
||||
|
||||
__declspec(selectany) PFN_WPPTRACEMESSAGE pfnWppTraceMessage = WppInitTraceFunction;
|
||||
__declspec(selectany) PFN_WPPTRACEMESSAGEVA pfnWppTraceMessageVa = TraceMessageW2kVa;
|
||||
__declspec(selectany) WPP_TRACE_API_SUITE WPPTraceSuite = WppTraceWin2K;
|
||||
|
||||
|
||||
#undef WPP_TRACE
|
||||
#define WPP_TRACE pfnWppTraceMessage
|
||||
|
||||
#ifndef WPP_MAX_MOF_FIELDS
|
||||
#define WPP_MAX_MOF_FIELDS 7
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef TRACE_MESSAGE_MAXIMUM_SIZE
|
||||
#define TRACE_MESSAGE_MAXIMUM_SIZE 8*1024
|
||||
#endif
|
||||
|
||||
|
||||
__inline ULONG
|
||||
TraceMessageW2kVa(IN TRACEHANDLE LoggerHandle,
|
||||
IN DWORD TraceOptions,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
IN va_list MessageArgList
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This is a function that simulates tracemessage in W2K
|
||||
|
||||
Arguments:
|
||||
|
||||
LoggerHandle - handle providers logger handle
|
||||
|
||||
TraceOptions - unreferenced
|
||||
|
||||
MessageGuid - pointer to message GUID
|
||||
|
||||
MessageNumber - Type of message been logged
|
||||
|
||||
MessageArgList - list or arguments
|
||||
|
||||
Return Value:
|
||||
|
||||
code indicating success or failure
|
||||
--*/
|
||||
{
|
||||
|
||||
typedef struct _WPP_TRACE_BUFFER {
|
||||
EVENT_TRACE_HEADER Header;
|
||||
MOF_FIELD MofField[WPP_MAX_MOF_FIELDS+1];
|
||||
} WPP_TRACE_BUFFER;
|
||||
|
||||
|
||||
size_t ByteCount;
|
||||
size_t ArgumentCount;
|
||||
va_list VarArgs = MessageArgList;
|
||||
PVOID DataPtr ;
|
||||
size_t DataSize = 0;
|
||||
size_t ArgOffset;
|
||||
ULONG Status;
|
||||
WPP_TRACE_BUFFER TraceBuf;
|
||||
PVOID Data=NULL;
|
||||
|
||||
UNREFERENCED_PARAMETER(TraceOptions);
|
||||
|
||||
//
|
||||
// Fill in header fields
|
||||
// Type is 0xFF to indicate that the first data is the MessageNumber
|
||||
// The first Mof data is the Message Number
|
||||
//
|
||||
|
||||
TraceBuf.Header.GuidPtr = (ULONGLONG)MessageGuid ;
|
||||
TraceBuf.Header.Flags = WNODE_FLAG_TRACED_GUID |WNODE_FLAG_USE_GUID_PTR|WNODE_FLAG_USE_MOF_PTR;
|
||||
TraceBuf.Header.Class.Type = 0xFF ;
|
||||
TraceBuf.MofField[0].DataPtr = (ULONGLONG)&MessageNumber;
|
||||
TraceBuf.MofField[0].Length = sizeof(USHORT);
|
||||
|
||||
// Determine the number bytes to follow header
|
||||
ByteCount = 0 ;
|
||||
ArgumentCount = 0 ;
|
||||
|
||||
while ((DataPtr = va_arg (VarArgs, PVOID)) != NULL) {
|
||||
DataSize = va_arg (VarArgs, size_t);
|
||||
|
||||
// Check for integer overflow.
|
||||
if (ByteCount + DataSize > ByteCount)
|
||||
{
|
||||
ByteCount += DataSize ;
|
||||
ArgumentCount++ ;
|
||||
|
||||
if (ArgumentCount <= WPP_MAX_MOF_FIELDS) {
|
||||
TraceBuf.MofField[ArgumentCount].DataPtr = (ULONGLONG)DataPtr;
|
||||
TraceBuf.MofField[ArgumentCount].Length = (ULONG)DataSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
va_end(VarArgs);
|
||||
if (ByteCount > TRACE_MESSAGE_MAXIMUM_SIZE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ArgumentCount > WPP_MAX_MOF_FIELDS) {
|
||||
//
|
||||
// This occurs infrequently
|
||||
// Allocate the blob to hold the data
|
||||
//
|
||||
Data = LocalAlloc(0,ByteCount);
|
||||
if (Data == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
TraceBuf.MofField[1].DataPtr = (ULONGLONG)Data;
|
||||
TraceBuf.MofField[1].Length = (ULONG)ByteCount;
|
||||
|
||||
ArgOffset = 0 ;
|
||||
DataSize = 0 ;
|
||||
VarArgs = MessageArgList;
|
||||
while ((DataPtr = va_arg (VarArgs, PVOID)) != NULL) {
|
||||
DataSize = va_arg (VarArgs, size_t) ;
|
||||
memcpy((char*)Data + ArgOffset, DataPtr, DataSize) ;
|
||||
ArgOffset += DataSize ;
|
||||
}
|
||||
va_end(VarArgs) ;
|
||||
|
||||
//Fill in the total size (header + 2 mof fields)
|
||||
TraceBuf.Header.Size = (USHORT)(sizeof(EVENT_TRACE_HEADER) + 2*sizeof(MOF_FIELD));
|
||||
|
||||
} else {
|
||||
//Fill in the total size (header + mof fields)
|
||||
TraceBuf.Header.Size = (USHORT)(sizeof(EVENT_TRACE_HEADER) + (ArgumentCount+1)*sizeof(MOF_FIELD));
|
||||
}
|
||||
|
||||
Status = TraceEvent(LoggerHandle, &TraceBuf.Header) ;
|
||||
|
||||
if (Data) {
|
||||
LocalFree(Data);
|
||||
}
|
||||
|
||||
if(ERROR_SUCCESS != Status) {
|
||||
// Silently ignored error
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
__inline ULONG
|
||||
TraceMessageW2k(IN TRACEHANDLE LoggerHandle,
|
||||
IN DWORD TraceOptions,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
...
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This is a function that simulates tracemessage in W2K
|
||||
|
||||
Arguments:
|
||||
|
||||
LoggerHandle - handle providers logger handle
|
||||
|
||||
TraceOptions - unreferenced
|
||||
|
||||
MessageGuid - pointer to message GUID
|
||||
|
||||
MessageNumber - Type of message been logged
|
||||
|
||||
... - list or arguments
|
||||
|
||||
Return Value:
|
||||
|
||||
code indicating success or failure
|
||||
--*/
|
||||
{
|
||||
va_list VarArgs ;
|
||||
|
||||
va_start(VarArgs, MessageNumber);
|
||||
|
||||
return( TraceMessageW2kVa( LoggerHandle,
|
||||
TraceOptions,
|
||||
MessageGuid,
|
||||
MessageNumber,
|
||||
VarArgs
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Advanced tracing APIs (XP and later) will be indirectly called.
|
||||
//
|
||||
|
||||
__inline VOID WppDynamicTracingSupport(
|
||||
VOID
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This function assigns at runtime the ETW API set to be use for tracing.
|
||||
|
||||
Arguments:
|
||||
|
||||
Remarks:
|
||||
|
||||
At runtime determine assing the funtions pointers for the trace APIs to be use.
|
||||
XP and above will use TraceMessage, and Win2K will use our private W2kTraceMessage
|
||||
which uses TraceEvent
|
||||
|
||||
--*/
|
||||
{
|
||||
HINSTANCE hinstLib;
|
||||
|
||||
hinstLib = LoadLibraryW(L"advapi32");
|
||||
if (hinstLib != NULL)
|
||||
{
|
||||
pfnWppTraceMessage = (PFN_WPPTRACEMESSAGE) (INT_PTR)
|
||||
GetProcAddress(hinstLib, "TraceMessage");
|
||||
|
||||
if (NULL == pfnWppTraceMessage) {
|
||||
pfnWppTraceMessage = TraceMessageW2k;
|
||||
pfnWppTraceMessageVa = TraceMessageW2kVa;
|
||||
WPPTraceSuite = WppTraceWin2K;
|
||||
} else {
|
||||
|
||||
WPPTraceSuite = WppTraceWinXP;
|
||||
pfnWppTraceMessageVa = (PFN_WPPTRACEMESSAGEVA) (INT_PTR)
|
||||
GetProcAddress(hinstLib, "TraceMessageVa");
|
||||
if (NULL == pfnWppTraceMessageVa) {
|
||||
pfnWppTraceMessageVa = TraceMessageW2kVa;
|
||||
}
|
||||
}
|
||||
|
||||
FreeLibrary(hinstLib);
|
||||
} else {
|
||||
pfnWppTraceMessage = TraceMessageW2k;
|
||||
pfnWppTraceMessageVa = TraceMessageW2kVa;
|
||||
WPPTraceSuite = WppTraceWin2K;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__inline ULONG
|
||||
WppInitTraceFunction(IN TRACEHANDLE LoggerHandle,
|
||||
IN DWORD TraceOptions,
|
||||
IN LPGUID MessageGuid,
|
||||
IN USHORT MessageNumber,
|
||||
...
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
This is a function initializes the tracing function if not
|
||||
calling WPP_INIT_TRACING. It uses TraceMessageVa to log events
|
||||
|
||||
|
||||
--*/
|
||||
{
|
||||
|
||||
va_list VarArgs ;
|
||||
|
||||
WppDynamicTracingSupport();
|
||||
|
||||
va_start(VarArgs, MessageNumber);
|
||||
|
||||
pfnWppTraceMessageVa( LoggerHandle,
|
||||
TraceOptions,
|
||||
MessageGuid,
|
||||
MessageNumber,
|
||||
VarArgs
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#undef WppLoadTracingSupport
|
||||
#define WppLoadTracingSupport WppDynamicTracingSupport()
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // WPP_ALREADY_INCLUDED
|
||||
|
||||
`INCLUDE control.tpl`
|
||||
`INCLUDE tracemacro.tpl`
|
||||
|
||||
`IF FOUND WPP_INIT_TRACING`
|
||||
#define WPPINIT_EXPORT
|
||||
`INCLUDE um-init.tpl`
|
||||
`ENDIF`
|
||||
|
||||
//
|
||||
// Tracing Macro name redefinition
|
||||
//
|
||||
|
||||
// NoMsgArgs
|
||||
|
||||
`FORALL f IN Funcs WHERE !DoubleP && !MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name` WPP_(CALL)
|
||||
`ENDFOR`
|
||||
|
||||
`FORALL f IN Funcs WHERE DoubleP && !MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name`(ARGS) WPP_(CALL) ARGS
|
||||
`ENDFOR`
|
||||
|
||||
|
||||
// MsgArgs
|
||||
|
||||
`FORALL f IN Funcs WHERE MsgArgs`
|
||||
#undef `f.Name`
|
||||
#define `f.Name`(`f.FixedArgs` MSGARGS) WPP_(CALL)(`f.FixedArgs` MSGARGS)
|
||||
`ENDFOR`
|
||||
|
||||
`FORALL r IN Reorder`
|
||||
#undef WPP_R`r.Name`
|
||||
#define WPP_R`r.Name`(`r.Arguments`) `r.Permutation`
|
||||
`ENDFOR`
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
#
|
||||
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
|
||||
#
|
||||
|
||||
parameters:
|
||||
name: ''
|
||||
# send telemetry
|
||||
enableTelemetry: true
|
||||
# install Microbuild plugin if not a public build
|
||||
enableMicrobuild: true
|
||||
# queue YAML object - https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted-schema.md#queue
|
||||
queue: {}
|
||||
# variables YAML object - https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted-schema.md#phase
|
||||
variables: {}
|
||||
# run this build as a public build, even in the internal project
|
||||
runAsPublic: false
|
||||
|
||||
# Common conditionals: There are a number of common conditionals that are useful. Generally these are used to decide what resources can be accessed,
|
||||
# or what logic should be applied based on the context the build is being run in.
|
||||
# - eq/ne(variables['Agent.Os'], 'Windows_NT') - Running/not running on a windows machine
|
||||
# - eq/ne(variables['System.TeamProject'], 'public') - Running/not running on the dotnet public VSTS project
|
||||
# - and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest') - Not running in public and not a pull request.
|
||||
# - or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest') - Running in public or a pull request.
|
||||
|
||||
phases:
|
||||
- template: /eng/common/templates/phases/base.yml
|
||||
parameters:
|
||||
enableTelemetry: ${{ parameters.enableTelemetry }}
|
||||
|
||||
enableMicrobuild: ${{ parameters.enableMicrobuild }}
|
||||
|
||||
name: ${{ parameters.name }}
|
||||
|
||||
queue: ${{ parameters.queue }}
|
||||
|
||||
runAsPublic: ${{ parameters.runAsPublic }}
|
||||
|
||||
variables:
|
||||
${{ insert }}: ${{ parameters.variables }}
|
||||
_HelixBuildConfig: $(_BuildConfig)
|
||||
# Only enable publishing in non-public, non PR scenarios.
|
||||
${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
# This should be changed to an isolated blob feed per-build.
|
||||
# Right now a manual build of a random branch would get published alongside the normal branch artifacts.
|
||||
_PublishBlobFeedUrl: https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json
|
||||
_SignArgs: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
|
||||
_PublishArgs: /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
|
||||
/p:DotNetPublishBlobFeedUrl=$(_PublishBlobFeedUrl)
|
||||
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
|
||||
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
|
||||
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
|
||||
_OfficialBuildIdArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
|
||||
# else
|
||||
${{ if or(eq(parameters.runAsPublic, 'true'), eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
_PublishArgs: ''
|
||||
_OfficialBuildIdArgs: ''
|
||||
_SignArgs: ''
|
||||
|
||||
steps:
|
||||
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- task: AzureKeyVault@1
|
||||
inputs:
|
||||
azureSubscription: 'DotNet-Engineering-Services_KeyVault'
|
||||
KeyVaultName: EngKeyVault
|
||||
SecretsFilter: 'dotnetfeed-storage-access-key-1,microsoft-symbol-server-pat,symweb-symbol-server-pat'
|
||||
|
||||
# Use utility script to run script command dependent on agent OS.
|
||||
- script: eng\common\cibuild.cmd
|
||||
-configuration $(_BuildConfig)
|
||||
-prepareMachine
|
||||
$(_PublishArgs)
|
||||
$(_SignArgs)
|
||||
$(_OfficialBuildIdArgs)
|
||||
/p:Platform=$(_Platform) /p:IsShipping=$(_IsShipping)
|
||||
displayName: Windows Build / Publish
|
||||
condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Logs to VSTS
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
|
||||
PublishLocation: Container
|
||||
ArtifactName: $(Agent.Os)_$(Agent.JobName)
|
||||
continueOnError: true
|
||||
condition: always()
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: Publish Test Results
|
||||
inputs:
|
||||
testResultsFormat: 'xUnit'
|
||||
testResultsFiles: '*.xml'
|
||||
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
|
||||
continueOnError: true
|
||||
condition: always()
|
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
|
||||
#
|
||||
|
||||
# This repo uses C++/CLI /clr:pure (or /clr:netcore) switches during compilation, which are
|
||||
# deprecated. Ensure that this warning is always suppressed during build.
|
||||
if (($properties -eq $null) -or (-not ($properties -icontains '/nowarn:D9035'))) {
|
||||
$properties = @('/nowarn:D9035') + $properties
|
||||
}
|
||||
|
||||
# Make sure that Nuget restore doesn't hit the cache when running CI builds
|
||||
# See https://github.com/NuGet/Home/issues/3116
|
||||
if ($ci) {
|
||||
if (($properties -eq $null) -or (-not ($properties -icontains '/p:RestoreNoCache=true'))) {
|
||||
$properties = @('/p:RestoreNoCache=true') + $properties
|
||||
}
|
||||
}
|
||||
# Always generate binary logs
|
||||
$binaryLog = $true
|
||||
$DoNotAbortNativeToolsInstallationOnFailure = $true
|
|
@ -1,8 +1,12 @@
|
|||
#
|
||||
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
|
||||
#
|
||||
#
|
||||
parameters:
|
||||
|
||||
# Needed because agent pool can't be read from a user-defined variable (Azure DevOps limitation)
|
||||
# Defaults to dotnet-external-temp-vs2019
|
||||
agentPool: dotnet-external-temp-vs2019
|
||||
# Defaults to dotnet-internal-vs2019-preview
|
||||
agentPool: dotnet-internal-vs2019-preview
|
||||
|
||||
# Needed because runAsPublic is used in template expressions, which can't read from user-defined variables
|
||||
# Defaults to true
|
||||
|
@ -16,7 +20,7 @@ jobs:
|
|||
enablePublishTestResults: true
|
||||
enablePublishBuildAssets: true
|
||||
enableTelemetry: true
|
||||
helixRepo: dotnet/wpf
|
||||
helixRepo: dnceng/wpf
|
||||
|
||||
jobs:
|
||||
- job: Windows_NT
|
||||
|
@ -26,7 +30,7 @@ jobs:
|
|||
- name: _TeamName
|
||||
value: DotNetCore
|
||||
- name: _SignType
|
||||
value: test
|
||||
value: real
|
||||
- name: _SignArgs
|
||||
value: ''
|
||||
|
||||
|
@ -67,6 +71,8 @@ jobs:
|
|||
value: /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
|
||||
/p:DotNetPublishBlobFeedUrl=$(_PublishBlobFeedUrl)
|
||||
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
|
||||
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
|
||||
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
|
||||
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
|
||||
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
|
||||
- name: _OfficialBuildIdArgs
|
||||
|
@ -102,4 +108,4 @@ jobs:
|
|||
$(_SignArgs)
|
||||
$(_OfficialBuildIdArgs)
|
||||
$(_PlatformArgs)
|
||||
displayName: Windows Build / Publish
|
||||
displayName: Windows Build / Publish
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#
|
||||
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
|
||||
#
|
||||
|
||||
. $PsScriptRoot\common\init-tools-native.ps1 -InstallDirectory $PSScriptRoot\..\.tools\native -GlobalJsonFile $PSScriptRoot\..\global.json
|
|
@ -9,6 +9,11 @@
|
|||
"version": "3.0.100-preview-010024"
|
||||
},
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19177.11"
|
||||
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19177.2",
|
||||
"Microsoft.DotNet.Arcade.Wpf.Sdk": "4.8.0-prerelease.19168.11"
|
||||
},
|
||||
"native-tools": {
|
||||
"strawberry-perl": "5.28.1.1-1",
|
||||
"msvcurt-c1xx": "0.0.0.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<IsPackagingProject>true</IsPackagingProject>
|
||||
|
||||
<!-- When an Sdk-style project sets NoTargets=true, it will produce no assemblies -->
|
||||
<NoTargets>true</NoTargets>
|
||||
<MsBuildSdkPackage Condition="$(MSBuildProjectName.Contains('.Sdk'))">true</MsBuildSdkPackage>
|
||||
</PropertyGroup>
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
|
||||
<PropertyGroup>
|
||||
<TargetName>Dummy-$(PackageName)</TargetName>
|
||||
<NoBuild>true</NoBuild>
|
||||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||
<CreateArchNeutralPackage Condition="$(MSBuildProjectName.Contains('.ArchNeutral'))">true</CreateArchNeutralPackage>
|
||||
|
||||
<!--
|
||||
Set $(IsPackable) = true, except when
|
||||
$(CreateArchNeutralPackage) == true && $(Platform) != x86
|
||||
The idea here is that for arch-neutral packages, only the x86 build phase will generate the nuget package
|
||||
The platform/RID specific packages will be generated in their respective $(Platform) specific build phases
|
||||
-->
|
||||
<IsPackable>true</IsPackable>
|
||||
<IsPackable Condition="('$(Platform)'!='AnyCPU' and '$(Platform)'!='Win32' and '$(Platform)'!='x86') and '$(CreateArchNeutralPackage)'=='true'">false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
<DefaultPackageLicenseFile>LICENSE.TXT</DefaultPackageLicenseFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!--
|
||||
We want these files to be included and copied by exactly one project per package. Sometimes, there is more than one project per
|
||||
package - and ArchNeutral project, and a RID-specific project. Including these in both projects can result in build-time
|
||||
failures, so scope it to just the ArchNeutral projects
|
||||
|
||||
The ArchNeutral projects are only Packed in x86/AnyCPU builds, but PreparePackageAssets target - which copies these assets - always
|
||||
runs in either build-platform.
|
||||
-->
|
||||
<PackagingContent Condition="Exists('$(RepoRoot)LICENSE.TXT') And $(MSBuildProjectName.Contains('.ArchNeutral'))"
|
||||
Include="$(RepoRoot)LICENSE.TXT"
|
||||
SubFolder="root" />
|
||||
<PackagingContent Condition="Exists('$(RepoRoot)THIRD-PARTY-NOTICES.TXT') And $(MSBuildProjectName.Contains('.ArchNeutral'))"
|
||||
Include="$(RepoRoot)THIRD-PARTY-NOTICES.TXT"
|
||||
SubFolder="root" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,3 @@
|
|||
<Project>
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
|
||||
</Project>
|
|
@ -0,0 +1,31 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}</ProjectGuid>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
PlatformIndependentPackage = true means that this package does
|
||||
not require the automatic generation of a runtime.json file using
|
||||
the Bait & Switch technique to reference RID specific packages
|
||||
-->
|
||||
<PlatformIndependentPackage>true</PlatformIndependentPackage>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageName>$(MSBuildProjectName.Replace('.ArchNeutral',''))</PackageName>
|
||||
<AssemblyName>$(PackageName)</AssemblyName>
|
||||
<PackageDescription>WPF Build props/targets transport package shared between dotnet/wpf and dotnet-wpf-int</PackageDescription>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\Sdk\*" SubFolder="root\Sdk" />
|
||||
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\*" SubFolder="root\tools" />
|
||||
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\AvTrace\*" SubFolder="root\tools\AvTrace" />
|
||||
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\WppConfig\*" SubFolder="root\tools\WppConfig" />
|
||||
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\WppConfig\rev1\*" SubFolder="root\tools\WppConfig\rev1" />
|
||||
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\CodeAnalysis\*" SubFolder="root\tools\CodeAnalysis" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>9a7e395b-e859-40e2-809d-efb72cf3a2ee</ProjectGuid>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageName>$(MSBuildProjectName.Replace('.ArchNeutral',''))</PackageName>
|
||||
<AssemblyName>$(PackageName)</AssemblyName>
|
||||
<PackageDescription>WPF Transport Package from dotnet/wpf repository</PackageDescription>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>c847934a-828c-4ebb-a004-b0e97c8313f4</ProjectGuid>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageName>$(MSBuildProjectName.Replace('.ArchNeutral',''))</PackageName>
|
||||
<AssemblyName>$(PackageName)</AssemblyName>
|
||||
<PackageDescription>WPF Transport Package from dotnet/wpf repository</PackageDescription>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,4 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project>
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
|
||||
</Project>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project>
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
|
||||
</Project>
|
||||
|
|
|
@ -2,21 +2,24 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
#if CUSTOM_SR_NAMESPACE
|
||||
namespace #CUSTOM_SR_NAMESPACE#
|
||||
#if WINDOWS_BASE
|
||||
namespace MS.Internal.WindowsBase
|
||||
#elif PRESENTATION_CORE
|
||||
namespace MS.Internal.PresentationCore
|
||||
#elif PBTCOMPILER
|
||||
namespace MS.Utility
|
||||
#elif AUTOMATION
|
||||
namespace MS.Internal.Automation
|
||||
#else
|
||||
namespace System
|
||||
#endif
|
||||
{
|
||||
#if CUSTOM_SR_CLASSNAME
|
||||
internal partial class #CUSTOM_SR_CLASSNAME#
|
||||
#else
|
||||
|
||||
internal partial class SR
|
||||
#endif
|
||||
{
|
||||
private static ResourceManager ResourceManager => SRID.ResourceManager;
|
||||
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<StrongNameKeyId>ECMA</StrongNameKeyId>
|
||||
</PropertyGroup>
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
|
||||
<PropertyGroup>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<GenerateResourcesCodeAsConstants>true</GenerateResourcesCodeAsConstants>
|
||||
<WpfSharedDir>$(MSBuildThisFileDirectory)Shared\</WpfSharedDir>
|
||||
<WpfCommonDir>$(MSBuildThisFileDirectory)Common\</WpfCommonDir>
|
||||
<IsShipping>true</IsShipping>
|
||||
<EnableXlfLocalization>true</EnableXlfLocalization>
|
||||
<WpfGraphicsPath>$(MSBuildThisFileDirectory)WpfGfx\</WpfGraphicsPath>
|
||||
<WpfGraphicsDir>$(WpfGraphicsPath)</WpfGraphicsDir>
|
||||
<WpfPresentationNativeDir>$(MSBuildThisFileDirectory)PresentationNative\</WpfPresentationNativeDir>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -17,6 +17,8 @@ namespace MS.Internal.PresentationFramework
|
|||
namespace MS.Internal.ReachFramework
|
||||
#elif UIAUTOMATIONTYPES
|
||||
namespace MS.Internal.UIAutomationTypes
|
||||
#elif DIRECTWRITE_FORWARDER
|
||||
namespace MS.Internal.DirectWriteForwarder
|
||||
#else
|
||||
namespace Microsoft.Internal
|
||||
#endif
|
||||
|
@ -32,6 +34,7 @@ namespace Microsoft.Internal
|
|||
internal const string DEVDIV_PUBLIC_KEY_TOKEN = "b77a5c561934e089";
|
||||
|
||||
// Constants to prevent hardcoding in InternalsVisibleTo attribute
|
||||
internal const string DirectWriteForwarder = "DirectWriteForwarder, PublicKey=" + WCP_PUBLIC_KEY_STRING;
|
||||
internal const string PresentationCore = "PresentationCore, PublicKey="+ WCP_PUBLIC_KEY_STRING;
|
||||
internal const string PresentationCFFRasterizer = "PresentationCFFRasterizer, PublicKey="+ WCP_PUBLIC_KEY_STRING;
|
||||
internal const string PresentationFramework = "PresentationFramework, PublicKey="+ WCP_PUBLIC_KEY_STRING;
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netcoreapp-Windows_NT;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -2,22 +2,15 @@
|
|||
<PropertyGroup>
|
||||
<ProjectGuid>{9AC36357-34B7-40A1-95CA-FE9F46D089A7}</ProjectGuid>
|
||||
<AssemblyName>System.Xaml</AssemblyName>
|
||||
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
|
||||
<NoWarn>$(NoWarn);0618;NU5125</NoWarn>
|
||||
<NoWarn>$(NoWarn);0618;NU5125;0618</NoWarn>
|
||||
<DefineConstants>$(DefineConstants);OLDRESOURCES;SYSTEM_XAML</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IsPackable>true</IsPackable>
|
||||
|
||||
<PackageRuntimeIdentifierPrefix Condition="'$(Platform)'!='AnyCPU'">runtime.win-$(Platform)</PackageRuntimeIdentifierPrefix>
|
||||
<PackageRuntimeIdentifierPrefix Condition="'$(Platform)'=='AnyCPU'">runtime.win-x86</PackageRuntimeIdentifierPrefix>
|
||||
|
||||
<PackageId>$(PackageRuntimeIdentifierPrefix).Microsoft.DotNet.Wpf.Private</PackageId>
|
||||
<Product>Microsoft.DotNet.Wpf</Product>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="$(WpfSharedDir)System\Windows\Markup\TypeConverterHelper.cs">
|
||||
|
@ -96,11 +89,37 @@
|
|||
|
||||
|
||||
<!-- <Compile Remove="" /> -->
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<NetCoreReference Include="netstandard" />
|
||||
<NetCoreReference Include="System" />
|
||||
<NetCoreReference Include="System.Collections" />
|
||||
<NetCoreReference Include="System.Collections.Concurrent" />
|
||||
<NetCoreReference Include="System.Collections.NonGeneric" />
|
||||
<NetCoreReference Include="System.Collections.Specialized" />
|
||||
<NetCoreReference Include="System.ComponentModel" />
|
||||
<NetCoreReference Include="System.ComponentModel.Primitives" />
|
||||
<NetCoreReference Include="System.ComponentModel.TypeConverter" />
|
||||
<NetCoreReference Include="System.Diagnostics.Debug" />
|
||||
<NetCoreReference Include="System.Diagnostics.Tools" />
|
||||
<NetCoreReference Include="System.ObjectModel" />
|
||||
<NetCoreReference Include="System.Reflection.Emit.ILGeneration" />
|
||||
<NetCoreReference Include="System.Reflection.Emit.Lightweight" />
|
||||
<NetCoreReference Include="System.Reflection.Primitives" />
|
||||
<NetCoreReference Include="System.Resources.ResourceManager" />
|
||||
<NetCoreReference Include="System.Runtime" />
|
||||
<NetCoreReference Include="System.Runtime.Extensions" />
|
||||
<NetCoreReference Include="System.Runtime.InteropServices" />
|
||||
<NetCoreReference Include="System.Runtime.Serialization.Formatters" />
|
||||
<NetCoreReference Include="System.Text.Encoding.Extensions" />
|
||||
<NetCoreReference Include="System.Threading" />
|
||||
<NetCoreReference Include="System.Threading.Thread" />
|
||||
<NetCoreReference Include="System.Threading.ThreadPool" />
|
||||
<NetCoreReference Include="System.Xml" />
|
||||
<NetCoreReference Include="System.Xml.ReaderWriter" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Security.Permissions" Version="$(SystemSecurityPermissionsPackageVersion)">
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Security.Permissions" Version="$(SystemSecurityPermissionsPackageVersion)" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<RootNamespace>TestServices</RootNamespace>
|
||||
<DefineConstants>$(DefineConstants);FRAMEWORK_NATIVEMETHODS;CORE_NATIVEMETHODS;DRT</DefineConstants>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NoWarn>$(NoWarn);CS0618</NoWarn>
|
||||
<NoWarn>$(NoWarn);CS0618;0618</NoWarn>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
<Project>
|
||||
<Import Condition="Exists('..\dir.props')" Project="..\dir.props" />
|
||||
<Import
|
||||
Condition="Exists('$(MsBuildThisFileDirecotry)Directory.Build.props')"
|
||||
Project="$(MsBuildThisFileDirecotry)Directory.Build.props" />
|
||||
</Project>
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче