Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add failing test to track type load exception #573

Merged
merged 2 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/GenerationSandbox.Tests/BasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -474,4 +474,22 @@ public void ZeroOrMinusOneIsInvalidSafeHandle()
h = new(new IntPtr(-1), ownsHandle: false);
Assert.True(h.IsInvalid);
}

/// <summary>
/// Verifies that structs with explicit field placement where managed and unmanaged values overlap do not cause a TypeLoadException.
/// </summary>
/// <remarks>
/// This demonstrates the problem tracked by <see href="https://github.com/microsoft/CsWin32/issues/292">this bug</see>.
/// </remarks>
[Fact(Skip = "Failure tracked by #292")]
public void LoadProblematicTypes()
{
Windows.Win32.System.Com.VARDESC d = new()
{
Anonymous =
{
oInst = 3,
},
};
}
}
5 changes: 3 additions & 2 deletions test/GenerationSandbox.Tests/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ IPersistFile
KEY_EVENT_RECORD
LoadLibrary
MainAVIHeader
MAX_PATH
NTSTATUS
PathParseIconLocation
RegLoadAppKey
RM_PROCESS_INFO
ShellLink
VARDESC
WER_REPORT_INFORMATION
wglGetProcAddress
WPARAM
WriteFile
PathParseIconLocation
MAX_PATH
8 changes: 4 additions & 4 deletions test/SpellChecker/NativeMethods.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CoCreateInstance
CLSCTX
CoCreateInstance
CoTaskMemFree
SpellCheckerFactory
ISpellCheckerFactory
ISpellChecker
CLSCTX
ISpellCheckerFactory
S_FALSE
S_OK
SpellCheckerFactory
50 changes: 25 additions & 25 deletions test/WinRTInteropTest/NativeMethods.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
CreateDispatcherQueueController
HWND
ICompositorDesktopInterop
BeginPaint
BS_PUSHBUTTON
CreateDispatcherQueueController
CreateWindowExW
WNDCLASSEXW
RegisterClassExW
CW_USEDEFAULT
DefWindowProc
DestroyWindow
DispatchMessage
EndPaint
GetMessage
GetModuleHandle
LoadCursor
LoadIcon
HDC
HINSTANCE
HMENU
HWND
ICompositorDesktopInterop
IDC_ARROW
IDI_APPLICATION
InvalidateRect
LoadCursor
LoadIcon
MSG
PAINTSTRUCT
PostMessage
PostQuitMessage
RegisterClassExW
ShowWindow
UpdateWindow
GetMessage
TranslateMessage
DispatchMessage
MSG
WM_CREATE
HMENU
HINSTANCE
UpdateWindow
WM_CLOSE
WM_COMMAND
WM_CREATE
WM_DESTROY
PostQuitMessage
WM_PAINT
HDC
BeginPaint
EndPaint
WM_CLOSE
DestroyWindow
PAINTSTRUCT
InvalidateRect
PostMessage
CW_USEDEFAULT
BS_PUSHBUTTON
WNDCLASSEXW