-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Support long module path #57335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support long module path #57335
Conversation
we test the code path that rents a bigger array from ArrayPool
|
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process Issue DetailsIt's #33505 that I would like to include in 6.0, please ignore the PR until all
|
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Stephen Toub <[email protected]>
…e tmp modules before throwing exception
…ner prints available module paths
20db50d to
93414f6
Compare
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Stephen Toub <[email protected]>
|
Hello @adamsitnik! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
| while ((length = Interop.Kernel32.GetModuleBaseName(processHandle, moduleHandle, chars, chars.Length)) == chars.Length) | ||
| { | ||
| char[] toReturn = chars; | ||
| chars = ArrayPool<char>.Shared.Rent(length * 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it better to rent a new array first before returning the old one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order of renting and returning doesn't matter. But what does matter is the array being returned isn't referenced by the variable used for returning in the finally block. If it is, and the Return call throws after having stored the array, it could double return.
It's #33505 that I would like to include in 6.0, please ignore the PR until all
System.Diagnostics.Processtests are green.