Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 7859c07

Browse files
author
Lakshmi Priya Sekar
committed
BugFix: Test modules from CurrentProcess to avoid cross bit access on 64bit machines.
1 parent 304b884 commit 7859c07

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/System.Diagnostics.Process/tests/ProcessCollectionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class ProcessCollectionTests : ProcessTestBase
1212
[Fact]
1313
public void TestModuleCollectionBehavior()
1414
{
15-
ProcessModule[] mArray = _process.Modules.Cast<ProcessModule>().ToArray();
15+
ProcessModule[] mArray = Process.GetCurrentProcess().Modules.Cast<ProcessModule>().ToArray();
1616

1717
// Constructor
1818
ProcessModuleCollection moduleCollection = new ProcessModuleCollection(mArray);

src/System.Diagnostics.Process/tests/ProcessTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ public void TestMinWorkingSet()
275275
[Fact]
276276
public void TestModules()
277277
{
278-
foreach (ProcessModule pModule in _process.Modules)
278+
ProcessModuleCollection moduleCollection = Process.GetCurrentProcess().Modules;
279+
foreach (ProcessModule pModule in moduleCollection)
279280
{
280281
// Validated that we can get a value for each of the following.
281282
Assert.NotNull(pModule);

0 commit comments

Comments
 (0)