Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit f392462

Browse files
authored
Wrap native handles with SafeHandle (#28)
1 parent 24c79fa commit f392462

5 files changed

Lines changed: 145 additions & 134 deletions

File tree

src/VmmSharpEx/Internal/Lci.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@ internal static partial class Lci
3737

3838
[LibraryImport("leechcore.dll", EntryPoint = "LcRead")]
3939
[return: MarshalAs(UnmanagedType.Bool)]
40-
public static unsafe partial bool LcRead(IntPtr hLC, ulong pa, uint cb, void* pb);
40+
public static unsafe partial bool LcRead(LeechCore.Handle hLC, ulong pa, uint cb, void* pb);
4141

4242
[LibraryImport("leechcore.dll", EntryPoint = "LcReadScatter")]
43-
public static unsafe partial void LcReadScatter(IntPtr hLC, uint cMEMs, IntPtr ppMEMs);
43+
public static unsafe partial void LcReadScatter(LeechCore.Handle hLC, uint cMEMs, IntPtr ppMEMs);
4444

4545
[LibraryImport("leechcore.dll", EntryPoint = "LcWrite")]
4646
[return: MarshalAs(UnmanagedType.Bool)]
47-
public static unsafe partial bool LcWrite(IntPtr hLC, ulong pa, uint cb, void* pb);
47+
public static unsafe partial bool LcWrite(LeechCore.Handle hLC, ulong pa, uint cb, void* pb);
4848

4949
[LibraryImport("leechcore.dll", EntryPoint = "LcGetOption")]
5050
[return: MarshalAs(UnmanagedType.Bool)]
51-
public static partial bool GetOption(IntPtr hLC, LcOption fOption, out ulong pqwValue);
51+
public static partial bool GetOption(LeechCore.Handle hLC, LcOption fOption, out ulong pqwValue);
5252

5353
[LibraryImport("leechcore.dll", EntryPoint = "LcSetOption")]
5454
[return: MarshalAs(UnmanagedType.Bool)]
55-
public static partial bool SetOption(IntPtr hLC, LcOption fOption, ulong qwValue);
55+
public static partial bool SetOption(LeechCore.Handle hLC, LcOption fOption, ulong qwValue);
5656

5757
[LibraryImport("leechcore.dll", EntryPoint = "LcCommand")]
5858
[return: MarshalAs(UnmanagedType.Bool)]
59-
public static unsafe partial bool LcCommand(IntPtr hLC, LcCmd fOption, uint cbDataIn, void* pbDataIn, out IntPtr ppbDataOut, out uint pcbDataOut);
59+
public static unsafe partial bool LcCommand(LeechCore.Handle hLC, LcCmd fOption, uint cbDataIn, void* pbDataIn, out IntPtr ppbDataOut, out uint pcbDataOut);
6060

6161
[StructLayout(LayoutKind.Sequential)]
6262
public struct LC_CONFIG_ERRORINFO

0 commit comments

Comments
 (0)