Hi,
i get a "Wrong Parameter" from Marshal.GetLast Win32Error() on using this:
[StructLayout(La youtKind.Sequen tial)]
public class SP_DEVINFO_DATA
{
public int cbSize;
public Guid classGuid;
public int devInst;
public ulong reserved;
};
[StructLayout(La youtKind.Sequen tial,CharSet=Ch arSet.Unicode)]
internal class SP_DRVINFO_DATA
{
public System.UInt32 cbSize;
public System.UInt32 DriverType;
public System.IntPtr Reserved;
[MarshalAs(Unman agedType.ByValT Str, SizeConst = 256)]
public System.String Description;
[MarshalAs(Unman agedType.ByValT Str, SizeConst = 256)]
public System.String MfgName;
[MarshalAs(Unman agedType.ByValT Str, SizeConst = 256)]
public System.String ProviderName;
public System.Runtime. InteropServices .ComTypes.FILET IME
DriverDate;
public System.UInt64 DriverVersion;
}
[DllImport("setu papi.dll", CharSet = CharSet.Unicode , SetLastError =
true)]
private static extern bool SetupDiGetSelec tedDriver
(
System.IntPtr DeviceInfoSet,
[In]ref SP_DEVINFO_DATA DeviceInfoData,
[Out]out SP_DRVINFO_DATA DriverInfoData
);
The "DeviceInfo Set" and "DeviceInfoData " of the Call are valid,
but something goes wrong while marshalling data between the
managed and unmanaged border. Something must be wrong
with my declarations,.. ...but what? I am certain, that it is some
stuff on the "SP_DRVINFO_DAT A",...any ideas?
TIA,...
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Latest Project: http://www.codeplex.com/restarts
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."