// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Data.OleDb;
namespaceMicrosoft.Plugin.Indexer.SearchHelper
{
publicclassOleDBSearch:ISearch,IDisposable
{
privateOleDbCommandcommand;
privateOleDbConnectionconn;
privateOleDbDataReaderwDSResults;
privatebooldisposedValue;
[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Security",
"CA2100:Review SQL queries for security vulnerabilities",
Justification="sqlQuery does not come from user input but is generated via the ISearchQueryHelper::GenerateSqlFromUserQuery see: https://docs.microsoft.com/en-us/windows/win32/search/-search-3x-wds-qryidx-searchqueryhelper#using-the-generatesqlfromuserquery-method")]
// AccessViolationException can occur if another query is made before the current query completes. Since the old query would be cancelled we can ignore the exception
catch(System.AccessViolationException)
{
// do nothing
}
}
returnresult;
}
// Checks if all the variables related to database connection have been properly disposed