-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PT Run] Replace tblimp-Microsoft.Search.Interop package with source implementation #16363
[PT Run] Replace tblimp-Microsoft.Search.Interop package with source implementation #16363
Conversation
…dowsIndexerTest to use Indexer.Interop classes
…kler/PowerToys into dev/snickler/win32searchapi
🔥🔥🔥 |
Thanks a lot for opening this PR @snickler Where do the class definitions come from, though? Any Microsoft docs or were they reverse engineered? Could you please link the source here or explain how you generated those? |
It was generated using
The After generating the library, I initially used ILSpy and integrated the generated C# into the Indexer project, but I kept running into Access Violations when properties on the queryHelper were set. I went through tons of trial and error, used JetBrains dotPeek to generate the source properly. I then realized what was wrong the entire time, it was because the definition for SearchAPI listed the put_xxxx methods before the set_xxxxx ones. ILSpy generates the C# source with { get; set } in that static order, whereas many properties needed to be { set; get }. It took me a while to realize it after using dotPeek. When I verified it worked, I removed the bulk of the generated source files and kept only the minimal implementation of search based on ISearchManager, ISearchQueryHelper, ISearchCatalogManager use. |
Thanks a lot for the explanation @snickler ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The change works and seems like everything is in place.
Thanks a lot for the contribution!
Summary of the Pull Request
What is this about:
This PR removes the tlbimp-Microsoft.Search.Interop NuGet package and replaces with COM Interop interfaces/classes to provide an implementation that works with what is currently used .
What is included in the PR:
How does someone test / validate:
ExecuteQuery
method inWindowsSearchAPI.cs
, Set thePowerLauncher
project as the startup project and debug it. Verify theresults
list contains results from your local search index.Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.