forked from microsoft/PowerToys
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PT Run] Replace tblimp-Microsoft.Search.Interop package with source …
…implementation (microsoft#16363) * Removed Search Interop tlb package. Added minimal Search API Com implementation * Added CSearchManagerImp * Updated Main with proper reference to CSearchManagerImp. Switched WindowsIndexerTest to use Indexer.Interop classes * Updated with proper SearchAPI Interop implementation * Deleted initial CSearchManager file that didn't work * Updated namespaces to match folder structure * Removed the interfaces and classes not being used from SearchAPI. Added suppressions * Updated spell check. Renamed CSearch call back to original * Fix spell check * Switched back to original class name for Search Manager in tests * Removed Microsoft.Search.Interop.dll from setup * Removed Microsoft.Search.Interop package from PowerLauncher and signing scripts
- Loading branch information
Showing
18 changed files
with
773 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Interop/CSearchCatalogManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Runtime.InteropServices; | ||
|
||
namespace Microsoft.Plugin.Indexer.Interop | ||
{ | ||
[CoClass(typeof(CSearchCatalogManagerClass))] | ||
[Guid("AB310581-AC80-11D1-8DF3-00C04FB6EF50")] | ||
[ComImport] | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1715:Identifiers should have correct prefix", Justification = "Using original name from type lib")] | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1302:Interface names should begin with I", Justification = "Using original name from type lib")] | ||
public interface CSearchCatalogManager : ISearchCatalogManager | ||
{ | ||
} | ||
} |
133 changes: 133 additions & 0 deletions
133
src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Interop/CSearchCatalogManagerClass.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Microsoft.Plugin.Indexer.Interop | ||
{ | ||
[ComConversionLoss] | ||
[Guid("AAB49DD5-AD0B-40AE-B654-AE8976BF6BD2")] | ||
[ClassInterface((short)0)] | ||
[ComImport] | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1212:Property accessors should follow order", Justification = "The order of the property accessors must match the order in which the methods were defined in the vtable")] | ||
public class CSearchCatalogManagerClass : ISearchCatalogManager, CSearchCatalogManager | ||
{ | ||
[DispId(1610678272)] | ||
public virtual extern string Name | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.LPWStr)] | ||
get; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern IntPtr GetParameter([MarshalAs(UnmanagedType.LPWStr), In] string pszName); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void SetParameter([MarshalAs(UnmanagedType.LPWStr), In] string pszName, [In] ref object pValue); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void GetCatalogStatus( | ||
out object pStatus, | ||
out object pPausedReason); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void Reset(); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void Reindex(); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void ReindexMatchingURLs([MarshalAs(UnmanagedType.LPWStr), In] string pszPattern); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void ReindexSearchRoot([MarshalAs(UnmanagedType.LPWStr), In] string pszRoot); | ||
|
||
[DispId(1610678280)] | ||
public virtual extern uint ConnectTimeout | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[param: In] | ||
set; | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
get; | ||
} | ||
|
||
[DispId(1610678282)] | ||
public virtual extern uint DataTimeout | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[param: In] | ||
set; | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
get; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern int NumberOfItems(); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void NumberOfItemsToIndex( | ||
out int plIncrementalCount, | ||
out int plNotificationQueue, | ||
out int plHighPriorityQueue); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.LPWStr)] | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1055:URI-like return values should not be strings", Justification = "Keeping original method name")] | ||
public virtual extern string URLBeingIndexed(); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern uint GetURLIndexingState([MarshalAs(UnmanagedType.LPWStr), In] string psz); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.Interface)] | ||
public virtual extern object GetPersistentItemsChangedSink(); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void RegisterViewForNotification( | ||
[MarshalAs(UnmanagedType.LPWStr), In] string pszView, | ||
[MarshalAs(UnmanagedType.Interface), In] object pViewChangedSink, | ||
out uint pdwCookie); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void GetItemsChangedSink( | ||
[MarshalAs(UnmanagedType.Interface), In] object pISearchNotifyInlineSite, | ||
[In] ref Guid riid, | ||
out IntPtr ppv, | ||
out Guid pGUIDCatalogResetSignature, | ||
out Guid pGUIDCheckPointSignature, | ||
out uint pdwLastCheckPointNumber); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void UnregisterViewForNotification([In] uint dwCookie); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void SetExtensionClusion([MarshalAs(UnmanagedType.LPWStr), In] string pszExtension, [In] int fExclude); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.Interface)] | ||
public virtual extern object EnumerateExcludedExtensions(); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.Interface)] | ||
public virtual extern CSearchQueryHelper GetQueryHelper(); | ||
|
||
[DispId(1610678295)] | ||
public virtual extern int DiacriticSensitivity | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[param: In] | ||
set; | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
get; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.Interface)] | ||
public virtual extern object GetCrawlScopeManager(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Interop/CSearchManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Runtime.InteropServices; | ||
|
||
namespace Microsoft.Plugin.Indexer.Interop | ||
{ | ||
[CoClass(typeof(CSearchManagerClass))] | ||
[Guid("AB310581-AC80-11D1-8DF3-00C04FB6EF69")] | ||
[ComImport] | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1715:Identifiers should have correct prefix", Justification = "Using original name from type lib")] | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1302:Interface names should begin with I", Justification = "Using original name from type lib")] | ||
public interface CSearchManager : ISearchManager | ||
{ | ||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Interop/CSearchManagerClass.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Microsoft.Plugin.Indexer.Interop | ||
{ | ||
[Guid("7D096C5F-AC08-4F1F-BEB7-5C22C517CE39")] | ||
[TypeLibType(2)] | ||
[ClassInterface((short)0)] | ||
[ComConversionLoss] | ||
[ComImport] | ||
public class CSearchManagerClass : ISearchManager, CSearchManager | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void GetIndexerVersionStr([MarshalAs(UnmanagedType.LPWStr)] out string ppszVersionString); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void GetIndexerVersion(out uint pdwMajor, out uint pdwMinor); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern IntPtr GetParameter([MarshalAs(UnmanagedType.LPWStr), In] string pszName); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void SetParameter([MarshalAs(UnmanagedType.LPWStr), In] string pszName, [In] ref object pValue); | ||
|
||
[DispId(1610678276)] | ||
public virtual extern string ProxyName | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.LPWStr)] | ||
get; | ||
} | ||
|
||
[DispId(1610678277)] | ||
public virtual extern string BypassList | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.LPWStr)] | ||
get; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
public virtual extern void SetProxy( | ||
[In] object sUseProxy, | ||
[In] int fLocalByPassProxy, | ||
[In] uint dwPortNumber, | ||
[MarshalAs(UnmanagedType.LPWStr), In] string pszProxyName, | ||
[MarshalAs(UnmanagedType.LPWStr), In] string pszByPassList); | ||
|
||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.Interface)] | ||
public virtual extern CSearchCatalogManager GetCatalog([MarshalAs(UnmanagedType.LPWStr), In] string pszCatalog); | ||
|
||
[DispId(1610678280)] | ||
public virtual extern string UserAgent | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[return: MarshalAs(UnmanagedType.LPWStr)] | ||
get; | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
[param: MarshalAs(UnmanagedType.LPWStr)] | ||
[param: In] | ||
set; | ||
} | ||
|
||
[DispId(1610678282)] | ||
public virtual extern object UseProxy | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
get; | ||
} | ||
|
||
[DispId(1610678283)] | ||
public virtual extern int LocalBypass | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
get; | ||
} | ||
|
||
[DispId(1610678284)] | ||
public virtual extern uint PortNumber | ||
{ | ||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] | ||
get; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/Interop/CSearchQueryHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Runtime.InteropServices; | ||
|
||
namespace Microsoft.Plugin.Indexer.Interop | ||
{ | ||
[Guid("AB310581-AC80-11D1-8DF3-00C04FB6EF63")] | ||
[CoClass(typeof(CSearchQueryHelperClass))] | ||
[ComImport] | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1715:Identifiers should have correct prefix", Justification = "Using original name from type lib")] | ||
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1302:Interface names should begin with I", Justification = "Using original name from type lib")] | ||
public interface CSearchQueryHelper : ISearchQueryHelper | ||
{ | ||
} | ||
} |
Oops, something went wrong.