Use VisualStudioMock.exe (still not fully working)
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//#define LOG_CALLS
|
||||
#define LOG_CALLS
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -44,6 +44,8 @@ namespace VisualStudioMock
|
||||
this._realInstanceN = Marshal.GetIUnknownForObject(instance);
|
||||
this._proxyInstanceN = Marshal.AllocHGlobal(IntPtr.Size * 4);
|
||||
|
||||
this._getInterfaceN = Marshal.GetFunctionPointerForDelegate((Delegate)(this._getInterface = new GetInterfaceDelegate(GetInterface)));
|
||||
|
||||
IntPtr vtbl = _proxyInstanceN + IntPtr.Size;
|
||||
Marshal.WriteIntPtr(_proxyInstanceN, vtbl);
|
||||
Marshal.WriteIntPtr(vtbl, this._getInterfaceN = Marshal.GetFunctionPointerForDelegate((Delegate)(this._getInterface = new GetInterfaceDelegate(GetInterface))));
|
||||
@@ -120,12 +122,12 @@ namespace VisualStudioMock
|
||||
|
||||
private int AddRef(IntPtr @this)
|
||||
{
|
||||
return 1;
|
||||
return Marshal.AddRef(_realInstanceN);
|
||||
}
|
||||
|
||||
private int Release(IntPtr @this)
|
||||
{
|
||||
return 1;
|
||||
return Marshal.Release(_realInstanceN);
|
||||
}
|
||||
|
||||
private static IntPtr CreateThunk(IntPtr @this, IntPtr jmpTarget)
|
||||
|
||||
Reference in New Issue
Block a user