Refactoring P/Invoke.
Correct implementation of Windows processes.