Search code examples
winapi32-bittoolchainmingw-w64

Mingw w64 32bit toolchain libwintrust


Hi I am using mingw w64 for compiling my windows service. Everything was good until I wanted to compile for 32bit version. I am missing libwintrust file.

Does anyone know more about this? There is libwintrust in 64bit toolchain but not in 32 :(


Solution

  • Ok, at the end it was not so hard. I guess that direct linking wont work because gcc doesn't know the entry point for WinVerifyTrust@12 and in wintrust.dll name is without @12 (as I understand @12 is stack size for input data). Also Windows SDK have different compiler so it probably have different linker.

    Solution is pretty simple. You can generate library for almost any dll with dlltool in bin folder of mingw w64(32bit and 64bit). All you need is def file. In def file you have to use it with suffix because mingw is asking for it. Also you have to use option (-k) because in wintrust.dll it is without @12 so dll tool will know what to look for.

    Now everything works :)