Skip to content

Commit d9a43ee

Browse files
committed
Fixed QueryInterfaceOrNull.
1 parent 6b070f1 commit d9a43ee

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

ComObject.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ public static bool EqualsComObject<T>(T left, T right) where T : ComObject
9999
public virtual T QueryInterface<T>() where T : ComObject
100100
{
101101
IntPtr parentPtr;
102-
this.QueryInterface(typeof(T).GetTypeInfo().GUID, out parentPtr);
102+
var result = this.QueryInterface(typeof(T).GetTypeInfo().GUID, out parentPtr);
103+
result.CheckError();
103104
return FromPointer<T>(parentPtr);
104105
}
105106

Mapping.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<assembly>SharpGen.Runtime.COM</assembly>
2626

2727

28-
<sdk name="WindowsSdk" version="10.0.15063.0" />
28+
<sdk name="WindowsSdk" version="10.0.16299.0" />
2929
<sdk name="StdLib" />
3030

3131
<include-prolog>
@@ -161,6 +161,7 @@
161161
<context>Unknwnbase</context>
162162
<map interface="IUnknown" callback="true" callback-dual="true" callback-name="ComObject" callback-visibility="public" />
163163
<map method="IUnknown::.*" keep-implement-public="true" />
164+
<map method="IUnknown::QueryInterface" check="false" />
164165
<context-clear/>
165166

166167
<!-- Map IStream -->

NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
</packageSources>
6+
</configuration>

0 commit comments

Comments
 (0)