You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Windows Server 2022 |[2.4.6](https://github.com/github/codeql-cli-binaries/releases/tag/v2.4.6) or [2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.0.13 (If using codeql 2.15.4)| 0.9.0 (If using codeql 2.15.4) | WHCP_21H2|
17
-
| Windows 11 |[2.4.6](https://github.com/github/codeql-cli-binaries/releases/tag/v2.4.6) or [2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.0.13 (If using codeql 2.15.4)| 0.9.0 (If using codeql 2.15.4)|WHCP_21H2|
18
-
| Windows 11, version 22H2 |[2.6.3](https://github.com/github/codeql-cli-binaries/releases/tag/v2.6.3) or [2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.0.13 (If using codeql 2.15.4)| 0.9.0 (If using codeql 2.15.4)|WHCP_22H2|
19
-
| Windows 11, version 23H2 |[2.6.3](https://github.com/github/codeql-cli-binaries/releases/tag/v2.6.3) or [2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.0.13 (If using codeql 2.15.4)| 0.9.0 (If using codeql 2.15.4)|WHCP_22H2|
20
-
| Windows 11, version 24H2 |[2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.1.0 | 0.9.0 | WHCP_24H2 |
14
+
| Release | CodeQL CLI version | microsoft/windows-drivers qlpack version| microsoft/cpp-queries version | codeql/cpp-queries version | Associated Repo Branch|
| Windows Server 2022 |[2.4.6](https://github.com/github/codeql-cli-binaries/releases/tag/v2.4.6) or [2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.0.13 (If using codeql 2.15.4)| N/A |0.9.0 (If using codeql 2.15.4) | WHCP_21H2 |
17
+
| Windows 11, version 22H2 |[2.6.3](https://github.com/github/codeql-cli-binaries/releases/tag/v2.6.3) or [2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.0.13 (If using codeql 2.15.4)| N/A |0.9.0 (If using codeql 2.15.4) | WHCP_22H2 |
18
+
| Windows 11, version 23H2 |[2.6.3](https://github.com/github/codeql-cli-binaries/releases/tag/v2.6.3) or [2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.0.13 (If using codeql 2.15.4)| N/A |0.9.0 (If using codeql 2.15.4) | WHCP_22H2 |
19
+
| Windows 11 |[2.4.6](https://github.com/github/codeql-cli-binaries/releases/tag/v2.4.6) or [2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.0.13 (If using codeql 2.15.4)| N/A |0.9.0 (If using codeql 2.15.4) | WHCP_21H2 |
20
+
| Windows 11, version 24H2 |[2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4)| 1.1.0 | N/A |0.9.0 | WHCP_24H2 |
21
+
| Windows Server 2025 |[2.20.1](https://github.com/github/codeql-cli-binaries/releases/tag/v2.20.1)| 1.5.0 | 0.0.2 | N/A | WHCP_TODO |
22
+
| Windows 11, version <todo> |[2.20.1](https://github.com/github/codeql-cli-binaries/releases/tag/v2.20.1)| 1.5.0 | 0.0.2 | N/A | WHCP_TODO |
21
23
22
24
25
+
### For Testing the Latest in Development
23
26
24
27
28
+
| CodeQL CLI version | microsoft/windows-drivers qlpack version | microsoft/cpp-queries version | codeql/cpp-queries version |Associated Repo Branch|
|[Latest](https://github.com/github/codeql-cli-binaries/releases/latest)|[Latest](https://github.com/microsoft/Windows-Driver-Developer-Supplemental-Tools/pkgs/container/windows-drivers)|[Latest](https://github.com/orgs/microsoft/packages/container/package/cpp-queries)| N/A | Development |
31
+
25
32
## Quickstart
26
33
27
34
1. Create a directory where you can place the CodeQL CLI and the queries you want to use:
28
35
```
29
36
D:\> mkdir codeql-home
30
37
```
31
38
32
-
1. Download the CodeQL CLI zip by selecting the asset associated with your OS and architecture (codeql-win64.zip, codeql-linux64.zip, etc.), then extract it to the directory you created in the previous step.
33
-
39
+
1. Download the CodeQL CLI
40
+
34
41
**NOTE** Visual Studio 17.8 broke compatibility with the older versions of CodeQL used in the WHCP_21H2 and WHCP_22H2 branches. [CodeQL CLI version 2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4) has been validated for use with WHCP 21H2 and WHCP 22H2 when using Visual Studio 17.8 or greater.
35
-
36
-
For the WHCP Program, use the CodeQL CLI version in accordance with the table above and Windows release you are certifying for: [version 2.4.6](https://github.com/github/codeql-cli-binaries/releases/tag/v2.4.6), [version 2.6.3](https://github.com/github/codeql-cli-binaries/releases/tag/v2.6.3), or [version 2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4).
37
-
38
-
39
-
40
-
For general use, use [CodeQL CLI version 2.15.4](https://github.com/github/codeql-cli-binaries/releases/tag/v2.15.4) and the latest version of the microsoft/windows-driver qlpack.
41
-
42
-
42
+
43
+
For the WHCP Program, use the CodeQL CLI version in accordance with the table above and Windows release you are certifying for
44
+
1. Navigate to the [CodeQL CLI Release Page](https://github.com/github/codeql-cli-binaries/releases)
45
+
1. Find the release version based on the tables above and select the asset associated with your OS and architecture (codeql-win64.zip, codeql-linux64.zip, etc.),
46
+
1. Extract the downloaded zip to the directory you created in the previous step.
47
+
1. (Optional) Add the CodeQL install location to your PATH
43
48
44
49
1. Verify CodeQL is installed correctly by checking the version:
45
50
```
@@ -54,20 +59,7 @@ This repository contains open-source components for supplemental use in developi
54
59
55
60
1. Install CodeQL Packages
56
61
57
-
For WHCP_21H2 and WHCP_22H2 branches:
58
-
59
-
1. If using Visual Studio 2022 17.8 or greater with WHCP_21H2 or WHCP_22H2 and CodeQL CLI version 2.15.4:
60
-
61
-
Follow the steps for "ALL OTHER BRANCHES." **Make sure to remove the CodeQL submodule if you still have an old version of the repo cloned.** CodeQL might try to use the queries in the submodule by default which will cause errors because of mismatched versions.
62
-
63
-
1. If using Visual Studio version 17.7 or below **AND** either WHCP_21H2 or WHCP_22H2 **AND** CodeQL VLI version 2.4.6 or 2.6.3:
64
-
65
-
Follow special instructions for WHCP_21H2 and WHCP_22H2 using VS17.7 at the end of this readme
66
-
67
62
68
-
**For ALL OTHER BRANCHES:**
69
-
70
-
**Note:** It is no longer necessary to clone the Windows-Driver-Developer-Supplemental-Tools repo to use the queries for certification.
71
63
72
64
Download the correct version of the CodeQL packs from the Windows Hardware Compatibility Program Release Version Matrix:
73
65
```
@@ -86,7 +78,7 @@ This repository contains open-source components for supplemental use in developi
@@ -101,44 +93,36 @@ This repository contains open-source components for supplemental use in developi
101
93
102
94
1. Analyze your CodeQL database:
103
95
104
-
CodeQL's analysis output is provided in the form of a SARIF log file. For a human readable format, drop the SARIF file into [SARIF Viewer Website](https://microsoft.github.io/sarif-web-component/). (If there are violations, they will show up. If not, the page will not update.)
96
+
CodeQL's analysis output is provided in the form of a SARIF log file. For a human readable format, drop the SARIF file into [SARIF Viewer Website](https://microsoft.github.io/sarif-web-component/) (If there are violations, they will show up. If not, the page will not update) or view using an extension in Visual Studio or Visual Studio Code.
105
97
106
-
CodeQL query suites are provided in the suites directory and contain the sets of all recommended and mustfix queries. The desired query suite file should be downloaded/copied locally.
107
-
108
-
1. Create a local copy of the desired query suite file:
109
-
110
-
* windows_driver_mustfix.qls
111
-
* windows_driver_recommended.qls
98
+
CodeQL query suites are provided in the windows-driver-suites directory and contain the sets of all recommended and mustfix queries. Both the recommended and mustfix queries must be run. Once the microsoft/windows-drivers pack is downloaded, these suites can be referenced relative to the pack name, as seen below.
112
99
113
-
2. To analyze a CodeQL database run the following command:
100
+
1. To analyze a CodeQL database run the following command:
114
101
```
115
-
codeql database analyze --download <path to database> <path to query suite .qls file> --format=sarifv2.1.0 --output=<outputname>.sarif
102
+
codeql database analyze <path to database> <path to query suite .qls file> --format=sarifv2.1.0 --output=<outputname>.sarif
116
103
```
117
-
**NOTE** The "--download" flag tells CodeQL to download dependencies before running the queries.
Specific versions, queries, or suites can be specified using the format `codeql database analyze <database> <scope>/<pack>@x.x.x:<path>`. For futher information, see the [CodeQL documentation](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/publishing-and-using-codeql-packs#using-a-codeql-pack-to-analyze-a-codeql-database).
107
+
**NOTE** The "--download" flag can be used to tell CodeQL to download dependencies before running the queries.
108
+
109
+
**NOTE** Specific versions, queries, or suites can be specified using the format `codeql database analyze <database> <scope>/<pack>@x.x.x:<path>`. For futher information, see the [CodeQL documentation](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/publishing-and-using-codeql-packs#using-a-codeql-pack-to-analyze-a-codeql-database).
_(Parameters: path to new database, query pack, format, output sarif file)_
125
-
126
112
127
113
1. ***For WHCP Users Only***: Prepare to Create a Driver Verification Log (DVL):
128
114
129
-
Before you can create a DVL, you must copy your SARIF log file to the parent directory of your driver project. You can also modify your output location in the `codeql database analyze` step in order to skip this additional step. Once you have finished this step, please refer to the continued instructions at [CodeQL and the Static Tools Logo Test, Driver Verification Log DVL Consumption of SARIF Output](https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql#driver-verification-log-dvl-consumption-of-sarif-output).
130
-
```
131
-
D:\codeql-home\codeql>copy <path to SARIF output file> <path to driver directory>
Tocreate a DVL, your SARIF log file must be in the parent directory of your driver project. You can modify your output location in the `codeql database analyze` step or copy the file manyally
116
+
117
+
Please refer to the continued instructions at [CodeQL and the Static Tools Logo Test, Driver Verification Log DVL Consumption of SARIF Output](https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql#driver-verification-log-dvl-consumption-of-sarif-output).
134
118
135
119
## Navigation
136
120
137
121
Windows drivers queries are in the `src/drivers` directory.
138
122
139
123
Non-driver Microsoft-specific queries provided by Microsoft are in the `src/microsoft` directory.
140
124
141
-
Query suites are located in the `suites` directory and contain the Must-Fix and Recommended-Fix suites used by the WHCP Program.
125
+
Query suites are located in the `windows-driver-suites` directory and contain the Must-Fix and Recommended-Fix suites used by the WHCP Program.
142
126
143
127
144
128
@@ -177,7 +161,21 @@ Use of Microsoft trademarks or logos in modified versions of this project must n
177
161
Any use of third-party trademarks or logos are subject to those third-party's policies.
178
162
179
163
180
-
## Special instructions for WHCP_21H2 and WHCP_22H2 using VS17.7 or below
164
+
## Appendix
165
+
166
+
### Special instructions for for WHCP_21H2 and WHCP_22H2 branches:
167
+
168
+
1. If using Visual Studio 2022 17.8 or greater with WHCP_21H2 or WHCP_22H2 and CodeQL CLI version 2.15.4:
169
+
170
+
Follow regular steps, above. **Make sure to remove the CodeQL submodule if you still have an old version of the repo cloned.** CodeQL might try to use the queries in the submodule by default which will cause errors because of mismatched versions.
171
+
172
+
1. If using Visual Studio version 17.7 or below **AND** either WHCP_21H2 or WHCP_22H2 **AND** CodeQL VLI version 2.4.6 or 2.6.3:
173
+
174
+
Follow special instructions for WHCP_21H2 and WHCP_22H2 using VS17.7 at the end of this readme
175
+
176
+
### Special instructions for WHCP_21H2 and WHCP_22H2 using VS17.7 or below
177
+
178
+
181
179
These instructions only apply when using both Visual Studio 17.7 or below along with CodeQL 2.6.3 or 2.4.6
0 commit comments