This commit is contained in:
Nick Banks 2020-03-19 11:27:13 -07:00 коммит произвёл GitHub
Родитель 668cc7275e
Коммит d24a7bc3e8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 170 добавлений и 7 удалений

Просмотреть файл

@ -83,6 +83,17 @@ stages:
parameters:
arch: arm64
- stage: build_dbgext
displayName: Build WinDbg Extension
dependsOn: []
jobs:
- template: ./templates/build-config-dbgext.yml
parameters:
arch: x64
- template: ./templates/build-config-dbgext.yml
parameters:
arch: x86
- stage: build_linux
displayName: Build Linux
dependsOn: []
@ -113,6 +124,7 @@ stages:
dependsOn:
- build_windows
- build_winkernel
- build_dbgext
- build_linux
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/')))
jobs:

Просмотреть файл

@ -0,0 +1,28 @@
# This template contains steps to build quic.dll debugger extension for a single architecture.
parameters:
arch: ''
jobs:
- job: build_dbgext_${{ parameters.arch }}
displayName: Build WindDbg Debugger Extension ${{ parameters.arch }}
pool:
vmImage: windows-latest
steps:
- checkout: self
- task: VSBuild@1
continueOnError: true
inputs:
solution: msquic.dbgext.sln
platform: ${{ parameters.arch }}
configuration: debug
- task: VSBuild@1
continueOnError: true
inputs:
solution: msquic.dbgext.sln
platform: ${{ parameters.arch }}
configuration: release
- template: ./upload-artifacts.yml

31
msquic.dbgext.sln Normal file
Просмотреть файл

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29905.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dbg", "src\tools\dbg\dbg.vcxproj", "{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}.Debug|x64.ActiveCfg = Debug|x64
{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}.Debug|x64.Build.0 = Debug|x64
{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}.Debug|x86.ActiveCfg = Debug|Win32
{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}.Debug|x86.Build.0 = Debug|Win32
{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}.Release|x64.ActiveCfg = Release|x64
{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}.Release|x64.Build.0 = Release|x64
{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}.Release|x86.ActiveCfg = Release|Win32
{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D9149362-F9A0-48C2-8DD7-17D4889BE831}
EndGlobalSection
EndGlobal

87
src/tools/dbg/dbg.vcxproj Normal file
Просмотреть файл

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(WindowsSdkDir)\Debuggers\inc\engextcpp.cpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="analyze.cpp" />
<ClCompile Include="binding.cpp" />
<ClCompile Include="connection.cpp" />
<ClCompile Include="dump.cpp" />
<ClCompile Include="handle.cpp" />
<ClCompile Include="library.cpp" />
<ClCompile Include="listener.cpp" />
<ClCompile Include="packet.cpp" />
<ClCompile Include="quicdbg.cpp" />
<ClCompile Include="registration.cpp" />
<ClCompile Include="session.cpp" />
<ClCompile Include="stream.cpp" />
<ClCompile Include="worker.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="quicdbg.h" />
<ClInclude Include="quictypes.h" />
</ItemGroup>
<ItemGroup>
<None Include="quic.def" />
</ItemGroup>
<PropertyGroup Label="Globals">
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{3EE62742-8A44-4D09-AD78-5EDB2FBDCE18}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
<TargetName>quic</TargetName>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<OutDir>$(SolutionDir)artifacts\windbg\$(Platform)_$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)bld\windbg\$(Platform)_$(Configuration)\obj\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ItemDefinitionGroup>
<ClCompile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(WindowsSdkDir)Debuggers\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>dbgeng.lib;ntdll.lib;ws2_32.lib</AdditionalDependencies>
<ModuleDefinitionFile>quic.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

Просмотреть файл

@ -14,14 +14,19 @@ Abstract:
#pragma once
#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>
#include <engextcpp.hpp>
#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#define EXTCPP_EXPORTS
#include <windows.h>
#include <ws2def.h>
#include <ws2ipdef.h>
#include <ip2string.h>
#include <ws2tcpip.h>
#include <mstcpip.h>
#include <stdint.h>
#include <engextcpp.hpp>
#include <stdio.h>
extern ULONG g_ulDebug;
@ -289,7 +294,7 @@ struct IpAddress {
ReadTypeAtAddr(Addr, &Raw);
ULONG StringLen = sizeof(String);
if (Raw.si_family == AF_UNSPEC) {
sprintf(IpString, "UNSPEC:%u", RtlUshortByteSwap(Raw.Ipv4.sin_port));
sprintf(IpString, "UNSPEC:%u", ntohs(Raw.Ipv4.sin_port));
} else if (Raw.si_family == AF_INET) {
RtlIpv4AddressToStringExA(&Raw.Ipv4.sin_addr, Raw.Ipv4.sin_port, IpString, &StringLen);
} else {

Просмотреть файл

@ -975,7 +975,7 @@ struct Connection : Struct {
}
ULONG Version() {
return RtlUlongByteSwap(ReadType<ULONG>("Stats.QuicVersion"));
return ntohl(ReadType<ULONG>("Stats.QuicVersion"));
}
QUIC_HANDLE_TYPE Type() {