Index: chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc |
diff --git a/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc |
index e8af00d636b6f55df6de56d140af28b20ff66721..f0560d30cf50739fcfe49534aa6dad42d29ab285 100644 |
--- a/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc |
+++ b/chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win_unittest.cc |
@@ -179,10 +179,10 @@ TEST(SafeBrowsingEnvironmentDataCollectionWinTest, VerifyLoadedModules) { |
base::FilePath(safe_browsing::kTestDllNames[i]), NULL)); |
} |
- // Edit the first byte of the function exported by the first module. |
- HMODULE module_handle = NULL; |
- EXPECT_TRUE( |
- GetModuleHandleEx(0, safe_browsing::kTestDllNames[0], &module_handle)); |
+ // Edit the first byte of the function exported by the first module. Calling |
+ // GetModuleHandle so we do not increment the library ref count. |
+ HMODULE module_handle = GetModuleHandle(safe_browsing::kTestDllNames[0]); |
+ EXPECT_NE(reinterpret_cast<HANDLE>(NULL), module_handle); |
uint8_t* export_addr = reinterpret_cast<uint8_t*>( |
GetProcAddress(module_handle, safe_browsing::kTestExportName)); |
EXPECT_NE(reinterpret_cast<uint8_t*>(NULL), export_addr); |