Which .lib has IID___x_ABI_CWindows_CSystem_CProfile_CSystemManufacturers_CISmbiosInformationStatics?


Keywords:c 


Question: 

The windows headers for winrt, specifically winrt\windows.system.profile.systemmanufacturers.h contain among other things, a reference to:

EXTERN_C const IID IID___x_ABI_CWindows_CSystem_CProfile_CSystemManufacturers_CISmbiosInformationStatics;

However as far as I can find, that IID isn't defined in any known linker library. Does anyone happen to know where it is defined?

I'm trying to use this from C to call the winrt apis and getting an unresolved symbol.


1 Answer: 

If you look at the MSDN documentation for SmbiosInformation Class you'll see it's part of the "Windows Desktop Extension SDK" which means it's not defined by default in a project.

You need to add a reference to the Windows Desktop Extension SDK to your application. For a Visual C++ project using C++/CX, you'd add it by using Add a Reference... to Universal Windows -> Extensions -> Windows Desktop Extensions for the UWP (pick the version that matches the Target OS version you are using for your project). See MSDN

NOTE: If you were using C++/WinRT language projections instead of C++/CX, it's all inline in the header winrt/Windows.System.Profile.SystemManufacturers.h including the known GUID values as constexpr values so you don't need to link with anything special.

Note that if your application supports anything besides just the Desktop device family, you should guard you use of that class for runtime failure or by checking for support of the Windows.System.Profile.SystemManufacturers.SystemManufacturersContract.

Most applications that attempt to use this API will get E_ACCESSDENIED. Only special applications listed by the system manufacturer in the system configuration are allowed to use this particular class. See this post for what this is all about.