The first two patches are mostly needed to make wmic.exe work on Windows as well for easier testing and distinguishing between wmic.exe bugs and underlying libraries bugs (although it also makes sense not to depend on wbemprox implementation differences in Wine).
-- v2: wmic: Support array of BSTRs in convert_to_bstr().