Improve ProcessManager.Win (#32010)
* ---- Style changes start here ----
* Remove unnecessary using directives
* Remove unnecessary assignments
* Use IntPtr.Zero
* Replace magic numbers
* Remove unused parameters
* Replace constructor with initializer
* Simplify delegate interop
* Inline temporary variables
* Remove unnecessary checked keyword
* Remove unnecessary cast
* Introduce using statement
* ---- Style changes end here ----
* Remove magic sleep
* Prealloc list
* Reduce copying
* Use ArrayPool
* Support long path
* Improve P/Invoke signatures
* Optimize modules enumeration
* Rename and move HandleLastWin32Error
* while (true)
* Move comments near codes
* Revert "Support long path"
This reverts commit
1f06435144925668e7273ec458e78b869aad6055.
* Revert "Introduce using statement"
This reverts commit
e3d383a229c13b096dbdef9aa9c857ee6cf986e1.
* Revert "Remove magic sleep"
This reverts commit
d8bc0017131a9d9d6c1f66569a87699f9f7faea6.
* Add braces
* Simplify initialization
* Fix last Win32 error
* Avoid reallocation if modules count decreased
* Nits
* Simplify codes