Question

I'm referring to this page. I tried the code on a 64bit Win7 (and it worked fine) but was wondering what are the requirement for this method of getting the data? Will it work on both 64 and 32 bit systems? Will it work on Windows XP? Vista? 8?

Était-ce utile?

La solution

The code can be compiled to either a 32-bit or a 64-bit executable.

The 32-bit executable can run on either a 32-bit or a 64-bit system. A 64-bit executable can (of course) only run on a 64-bit system.

If you use a 32-bit executable on a 64-bit system, it will only "see" other 32-bit processes, not any 64-bit processes. If you use a 64-bit executable on a 64-bit system, it will see both 32-bit and 64-bit processes.

I haven't tried to go through that exact code in detail to be sure about every function it uses, but ToolHelp32 has been around since (at least) NT 4, so at least the majority of it should be fine on XP, and is definitely fine on newer systems. If you really need to target older systems (NT 3.5/3.51) you can use PSAPI instead, but I can hardly imagine that being a requirement anymore.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top