summaryrefslogtreecommitdiff
path: root/chromium/sandbox/win/src/interception_unittest.cc
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2023-02-22 13:25:25 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2023-02-23 14:08:24 +0000
commited9d108fc6eaeedc401c05813e4e2e29ccdeacc2 (patch)
treeb0d266427018368d470091fbefbaa76b9bbf24d6 /chromium/sandbox/win/src/interception_unittest.cc
parent588986e4d3589bc8ae950de5fca94bd60066c3da (diff)
downloadqtwebengine-chromium-ed9d108fc6eaeedc401c05813e4e2e29ccdeacc2.tar.gz
[Backport][Windows] Remove unused sidestep intercepts.
This CL removes the unused sidestep intercepts and associated code. The code was never ported to 64-bit and isn't used in 32-bit builds. Task-number: QTBUG-108240 Bug: 1270309 Review-URL: https://chromium-review.googlesource.com/c/chromium/src/+/3324867 Cr-Commit-Position: refs/heads/main@{#950447} Change-Id: Ib0e97a593b2218a6d93a99e16a55ff34f8607a61 Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/462007 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/sandbox/win/src/interception_unittest.cc')
-rw-r--r--chromium/sandbox/win/src/interception_unittest.cc29
1 files changed, 9 insertions, 20 deletions
diff --git a/chromium/sandbox/win/src/interception_unittest.cc b/chromium/sandbox/win/src/interception_unittest.cc
index f898a2dda2b..1cbde5c5d10 100644
--- a/chromium/sandbox/win/src/interception_unittest.cc
+++ b/chromium/sandbox/win/src/interception_unittest.cc
@@ -146,9 +146,6 @@ TEST(InterceptionManagerTest, BufferLayout1) {
OPEN_KEY_ID);
interceptions.AddToPatchedFunctions(L"kernel32.dll", "CreateFileEx",
INTERCEPTION_EAT, function, OPEN_KEY_ID);
- interceptions.AddToPatchedFunctions(L"kernel32.dll", "SomeFileEx",
- INTERCEPTION_SMART_SIDESTEP, function,
- OPEN_KEY_ID);
interceptions.AddToPatchedFunctions(L"user32.dll", "FindWindow",
INTERCEPTION_EAT, function, OPEN_KEY_ID);
interceptions.AddToPatchedFunctions(L"kernel32.dll", "CreateMutex",
@@ -163,16 +160,11 @@ TEST(InterceptionManagerTest, BufferLayout1) {
interceptions.AddToPatchedFunctions(L"ntdll.dll", "NtClose",
INTERCEPTION_SERVICE_CALL, function,
OPEN_KEY_ID);
- interceptions.AddToPatchedFunctions(L"ntdll.dll", "NtOpenFile",
- INTERCEPTION_SIDESTEP, function,
- OPEN_KEY_ID);
interceptions.AddToPatchedFunctions(L"some.dll", "Superfn", INTERCEPTION_EAT,
function, OPEN_KEY_ID);
interceptions.AddToPatchedFunctions(L"comctl.dll", "SaveAsDlg",
INTERCEPTION_EAT, "a", OPEN_KEY_ID);
interceptions.AddToPatchedFunctions(L"comctl.dll", "SaveAsDlg",
- INTERCEPTION_SIDESTEP, "ab", OPEN_KEY_ID);
- interceptions.AddToPatchedFunctions(L"comctl.dll", "SaveAsDlg",
INTERCEPTION_EAT, "abc", OPEN_KEY_ID);
interceptions.AddToPatchedFunctions(L"a.dll", "p", INTERCEPTION_EAT, function,
OPEN_KEY_ID);
@@ -185,7 +177,7 @@ TEST(InterceptionManagerTest, BufferLayout1) {
function, OPEN_KEY_ID);
// Verify that all interceptions were added
- ASSERT_EQ(18u, interceptions.interceptions_.size());
+ ASSERT_EQ(15u, interceptions.interceptions_.size());
size_t buffer_size = interceptions.GetBufferSize();
std::unique_ptr<BYTE[]> local_buffer(new BYTE[buffer_size]);
@@ -198,20 +190,20 @@ TEST(InterceptionManagerTest, BufferLayout1) {
// another group with the interceptions belonging to dlls that will be "hot"
// patched on the client. The second group lives on local_buffer, and the
// first group remains on the list of interceptions (inside the object
- // "interceptions"). There are 3 local interceptions (of ntdll); the
- // other 15 have to be sent to the child to be performed "hot".
- EXPECT_EQ(3u, interceptions.interceptions_.size());
+ // "interceptions"). There are 2 local interceptions (of ntdll); the
+ // other 13 have to be sent to the child to be performed "hot".
+ EXPECT_EQ(2u, interceptions.interceptions_.size());
int num_dlls, num_functions, num_names;
WalkBuffer(local_buffer.get(), buffer_size, &num_dlls, &num_functions,
&num_names);
- // The 15 interceptions on the buffer (to the child) should be grouped on 6
+ // The 13 interceptions on the buffer (to the child) should be grouped on 6
// dlls. Only four interceptions are using an explicit name for the
// interceptor function.
EXPECT_EQ(6, num_dlls);
- EXPECT_EQ(15, num_functions);
- EXPECT_EQ(4, num_names);
+ EXPECT_EQ(13, num_functions);
+ EXPECT_EQ(3, num_names);
}
TEST(InterceptionManagerTest, BufferLayout2) {
@@ -233,11 +225,8 @@ TEST(InterceptionManagerTest, BufferLayout2) {
interceptions.AddToPatchedFunctions(L"kernel32.dll", "CreateFileEx",
INTERCEPTION_EAT, function, OPEN_FILE_ID);
interceptions.AddToUnloadModules(L"some02.dll");
- interceptions.AddToPatchedFunctions(L"kernel32.dll", "SomeFileEx",
- INTERCEPTION_SMART_SIDESTEP, function,
- OPEN_FILE_ID);
// Verify that all interceptions were added
- ASSERT_EQ(5u, interceptions.interceptions_.size());
+ ASSERT_EQ(4u, interceptions.interceptions_.size());
size_t buffer_size = interceptions.GetBufferSize();
std::unique_ptr<BYTE[]> local_buffer(new BYTE[buffer_size]);
@@ -256,7 +245,7 @@ TEST(InterceptionManagerTest, BufferLayout2) {
&num_names);
EXPECT_EQ(3, num_dlls);
- EXPECT_EQ(4, num_functions);
+ EXPECT_EQ(3, num_functions);
EXPECT_EQ(0, num_names);
}