Skip to content

Commit 29b8cde

Browse files
jeffschwMSFTRon Petrusha
authored andcommitted
CLR COM Event Handler returns E_INVALIDARG and Array Data is not Updatted when Event Parameter is double pointer to SAFEARRAY. (microsoft#975)
* CLR COM Event Handler returns E_INVALIDARG and Array Data is not Updated when Event Parameter is double pointer to SAFEARRAY. * Address pr feedback
1 parent 7a93798 commit 29b8cde

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## .NET COM successfully marshals ByRef SafeArray parameters on events
2+
3+
### Scope
4+
Minor
5+
6+
### Version Introduced
7+
4.8
8+
9+
### Source Analyzer Status
10+
NotPlanned
11+
12+
### Change Description
13+
In the .NET Framework 4.7.2 and earlier versions, a ByRef [SafeArray](https://docs.microsoft.com/en-us/windows/desktop/api/oaidl/ns-oaidl-safearray) parameter on a COM event would fail to marshal back to native code. With this change the [SafeArray](https://docs.microsoft.com/en-us/windows/desktop/api/oaidl/ns-oaidl-safearray) is now marshalled successfully.
14+
15+
- [ x ] Quirked
16+
- [ ] Build-time break
17+
18+
### Recommended Action
19+
If properly marshalling ByRef SafeArray parameters on COM Events breaks execution, you can disable this code by adding the following configuration switch to your application config:
20+
21+
```xml
22+
<appSettings>
23+
<add key="Switch.System.Runtime.InteropServices.DoNotMarshalOutByrefSafeArrayOnInvoke" value="true" />
24+
</appSettings>
25+
```
26+
27+
### Category
28+
Core

0 commit comments

Comments
 (0)