-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathNativeFunction.cs
More file actions
49 lines (42 loc) · 1.38 KB
/
Copy pathNativeFunction.cs
File metadata and controls
49 lines (42 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
namespace DllManipulator.Internal
{
internal struct NativeFunctionIdentity
{
public string symbol;
public string containingDllName;
public NativeFunctionIdentity(string symbol, string containingDllName)
{
this.symbol = symbol;
this.containingDllName = containingDllName;
}
public override bool Equals(object obj)
{
if (obj is NativeFunctionIdentity other)
{
return symbol == other.symbol && containingDllName == other.containingDllName;
}
return false;
}
public override int GetHashCode()
{
int h1 = symbol.GetHashCode();
int h2 = containingDllName.GetHashCode();
uint num = (uint)((h1 << 5) | (int)((uint)h1 >> 27));
return ((int)num + h1) ^ h2;
}
}
internal class NativeFunction
{
public readonly NativeFunctionIdentity identity;
public NativeDll containingDll;
public Delegate @delegate = null;
public Type delegateType = null;
public int index = -1;
public NativeFunction(NativeFunctionIdentity identity, NativeDll containingDll)
{
this.identity = identity;
this.containingDll = containingDll;
}
}
}