**BREAKING CHANGES:** FIxed structures that could not load due to marshal attribute bugs

pull/187/head
dahall 2020-12-03 20:34:05 -07:00
parent a46337952b
commit 3aa3f9223d
3 changed files with 13 additions and 13 deletions

View File

@ -3270,7 +3270,7 @@ namespace Vanara.PInvoke
// TimeStamp; DWORD Reason; DWORD SourceInfo; DWORD SecurityId; DWORD FileAttributes; WORD FileNameLength; WORD FileNameOffset; WCHAR
// FileName[1]; } USN_RECORD_V2, *PUSN_RECORD_V2;
[PInvokeData("winioctl.h", MSDNShortId = "1747453d-fd18-4853-a953-47131f3067ae")]
[StructLayout(LayoutKind.Sequential, Size = 64)]
[StructLayout(LayoutKind.Sequential, Size = 64, CharSet = CharSet.Unicode)]
public struct USN_RECORD_V2
{
/// <summary>
@ -3556,8 +3556,8 @@ namespace Vanara.PInvoke
/// using the value of the <c>FileNameOffset</c> member. Doing so helps make your code compatible with any future versions of <c>USN_RECORD_V2</c>.
/// </para>
/// </summary>
[MarshalAs(UnmanagedType.LPWStr)]
public char FileName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)]
public string FileName;
}
/// <summary>
@ -3596,7 +3596,7 @@ namespace Vanara.PInvoke
// TimeStamp; DWORD Reason; DWORD SourceInfo; DWORD SecurityId; DWORD FileAttributes; WORD FileNameLength; WORD FileNameOffset; WCHAR
// FileName[1]; } USN_RECORD_V3, *PUSN_RECORD_V3;
[PInvokeData("winioctl.h", MSDNShortId = "6d95c5d1-6c6b-498f-a00d-eaa540e8b15b")]
[StructLayout(LayoutKind.Sequential, Size = 80)]
[StructLayout(LayoutKind.Sequential, Size = 80, CharSet = CharSet.Unicode)]
public struct USN_RECORD_V3
{
/// <summary>
@ -3882,8 +3882,8 @@ namespace Vanara.PInvoke
/// using the value of the <c>FileNameOffset</c> member. Doing so helps make your code compatible with any future versions of <c>USN_RECORD_V3</c>.
/// </para>
/// </summary>
[MarshalAs(UnmanagedType.LPWStr)]
public char FileName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)]
public string FileName;
}
/// <summary>

View File

@ -474,16 +474,16 @@ namespace Vanara.PInvoke
[FieldOffset(0)] public Guid clsid;
/// <summary/>
[FieldOffset(0), MarshalAs(UnmanagedType.LPWStr)] public string pFileExt;
[FieldOffset(0)] public StrPtrUni pFileExt;
/// <summary/>
[FieldOffset(0), MarshalAs(UnmanagedType.LPWStr)] public string pMimeType;
[FieldOffset(0)] public StrPtrUni pMimeType;
/// <summary/>
[FieldOffset(0), MarshalAs(UnmanagedType.LPWStr)] public string pProgId;
[FieldOffset(0)] public StrPtrUni pProgId;
/// <summary/>
[FieldOffset(0), MarshalAs(UnmanagedType.LPWStr)] public string pFileName;
[FieldOffset(0)] public StrPtrUni pFileName;
/// <summary/>
[FieldOffset(0)] public BYNAME ByName;
@ -495,7 +495,7 @@ namespace Vanara.PInvoke
public struct BYNAME
{
/// <summary/>
[MarshalAs(UnmanagedType.LPWStr)] public string pPackageName;
public StrPtrUni pPackageName;
/// <summary/>
public Guid PolicyId;

View File

@ -718,7 +718,7 @@ namespace Vanara.PInvoke
/// Array of IUnknown pointers on the objects for which this property sheet is being invoked. The number of elements in the
/// array is specified by <c>cObjects</c>. These pointers are passed to each property page through IPropertyPage::SetObjects.
/// </summary>
[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.IUnknown)] public object[] lplpUnk;
public IntPtr lplpUnk;
/// <summary>Number of property pages specified in <c>lpPages</c>.</summary>
public uint cPages;
@ -726,7 +726,7 @@ namespace Vanara.PInvoke
/// <summary>
/// Pointer to an array of size <c>cPages</c> containing the CLSIDs of each property page to display in the property sheet.
/// </summary>
[MarshalAs(UnmanagedType.LPArray)] public Guid[] lpPages;
public IntPtr lpPages;
/// <summary>Locale identifier for the property sheet. This value will be returned through IPropertyPageSite::GetLocaleID.</summary>
public LCID lcid;