Issue in deleting drivers on 22751 code level


After merging the code about importing/deleting drivers from 22751 code level, I got the following NotImplementException during uninstallation:
Exception encountered:
Type: NotImplementedException
Message: The method or operation is not implemented.
Source: AdminUI.WqlQueryEngine
Data: System.Collections.ListDictionaryInternal
TargetSite: System.Collections.Generic.Dictionary`2[System.String,System.String] get_PropertyList()
at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlQueryResultsObject.get_PropertyList()
at Microsoft.ConfigurationManagement.IntegrationDevelopmentKit.IntegrationKitUtilities.GetROStringProperty(IResultObject objectName, String propertyName)
I did some investigation, found there may be following problems in IntegrationKit.OSD.cs:
1) content = ExecuteNullableQuery(connection, query); in function GetPackagesContainingDriver
 The ExecuteNullableQuery will not return null object when there is no result object by the WQL query.
 If we pass this "content" to GetROStringProperty, above exception occurs.
2) The foreach opration can only be run once on the query result by ExecuteNullableQuery
 The first foreach works well, but the second foreach will jump out the cycle directly .
 So we can not use foreach to enum object after function GetNumberOfChildObjects. It will cause the function GetPackagesContainingDriver can not return the right value.
Closed Dec 17, 2009 at 11:35 PM by rhearn


wrote Apr 1, 2009 at 6:43 PM

Let me walk through what you're saying and try to confirm this issue...
Starting at GetPackagesContainingDriver(), at the following line: 
          content = ExecuteNullableQuery(connection, query);
You're saying that if the query results in no value, that the ExecuteNullableQuery method will not return a null, but instead will return an empty IResultObject?
Also, that continuing through the GetPackagesContainingDriver, checking for null has no effect if the object is valid but empty, and that passing the empty object to GetROStringProperty() results in the exception?
If this is the case then I guess Iu made the false assumption that the query would return either an IResultObject with one or more items, a null, or an exception. If the IResultObject can have zero items, we need to put in a short test in ExecuteNullableQuery to return a null in that case.
I will investigate a little further.

wrote Dec 17, 2009 at 11:35 PM

I believe this is fixed with changeset 24787.
Please re-open if this is still an issue.

wrote Feb 13, 2013 at 11:45 PM

wrote May 16, 2013 at 6:21 AM