@@ -38,7 +38,7 @@ public class AccessibleObject :
3838 UnsafeNativeMethods . IGridProvider ,
3939 UiaCore . IGridItemProvider ,
4040 OleAut32 . IEnumVariant ,
41- UnsafeNativeMethods . IOleWindow ,
41+ Ole32 . IOleWindow ,
4242 UnsafeNativeMethods . ILegacyIAccessibleProvider ,
4343 UnsafeNativeMethods . ISelectionProvider ,
4444 UiaCore . ISelectionItemProvider ,
@@ -59,7 +59,7 @@ public class AccessibleObject :
5959 private OleAut32 . IEnumVariant enumVariant = null ;
6060
6161 // IOleWindow interface of the 'inner' system IAccessible object that we are wrapping
62- private UnsafeNativeMethods . IOleWindow systemIOleWindow = null ;
62+ private Ole32 . IOleWindow systemIOleWindow = null ;
6363
6464 private readonly bool systemWrapper = false ; // Indicates this object is being used ONLY to wrap a system IAccessible
6565
@@ -1888,47 +1888,51 @@ void IAccessible.set_accValue(object childID, string newValue)
18881888 /// accessible object, which will be able to return an hwnd back to the OS. So we are
18891889 /// effectively 'preempting' what WindowFromAccessibleObject() would do.
18901890 /// </summary>
1891- int UnsafeNativeMethods . IOleWindow . GetWindow ( out IntPtr hwnd )
1891+ unsafe HRESULT Ole32 . IOleWindow . GetWindow ( IntPtr * phwnd )
18921892 {
18931893 // See if we have an inner object that can provide the window handle
18941894 if ( systemIOleWindow != null )
18951895 {
1896- return systemIOleWindow . GetWindow ( out hwnd ) ;
1896+ return systemIOleWindow . GetWindow ( phwnd ) ;
18971897 }
18981898
18991899 // Otherwise delegate to the parent object
19001900 AccessibleObject parent = Parent ;
1901- if ( parent is UnsafeNativeMethods . IOleWindow parentWindow )
1901+ if ( parent is Ole32 . IOleWindow parentWindow )
19021902 {
1903- return parentWindow . GetWindow ( out hwnd ) ;
1903+ return parentWindow . GetWindow ( phwnd ) ;
19041904 }
19051905
19061906 // Or fail if there is no parent
1907- hwnd = IntPtr . Zero ;
1908- return NativeMethods . E_FAIL ;
1907+ if ( phwnd == null )
1908+ {
1909+ return HRESULT . E_POINTER ;
1910+ }
1911+
1912+ * phwnd = IntPtr . Zero ;
1913+ return HRESULT . E_FAIL ;
19091914 }
19101915
19111916 /// <summary>
19121917 /// See GetWindow() above for details.
19131918 /// </summary>
1914- void UnsafeNativeMethods . IOleWindow . ContextSensitiveHelp ( int fEnterMode )
1919+ HRESULT Ole32 . IOleWindow . ContextSensitiveHelp ( BOOL fEnterMode )
19151920 {
19161921 // See if we have an inner object that can provide help
19171922 if ( systemIOleWindow != null )
19181923 {
1919- systemIOleWindow . ContextSensitiveHelp ( fEnterMode ) ;
1920- return ;
1924+ return systemIOleWindow . ContextSensitiveHelp ( fEnterMode ) ;
19211925 }
19221926
19231927 // Otherwise delegate to the parent object
19241928 AccessibleObject parent = Parent ;
1925- if ( parent is UnsafeNativeMethods . IOleWindow parentWindow )
1929+ if ( parent is Ole32 . IOleWindow parentWindow )
19261930 {
1927- parentWindow . ContextSensitiveHelp ( fEnterMode ) ;
1928- return ;
1931+ return parentWindow . ContextSensitiveHelp ( fEnterMode ) ;
19291932 }
19301933
19311934 // Or do nothing if there is no parent
1935+ return HRESULT . S_OK ;
19321936 }
19331937
19341938 /// <summary>
@@ -2112,7 +2116,7 @@ protected void UseStdAccessibleObjects(IntPtr handle, int objid)
21122116 {
21132117 systemIAccessible = ( IAccessible ) acc ;
21142118 systemIEnumVariant = ( OleAut32 . IEnumVariant ) en ;
2115- systemIOleWindow = acc as UnsafeNativeMethods . IOleWindow ;
2119+ systemIOleWindow = acc as Ole32 . IOleWindow ;
21162120 }
21172121 }
21182122
@@ -2707,17 +2711,17 @@ internal sealed class InternalAccessibleObject :
27072711 UnsafeNativeMethods . IGridProvider ,
27082712 UiaCore . IGridItemProvider ,
27092713 OleAut32 . IEnumVariant ,
2710- UnsafeNativeMethods . IOleWindow ,
2714+ Ole32 . IOleWindow ,
27112715 UnsafeNativeMethods . ILegacyIAccessibleProvider ,
27122716 UnsafeNativeMethods . ISelectionProvider ,
27132717 UiaCore . ISelectionItemProvider ,
27142718 UnsafeNativeMethods . IScrollItemProvider ,
27152719 UiaCore . IRawElementProviderHwndOverride
27162720 {
2717- private IAccessible publicIAccessible ; // AccessibleObject as IAccessible
2718- private readonly OleAut32 . IEnumVariant publicIEnumVariant ; // AccessibleObject as IEnumVariant
2719- private readonly UnsafeNativeMethods . IOleWindow publicIOleWindow ; // AccessibleObject as IOleWindow
2720- private readonly IReflect publicIReflect ; // AccessibleObject as IReflect
2721+ private IAccessible publicIAccessible ; // AccessibleObject as IAccessible
2722+ private readonly OleAut32 . IEnumVariant publicIEnumVariant ; // AccessibleObject as IEnumVariant
2723+ private readonly Ole32 . IOleWindow publicIOleWindow ; // AccessibleObject as IOleWindow
2724+ private readonly IReflect publicIReflect ; // AccessibleObject as IReflect
27212725
27222726 private readonly UnsafeNativeMethods . IServiceProvider publicIServiceProvider ; // AccessibleObject as IServiceProvider
27232727 private readonly UnsafeNativeMethods . IAccessibleEx publicIAccessibleEx ; // AccessibleObject as IAccessibleEx
@@ -2749,7 +2753,7 @@ internal InternalAccessibleObject(AccessibleObject accessibleImplemention)
27492753 // Get all the casts done here to catch any issues early
27502754 publicIAccessible = ( IAccessible ) accessibleImplemention ;
27512755 publicIEnumVariant = ( OleAut32 . IEnumVariant ) accessibleImplemention ;
2752- publicIOleWindow = ( UnsafeNativeMethods . IOleWindow ) accessibleImplemention ;
2756+ publicIOleWindow = ( Ole32 . IOleWindow ) accessibleImplemention ;
27532757 publicIReflect = ( IReflect ) accessibleImplemention ;
27542758 publicIServiceProvider = ( UnsafeNativeMethods . IServiceProvider ) accessibleImplemention ;
27552759 publicIAccessibleEx = ( UnsafeNativeMethods . IAccessibleEx ) accessibleImplemention ;
@@ -2923,14 +2927,14 @@ unsafe HRESULT OleAut32.IEnumVariant.Next(uint celt, IntPtr rgVar, uint* pCeltFe
29232927
29242928 HRESULT OleAut32 . IEnumVariant . Skip ( uint celt ) => publicIEnumVariant . Skip ( celt ) ;
29252929
2926- int UnsafeNativeMethods . IOleWindow . GetWindow ( out IntPtr hwnd )
2930+ unsafe HRESULT Ole32 . IOleWindow . GetWindow ( IntPtr * phwnd )
29272931 {
2928- return publicIOleWindow . GetWindow ( out hwnd ) ;
2932+ return publicIOleWindow . GetWindow ( phwnd ) ;
29292933 }
29302934
2931- void UnsafeNativeMethods . IOleWindow . ContextSensitiveHelp ( int fEnterMode )
2935+ HRESULT Ole32 . IOleWindow . ContextSensitiveHelp ( BOOL fEnterMode )
29322936 {
2933- publicIOleWindow . ContextSensitiveHelp ( fEnterMode ) ;
2937+ return publicIOleWindow . ContextSensitiveHelp ( fEnterMode ) ;
29342938 }
29352939
29362940 MethodInfo IReflect . GetMethod ( string name , BindingFlags bindingAttr , Binder binder , Type [ ] types , ParameterModifier [ ] modifiers )
0 commit comments