D:/msys64/mingw64/x86_64-w64-mingw32/include/setupapi.h:1879:119: error: 'DEVPROPKEY' does not name a type
WINSETUPAPI WINBOOL WINAPI SetupDiGetDevicePropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, DWORD PropertyBufferSize, PDWORD RequiredSize, DWORD Flags);
^~~~~~~~~~
D:/msys64/mingw64/x86_64-w64-mingw32/include/setupapi.h:1879:144: error: 'DEVPROPTYPE' has not been declared
WINSETUPAPI WINBOOL WINAPI SetupDiGetDevicePropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, DWORD PropertyBufferSize, PDWORD RequiredSize, DWORD Flags);
^~~~~~~~~~~
D:/msys64/mingw64/x86_64-w64-mingw32/include/setupapi.h:1880:116: error: 'DEVPROPKEY' has not been declared
WINSETUPAPI WINBOOL WINAPI SetupDiGetDevicePropertyKeys(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DEVPROPKEY *PropertyKeyArray, DWORD PropertyKeyCount, PDWORD RequiredPropertyKeyCount, DWORD Flags);
^~~~~~~~~~
Also here, workaround proposed by NowMachine here resolves issue. However it should be fixed in MinGW-w64.
https://sourceforge.net/p/mingw-w64/mailman/message/35303161/