Skip to content

Commit

Permalink
Merge pull request #290 from tannergooding/main
Browse files Browse the repository at this point in the history
Fixing all DllImports to be resolvable
  • Loading branch information
tannergooding authored Dec 19, 2021
2 parents 3ea8623 + 8e09a3d commit 1398700
Show file tree
Hide file tree
Showing 14 changed files with 214 additions and 77 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
windows-x64:
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}-2022
strategy:
matrix:
architecture: [ x64 ]
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
./artifacts/tst/**/*
if-no-files-found: error
build-nuget-preview:
runs-on: windows-latest
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- run: ./scripts/cibuild.cmd -configuration release -architecture x64
Expand All @@ -86,7 +86,7 @@ jobs:
./artifacts/tst/**/*
if-no-files-found: error
build-nuget-release:
runs-on: windows-latest
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- run: ./scripts/cibuild.cmd -configuration release -architecture x64
Expand Down
6 changes: 3 additions & 3 deletions generation/Windows/other/diacreate/generate.rsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@../../../settings.rsp
@../../../remap.rsp
--exclude
NoRegCoCreate
NoOleCoCreate
--include-directory
C:/Program Files/Microsoft Visual Studio/2022/Preview/DIA SDK/include
--file
Expand All @@ -14,6 +17,3 @@ TerraFX.Interop.Windows
../../../../tests/Interop/Windows/Windows/other/diacreate
--traverse
C:/Program Files/Microsoft Visual Studio/2022/Preview/DIA SDK/include/diacreate.h
--with-librarypath
NoRegCoCreate=msdia140
NoOleCoCreate=msdia140
19 changes: 10 additions & 9 deletions generation/Windows/um/DbgHelp/generate.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
@../../../remap.rsp
--define-macro
_IMAGEHLP_SOURCE_
--exclude
GetCheckUserInterruptShared
SymGetLineFromAddrW
SymGetLineNextW
SymGetLinePrevW
SymGetSymNextW
SymGetSymNextW64
SymGetSymPrevW
SymGetSymPrevW64
--file
um-DbgHelp.h
--methodClassName
Expand Down Expand Up @@ -34,7 +43,6 @@ FindExecutableImageEx=DbgHelp
FindExecutableImageExW=DbgHelp
FindFileInPath=DbgHelp
FindFileInSearchPath=DbgHelp
GetCheckUserInterruptShared=DbgHelp
GetSymLoadError=DbgHelp
GetTimestampForLoadedLibrary=DbgHelp
ImageDirectoryEntryToData=DbgHelp
Expand Down Expand Up @@ -123,7 +131,6 @@ SymGetHomeDirectoryW=DbgHelp
SymGetLineFromAddr64=DbgHelp
SymGetLineFromAddr=DbgHelp
SymGetLineFromAddrW64=DbgHelp
SymGetLineFromAddrW=DbgHelp
SymGetLineFromInlineContext=DbgHelp
SymGetLineFromInlineContextW=DbgHelp
SymGetLineFromName64=DbgHelp
Expand All @@ -132,11 +139,9 @@ SymGetLineFromNameW64=DbgHelp
SymGetLineNext64=DbgHelp
SymGetLineNext=DbgHelp
SymGetLineNextW64=DbgHelp
SymGetLineNextW=DbgHelp
SymGetLinePrev64=DbgHelp
SymGetLinePrev=DbgHelp
SymGetLinePrevW64=DbgHelp
SymGetLinePrevW=DbgHelp
SymGetModuleBase64=DbgHelp
SymGetModuleBase=DbgHelp
SymGetModuleInfo64=DbgHelp
Expand Down Expand Up @@ -167,12 +172,8 @@ SymGetSymFromName64=DbgHelp
SymGetSymFromName=DbgHelp
SymGetSymNext64=DbgHelp
SymGetSymNext=DbgHelp
SymGetSymNextW64=DbgHelp
SymGetSymNextW=DbgHelp
SymGetSymPrev64=DbgHelp
SymGetSymPrev=DbgHelp
SymGetSymPrevW64=DbgHelp
SymGetSymPrevW=DbgHelp
SymGetTypeFromName=DbgHelp
SymGetTypeFromNameW=DbgHelp
SymGetTypeInfo=DbgHelp
Expand Down Expand Up @@ -422,4 +423,4 @@ UnmapDebugInformation
SymAddSourceStream=SupportedOSPlatform("windows10.0.19043.0")
SymAddSourceStreamA=SupportedOSPlatform("windows10.0.19043.0")
SymMatchString=SupportedOSPlatform("windows10.0.19043.0")
SymMatchStringA=SupportedOSPlatform("windows10.0.19043.0")
SymMatchStringA=SupportedOSPlatform("windows10.0.19043.0")
14 changes: 14 additions & 0 deletions generation/Windows/um/fci/generate.rsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
@../../../settings.rsp
@../../../remap.rsp
--exclude
FNFCIALLOC
FNFCICLOSE
FNFCIDELETE
FNFCIFILEPLACED
FNFCIFREE
FNFCIGETNEXTCABINET
FNFCIGETOPENINFO
FNFCIGETTEMPFILE
FNFCIOPEN
FNFCIREAD
FNFCISEEK
FNFCISTATUS
FNFCIWRITE
--file
um-fci.h
--methodClassName
Expand Down
11 changes: 10 additions & 1 deletion generation/Windows/um/fdi/generate.rsp
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
@../../../settings.rsp
@../../../remap.rsp
--exclude
_A_NAME_IS_UTF
FNALLOC
FNCLOSE
FNFDIDECRYPT
FNFDINOTIFY
FNFREE
FNOPEN
FNREAD
FNSEEK
FNWRITE
_A_EXEC
_A_NAME_IS_UTF
--file
um-fdi.h
--methodClassName
Expand Down
7 changes: 7 additions & 0 deletions generation/Windows/um/fdi_fci_types/generate.rsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@../../../settings.rsp
@../../../remap.rsp
--exclude
CompressionLevelFromTCOMP
CompressionMemoryFromTCOMP
CompressionTypeFromTCOMP
LZXCompressionWindowFromTCOMP
TCOMPfromLZXWindow
TCOMPfromTypeLevelMemory
--file
um-fdi_fci_types.h
--methodClassName
Expand Down
2 changes: 1 addition & 1 deletion generation/Windows/um/oleauto/generate.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ VarI4FromI8
VarI4FromUI8
VarI8FromI8
VarUI4FromUI4
VarUI8FromI4
VarUI8FromUI8
V_ARRAY
V_ARRAYREF
Expand Down Expand Up @@ -448,7 +449,6 @@ VarUI8FromDec=oleaut32
VarUI8FromDisp=oleaut32
VarUI8FromI1=oleaut32
VarUI8FromI2=oleaut32
VarUI8FromI4=oleaut32
VarUI8FromI8=oleaut32
VarUI8FromR4=oleaut32
VarUI8FromR8=oleaut32
Expand Down
9 changes: 9 additions & 0 deletions generation/Windows/um/winternl/generate.rsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
@../../../settings.rsp
@../../../remap.rsp
--exclude
InitializeObjectAttributes
NT_ERROR
NT_INFORMATION
NT_SUCCESS
NT_WARNING
RtlFillMemory
RtlMoveMemory
RtlZeroMemory
--file
um-winternl.h
--methodClassName
Expand Down
20 changes: 0 additions & 20 deletions sources/Interop/Windows/Windows/other/diacreate/Windows.cs

This file was deleted.

33 changes: 0 additions & 33 deletions sources/Interop/Windows/Windows/um/DbgHelp/Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,6 @@ public static void KdHelp32To64([NativeTypeName("PKDHELP")] KDHELP* p32, [Native
[SetsLastSystemError]
public static extern BOOL SymGetLineFromAddr(HANDLE hProcess, [NativeTypeName("DWORD")] uint dwAddr, [NativeTypeName("PDWORD")] uint* pdwDisplacement, [NativeTypeName("PIMAGEHLP_LINE")] IMAGEHLP_LINE* Line);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetLineFromAddrW"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
public static extern BOOL SymGetLineFromAddrW(HANDLE hProcess, [NativeTypeName("DWORD")] uint dwAddr, [NativeTypeName("PDWORD")] uint* pdwDisplacement, [NativeTypeName("PIMAGEHLP_LINEW")] IMAGEHLP_LINEW* Line);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetLineFromName64"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
[SetsLastSystemError]
Expand Down Expand Up @@ -473,10 +469,6 @@ public static void KdHelp32To64([NativeTypeName("PKDHELP")] KDHELP* p32, [Native
[SetsLastSystemError]
public static extern BOOL SymGetLineNext(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_LINE")] IMAGEHLP_LINE* Line);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetLineNextW"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
public static extern BOOL SymGetLineNextW(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_LINEW")] IMAGEHLP_LINEW* Line);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetLinePrev64"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
[SetsLastSystemError]
Expand All @@ -492,10 +484,6 @@ public static void KdHelp32To64([NativeTypeName("PKDHELP")] KDHELP* p32, [Native
[SetsLastSystemError]
public static extern BOOL SymGetLinePrev(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_LINE")] IMAGEHLP_LINE* Line);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetLinePrevW"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
public static extern BOOL SymGetLinePrevW(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_LINEW")] IMAGEHLP_LINEW* Line);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetFileLineOffsets64"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
[SetsLastSystemError]
Expand Down Expand Up @@ -1056,46 +1044,25 @@ public static void KdHelp32To64([NativeTypeName("PKDHELP")] KDHELP* p32, [Native
[SetsLastSystemError]
public static extern BOOL SymGetSymNext64(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_SYMBOL64")] IMAGEHLP_SYMBOL64* Symbol);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetSymNextW64"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
public static extern BOOL SymGetSymNextW64(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_SYMBOLW64")] IMAGEHLP_SYMBOLW64* Symbol);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetSymNext"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
[SetsLastSystemError]
public static extern BOOL SymGetSymNext(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_SYMBOL")] IMAGEHLP_SYMBOL* Symbol);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetSymNextW"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
public static extern BOOL SymGetSymNextW(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_SYMBOLW")] IMAGEHLP_SYMBOLW* Symbol);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetSymPrev64"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
[SetsLastSystemError]
public static extern BOOL SymGetSymPrev64(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_SYMBOL64")] IMAGEHLP_SYMBOL64* Symbol);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetSymPrevW64"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
public static extern BOOL SymGetSymPrevW64(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_SYMBOLW64")] IMAGEHLP_SYMBOLW64* Symbol);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetSymPrev"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
[SetsLastSystemError]
public static extern BOOL SymGetSymPrev(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_SYMBOL")] IMAGEHLP_SYMBOL* Symbol);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SymGetSymPrevW"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
public static extern BOOL SymGetSymPrevW(HANDLE hProcess, [NativeTypeName("PIMAGEHLP_SYMBOLW")] IMAGEHLP_SYMBOLW* Symbol);

/// <include file='Windows.xml' path='doc/member[@name="Windows.SetCheckUserInterruptShared"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
public static extern void SetCheckUserInterruptShared([NativeTypeName("LPCALL_BACK_USER_INTERRUPT_ROUTINE")] delegate* unmanaged<uint> lpStartAddress);

/// <include file='Windows.xml' path='doc/member[@name="Windows.GetCheckUserInterruptShared"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
[return: NativeTypeName("LPCALL_BACK_USER_INTERRUPT_ROUTINE")]
public static extern delegate* unmanaged<uint> GetCheckUserInterruptShared();

/// <include file='Windows.xml' path='doc/member[@name="Windows.GetSymLoadError"]/*' />
[DllImport("DbgHelp", ExactSpelling = true)]
[return: NativeTypeName("DWORD")]
Expand Down
4 changes: 2 additions & 2 deletions sources/Interop/Windows/Windows/um/UIAnimation/UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

namespace TerraFX.Interop.Windows;

public static unsafe partial class UI
public static partial class UI
{
[NativeTypeName("#define UI_ANIMATION_SECONDS_EVENTUALLY ( -1 )")]
public const int UI_ANIMATION_SECONDS_EVENTUALLY = (-1);

[NativeTypeName("#define UI_ANIMATION_KEYFRAME_STORYBOARD_START ( ( UI_ANIMATION_KEYFRAME )-1 )")]
public static UI_ANIMATION_KEYFRAME UI_ANIMATION_KEYFRAME_STORYBOARD_START => (UI_ANIMATION_KEYFRAME)unchecked((int*)(-1));
public static UI_ANIMATION_KEYFRAME UI_ANIMATION_KEYFRAME_STORYBOARD_START => unchecked((UI_ANIMATION_KEYFRAME)(-1));

[NativeTypeName("#define UI_ANIMATION_REPEAT_INDEFINITELY ( -1 )")]
public const int UI_ANIMATION_REPEAT_INDEFINITELY = (-1);
Expand Down
4 changes: 0 additions & 4 deletions sources/Interop/Windows/Windows/um/oleauto/Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,10 +1006,6 @@ public static unsafe partial class Windows
[DllImport("oleaut32", ExactSpelling = true)]
public static extern HRESULT VarUI8FromI2(short sIn, [NativeTypeName("ULONG64 *")] ulong* pi64Out);

/// <include file='Windows.xml' path='doc/member[@name="Windows.VarUI8FromI4"]/*' />
[DllImport("oleaut32", ExactSpelling = true)]
public static extern HRESULT VarUI8FromI4([NativeTypeName("LONG")] int lIn, [NativeTypeName("ULONG64 *")] ulong* pi64Out);

/// <include file='Windows.xml' path='doc/member[@name="Windows.VarUI8FromI8"]/*' />
[DllImport("oleaut32", ExactSpelling = true)]
public static extern HRESULT VarUI8FromI8([NativeTypeName("LONG64")] long ui64In, [NativeTypeName("ULONG64 *")] ulong* pi64Out);
Expand Down
2 changes: 1 addition & 1 deletion sources/Interop/Windows/Windows/um/winternl/Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,5 @@ public static unsafe partial class Windows
public const uint LOGONID_CURRENT = unchecked((uint)(-1));

[NativeTypeName("#define SERVERNAME_CURRENT ((HANDLE)NULL)")]
public static void* SERVERNAME_CURRENT => unchecked((void*)(0));
public static void* SERVERNAME_CURRENT => unchecked((HANDLE)(0));
}
Loading

0 comments on commit 1398700

Please sign in to comment.