Skip to content

Commit

Permalink
Merge branch 'main' into winternl
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding authored Dec 8, 2021
2 parents db1556f + 9689918 commit bd1399e
Show file tree
Hide file tree
Showing 34 changed files with 1,079 additions and 0 deletions.
32 changes: 32 additions & 0 deletions TerraFX.Interop.Windows.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2742,6 +2742,34 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "winternl", "winternl", "{C6
generation\Windows\um\winternl\um-winternl.h = generation\Windows\um\winternl\um-winternl.h
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fdi", "fdi", "{37AEBE29-9D61-4D84-A0D1-F7B748103D97}"
ProjectSection(SolutionItems) = preProject
generation\Windows\um\fdi\generate.rsp = generation\Windows\um\fdi\generate.rsp
generation\Windows\um\fdi\header.txt = generation\Windows\um\fdi\header.txt
generation\Windows\um\fdi\um-fdi.h = generation\Windows\um\fdi\um-fdi.h
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fci", "fci", "{CBC62B75-03A4-470D-A52A-D84161773CB7}"
ProjectSection(SolutionItems) = preProject
generation\Windows\um\fci\generate.rsp = generation\Windows\um\fci\generate.rsp
generation\Windows\um\fci\header.txt = generation\Windows\um\fci\header.txt
generation\Windows\um\fci\um-fci.h = generation\Windows\um\fci\um-fci.h
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fdi_fci_types", "fdi_fci_types", "{5FC51DA5-FF47-4100-BE74-2F3DE11EF163}"
ProjectSection(SolutionItems) = preProject
generation\Windows\um\fdi_fci_types\generate.rsp = generation\Windows\um\fdi_fci_types\generate.rsp
generation\Windows\um\fdi_fci_types\header.txt = generation\Windows\um\fdi_fci_types\header.txt
generation\Windows\um\fdi_fci_types\um-fdi_fci_types.h = generation\Windows\um\fdi_fci_types\um-fdi_fci_types.h
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lzexpand", "lzexpand", "{CC539B27-F7D6-44F9-9CB4-6CA9486D824D}"
ProjectSection(SolutionItems) = preProject
generation\Windows\um\lzexpand\generate.rsp = generation\Windows\um\lzexpand\generate.rsp
generation\Windows\um\lzexpand\header.txt = generation\Windows\um\lzexpand\header.txt
generation\Windows\um\lzexpand\um-lzexpand.h = generation\Windows\um\lzexpand\um-lzexpand.h
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -3165,6 +3193,10 @@ Global
{F311F39C-98D2-4DB0-938A-279CCF799089} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE}
{1729358D-206C-4F08-AD5F-C6F2E63ECD88} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE}
{C6D41109-BC96-4D1B-83BA-C6A00361FB6E} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE}
{37AEBE29-9D61-4D84-A0D1-F7B748103D97} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE}
{CBC62B75-03A4-470D-A52A-D84161773CB7} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE}
{5FC51DA5-FF47-4100-BE74-2F3DE11EF163} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE}
{CC539B27-F7D6-44F9-9CB4-6CA9486D824D} = {67311E5E-FA9C-43A6-B431-9EF10047A0CE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2FE36DF8-2D9C-4F20-8787-45DC74B57461}
Expand Down
20 changes: 20 additions & 0 deletions generation/Windows/um/fci/generate.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@../../../settings.rsp
@../../../remap.rsp
--file
um-fci.h
--methodClassName
Windows
--namespace
TerraFX.Interop.Windows
--output
../../../../sources/Interop/Windows/Windows/um/fci
--test-output
../../../../tests/Interop/Windows/Windows/um/fci
--traverse
C:/Program Files (x86)/Windows Kits/10/Include/10.0.20348.0/um/fci.h
--with-librarypath
FCIAddFile=cabinet
FCICreate=cabinet
FCIDestroy=cabinet
FCIFlushCabinet=cabinet
FCIFlushFolder=cabinet
4 changes: 4 additions & 0 deletions generation/Windows/um/fci/header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

// Ported from um/fci.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.
2 changes: 2 additions & 0 deletions generation/Windows/um/fci/um-fci.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "..\..\..\TerraFX.h"
#include <fci.h>
23 changes: 23 additions & 0 deletions generation/Windows/um/fdi/generate.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@../../../settings.rsp
@../../../remap.rsp
--exclude
_A_NAME_IS_UTF
_A_EXEC
--file
um-fdi.h
--methodClassName
Windows
--namespace
TerraFX.Interop.Windows
--output
../../../../sources/Interop/Windows/Windows/um/fdi
--test-output
../../../../tests/Interop/Windows/Windows/um/fid
--traverse
C:/Program Files (x86)/Windows Kits/10/Include/10.0.20348.0/um/fdi.h
--with-librarypath
FDICopy=cabinet
FDICreate=cabinet
FDIDestroy=cabinet
FDIIsCabinet=cabinet
FDITruncateCabinet=cabinet
4 changes: 4 additions & 0 deletions generation/Windows/um/fdi/header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

// Ported from um/fdi.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.
2 changes: 2 additions & 0 deletions generation/Windows/um/fdi/um-fdi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "..\..\..\TerraFX.h"
#include <fdi.h>
14 changes: 14 additions & 0 deletions generation/Windows/um/fdi_fci_types/generate.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@../../../settings.rsp
@../../../remap.rsp
--file
um-fdi_fci_types.h
--methodClassName
Windows
--namespace
TerraFX.Interop.Windows
--output
../../../../sources/Interop/Windows/Windows/um/fdi_fci_types
--test-output
../../../../tests/Interop/Windows/Windows/um/fdi_fci_types
--traverse
C:/Program Files (x86)/Windows Kits/10/Include/10.0.20348.0/um/fdi_fci_types.h
4 changes: 4 additions & 0 deletions generation/Windows/um/fdi_fci_types/header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

// Ported from um/fdi_fci_types.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.
2 changes: 2 additions & 0 deletions generation/Windows/um/fdi_fci_types/um-fdi_fci_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "..\..\..\TerraFX.h"
#include <fdi_fci_types.h>
27 changes: 27 additions & 0 deletions generation/Windows/um/lzexpand/generate.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@../../../settings.rsp
@../../../remap.rsp
--file
um-lzexpand.h
--methodClassName
Windows
--namespace
TerraFX.Interop.Windows
--output
../../../../sources/Interop/Windows/Windows/um/lzexpand
--test-output
../../../../tests/Interop/Windows/Windows/um/lzexpand
--traverse
C:/Program Files (x86)/Windows Kits/10/Include/10.0.20348.0/um/lzexpand.h
--with-librarypath
CopyLZFile=lz32
GetExpandedNameA=lz32
GetExpandedNameW=lz32
LZClose=lz32
LZCopy=lz32
LZInit=lz32
LZOpenFileA=lz32
LZOpenFileW=lz32
LZRead=lz32
LZSeek=lz32
LZStart=lz32
LZDone=lz32
4 changes: 4 additions & 0 deletions generation/Windows/um/lzexpand/header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

// Ported from um/lzexpand.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.
2 changes: 2 additions & 0 deletions generation/Windows/um/lzexpand/um-lzexpand.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "..\..\..\TerraFX.h"
#include <lzexpand.h>
51 changes: 51 additions & 0 deletions sources/Interop/Windows/Windows/um/fci/CCAB.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

// Ported from um/fci.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.

namespace TerraFX.Interop.Windows;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB"]/*' />
public unsafe partial struct CCAB
{
/// <include file='CCAB.xml' path='doc/member[@name="CCAB.cb"]/*' />
[NativeTypeName("ULONG")]
public uint cb;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.cbFolderThresh"]/*' />
[NativeTypeName("ULONG")]
public uint cbFolderThresh;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.cbReserveCFHeader"]/*' />
public uint cbReserveCFHeader;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.cbReserveCFFolder"]/*' />
public uint cbReserveCFFolder;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.cbReserveCFData"]/*' />
public uint cbReserveCFData;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.iCab"]/*' />
public int iCab;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.iDisk"]/*' />
public int iDisk;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.fFailOnIncompressible"]/*' />
public int fFailOnIncompressible;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.setID"]/*' />
public ushort setID;

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.szDisk"]/*' />
[NativeTypeName("char [256]")]
public fixed sbyte szDisk[256];

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.szCab"]/*' />
[NativeTypeName("char [256]")]
public fixed sbyte szCab[256];

/// <include file='CCAB.xml' path='doc/member[@name="CCAB.szCabPath"]/*' />
[NativeTypeName("char [256]")]
public fixed sbyte szCabPath[256];
}
40 changes: 40 additions & 0 deletions sources/Interop/Windows/Windows/um/fci/FCIERROR.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

// Ported from um/fci.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.

namespace TerraFX.Interop.Windows;

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR"]/*' />
public enum FCIERROR
{
/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_NONE"]/*' />
FCIERR_NONE,

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_OPEN_SRC"]/*' />
FCIERR_OPEN_SRC,

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_READ_SRC"]/*' />
FCIERR_READ_SRC,

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_ALLOC_FAIL"]/*' />
FCIERR_ALLOC_FAIL,

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_TEMP_FILE"]/*' />
FCIERR_TEMP_FILE,

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_BAD_COMPR_TYPE"]/*' />
FCIERR_BAD_COMPR_TYPE,

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_CAB_FILE"]/*' />
FCIERR_CAB_FILE,

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_USER_ABORT"]/*' />
FCIERR_USER_ABORT,

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_MCI_FAIL"]/*' />
FCIERR_MCI_FAIL,

/// <include file='FCIERROR.xml' path='doc/member[@name="FCIERROR.FCIERR_CAB_FORMAT_LIMIT"]/*' />
FCIERR_CAB_FORMAT_LIMIT,
}
50 changes: 50 additions & 0 deletions sources/Interop/Windows/Windows/um/fci/Windows.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

// Ported from um/fci.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.

using System.Runtime.InteropServices;

namespace TerraFX.Interop.Windows;

public static unsafe partial class Windows
{
/// <include file='Windows.xml' path='doc/member[@name="Windows.FCICreate"]/*' />
[DllImport("cabinet", ExactSpelling = true)]
[return: NativeTypeName("HFCI")]
public static extern void* FCICreate([NativeTypeName("PERF")] ERF* perf, [NativeTypeName("PFNFCIFILEPLACED")] delegate* unmanaged<CCAB*, sbyte*, int, BOOL, void*, int> pfnfcifp, [NativeTypeName("PFNFCIALLOC")] delegate* unmanaged<uint, void*> pfna, [NativeTypeName("PFNFCIFREE")] delegate* unmanaged<void*, void> pfnf, [NativeTypeName("PFNFCIOPEN")] delegate* unmanaged<sbyte*, int, int, int*, void*, nint> pfnopen, [NativeTypeName("PFNFCIREAD")] delegate* unmanaged<nint, void*, uint, int*, void*, uint> pfnread, [NativeTypeName("PFNFCIWRITE")] delegate* unmanaged<nint, void*, uint, int*, void*, uint> pfnwrite, [NativeTypeName("PFNFCICLOSE")] delegate* unmanaged<nint, int*, void*, int> pfnclose, [NativeTypeName("PFNFCISEEK")] delegate* unmanaged<nint, int, int, int*, void*, int> pfnseek, [NativeTypeName("PFNFCIDELETE")] delegate* unmanaged<sbyte*, int*, void*, int> pfndelete, [NativeTypeName("PFNFCIGETTEMPFILE")] delegate* unmanaged<sbyte*, int, void*, BOOL> pfnfcigtf, [NativeTypeName("PCCAB")] CCAB* pccab, void* pv);

/// <include file='Windows.xml' path='doc/member[@name="Windows.FCIAddFile"]/*' />
[DllImport("cabinet", ExactSpelling = true)]
public static extern BOOL FCIAddFile([NativeTypeName("HFCI")] void* hfci, [NativeTypeName("LPSTR")] sbyte* pszSourceFile, [NativeTypeName("LPSTR")] sbyte* pszFileName, BOOL fExecute, [NativeTypeName("PFNFCIGETNEXTCABINET")] delegate* unmanaged<CCAB*, uint, void*, BOOL> pfnfcignc, [NativeTypeName("PFNFCISTATUS")] delegate* unmanaged<uint, uint, uint, void*, int> pfnfcis, [NativeTypeName("PFNFCIGETOPENINFO")] delegate* unmanaged<sbyte*, ushort*, ushort*, ushort*, int*, void*, nint> pfnfcigoi, [NativeTypeName("TCOMP")] ushort typeCompress);

/// <include file='Windows.xml' path='doc/member[@name="Windows.FCIFlushCabinet"]/*' />
[DllImport("cabinet", ExactSpelling = true)]
public static extern BOOL FCIFlushCabinet([NativeTypeName("HFCI")] void* hfci, BOOL fGetNextCab, [NativeTypeName("PFNFCIGETNEXTCABINET")] delegate* unmanaged<CCAB*, uint, void*, BOOL> pfnfcignc, [NativeTypeName("PFNFCISTATUS")] delegate* unmanaged<uint, uint, uint, void*, int> pfnfcis);

/// <include file='Windows.xml' path='doc/member[@name="Windows.FCIFlushFolder"]/*' />
[DllImport("cabinet", ExactSpelling = true)]
public static extern BOOL FCIFlushFolder([NativeTypeName("HFCI")] void* hfci, [NativeTypeName("PFNFCIGETNEXTCABINET")] delegate* unmanaged<CCAB*, uint, void*, BOOL> pfnfcignc, [NativeTypeName("PFNFCISTATUS")] delegate* unmanaged<uint, uint, uint, void*, int> pfnfcis);

/// <include file='Windows.xml' path='doc/member[@name="Windows.FCIDestroy"]/*' />
[DllImport("cabinet", ExactSpelling = true)]
public static extern BOOL FCIDestroy([NativeTypeName("HFCI")] void* hfci);

[NativeTypeName("#define INCLUDED_FCI 1")]
public const int INCLUDED_FCI = 1;

[NativeTypeName("#define _A_NAME_IS_UTF 0x80")]
public const int _A_NAME_IS_UTF = 0x80;

[NativeTypeName("#define _A_EXEC 0x40")]
public const int _A_EXEC = 0x40;

[NativeTypeName("#define statusFile 0")]
public const int statusFile = 0;

[NativeTypeName("#define statusFolder 1")]
public const int statusFolder = 1;

[NativeTypeName("#define statusCabinet 2")]
public const int statusCabinet = 2;
}
35 changes: 35 additions & 0 deletions sources/Interop/Windows/Windows/um/fdi/FDICABINETINFO.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

// Ported from um/fdi.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.

namespace TerraFX.Interop.Windows;

/// <include file='FDICABINETINFO.xml' path='doc/member[@name="FDICABINETINFO"]/*' />
public partial struct FDICABINETINFO
{
/// <include file='FDICABINETINFO.xml' path='doc/member[@name="FDICABINETINFO.cbCabinet"]/*' />
[NativeTypeName("long")]
public int cbCabinet;

/// <include file='FDICABINETINFO.xml' path='doc/member[@name="FDICABINETINFO.cFolders"]/*' />
public ushort cFolders;

/// <include file='FDICABINETINFO.xml' path='doc/member[@name="FDICABINETINFO.cFiles"]/*' />
public ushort cFiles;

/// <include file='FDICABINETINFO.xml' path='doc/member[@name="FDICABINETINFO.setID"]/*' />
public ushort setID;

/// <include file='FDICABINETINFO.xml' path='doc/member[@name="FDICABINETINFO.iCabinet"]/*' />
public ushort iCabinet;

/// <include file='FDICABINETINFO.xml' path='doc/member[@name="FDICABINETINFO.fReserve"]/*' />
public BOOL fReserve;

/// <include file='FDICABINETINFO.xml' path='doc/member[@name="FDICABINETINFO.hasprev"]/*' />
public BOOL hasprev;

/// <include file='FDICABINETINFO.xml' path='doc/member[@name="FDICABINETINFO.hasnext"]/*' />
public BOOL hasnext;
}
Loading

0 comments on commit bd1399e

Please sign in to comment.