0
Reply

[help]some problems about SetupDiGetClassDevs()

Administrator

Administrator

Mar 10 2003 4:11 AM
2.9k
code like this: ... [StructLayout(LayoutKind.Sequential)] public struct GUID { public ulong Data1; public ushort Data2; public ushort Data3; public byte[] Data4; } ... [DllImport("kernel32.dll")] public static exten ing SetupDiGetClassDevs ( ... Q1: how to define GUID.Data4 with 4 elements? Q2: using sizeof(GUID) must in unsafe code, but can not using it for manage struct GUID. is there a way to deal with it? or using what management function can get the same effect as sizeof(GUID)? Q3: I have build the codes into .exe, but when excute, there're a System.EntryPointNotFoundException "Unable to find an entrypoint named SetupDiGetClassDevs in DLL kernel32.dll". but other API like SetupDiEnumDeviceInfo() works well, why? thx.