Merge branch 'master' into codes

This commit is contained in:
dqtsth 2021-11-25 22:31:34 +11:00 коммит произвёл GitHub
Родитель cf0e4d963c 6665ab10d7
Коммит 085bdb4575
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
27 изменённых файлов: 509 добавлений и 25 удалений

Просмотреть файл

@ -19,7 +19,7 @@ if (!$SkipInstallTools.IsPresent)
{
. .\scripts\CommonUtils.ps1
Install-BuildTools
Install-BuildTools -Clean:$Clean.IsPresent
}
if ($Clean.IsPresent)

Просмотреть файл

@ -38,7 +38,6 @@ LPENCLAVE_ROUTINE
<IncludeRoot>/um/d3dcaps.h
<IncludeRoot>/um/d3dtypes.h
<IncludeRoot>/shared/wtypes.h
<IncludeRoot>/um/rpcnsip.h
<IncludeRoot>/um/minwinbase.h
<IncludeRoot>/um/storprop.h
<IncludeRoot>/um/atlthunk.h

Просмотреть файл

@ -0,0 +1,15 @@
#define SECURITY_WIN32 // For sspi.h
#define QCC_OS_GROUP_WINDOWS
#include "intrinfix.h"
#include "windows.fixed.h"
#include <sdkddkver.h>
//#include <ntdef.h>
// Would need to use ntdef.h, but we need windows.h
typedef LONG NTSTATUS;
typedef UCHAR KIRQL;
#include <webapplication.h>

Просмотреть файл

@ -0,0 +1,4 @@
--traverse
<IncludeRoot>/winrt/webapplication.h
--namespace
Windows.Win32.System.Diagnostics.Debug.WebApp

Просмотреть файл

@ -16,7 +16,6 @@ typedef UCHAR KIRQL;
#include <minidumpapiset.h>
#include <activdbg.h>
#include <activprof.h>
#include <webapplication.h>
#include <ImageHlp.h>
#include <bugcodes.h>
#include <activaut.h>

Просмотреть файл

@ -9,7 +9,6 @@
<IncludeRoot>/um/activdbg.h
<IncludeRoot>/um/dbgprop.h
<IncludeRoot>/um/activprof.h
<IncludeRoot>/winrt/webapplication.h
<IncludeRoot>/shared/bugcodes.h
<IncludeRoot>/um/activaut.h
<IncludeRoot>/um/activdbg100.h

Просмотреть файл

@ -10,5 +10,4 @@
#include <d3d12sdklayers.h>
#include <d3d12shader.h>
#include <d3d12compatibility.h>
#include <d3d9on12.h>
#include <mfd3d12.h>

Просмотреть файл

@ -0,0 +1,11 @@
#define SECURITY_WIN32 // For sspi.h
#define QCC_OS_GROUP_WINDOWS
#include "intrinfix.h"
#include "windows.fixed.h"
#include <sdkddkver.h>
#define D3D11_NO_HELPERS
#include <d3d9on12.h>

Просмотреть файл

@ -0,0 +1,4 @@
--traverse
<IncludeRoot>/um/d3d9on12.h
--namespace
Windows.Win32.Graphics.Direct3D9on12

Просмотреть файл

@ -21,5 +21,5 @@
#include <rpcssl.h>
//#include <rpcproxy.h> Leaving out on purpose. Requires C-only interfaces and we don't think we need proxy metadata
#include <ndr64types.h>
#include <rpcnsip.h>

Просмотреть файл

@ -11,5 +11,6 @@ NDR_SCONTEXT
<IncludeRoot>/shared/rpcndr.h
<IncludeRoot>/um/ndr64types.h
<IncludeRoot>/um/rpcproxy.h
<IncludeRoot>/um/rpcnsip.h
--namespace
Windows.Win32.System.Rpc

Просмотреть файл

@ -47,7 +47,7 @@
<ShowEmitWinmdOutputDetails>true</ShowEmitWinmdOutputDetails>
<!-- To regenerate this list; remove the property and the build will indicate what names can safely go here as a build optimization -->
<ExcludeFromCrossarch>ActiveDirectory;AllJoyn;Antimalware;ApplicationVerifier;AppxPackaging;Audio.Apo;Audio.DirectMusic;Audio.DirectSound;Audio.Endpoints;Authorization;Authorization.UI;Base;Bits;Bluetooth;Buses;CEIP;Certificates;Cloudapi;CmpApi;Com;Com.CallObj;Com.ChannelCreds;Com.Events;Com.StructuredStorage;Com.Urlmon;Communication;ComOle;CompositionSwapchain;Console;Controls.RichEdit;Cos;Credentials;DataXchg;DebuggerExtensions;Dedup;DeviceAccess;DeviceQuery;Devices.Properties;DevLic;Direct2D;Direct2D.Common;Direct3D;Direct3D10;Direct3D11;Direct3D11on12;Direct3D12;Direct3DDxc;Direct3DFxc;DirectComp;DirectDraw;DirectManipulation;DirectML;DirectWrite;DTC;Dwm;DXCore;Dxgi;Dxgi.Common;Eap;EapHost;Edp;Enstor;Environment;Etw;Fax;FileHistory;Foundation;Fs;Fsrm;FunctionDiscovery;GameMode;GamingDvcInfo;Gdi;Gpmc;Hid;HostComputeNetwork;HostComputeSystem;HtmlHelp;HttpServer;Hypervisor;Identity;IdentityProvider;Ifsk;Iis;ImagingDevice;IMapi;IndexSrv;Input_Ink;Input_IntContext;Input.Ime;InputRadial;InternetConnectionWizard;InternetExplorer;Intl;IO;Isolation;JobObjects;Kernel;KeyboardAndMouseInput;Ldap;LibraryLoader;Lwef;MachineLearning;MadCap;MagApi;Mapi;Mbn;MdmReg;Media;Media.DShow;Media.DShow.Xml;Media.DxMediaObjects;Memory;MessageQueuing;Mi;MixedReality;MixedRealityInterop;Mmc;Monitor;MsChap;MsCs;MsTv;MsXml;Multimedia;Ndf;Ndis;NetMgmt;NetShell;NetworkAccessProtection;Nla;Nps;NWifi;Of;Opc;OpenGL;P2p;Parcon;PicAcq;Pipes;Pla;Policy;Power;PrintTicket;Proc_Snap;ProjFs;Properties;PsApi;PWM;Qos;Rdc;Rdp;RealTimeCommunications;Registry;RemoteAssist;Rm;Rpc;RRas;RstMgr;SecBitomet;Security;Security.AppLocker;Security.ConfigurationSnapin;Security.Cryptography;Security.Cryptography.Catalog;Security.Cryptography.Sip;Security.Cryptography.UI;Security.DiagnosticDataQuery;Security.DirectoryServices;Security.LicenseProtection;Security.Tpm;Security.WinTrust;Security.WinWlx;SecurityCenter;Sens;SerPorts;Services;Setup;Shell.Common;Shutdown;SideShow;Smi;Snmp;Speech;Sr;SwDevice;SystemInformation;Tablet;Tapi3;TaskSchd;Tbs;Tcui;TermServ;Threading;Time;ToolHelp;TransactionServer;Tsf;Ual;UiAnimation;UpdateAssessment;Upnp;Vhd;VirtualDiskService;VSS;Wab;Wcm;Wcn;Wcs;Wds;WebDav;WebServicesOnDevices;WebSock;Wec;Wer;Wes;Wia;Wibe;Wic;Win32_Tile_Badge_Notif;WinAuto;WinContacts;WindowsConnectionManager;WindowsFilteringPlatform;WindowsFirewall;WindowsRibbon;WindowsSetupAndMigration;WinInet;WinLocation;WinRm;WinRT;WinRT.AllJoyn;WinRT.Composition;WinRT.CoreInputView;WinRT.Direct2D;WinRT.Direct3D11;WinRT.Display;WinRT.Graphics.Capture;WinRT.Graphics.Imaging;WinRT.Holographic;WinRT.Isolation;WinRT.Media;WinRT.ML;WinRT.Pdf;WinRT.Printing;WinRT.Storage;WinRT.Xaml;WinSat;WinSensors;WinSync;WinTouch;Wmdm;WmFormat;Wmi;Wmlss;Wmp;Wnet;wnv;WpdSdk;Wsb;Wsl;Wsw;Wua;Xaml_Diagnostics;Xaudio2;Xblidp;Xinput;XmlLite;Xps;XpsPrinting</ExcludeFromCrossarch>
<ExcludeFromCrossarch>ActiveDirectory;AllJoyn;Antimalware;ApplicationVerifier;AppxPackaging;Audio.Apo;Audio.DirectMusic;Audio.DirectSound;Audio.Endpoints;Authorization;Authorization.UI;Base;Bits;Bluetooth;Buses;CEIP;Certificates;Cloudapi;CmpApi;Com;Com.CallObj;Com.ChannelCreds;Com.Events;Com.StructuredStorage;Com.Urlmon;Communication;ComOle;CompositionSwapchain;Console;Controls.RichEdit;Cos;Credentials;DataXchg;DebuggerExtensions;Debug.WebApp;Dedup;DeviceAccess;DeviceQuery;Devices.Properties;DevLic;Direct2D;Direct2D.Common;Direct3D;Direct3D10;Direct3D11;Direct3D9on12;Direct3D11on12;Direct3D12;Direct3DDxc;Direct3DFxc;DirectComp;DirectDraw;DirectManipulation;DirectML;DirectWrite;DTC;Dwm;DXCore;Dxgi;Dxgi.Common;Eap;EapHost;Edp;Enstor;Environment;Etw;Fax;FileHistory;Foundation;Fs;Fsrm;FunctionDiscovery;GameMode;GamingDvcInfo;Gdi;Gpmc;Hid;HostComputeNetwork;HostComputeSystem;HtmlHelp;HttpServer;Hypervisor;Identity;IdentityProvider;Ifsk;Iis;ImagingDevice;IMapi;IndexSrv;Input_Ink;Input_IntContext;Input.Ime;InputRadial;InternetConnectionWizard;InternetExplorer;Intl;IO;Isolation;JobObjects;Kernel;KeyboardAndMouseInput;Ldap;LibraryLoader;Lwef;MachineLearning;MadCap;MagApi;Mapi;Mbn;MdmReg;Media;Media.DShow;Media.DShow.Xml;Media.DxMediaObjects;Memory;MessageQueuing;Mi;MixedReality;MixedRealityInterop;Mmc;Monitor;MsChap;MsCs;MsTv;MsXml;Multimedia;Ndf;Ndis;NetMgmt;NetShell;NetworkAccessProtection;Nla;Nps;NWifi;Of;Opc;OpenGL;P2p;Parcon;PicAcq;Pipes;Pla;Policy;Power;PrintTicket;Proc_Snap;ProjFs;Properties;PsApi;PWM;Qos;Rdc;Rdp;RealTimeCommunications;Registry;RemoteAssist;Rm;Rpc;RRas;RstMgr;SecBitomet;Security;Security.AppLocker;Security.ConfigurationSnapin;Security.Cryptography;Security.Cryptography.Catalog;Security.Cryptography.Sip;Security.Cryptography.UI;Security.DiagnosticDataQuery;Security.DirectoryServices;Security.LicenseProtection;Security.Tpm;Security.WinTrust;Security.WinWlx;SecurityCenter;Sens;SerPorts;Services;Setup;Shell.Common;Shutdown;SideShow;Smi;Snmp;Speech;Sr;SwDevice;SystemInformation;Tablet;Tapi3;TaskSchd;Tbs;Tcui;TermServ;Threading;Time;ToolHelp;TransactionServer;Tsf;Ual;UiAnimation;UpdateAssessment;Upnp;Vhd;VirtualDiskService;VSS;Wab;Wcm;Wcn;Wcs;Wds;WebDav;WebServicesOnDevices;WebSock;Wec;Wer;Wes;Wia;Wibe;Wic;Win32_Tile_Badge_Notif;WinAuto;WinContacts;WindowsConnectionManager;WindowsFilteringPlatform;WindowsFirewall;WindowsRibbon;WindowsSetupAndMigration;WinInet;WinLocation;WinRm;WinRT;WinRT.AllJoyn;WinRT.Composition;WinRT.CoreInputView;WinRT.Direct2D;WinRT.Direct3D11;WinRT.Display;WinRT.Graphics.Capture;WinRT.Graphics.Imaging;WinRT.Holographic;WinRT.Isolation;WinRT.Media;WinRT.ML;WinRT.Pdf;WinRT.Printing;WinRT.Storage;WinRT.Xaml;WinSat;WinSensors;WinSync;WinTouch;Wmdm;WmFormat;Wmi;Wmlss;Wmp;Wnet;wnv;WpdSdk;Wsb;Wsl;Wsw;Wua;Xaml_Diagnostics;Xaudio2;Xblidp;Xinput;XmlLite;Xps;XpsPrinting</ExcludeFromCrossarch>
<!-- Set to false because the WinSDK assets are already in this project -->
<UseWinSDKAssets>false</UseWinSDKAssets>

Просмотреть файл

@ -1050,6 +1050,16 @@
"Name": "HTREEITEM",
"ValueType": "IntPtr"
},
{
"Namespace": "Windows.Win32.UI.Controls",
"Name": "HDSA",
"ValueType": "IntPtr"
},
{
"Namespace": "Windows.Win32.UI.Controls",
"Name": "HDPA",
"ValueType": "IntPtr"
},
{
"Namespace": "Windows.Win32.System.Threading",
"Name": "LPPROC_THREAD_ATTRIBUTE_LIST",

Просмотреть файл

@ -208,12 +208,24 @@ OpenPrivateNamespaceW::return=NamespaceHandle
CreateBoundaryDescriptorA::return=BoundaryDescriptorHandle
CreateBoundaryDescriptorW::return=BoundaryDescriptorHandle
DeleteBoundaryDescriptor::BoundaryDescriptor=BoundaryDescriptorHandle
OpenEventLogA::return=EventLogHandle
OpenEventLogW::return=EventLogHandle
RegisterEventSourceA::return=EventSourceHandle
RegisterEventSourceW::return=EventSourceHandle
BackupEventLogA::hEventLog=EventLogHandle
BackupEventLogW::hEventLog=EventLogHandle
ClearEventLogA::hEventLog=EventLogHandle
ClearEventLogW::hEventLog=EventLogHandle
GetEventLogInformation::hEventLog=EventLogHandle
GetNumberOfEventLogRecords::hEventLog=EventLogHandle
GetOldestEventLogRecord::hEventLog=EventLogHandle
NotifyChangeEventLog::hEventLog=EventLogHandle
OpenBackupEventLogA::return=EventLogHandle
OpenBackupEventLogW::return=EventLogHandle
OpenEventLogA::return=EventLogHandle
OpenEventLogW::return=EventLogHandle
ReadEventLogA::hEventLog=EventLogHandle
ReadEventLogW::hEventLog=EventLogHandle
RegisterEventSourceA::return=EventSourceHandle
RegisterEventSourceW::return=EventSourceHandle
ReportEventA::hEventLog=EventSourceHandle
ReportEventW::hEventLog=EventSourceHandle
SHChangeNotification_Lock::return=ShFindChangeNotificationHandle
WTSVirtualChannelOpen::return=HwtsVirtualChannelHandle
WTSVirtualChannelOpenEx::return=HwtsVirtualChannelHandle
@ -502,8 +514,8 @@ D3D11_TEXTURE2D_DESC::CPUAccessFlags=D3D11_CPU_ACCESS_FLAG
StartDocPrinterA::pDocInfo=DOC_INFO_1A*
StartDocPrinterW::pDocInfo=DOC_INFO_1W*
PEXCEPTION_FILTER::EstablisherFrame=[In]void*
IUIAutomationElement::get_CurrentNativeWindowHandle::retVal=HWND
IUIAutomationElement::get_CachedNativeWindowHandle::retVal=HWND
IUIAutomationElement::get_CurrentNativeWindowHandle::retVal=HWND*
IUIAutomationElement::get_CachedNativeWindowHandle::retVal=HWND*
IUIAutomationProxyFactory::CreateProvider::hwnd=HWND
IUIAutomation::ElementFromHandle::hwnd=HWND
IUIAutomation::ElementFromHandleBuildCache::hwnd=HWND
@ -565,3 +577,7 @@ IEnumPortableDeviceObjectIDs::Next::return=[AlternateSuccessCodes]
IEnumPortableDeviceObjectIDs::Skip::return=[AlternateSuccessCodes]
IADsPropertyList::Next::return=[AlternateSuccessCodes]
IADsPropertyList::Skip::return=[AlternateSuccessCodes]
JsDebugReadMemoryFlags=[ScopedEnum]
SHCreateItemFromParsingName::ppv=[ComOutPtr]
PRINTER_OPTIONSA::dwFlags=PRINTER_OPTION_FLAGS
PRINTER_OPTIONSW::dwFlags=PRINTER_OPTION_FLAGS

Просмотреть файл

@ -3207,6 +3207,10 @@
{
"method": "InitiateSystemShutdownExW",
"parameter": "dwReason"
},
{
"method": "ExitWindowsEx",
"parameter": "dwReason"
}
]
},
@ -20575,6 +20579,7 @@
},
{
"name": "JOB_OBJECT_CPU_RATE_CONTROL",
"namespace": "Windows.Win32.System.JobObjects",
"members": [
{
"name": "JOB_OBJECT_CPU_RATE_CONTROL_ENABLE",
@ -23928,6 +23933,7 @@
},
{
"name": "JOB_OBJECT_TERMINATE_AT_END_ACTION",
"namepace": "Windows.Win32.System.JobObjects",
"members": [
{
"name": "JOB_OBJECT_TERMINATE_AT_END_OF_JOB",
@ -29243,5 +29249,125 @@
"parameter": "dwOS"
}
]
},
{
"name": "DEVICEFAMILYINFOENUM",
"flags": false,
"type": "uint",
"autoPopulate": {
"header": "winnt.h",
"filter": "DEVICEFAMILYINFOENUM_"
},
"members": [],
"uses": [
{
"method": "RtlGetDeviceFamilyInfoEnum",
"parameter": "pulDeviceFamily"
}
]
},
{
"name": "DEVICEFAMILYDEVICEFORM",
"flags": false,
"type": "uint",
"autoPopulate": {
"header": "winnt.h",
"filter": "DEVICEFAMILYDEVICEFORM_"
},
"members": [],
"uses": [
{
"method": "RtlGetDeviceFamilyInfoEnum",
"parameter": "pulDeviceForm"
}
]
},
{
"name": "PRINTER_ACCESS_RIGHTS",
"flags": true,
"autoPopulate": {
"filter": "PRINTER_ACCESS_|SERVER_ACCESS_",
"header": "winspool.h"
},
"members": [
{
"name": "PRINTER_ALL_ACCESS",
"value": "(PRINTER_STANDARD_RIGHTS_REQUIRED | PRINTER_ACCESS_ADMINISTER | PRINTER_ACCESS_USE)"
},
{
"name": "PRINTER_READ",
"value": "(PRINTER_STANDARD_RIGHTS_READ | PRINTER_ACCESS_USE)"
},
{
"name": "PRINTER_WRITE",
"value": "(PRINTER_STANDARD_RIGHTS_WRITE | PRINTER_ACCESS_USE)"
},
{
"name": "PRINTER_EXECUTE",
"value": "(PRINTER_STANDARD_RIGHTS_EXECUTE | PRINTER_ACCESS_USE)"
},
{
"name": "SERVER_ALL_ACCESS",
"value": "(PRINTER_STANDARD_RIGHTS_REQUIRED | SERVER_ACCESS_ADMINISTER | SERVER_ACCESS_ENUMERATE)"
},
{
"name": "SERVER_READ",
"value": "(PRINTER_STANDARD_RIGHTS_READ | SERVER_ACCESS_ENUMERATE)"
},
{
"name": "SERVER_WRITE",
"value": "(PRINTER_STANDARD_RIGHTS_WRITE | SERVER_ACCESS_ADMINISTER | SERVER_ACCESS_ENUMERATE)"
},
{
"name": "SERVER_EXECUTE",
"value": "(PRINTER_STANDARD_RIGHTS_EXECUTE | SERVER_ACCESS_ENUMERATE)"
},
{
"name": "PRINTER_DELETE",
"value": "(0x00010000)"
},
{
"name": "PRINTER_READ_CONTROL",
"value": "(0x00020000)"
},
{
"name": "PRINTER_WRITE_DAC",
"value": "(0x00040000)"
},
{
"name": "PRINTER_WRITE_OWNER",
"value": "(0x00080000)"
},
{
"name": "PRINTER_SYNCHRONIZE",
"value": "(0x00100000)"
},
{
"name": "PRINTER_STANDARD_RIGHTS_REQUIRED",
"value": "(0x000F0000)"
},
{
"name": "PRINTER_STANDARD_RIGHTS_READ",
"value": "(0x00020000)"
},
{
"name": "PRINTER_STANDARD_RIGHTS_WRITE",
"value": "(0x00020000)"
},
{
"name": "PRINTER_STANDARD_RIGHTS_EXECUTE",
"value": "(0x00020000)"
}
],
"uses": [
{
"struct": "PRINTER_DEFAULTSA",
"field": "DesiredAccess"
},
{
"struct": "PRINTER_DEFAULTSW",
"field": "DesiredAccess"
}
]
}
]

Просмотреть файл

@ -8,5 +8,8 @@ namespace Windows.Win32.Foundation
{
[NativeTypeName("HANDLE")]
public const int INVALID_HANDLE_VALUE = -1;
[NativeTypeName("HRESULT")]
public const int CO_E_NOTINITIALIZED = unchecked((int)0x800401F0);
}
}

Просмотреть файл

@ -95,6 +95,26 @@ namespace Windows.Win32.Graphics.Gdi
DIB_RGB_COLORS = 0,
DIB_PAL_COLORS = 1
}
[NativeTypeName("struct tagMONITORINFOEXA : tagMONITORINFO")]
[NativeInheritance("tagMONITORINFO")]
public unsafe partial struct MONITORINFOEXA
{
public MONITORINFO monitorInfo;
[NativeTypeName("CHAR [32]")]
public fixed sbyte szDevice[32];
}
[NativeTypeName("struct tagMONITORINFOEXW : tagMONITORINFO")]
[NativeInheritance("tagMONITORINFO")]
public unsafe partial struct MONITORINFOEXW
{
public MONITORINFO monitorInfo;
[NativeTypeName("WCHAR [32]")]
public fixed ushort szDevice[32];
}
public static unsafe partial class Apis
{

Просмотреть файл

@ -114,6 +114,10 @@ IDirect3DDevice9Video=Windows.Win32.Media.MediaFoundation
D3DCONTENTPROTECTIONCAPS=Windows.Win32.Media.MediaFoundation
D3DOVERLAYCAPS=Windows.Win32.Media.MediaFoundation
# endregion d3d9caps.h
# region d3d9types.h
D3DMATRIX=Windows.Win32.Graphics.Direct3D
D3DVECTOR=Windows.Win32.Graphics.Direct3D
# endregion d3d9types.h
# region dbghelp.h (also defined in imagehlp.h)
PSYMBOLSERVERCALLBACKPROC=Windows.Win32.System.Diagnostics.Debug
# endregion dbghelp.h
@ -271,6 +275,9 @@ IPropertyBag=Windows.Win32.System.Com.StructuredStorage
IPropertyBag2=Windows.Win32.System.Com.StructuredStorage
PROPBAG2=Windows.Win32.System.Com.StructuredStorage
IErrorInfo=Windows.Win32.System.Com
SetErrorInfo=Windows.Win32.System.Com
GetErrorInfo=Windows.Win32.System.Com
ISupportErrorInfo=Windows.Win32.System.Com
IErrorLog=Windows.Win32.System.Com
EXCEPINFO=Windows.Win32.System.Com
LPEXCEPFINO_DEFERRED_FILLIN=Windows.Win32.System.Com
@ -1539,6 +1546,7 @@ ADMINISTRATOR_POWER_POLICY=Windows.Win32.System.Power
ASSEMBLY_FILE_DETAILED_INFORMATION=Windows.Win32.System.ApplicationInstallationAndServicing
AUDIT_EVENT_TYPE=Windows.Win32.Security
BATTERY_REPORTING_SCALE=Windows.Win32.System.Power
BindIoCompletionCallback=Windows.Win32.System.IO
CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE=Windows.Win32.Security
CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE=Windows.Win32.Security
CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1=Windows.Win32.Security
@ -1547,10 +1555,30 @@ CLAIM_SECURITY_ATTRIBUTES_INFORMATION=Windows.Win32.Security
COMPARTMENT_ID=Windows.Win32.System.Kernel
COMPATIBILITY_CONTEXT_ELEMENT=Windows.Win32.System.ApplicationInstallationAndServicing
CONTEXT=Windows.Win32.System.Diagnostics.Debug
CORRELATION_VECTOR=Windows.Win32.System.CorrelationVector
RTL_CORRELATION_*=Windows.Win32.System.CorrelationVector
RtlInitializeCorrelationVector=Windows.Win32.System.CorrelationVector
RtlIncrementCorrelationVector=Windows.Win32.System.CorrelationVector
RtlExtendCorrelationVector=Windows.Win32.System.CorrelationVector
RtlValidateCorrelationVector=Windows.Win32.System.CorrelationVector
CUSTOM_SYSTEM_EVENT_TRIGGER_CONFIG=Windows.Win32.System.WindowsProgramming
DISPATCHER_CONTEXT=Windows.Win32.System.Diagnostics.Debug
DISPATCHER_CONTEXT_ARM64=Windows.Win32.System.Diagnostics.Debug
DEVICE_POWER_STATE=Windows.Win32.System.Power
EVENTLOGRECORD=Windows.Win32.System.EventLog
EVENTSFORLOGFILE=Windows.Win32.System.EventLog
XSAVE_FORMAT=Windows.Win32.System.Diagnostics.Debug
XSAVE_AREA=Windows.Win32.System.Diagnostics.Debug
XSTATE_CONTEXT=Windows.Win32.System.Diagnostics.Debug
EXCEPTION_POINTERS=Windows.Win32.System.Diagnostics.Debug
EXCEPTION_RECORD=Windows.Win32.System.Diagnostics.Debug
EXCEPTION_RECORD64=Windows.Win32.System.Diagnostics.Debug
EXCEPTION_REGISTRATION_RECORD=Windows.Win32.System.Kernel
NT_TIB=Windows.Win32.System.Kernel
ARM64_NT_CONTEXT=Windows.Win32.System.Diagnostics.Debug
XSTATE_CONFIGURATION=Windows.Win32.System.Diagnostics.Debug
IMAGE_ROM_HEADERS=Windows.Win32.System.Diagnostics.Debug
IMAGE_COR20_HEADER=Windows.Win32.System.Diagnostics.Debug
FILE_ID_128=Windows.Win32.Storage.FileSystem
FILE_NOTIFY_EXTENDED_INFORMATION=Windows.Win32.Storage.FileSystem
FILE_NOTIFY_INFORMATION=Windows.Win32.Storage.FileSystem
@ -1577,6 +1605,33 @@ IMAGE_SECTION_HEADER=Windows.Win32.System.Diagnostics.Debug
IMAGE_DELAYLOAD_DESCRIPTOR=Windows.Win32.System.WindowsProgramming
IMAGE_THUNK_DATA32=Windows.Win32.System.WindowsProgramming
IMAGE_THUNK_DATA64=Windows.Win32.System.WindowsProgramming
JOB_OBJECT_IO_RATE_CONTROL_FLAGS=Windows.Win32.System.JobObjects
JOBOBJECTINFOCLASS=Windows.Win32.System.JobObjects
JOB_SET_ARRAY=Windows.Win32.System.JobObjects
JOBOBJECT_BASIC_LIMIT_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2=Windows.Win32.System.JobObjects
JOBOBJECT_LIMIT_VIOLATION_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2=Windows.Win32.System.JobObjects
JOBOBJECT_EXTENDED_LIMIT_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_BASIC_UI_RESTRICTIONS=Windows.Win32.System.JobObjects
JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE=Windows.Win32.System.JobObjects
JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2=Windows.Win32.System.JobObjects
JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V3=Windows.Win32.System.JobObjects
JOBOBJECT_BASIC_ACCOUNTING_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_RATE_CONTROL_TOLERANCE=Windows.Win32.System.JobObjects
JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL=Windows.Win32.System.JobObjects
JOB_OBJECT_NET_RATE_CONTROL_FLAGS=Windows.Win32.System.JobObjects
JOBOBJECT_ASSOCIATE_COMPLETION_PORT=Windows.Win32.System.JobObjects
JOBOBJECT_BASIC_PROCESS_ID_LIST=Windows.Win32.System.JobObjects
JOBOBJECT_CPU_RATE_CONTROL_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_END_OF_JOB_TIME_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_IO_ATTRIBUTION_CONTROL_FLAGS=Windows.Win32.System.JobObjects
JOBOBJECT_IO_ATTRIBUTION_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_IO_ATTRIBUTION_STATS=Windows.Win32.System.JobObjects
JOBOBJECT_JOBSET_INFORMATION=Windows.Win32.System.JobObjects
JOBOBJECT_NET_RATE_CONTROL_INFORMATION=Windows.Win32.System.JobObjects
LATENCY_TIME=Windows.Win32.System.Power
LDT_ENTRY=Windows.Win32.System.Diagnostics.Debug
LOGICAL_PROCESSOR_RELATIONSHIP=Windows.Win32.System.SystemInformation
@ -1606,12 +1661,20 @@ OSVERSIONINFOEXW=Windows.Win32.System.SystemInformation
OSVERSIONINFOW=Windows.Win32.System.SystemInformation
OSVERSIONINFOW=Windows.Win32.System.SystemInformation
PFLS_CALLBACK_FUNCTION=Windows.Win32.System.Threading
POWER_INFORMATION_LEVEL=Windows.Win32.System.Power
POWER_REQUEST_TYPE=Windows.Win32.System.Power
CM_POWER_DATA=Windows.Win32.System.Power
SET_POWER_SETTING_VALUE=Windows.Win32.System.Power
RTL_SRWLOCK=Windows.Win32.System.Threading
RTL_CRITICAL_SECTION=Windows.Win32.System.Threading
RTL_RUN_ONCE=Windows.Win32.System.Threading
RTL_CONDITION_VARIABLE=Windows.Win32.System.Threading
REASON_CONTEXT=Windows.Win32.System.Threading
RTL_BARRIER=Windows.Win32.System.Threading
SE_SECURITY_DESCRIPTOR=Windows.Win32.Security
SE_ACCESS_REPLY=Windows.Win32.Security
ACCESS_REASONS=Windows.Win32.Security
SE_SID=Windows.Win32.Security
PROCESS_DYNAMIC_EH_CONTINUATION_TARGET=Windows.Win32.System.Threading
PROCESS_DYNAMIC_ENFORCED_ADDRESS_RANGE=Windows.Win32.System.Threading
WAITORTIMERCALLBACK=Windows.Win32.System.Threading
@ -1642,6 +1705,12 @@ STORAGE_BUS_TYPE=Windows.Win32.Storage.FileSystem
SYSTEM_CPU_SET_INFORMATION=Windows.Win32.System.SystemInformation
SYSTEM_POOL_ZEROING_INFORMATION=Windows.Win32.System.SystemInformation
SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION=Windows.Win32.System.SystemInformation
SYSTEM_PROCESS_TRUST_LABEL_ACE=Windows.Win32.Security
SYSTEM_ACCESS_FILTER_ACE=Windows.Win32.Security
SE_ACCESS_REQUEST=Windows.Win32.Security
SE_ACCESS_REPLY=Windows.Win32.Security
SE_IMPERSONATION_STATE=Windows.Win32.Security
JOBOBJECT_SECURITY_LIMIT_INFORMATION=Windows.Win32.System.JobObjects
SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION=Windows.Win32.System.SystemInformation
CPU_SET_INFORMATION_TYPE=Windows.Win32.System.SystemInformation
GROUP_AFFINITY=Windows.Win32.System.SystemInformation
@ -1653,6 +1722,8 @@ POWER_PLATFORM_ROLE=Windows.Win32.System.Power
PRIVILEGE_SET=Windows.Win32.Security
PROCESSOR_POWER_POLICY_INFO=Windows.Win32.System.Power
PROCESSOR_POWER_POLICY=Windows.Win32.System.Power
PROCESS_DYNAMIC_EH_CONTINUATION_TARGETS_INFORMATION=Windows.Win32.System.Threading
PROCESS_DYNAMIC_ENFORCED_ADDRESS_RANGES_INFORMATION=Windows.Win32.System.Threading
PSECURE_MEMORY_CACHE_CALLBACK=Windows.Win32.System.Memory
PVECTORED_EXCEPTION_HANDLER=Windows.Win32.System.Diagnostics.Debug
QUOTA_LIMITS=Windows.Win32.Security
@ -1662,13 +1733,42 @@ RtlAddGrowableFunctionTable=Windows.Win32.System.Diagnostics.Debug
RtlCaptureContext=Windows.Win32.System.Diagnostics.Debug
RtlCaptureContext2=Windows.Win32.System.Diagnostics.Debug
RtlCaptureStackBackTrace=Windows.Win32.System.Diagnostics.Debug
RtlCompareMemory=Windows.Win32.System.Memory
RtlConvertDeviceFamilyInfoToString=Windows.Win32.System.SystemInformation
RtlCrc32=Windows.Win32.System.Memory
RtlCrc64=Windows.Win32.System.Memory
RtlDrainNonVolatileFlush=Windows.Win32.System.Memory.NonVolatile
RtlFillNonVolatileMemory=Windows.Win32.System.Memory.NonVolatile
RtlFlushNonVolatileMemory=Windows.Win32.System.Memory.NonVolatile
RtlFlushNonVolatileMemoryRanges=Windows.Win32.System.Memory.NonVolatile
RtlFreeNonVolatileToken=Windows.Win32.System.Memory.NonVolatile
RtlGetDeviceFamilyInfoEnum=Windows.Win32.System.SystemInformation
RtlGetNonVolatileToken=Windows.Win32.System.Memory.NonVolatile
RtlGetProductInfo=Windows.Win32.System.SystemInformation
RtlGetReturnAddressHijackTarget=Windows.Win32.System.WindowsProgramming
RtlGetSystemGlobalData=Windows.Win32.System.SystemInformation
RtlIsZeroMemory=Windows.Win32.System.Memory
RtlOsDeploymentState=Windows.Win32.System.SystemInformation
OS_DEPLOYEMENT_STATE_VALUES=Windows.Win32.System.SystemInformation
RtlWriteNonVolatileMemory=Windows.Win32.System.Memory.NonVolatile
RtlDeleteFunctionTable=Windows.Win32.System.Diagnostics.Debug
RtlDeleteGrowableFunctionTable=Windows.Win32.System.Diagnostics.Debug
RtlGrowFunctionTable=Windows.Win32.System.Diagnostics.Debug
RtlInitializeSListHead=Windows.Win32.System.Kernel
RtlFirstEntrySList=Windows.Win32.System.Kernel
RtlInterlockedPopEntrySList=Windows.Win32.System.Kernel
RtlInterlockedPushEntrySList=Windows.Win32.System.Kernel
RtlInterlockedPushListSListEx=Windows.Win32.System.Kernel
RtlInterlockedFlushSList=Windows.Win32.System.Kernel
RtlInstallFunctionTableCallback=Windows.Win32.System.Diagnostics.Debug
RtlLookupFunctionEntry=Windows.Win32.System.Diagnostics.Debug
RtlNormalizeSecurityDescriptor=Windows.Win32.Security
RtlPcToFileHeader=Windows.Win32.System.Diagnostics.Debug
RtlQueryDepthSList=Windows.Win32.System.Kernel
RtlRaiseCustomSystemEventTrigger=Windows.Win32.System.WindowsProgramming
RtlRaiseException=Windows.Win32.System.Diagnostics.Debug
RtlRestoreContext=Windows.Win32.System.Diagnostics.Debug
RtlSwitchedVVI=Windows.Win32.System.SystemInformation
RtlUnwind=Windows.Win32.System.Diagnostics.Debug
RtlUnwindEx=Windows.Win32.System.Diagnostics.Debug
RtlVirtualUnwind=Windows.Win32.System.Diagnostics.Debug
@ -1703,6 +1803,11 @@ SYSTEM_POWER_STATE=Windows.Win32.System.Power
SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION=Windows.Win32.System.SystemInformation
SYSTEM_RESOURCE_ATTRIBUTE_ACE=Windows.Win32.Security
SYSTEM_SCOPED_POLICY_ID_ACE=Windows.Win32.Security
TAPE_ERASE=Windows.Win32.Storage.FileSystem
TAPE_PREPARE=Windows.Win32.Storage.FileSystem
TAPE_WRITE_MARKS=Windows.Win32.Storage.FileSystem
TAPE_GET_POSITION=Windows.Win32.Storage.FileSystem
TAPE_SET_POSITION=Windows.Win32.Storage.FileSystem
TOKEN_ACCESS_INFORMATION=Windows.Win32.Security
TOKEN_APPCONTAINER_INFORMATION=Windows.Win32.Security
TOKEN_AUDIT_POLICY=Windows.Win32.Security
@ -1754,6 +1859,8 @@ ARM64_NT_NEON128=Windows.Win32.System.Diagnostics.Debug
M128A=Windows.Win32.System.Diagnostics.Debug
IMAGE_LOAD_CONFIG_CODE_INTEGRITY=Windows.Win32.System.Diagnostics.Debug
XSTATE_FEATURE=Windows.Win32.System.Diagnostics.Debug
XSAVE_AREA_HEADER=Windows.Win32.System.Diagnostics.Debug
IMAGE_ROM_OPTIONAL_HEADER=Windows.Win32.System.Diagnostics.Debug
EXCEPTION_RECORD32=Windows.Win32.System.Diagnostics.Debug
IMAGE_RUNTIME_FUNCTION_ENTRY=Windows.Win32.System.Diagnostics.Debug
UNWIND_HISTORY_TABLE_ENTRY=Windows.Win32.System.Diagnostics.Debug
@ -2121,6 +2228,8 @@ MsgWaitForMultipleObjectsEx=Windows.Win32.UI.WindowsAndMessaging
MULTIKEYHELPA=Windows.Win32.UI.Shell
MULTIKEYHELPW=Windows.Win32.UI.Shell
NMHDR=Windows.Win32.UI.Controls
NV_MEMORY_RANGE=Windows.Win32.System.Memory.NonVolatile
RTL_SYSTEM_GLOBAL_DATA_ID=Windows.Win32.System.SystemInformation
NotifyWinEvent=Windows.Win32.UI.Accessibility
OemKeyScan=Windows.Win32.UI.Input.KeyboardAndMouse
OffsetRect=Windows.Win32.Graphics.Gdi
@ -2161,8 +2270,9 @@ RAWMOUSE=Windows.Win32.UI.Input
RedrawWindow=Windows.Win32.Graphics.Gdi
RegisterClipboardFormatA=Windows.Win32.System.DataExchange
RegisterClipboardFormatW=Windows.Win32.System.DataExchange
RegisterDeviceNotificationA=Windows.Win32.System.SystemServices
RegisterDeviceNotificationW=Windows.Win32.System.SystemServices
RegisterDeviceNotificationA=Windows.Win32.UI.WindowsAndMessaging
RegisterDeviceNotificationW=Windows.Win32.UI.WindowsAndMessaging
UnregisterDeviceNotification=Windows.Win32.UI.WindowsAndMessaging
RegisterHotKey=Windows.Win32.UI.Input.KeyboardAndMouse
RegisterPointerDeviceNotifications=Windows.Win32.UI.Controls
RegisterPointerInputTarget=Windows.Win32.UI.Accessibility

Просмотреть файл

@ -33,6 +33,10 @@ CF_HYDRATION_POLICY_PRIMARY=ushort
CF_POPULATION_POLICY_MODIFIER=ushort
CF_POPULATION_POLICY_PRIMARY=ushort
--exclude
_TREEITEM
_IMAGELIST
_DSA
_DPA
tag_s_RIFFWAVE_INST
PENCLAVE_TARGET_FUNCTION
PRTM_EVENT_CALLBACK
@ -62,6 +66,9 @@ _OLD_LARGE_INTEGER
IVssCreateWriterMetadataEx
_SLIST_ENTRY
__RPCPROXY_H_VERSION__
_DISPATCHER_CONTEXT_ARM64
tagMONITORINFOEXA
tagMONITORINFOEXW
--remap
ABI::Windows::Foundation::IActivatableClassRegistration=IActivatableClassRegistration
adpcmcoef_tag=ADPCMCOEFSET
@ -1164,7 +1171,6 @@ _ICONINFOEXA=ICONINFOEXA
_ICONINFOEXW=ICONINFOEXW
_ImageArchitectureEntry=IMAGE_ARCHITECTURE_ENTRY
_ImageArchitectureHeader=IMAGE_ARCHITECTURE_HEADER
_IMAGELIST*=IntPtr
_IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY=IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY
_IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY=IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY
_IMAGE_ARCHIVE_MEMBER_HEADER=IMAGE_ARCHIVE_MEMBER_HEADER
@ -11930,3 +11936,8 @@ tACMDRVFORMATSUGGEST=ACMDRVFORMATSUGGEST
_PROPERTYUI_NAME_FLAGS=PROPERTYUI_NAME_FLAGS
_PROPERTYUI_FLAGS=PROPERTYUI_FLAGS
_PROPERTYUI_FORMAT_FLAGS=PROPERTYUI_FORMAT_FLAGS
CM_Power_Data_s=CM_POWER_DATA
_TREEITEM*=HTREEITEM
_IMAGELIST*=HIMAGELIST
_DSA*=HDSA
_DPA*=HDPA

Просмотреть файл

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:df35330c69c9b8e50dbcefd0d073e98cc3e64bbfed7dc2389b71676c0c1c0617
size 15438336
oid sha256:0e089aa1c68fa02e24f0b7a9cc7042d71730a028e9a8f99a06f99586e4ca4bbe
size 15601664

Просмотреть файл

@ -73,9 +73,16 @@ function Install-DotNetTool
function Install-BuildTools
{
Param([switch]$Clean)
Install-DotNetTool -Name ClangSharpPInvokeGenerator -Version 11.0.0-beta3
Install-DotNetTool -Name nbgv
if ($Clean.IsPresent)
{
& dotnet clean "$rootDir\buildtools"
}
& dotnet build "$rootDir\buildtools" -c Release
ThrowOnNativeProcessError

Просмотреть файл

@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.14-preview",
"version": "0.15-preview",
"assemblyVersion": {
"precision": "revision"
},

Просмотреть файл

@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
@ -39,7 +37,7 @@ namespace MetadataUtils
private static readonly Regex DefineGuidConstRegex =
new Regex(
@"^\s*(DEFINE_GUID|DEFINE_DEVPROPKEY|DEFINE_KNOWN_FOLDER|OUR_GUID_ENTRY)\s*\((.*)");
@"^\s*(DEFINE_GUID|DEFINE_DEVPROPKEY|DEFINE_PROPERTYKEY|DEFINE_KNOWN_FOLDER|OUR_GUID_ENTRY)\s*\((.*)");
private static readonly Regex DefineAviGuidConstRegex =
new Regex(
@ -319,7 +317,7 @@ namespace MetadataUtils
var writer = this.GetConstantWriter(originalNamespace, name);
if (defineGuidKeyword == "DEFINE_DEVPROPKEY")
if (defineGuidKeyword == "DEFINE_DEVPROPKEY" || defineGuidKeyword == "DEFINE_PROPERTYKEY")
{
writer.AddPropKey(name, args);
}

Просмотреть файл

@ -111,6 +111,13 @@ namespace WinmdUtilsProgram
showNamespaceCycles.Handler = CommandHandler.Create<FileInfo, IConsole>(ShowNamespaceCycles);
var showBrokenArchTypes = new Command("showBrokenArchTypes", "Show broken architecture types.")
{
new Option<FileInfo>("--winmd", "The winmd to inspect.") { IsRequired = true }.ExistingOnly(),
};
showBrokenArchTypes.Handler = CommandHandler.Create<FileInfo, IConsole>(ShowBrokenArchTypes);
var rootCommand = new RootCommand("Win32metadata winmd utils")
{
showMissingImportsCommand,
@ -123,7 +130,8 @@ namespace WinmdUtilsProgram
showLibImports,
createLibRsp,
showNamespaceDependencies,
showNamespaceCycles
showNamespaceCycles,
showBrokenArchTypes
};
return rootCommand.Invoke(args);
@ -640,6 +648,139 @@ namespace WinmdUtilsProgram
return string.Empty;
}
private static bool VerifyTypeHasRightArch(
Dictionary<string, List<ITypeDefinition>> namesToArchDefs,
IEntity owner,
IType type,
Architecture requiredArch,
IConsole console)
{
bool success = true;
if (owner != type)
{
var currentType = type;
while (currentType.Kind == TypeKind.Array)
{
ArrayType arrayType = (ArrayType)currentType;
currentType = arrayType.ElementType;
}
while (currentType.Kind == TypeKind.Pointer)
{
PointerType pointerType = (PointerType)currentType;
currentType = pointerType.ElementType;
}
// If the type isn't in the map, it's not arch-specific, so return success
if (!namesToArchDefs.TryGetValue(currentType.FullName, out var foundArchTypes))
{
return true;
}
bool found = false;
Architecture typeArches = Architecture.None;
foreach (var archType in foundArchTypes)
{
var typeArchAttr =
archType.GetAttributes().Single(a => a.AttributeType.FullName == "Windows.Win32.Interop.SupportedArchitectureAttribute");
var typeArch = (Architecture)typeArchAttr.FixedArguments[0].Value;
typeArches |= typeArch;
if ((typeArches & requiredArch) == requiredArch)
{
found = true;
break;
}
}
if (!found)
{
console.Out.Write($"{owner.FullName} supports '{requiredArch}' but referenced type {type.FullName} only supports '{typeArches}'");
success = false;
}
}
if (type.Kind == TypeKind.Struct)
{
foreach (var field in type.GetFields())
{
if (!VerifyTypeHasRightArch(namesToArchDefs, owner, field.Type, requiredArch, console))
{
success = false;
}
}
}
else if (type.Kind == TypeKind.Delegate)
{
var invoke = type.GetMethods(m => m.Name == "Invoke").Single();
foreach (var param in invoke.Parameters)
{
if (!VerifyTypeHasRightArch(namesToArchDefs, owner, param.Type, requiredArch, console))
{
success = false;
}
}
}
return success;
}
public static int ShowBrokenArchTypes(FileInfo winmd, IConsole console)
{
DecompilerTypeSystem winmd1 = DecompilerTypeSystemUtils.CreateTypeSystemFromFile(winmd.FullName);
int badTopLevelTypes = 0;
Dictionary<string, List<ITypeDefinition>> namesToArchDefs = new Dictionary<string, List<ITypeDefinition>>();
foreach (var type in winmd1.GetTopLevelTypeDefinitions()
.Where(t => t.GetAttributes()
.Any(a => a.AttributeType.FullName == "Windows.Win32.Interop.SupportedArchitectureAttribute")))
{
if (!namesToArchDefs.TryGetValue(type.FullName, out var list))
{
list = new();
namesToArchDefs[type.FullName] = list;
}
list.Add(type);
}
foreach (var type in namesToArchDefs.SelectMany(map => map.Value))
{
var archAttr = type.GetAttributes().Single(a => a.AttributeType.FullName == "Windows.Win32.Interop.SupportedArchitectureAttribute");
Architecture arch = (Architecture)archAttr.FixedArguments[0].Value;
if (!VerifyTypeHasRightArch(namesToArchDefs, type, type, arch, console))
{
badTopLevelTypes++;
}
}
foreach (var apisClass in winmd1.GetTopLevelTypeDefinitions().Where(t => t.Kind == TypeKind.Class && t.Name == "Apis"))
{
foreach (var method in apisClass.Methods.Where(
m => m.IsStatic && m.DeclaringType == apisClass && m.GetAttributes()
.Any(a => a.AttributeType.FullName == "Windows.Win32.Interop.SupportedArchitectureAttribute")))
{
var archAttr = method.GetAttributes().Single(a => a.AttributeType.FullName == "Windows.Win32.Interop.SupportedArchitectureAttribute");
Architecture arch = (Architecture)archAttr.FixedArguments[0].Value;
foreach (var param in method.Parameters)
{
VerifyTypeHasRightArch(namesToArchDefs, method, param.Type, arch, console);
}
}
}
if (badTopLevelTypes == 0)
{
console.Out.Write("No broken arch-specific types or methods found.\r\n");
}
return badTopLevelTypes == 0 ? 0 : -1;
}
public static int ShowNamespaceCycles(FileInfo winmd, IConsole console)
{
foreach (var cycle in NamespaceDependencyUtil.GetNamespaceCycles(winmd.FullName))

Просмотреть файл

@ -47,6 +47,10 @@
"showNamespaceCycles": {
"commandName": "Project",
"commandLineArgs": "showNamespaceCycles --winmd $(ProjectDir)..\\..\\bin\\Windows.Win32.winmd"
},
"showBrokenArchTypes": {
"commandName": "Project",
"commandLineArgs": "showBrokenArchTypes --winmd $(ProjectDir)..\\..\\bin\\Windows.Win32.winmd"
}
}
}

Просмотреть файл

@ -51,6 +51,13 @@ namespace Windows.Win32.Tests
this.ExecWinmdUtils(args);
}
[Fact]
public void NoBrokenArchTypes()
{
string args = $"showBrokenArchTypes --winmd \"{TestUtils.Win32WinmdPath}\"";
this.ExecWinmdUtils(args);
}
private void ExecWinmdUtils(string args)
{
string winmdUtilsDll = Path.Combine(TestUtils.BinPath, "winmdutils.dll");

Просмотреть файл

@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "14.0-preview",
"version": "15.0-preview",
"assemblyVersion": {
"precision": "revision"
},