K32EnumProcesses and Windows Vista

Assuming that Blender developers still want to support Vista…

…the test build raises an error about K32EnumProcess being unavailable while the nightly does not.

I found this erudite discussion about the issue and how to solve it. From that discussion one finds that the fix boils down to #define-ing PSAPI_VERSION 1 and linking psapi.lib.

I investigated this strange behaviour of the fix appearing/disappearing in different builds so I downloaded 2.74 sources and investigated. The sources do not contain the #define. Inside the CMakeList.txt. psapi.lib is linked (lines 1173 and 1546) but the -DPSAPI_VERSION=1 is never stated.

The result is therefore that:

  • if you want to support Vista, the define is missing (sources or CMakeLists.txt);
  • if you don’t want to support Vista, the link library in CMakeLists.txt is redundant.

I leave the final decision to the powers to be.

To me this seems like something you should report as a bug on developer.blender.org.

You are right, we set PSAPI_VERSION=1 by setting _WIN32_WINNT version to 0x501. This works when building with scons but fails for the cmake build for some reason I am investigating.

Also in the future please share these things on the tracker as that is the proper place for it. Most devs build with cmake and releases are build with scons, these differences can and do sneak up on us and that this is a good example.