Skip to content

Commit 5965532

Browse files
authored
Merge pull request #19599 from jketema/jketema/win
C++: Address comments from earlier Windows MaD PRs
2 parents 8c39f61 + ae26654 commit 5965532

File tree

6 files changed

+173
-169
lines changed

6 files changed

+173
-169
lines changed

cpp/ql/lib/ext/Boost.Asio.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# partial model of the Boost::Asio network library
1+
# partial model of the Boost::Asio network library
22
extensions:
33
- addsTo:
44
pack: codeql/cpp-all

cpp/ql/lib/ext/Windows.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# partial model of windows system calls
1+
# partial model of windows system calls
22
extensions:
33
- addsTo:
44
pack: codeql/cpp-all

cpp/ql/test/library-tests/dataflow/external-models/flow.expected

Lines changed: 138 additions & 138 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
| asio_streams.cpp:87:34:87:44 | read_until output argument | remote |
22
| test.cpp:10:10:10:18 | call to ymlSource | local |
3-
| windows.cpp:11:15:11:29 | *call to GetCommandLineA | local |
4-
| windows.cpp:23:17:23:38 | *call to GetEnvironmentStringsA | local |
5-
| windows.cpp:28:36:28:38 | GetEnvironmentVariableA output argument | local |
6-
| windows.cpp:164:35:164:40 | ReadFile output argument | local |
7-
| windows.cpp:173:23:173:28 | ReadFileEx output argument | local |
8-
| windows.cpp:185:21:185:26 | ReadFile output argument | local |
9-
| windows.cpp:188:23:188:29 | ReadFileEx output argument | local |
10-
| windows.cpp:194:21:194:26 | ReadFile output argument | local |
11-
| windows.cpp:197:23:197:29 | ReadFileEx output argument | local |
12-
| windows.cpp:205:84:205:89 | NtReadFile output argument | local |
13-
| windows.cpp:282:23:282:35 | *call to MapViewOfFile | local |
14-
| windows.cpp:289:23:289:36 | *call to MapViewOfFile2 | local |
15-
| windows.cpp:298:23:298:36 | *call to MapViewOfFile3 | local |
16-
| windows.cpp:307:23:307:43 | *call to MapViewOfFile3FromApp | local |
17-
| windows.cpp:314:23:314:37 | *call to MapViewOfFileEx | local |
18-
| windows.cpp:321:23:321:42 | *call to MapViewOfFileFromApp | local |
19-
| windows.cpp:328:23:328:40 | *call to MapViewOfFileNuma2 | local |
3+
| windows.cpp:22:15:22:29 | *call to GetCommandLineA | local |
4+
| windows.cpp:34:17:34:38 | *call to GetEnvironmentStringsA | local |
5+
| windows.cpp:39:36:39:38 | GetEnvironmentVariableA output argument | local |
6+
| windows.cpp:168:35:168:40 | ReadFile output argument | local |
7+
| windows.cpp:177:23:177:28 | ReadFileEx output argument | local |
8+
| windows.cpp:189:21:189:26 | ReadFile output argument | local |
9+
| windows.cpp:192:23:192:29 | ReadFileEx output argument | local |
10+
| windows.cpp:198:21:198:26 | ReadFile output argument | local |
11+
| windows.cpp:201:23:201:29 | ReadFileEx output argument | local |
12+
| windows.cpp:209:84:209:89 | NtReadFile output argument | local |
13+
| windows.cpp:286:23:286:35 | *call to MapViewOfFile | local |
14+
| windows.cpp:293:23:293:36 | *call to MapViewOfFile2 | local |
15+
| windows.cpp:302:23:302:36 | *call to MapViewOfFile3 | local |
16+
| windows.cpp:311:23:311:43 | *call to MapViewOfFile3FromApp | local |
17+
| windows.cpp:318:23:318:37 | *call to MapViewOfFileEx | local |
18+
| windows.cpp:325:23:325:42 | *call to MapViewOfFileFromApp | local |
19+
| windows.cpp:332:23:332:40 | *call to MapViewOfFileNuma2 | local |

cpp/ql/test/library-tests/dataflow/external-models/steps.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
| test.cpp:28:35:28:35 | 0 | test.cpp:28:11:28:33 | call to ymlStepManual_with_body |
66
| test.cpp:32:38:32:38 | 0 | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body |
77
| test.cpp:35:38:35:38 | x | test.cpp:35:11:35:36 | call to ymlStepGenerated_with_body |
8-
| windows.cpp:16:36:16:38 | *cmd | windows.cpp:16:17:16:34 | **call to CommandLineToArgvA |
8+
| windows.cpp:27:36:27:38 | *cmd | windows.cpp:27:17:27:34 | **call to CommandLineToArgvA |

cpp/ql/test/library-tests/dataflow/external-models/windows.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@ void sink(char);
22
void sink(char*);
33
void sink(char**);
44

5-
char* GetCommandLineA();
6-
char** CommandLineToArgvA(char*, int*);
7-
char* GetEnvironmentStringsA();
8-
int GetEnvironmentVariableA(const char*, char*, int);
5+
using HANDLE = void*;
6+
using DWORD = unsigned long;
7+
using LPCH = char*;
8+
using LPSTR = char*;
9+
using LPCSTR = const char*;
10+
using LPVOID = void*;
11+
using LPDWORD = unsigned long*;
12+
using PVOID = void*;
13+
using ULONG_PTR = unsigned long*;
14+
using SIZE_T = decltype(sizeof(0));
15+
16+
LPSTR GetCommandLineA();
17+
LPSTR* CommandLineToArgvA(LPSTR, int*);
18+
LPCH GetEnvironmentStringsA();
19+
DWORD GetEnvironmentVariableA(LPCSTR, LPSTR, DWORD);
920

1021
void getCommandLine() {
1122
char* cmd = GetCommandLineA();
@@ -30,13 +41,6 @@ void getEnvironment() {
3041
sink(*buf); // $ ir
3142
}
3243

33-
using HANDLE = void*;
34-
using DWORD = unsigned long;
35-
using LPVOID = void*;
36-
using LPDWORD = unsigned long*;
37-
using PVOID = void*;
38-
using ULONG_PTR = unsigned long*;
39-
using SIZE_T = decltype(sizeof(0));
4044
typedef struct _OVERLAPPED {
4145
ULONG_PTR Internal;
4246
ULONG_PTR InternalHigh;

0 commit comments

Comments
 (0)