Commit 252b52a
authored
Improve COM ctor exception code for failing ProgIDs (phpGH-17673)
The `$module_name` of `com::__construct()` can be a ProgID, ClassID or
moniker. We first try `CLSIDFromString()`, and if that fails, we go
ahead and try to treat the `$module_name` as a moniker. If that also
fails, we throw an exception with the result of `MkParseDisplayName()`
what would just be `MK_E_SYNTAX` if given a ProgID. This result is
highly confusing for the common case where a ProgID is given, which is
not registered (e.g. due to a typo). In this case, we use the original
`HRESULT` (`CO_E_CLASSSTRING`) instead.1 parent fe9c904 commit 252b52a
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
185 | 188 | | |
186 | 189 | | |
187 | 190 | | |
| |||
0 commit comments