Message269595
What about instead of unconditionally calling CoInitializeEx in all cases, add a Py_EnsureCOM(flags) C API function? The flags param would be any flags that the caller must have, would default to 0, and would be combined with sys.coinit_flags before calling CoInitializeEx. If CoInitializeEx had already been called, the flags are compared with what were used in the call and an error is raised in case of conflict. Otherwise, CoInitializeEx is called and the flags are returned. It could also be exposed to Python code as sys.ensure_com, though in the case of something like AMSI being enabled, sys.ensure_com would always either be a no-op or raise an error.
Disclaimer: I know exactly nothing about COM, except what I've read in this issue and the AMSI issue. If this suggestion is unworkable, please ignore it entirely! |
|
Date |
User |
Action |
Args |
2016-06-30 16:25:05 | zach.ware | set | recipients:
+ zach.ware, mhammond, brett.cannon, paul.moore, tim.golden, eryksun, steve.dower, nnemkin |
2016-06-30 16:25:05 | zach.ware | set | messageid: <1467303905.16.0.165354937365.issue27417@psf.upfronthosting.co.za> |
2016-06-30 16:25:05 | zach.ware | link | issue27417 messages |
2016-06-30 16:25:05 | zach.ware | create | |
|