This commit is contained in:
2022-09-06 00:08:26 +08:00
parent e17ffc3965
commit 91d57c13f0
232 changed files with 191628 additions and 250 deletions

View File

@@ -0,0 +1,72 @@
---
name: Bug Report
about: Report a bug in Detours
title: "<header>: Problem"
labels: 'bug'
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is. Please check that you've
read the guidelines for submitting a bug report in the
[Bug Reports](https://github.com/microsoft/Detours/wiki/FAQ#bug-reports) section
of the FAQ.
**Command-line test case**
```
C:\Temp>type repro.cpp
#include <iostream>
#include <windows.h>
#include <detours.h>
void main() {
// Replace this program with one demonstrating your actual bug report,
// along with the following compilation command. Please leave compiler
// version banners in the output (don't use /nologo), and include output
// of your test program, if any.
std::cout << "Test Case Result: ";
if (DetourIsHelperProcess()) {
std::cout << "Fail\n";
} else {
std::cout << "Pass\n";
}
}
C:\Temp>cl.exe /EHsc /W4 /WX .\repro.cpp -I. ..\lib.X64\detours.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29111 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
repro.cpp
Microsoft (R) Incremental Linker Version 14.27.29111.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:repro.exe
repro.obj
..\lib.X64\detours.lib
C:\Temp>.\repro.exe
Test Case Result: Pass
```
**Expected behavior**
A clear and concise description of what you expected to happen.
Alternatively, include `static_assert` or `assert` lines in your
test case above whose failure clearly indicates the problem.
**Detours version**
* Option 1: Release version
* Displayed on the releases page: https://github.com/microsoft/Detours/releases/
* Example:
```
Version 4.0.1 of Detours
```
* Option 2: git commit hash
* Example:
```
https://github.com/microsoft/Detours/commit/2195148
```
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,17 @@
---
name: Question
about: Ask a question about Detours
title: ""
labels: question
assignees: ''
---
Instructions
============
Please check the Wiki, especially the [FAQ](https://github.com/microsoft/Detours/wiki/FAQ), to make sure your
question has not been answered there already.
If you can't find the answer to your question there, please ask your question in the [Detours GitHub Discussions](https://github.com/microsoft/Detours/discussions)
instead of filing an issue as a question, to avoid filling up the issue tracker with questions.

View File

@@ -0,0 +1,13 @@
<!--
Before submitting a pull request, please ensure that:
* These changes introduce no known API breaks (changing the public facing
functions return types, function parameters, renaming functions, etc.).
* The changes are tested.
* Your changes are written from scratch using only this repository.
If your changes are derived from any other project, you *must* mention it
here, so we can determine whether the license is compatible and what else
needs to be done.
-->

View File

@@ -0,0 +1,6 @@
---
name: "Detours CodeQL Config"
queries:
- uses: security-and-quality
- uses: security-extended

10
test/Detours/.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions Automatically
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "Dependencies:"

69
test/Detours/.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: CI-Build
env:
# Turn on msvc analysis during build, enable once warnings are clean.
DETOURS_ANALYZE: true
# Compile in parallel where possible.
CL: /MP
# Triggers the workflow on push or pull request events for the master branch.
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2016]
arch: [x86, x64, x64_arm, x64_arm64]
conf: [Release, Debug]
steps:
- name: Clone Repository
uses: actions/checkout@v2
# Setup build environment variables using vcvarsall.bat.
- name: Configure MSCV Compiler for ${{ matrix.arch }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Initialize CodeQL for C++
uses: github/codeql-action/init@v1
if: ${{ matrix.os == 'windows-2019' && matrix.conf == 'Debug' }}
with:
languages: cpp
config-file: ./.github/codeql/codeql-config.yml
- name: Build Detours for ${{ matrix.arch }} on ${{ matrix.os }}
env:
# Tell detours what process to target
DETOURS_TARGET_PROCESSOR: ${{ env.VSCMD_ARG_TGT_ARCH }}
DETOURS_CONFIG: ${{ matrix.conf }}
run: nmake
- name: Run unit tests for ${{ matrix.arch }} on ${{ matrix.os }}
id: run-unit-tests
env:
DETOURS_CONFIG: ${{ matrix.conf }}
run: cd tests && nmake test
if: ${{ matrix.arch == 'x86' || matrix.arch == 'x64' }}
- name: Upload artifacts for ${{ matrix.arch }} on ${{ matrix.os }}
uses: actions/upload-artifact@v2
with:
name: artifacts-${{ matrix.os }}
path: |
lib.*/
bin.*/
include/
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
if: ${{ matrix.os == 'windows-2019' && matrix.conf == 'Debug' }}