-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #11 Clean up. Stop deleting and recreated events, simply reset them in IO loop.
- Loading branch information
1 parent
bc858df
commit 6da16c5
Showing
8 changed files
with
156 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
|
||
namespace CitadelCore.Windows.WinAPI | ||
{ | ||
internal static class Iphlpapi | ||
{ | ||
[DllImport("Iphlpapi.dll", EntryPoint = "GetTcp6Table2")] | ||
public static extern int GetTcp6Table2(IntPtr TcpTable, ref int SizePointer, [MarshalAs(UnmanagedType.Bool)] bool Order); | ||
|
||
[DllImport("Iphlpapi.dll", EntryPoint = "GetTcpTable2")] | ||
public static extern int GetTcpTable2(IntPtr TcpTable, ref int SizePointer, [MarshalAs(UnmanagedType.Bool)] bool Order); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
|
||
namespace CitadelCore.Windows.WinAPI | ||
{ | ||
internal static class Kernel32 | ||
{ | ||
[Flags] | ||
public enum ProcessAccessFlags : uint | ||
{ | ||
All = 0x001F0FFF, | ||
Terminate = 0x00000001, | ||
CreateThread = 0x00000002, | ||
VirtualMemoryOperation = 0x00000008, | ||
VirtualMemoryRead = 0x00000010, | ||
VirtualMemoryWrite = 0x00000020, | ||
DuplicateHandle = 0x00000040, | ||
CreateProcess = 0x000000080, | ||
SetQuota = 0x00000100, | ||
SetInformation = 0x00000200, | ||
QueryInformation = 0x00000400, | ||
QueryLimitedInformation = 0x00001000, | ||
Synchronize = 0x00100000 | ||
} | ||
|
||
[DllImport("kernel32.dll", EntryPoint = "OpenProcess")] | ||
public static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId); | ||
|
||
[DllImport("kernel32.dll", EntryPoint = "QueryFullProcessImageName", CharSet = CharSet.Auto)] | ||
[return: MarshalAs(UnmanagedType.Bool)] | ||
public static extern bool QueryFullProcessImageName(System.IntPtr hProcess, uint dwFlags, StringBuilder lpExeName, ref int lpdwSize); | ||
|
||
[DllImport("kernel32.dll", EntryPoint = "CloseHandle")] | ||
[return: MarshalAs(UnmanagedType.Bool)] | ||
public static extern bool CloseHandle(IntPtr hObject); | ||
|
||
[DllImport("kernel32.dll", EntryPoint = "ResetEvent")] | ||
[return: MarshalAs(UnmanagedType.Bool)] | ||
public static extern bool ResetEvent(IntPtr hObject); | ||
|
||
[DllImport("kernel32.dll", SetLastError = true)] | ||
public static extern IntPtr CreateIoCompletionPort(IntPtr fileHandle, IntPtr existingCompletionPort, UIntPtr completionKey, uint numberOfConcurrentThreads); | ||
|
||
[DllImport("kernel32.dll", SetLastError = true)] | ||
public static extern IntPtr CreateIoCompletionPort(IntPtr fileHandle, IntPtr existingCompletionPort, ref uint completionKey, uint numberOfConcurrentThreads); | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern bool GetQueuedCompletionStatus(IntPtr completionPort, out uint lpNumberOfBytes, out UIntPtr lpCompletionKey, out IntPtr lpOverlapped, uint dwMilliseconds); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.