M
Michael
Hi all,
I believe I'm not PInvoking this struct correctly.
Here's the API definition.
typedef struct _SP_DRVINFO_DATA {
DWORD cbSize;
DWORD DriverType;
ULONG_PTR Reserved;
TCHAR Description[LINE_LEN];
TCHAR MfgName[LINE_LEN];
TCHAR ProviderName[LINE_LEN];
FILETIME DriverDate;
DWORDLONG DriverVersion;
} SP_DRVINFOR_DATA, *PSP_DRVINFO_DATA;
Here's my latest implementation attempt:
[StructLayout(LayoutKind.Sequential)]
public struct SP_DRVINFO_DATA
{
public System.UInt32 cbSize;
public System.UInt32 DriverType;
public System.UIntPtr Reserved;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public System.String Description;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public System.String MfgName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public System.String ProviderName;
public System.Runtime.InteropServices.ComTypes.FILETIME DriverDate;
public System.UInt64 DriverVersion;
}
Thanks, all
-MH
I believe I'm not PInvoking this struct correctly.
Here's the API definition.
typedef struct _SP_DRVINFO_DATA {
DWORD cbSize;
DWORD DriverType;
ULONG_PTR Reserved;
TCHAR Description[LINE_LEN];
TCHAR MfgName[LINE_LEN];
TCHAR ProviderName[LINE_LEN];
FILETIME DriverDate;
DWORDLONG DriverVersion;
} SP_DRVINFOR_DATA, *PSP_DRVINFO_DATA;
Here's my latest implementation attempt:
[StructLayout(LayoutKind.Sequential)]
public struct SP_DRVINFO_DATA
{
public System.UInt32 cbSize;
public System.UInt32 DriverType;
public System.UIntPtr Reserved;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public System.String Description;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public System.String MfgName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public System.String ProviderName;
public System.Runtime.InteropServices.ComTypes.FILETIME DriverDate;
public System.UInt64 DriverVersion;
}
Thanks, all
-MH