From 2f1a3d901e484609d818e7a462124ab140d91020 Mon Sep 17 00:00:00 2001 From: Mike Battista <13860912+mikebattista@users.noreply.github.com> Date: Tue, 21 Feb 2023 10:03:40 -0800 Subject: [PATCH] Fixed #947. This reverts previous fix da9490f90f8a2a4013c718b7c1511e0720a1b74b and maps LPBSTR and PBSTR to BSTR* in scraper settings. --- generation/WinSDK/autoTypes.json | 5 -- generation/WinSDK/scraper.settings.rsp | 4 +- scripts/ChangesSinceLastRelease.txt | 51 +++++++++---------- .../ClangSharpSourceWinmdGenerator.cs | 4 -- .../MetadataSyntaxTreeCleaner.cs | 5 -- 5 files changed, 28 insertions(+), 41 deletions(-) diff --git a/generation/WinSDK/autoTypes.json b/generation/WinSDK/autoTypes.json index b1a56d8c8..9be85f36f 100644 --- a/generation/WinSDK/autoTypes.json +++ b/generation/WinSDK/autoTypes.json @@ -20,11 +20,6 @@ "ValueType": "char*", "CloseApi": "SysFreeString" }, - { - "Namespace": "Windows.Win32.Foundation", - "Name": "PBSTR", - "ValueType": "BSTR*" - }, { "Namespace": "Windows.Win32.Foundation", "Name": "HANDLE", diff --git a/generation/WinSDK/scraper.settings.rsp b/generation/WinSDK/scraper.settings.rsp index df846cbbf..e8399968b 100644 --- a/generation/WinSDK/scraper.settings.rsp +++ b/generation/WinSDK/scraper.settings.rsp @@ -12238,4 +12238,6 @@ VARIANT_BOOL=VARIANT_BOOL _IFaxAccountNotify=IFaxAccountNotify _IFaxServerNotify2=IFaxServerNotify2 PLSA_HANDLE=LSA_HANDLE* -PWINUSB_INTERFACE_HANDLE=WINUSB_INTERFACE_HANDLE* \ No newline at end of file +PWINUSB_INTERFACE_HANDLE=WINUSB_INTERFACE_HANDLE* +PBSTR=BSTR* +LPBSTR=BSTR* \ No newline at end of file diff --git a/scripts/ChangesSinceLastRelease.txt b/scripts/ChangesSinceLastRelease.txt index ef6aec131..22fd911a3 100644 --- a/scripts/ChangesSinceLastRelease.txt +++ b/scripts/ChangesSinceLastRelease.txt @@ -162,32 +162,6 @@ Windows.Win32.UI.Input.KeyboardAndMouse.VIRTUAL_KEY.VK_DBE_SBCSCHAR added # Fixed #1466. Windows.Win32.System.Wmi.IWbemClassObject.Get : plFlavor : [In,Out] => [Optional] Windows.Win32.System.Wmi.IWbemClassObject.Get : pType : [In,Out] => [Optional] -# Fixed #947. -Windows.Win32.Foundation.PBSTR added -Windows.Win32.System.Mmc.Document.get_Location : Location...UInt16** => PBSTR -Windows.Win32.System.Mmc.Document.get_Name : Name...UInt16** => PBSTR -Windows.Win32.System.Mmc.Extension.get_Name : Name...UInt16** => PBSTR -Windows.Win32.System.Mmc.Extension.get_SnapinCLSID : SnapinCLSID...UInt16** => PBSTR -Windows.Win32.System.Mmc.Extension.get_Vendor : Vendor...UInt16** => PBSTR -Windows.Win32.System.Mmc.Extension.get_Version : Version...UInt16** => PBSTR -Windows.Win32.System.Mmc.INodeProperties.GetProperty : pbstrProperty...UInt16** => PBSTR -Windows.Win32.System.Mmc.MenuItem.get_DisplayName : DisplayName...UInt16** => PBSTR -Windows.Win32.System.Mmc.MenuItem.get_LanguageIndependentName : LanguageIndependentName...UInt16** => PBSTR -Windows.Win32.System.Mmc.MenuItem.get_LanguageIndependentPath : LanguageIndependentPath...UInt16** => PBSTR -Windows.Win32.System.Mmc.MenuItem.get_Path : Path...UInt16** => PBSTR -Windows.Win32.System.Mmc.Node.get_Bookmark : Bookmark...UInt16** => PBSTR -Windows.Win32.System.Mmc.Node.get_Name : Name...UInt16** => PBSTR -Windows.Win32.System.Mmc.Node.get_Nodetype : Nodetype...UInt16** => PBSTR -Windows.Win32.System.Mmc.Node.get_Property : PropertyValue...UInt16** => PBSTR -Windows.Win32.System.Mmc.Property.get_Name : Name...UInt16** => PBSTR -Windows.Win32.System.Mmc.SnapIn.get_Name : Name...UInt16** => PBSTR -Windows.Win32.System.Mmc.SnapIn.get_SnapinCLSID : SnapinCLSID...UInt16** => PBSTR -Windows.Win32.System.Mmc.SnapIn.get_Vendor : Vendor...UInt16** => PBSTR -Windows.Win32.System.Mmc.SnapIn.get_Version : Version...UInt16** => PBSTR -Windows.Win32.System.Mmc.View.get_CellContents : CellContents...UInt16** => PBSTR -Windows.Win32.System.Mmc.View.get_Memento : Memento...UInt16** => PBSTR -Windows.Win32.System.Ole.Apis.QueryPathOfRegTypeLib : lpbstrPathName...UInt16** => PBSTR -Windows.Win32.System.Ole.Apis.VarBstrCat : pbstrResult...UInt16** => PBSTR # Add usage hints for _SVGIO Windows.Win32.UI.Shell.IFolderView.ItemCount : uFlags...UInt32 => _SVGIO Windows.Win32.UI.Shell.IFolderView.Items : uFlags...UInt32 => _SVGIO @@ -348,3 +322,28 @@ Windows.Win32.Devices.Properties.DEVPROPTYPE.DEVPROP_TYPE_UINT32 added Windows.Win32.Devices.Properties.DEVPROPTYPE.DEVPROP_TYPE_UINT64 added Windows.Win32.Devices.Sensors.Apis.PropVariantGetInformation : RemappedType...UInt32* => DEVPROPTYPE* Windows.Win32.Media.MediaFoundation.IMFVirtualCamera.AddProperty : Type...UInt32 => DEVPROPTYPE +# Fixed #947. +Windows.Win32.System.Mmc.Document.get_Location : Location...UInt16** => BSTR* +Windows.Win32.System.Mmc.Document.get_Name : Name...UInt16** => BSTR* +Windows.Win32.System.Mmc.Extension.get_Name : Name...UInt16** => BSTR* +Windows.Win32.System.Mmc.Extension.get_SnapinCLSID : SnapinCLSID...UInt16** => BSTR* +Windows.Win32.System.Mmc.Extension.get_Vendor : Vendor...UInt16** => BSTR* +Windows.Win32.System.Mmc.Extension.get_Version : Version...UInt16** => BSTR* +Windows.Win32.System.Mmc.INodeProperties.GetProperty : pbstrProperty...UInt16** => BSTR* +Windows.Win32.System.Mmc.MenuItem.get_DisplayName : DisplayName...UInt16** => BSTR* +Windows.Win32.System.Mmc.MenuItem.get_LanguageIndependentName : LanguageIndependentName...UInt16** => BSTR* +Windows.Win32.System.Mmc.MenuItem.get_LanguageIndependentPath : LanguageIndependentPath...UInt16** => BSTR* +Windows.Win32.System.Mmc.MenuItem.get_Path : Path...UInt16** => BSTR* +Windows.Win32.System.Mmc.Node.get_Bookmark : Bookmark...UInt16** => BSTR* +Windows.Win32.System.Mmc.Node.get_Name : Name...UInt16** => BSTR* +Windows.Win32.System.Mmc.Node.get_Nodetype : Nodetype...UInt16** => BSTR* +Windows.Win32.System.Mmc.Node.get_Property : PropertyValue...UInt16** => BSTR* +Windows.Win32.System.Mmc.Property.get_Name : Name...UInt16** => BSTR* +Windows.Win32.System.Mmc.SnapIn.get_Name : Name...UInt16** => BSTR* +Windows.Win32.System.Mmc.SnapIn.get_SnapinCLSID : SnapinCLSID...UInt16** => BSTR* +Windows.Win32.System.Mmc.SnapIn.get_Vendor : Vendor...UInt16** => BSTR* +Windows.Win32.System.Mmc.SnapIn.get_Version : Version...UInt16** => BSTR* +Windows.Win32.System.Mmc.View.get_CellContents : CellContents...UInt16** => BSTR* +Windows.Win32.System.Mmc.View.get_Memento : Memento...UInt16** => BSTR* +Windows.Win32.System.Ole.Apis.QueryPathOfRegTypeLib : lpbstrPathName...UInt16** => BSTR* +Windows.Win32.System.Ole.Apis.VarBstrCat : pbstrResult...UInt16** => BSTR* diff --git a/sources/ClangSharpSourceToWinmd/ClangSharpSourceWinmdGenerator.cs b/sources/ClangSharpSourceToWinmd/ClangSharpSourceWinmdGenerator.cs index 537259fba..27ed86d55 100644 --- a/sources/ClangSharpSourceToWinmd/ClangSharpSourceWinmdGenerator.cs +++ b/sources/ClangSharpSourceToWinmd/ClangSharpSourceWinmdGenerator.cs @@ -971,10 +971,6 @@ private ITypeSymbol GetTypeFromShortName(string name) fixedName = Win32WideStringType; break; - case "LPBSTR": - fixedName = "Windows.Win32.Foundation.PBSTR"; - break; - default: break; } diff --git a/sources/ClangSharpSourceToWinmd/MetadataSyntaxTreeCleaner.cs b/sources/ClangSharpSourceToWinmd/MetadataSyntaxTreeCleaner.cs index 8d249b186..4baa566a3 100644 --- a/sources/ClangSharpSourceToWinmd/MetadataSyntaxTreeCleaner.cs +++ b/sources/ClangSharpSourceToWinmd/MetadataSyntaxTreeCleaner.cs @@ -679,11 +679,6 @@ private string GetInfoForNativeType(string nativeTypeName, out bool isConst, out isNullTerminated = true; break; - case "LPBSTR": - metadataType = "Windows.Win32.Foundation.PBSTR"; - isNullTerminated = true; - break; - case "LPCWSTR": case "PCWSTR": case "LPCWCH":