I think I've discovered the actual issue.

If I had to guess, I'd say that Friedrich allocated an array of ~250
DWORDs for use in EnumProcesses. If the name of your desired process
isn't within those first 250, then it fails.

Try closing junk2.exe, then opening a bunch of apps until tasklist gets
more than 250 processes, then open junk2 and try the test app.

Jeff Slarve