-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBNProgressFunction.cs
More file actions
48 lines (40 loc) · 978 Bytes
/
BNProgressFunction.cs
File metadata and controls
48 lines (40 loc) · 978 Bytes
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
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
namespace BinaryNinja
{
public delegate bool ProgressDelegate(
// uint64_t param2
ulong param2 ,
// uint64_t param3
ulong param3
);
internal static partial class NativeDelegates
{
/// <summary>
///
/// typedef bool (*BNProgressFunction)(void* param1, uint64_t param2, uint64_t param3)
/// </summary>
[UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)]
internal delegate bool BNProgressFunction(
// void* param1
IntPtr param1 ,
// uint64_t param2
ulong param2 ,
// uint64_t param3
ulong param3
);
}
internal static partial class UnsafeUtils
{
internal static NativeDelegates.BNProgressFunction WrapProgressDelegate(
ProgressDelegate callback)
{
return bool (param1 , param2 , param3) =>
{
return callback(param2 , param3);
};
}
}
}