IoTCore 中的 SetupAPI?

SetupAPI in IoTCore?

我可以在 windows10 IoTCore 中使用 SetupApi 函数吗?

我只写了一行: HDEVINFO Handle = SetupDiGetClassDevs(NULL,NULL,NULL,DIGCF_ALLCLASSES);
但是 句柄 = 0xfff...
GetlastError = 127 表示 "The specified procedure could not be found."

我无法重现你的问题,但你的代码对我有用。我在 Raspberry Pi 3 上测试 Windows 10 IoT Core 版本 17763.1.

我在 Windows 物联网核心控制台应用程序和调试中使用的代码遵循 this tutorial:

#include <windows.h>
#include <setupapi.h>


int main(int argc, char **argv)
{
    HDEVINFO Handle = SetupDiGetClassDevs(NULL, NULL, NULL, DIGCF_ALLCLASSES);
    DWORD errCode = GetLastError();
}

你可以试试看是否有效

我上传我的项目here