mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 19:22:22 +01:00
Stuff
This commit is contained in:
@@ -34,10 +34,11 @@ final class _MIB_TCPTABLE_OWNER_PID extends Struct {
|
||||
@Uint32()
|
||||
external int dwNumEntries;
|
||||
|
||||
@Array(1)
|
||||
@Array(512)
|
||||
external Array<_MIB_TCPROW_OWNER_PID> table;
|
||||
}
|
||||
|
||||
|
||||
bool isLocalHost(String host) => host.trim() == "127.0.0.1"
|
||||
|| host.trim().toLowerCase() == "localhost"
|
||||
|| host.trim() == "0.0.0.0";
|
||||
@@ -46,7 +47,6 @@ bool killProcessByPort(int port) {
|
||||
var pTcpTable = calloc<_MIB_TCPTABLE_OWNER_PID>();
|
||||
final dwSize = calloc<DWORD>();
|
||||
dwSize.value = 0;
|
||||
|
||||
int result = _getExtendedTcpTable(
|
||||
nullptr,
|
||||
dwSize,
|
||||
@@ -56,6 +56,7 @@ bool killProcessByPort(int port) {
|
||||
0
|
||||
);
|
||||
if (result == ERROR_INSUFFICIENT_BUFFER) {
|
||||
free(pTcpTable);
|
||||
pTcpTable = calloc<_MIB_TCPTABLE_OWNER_PID>(dwSize.value);
|
||||
result = _getExtendedTcpTable(
|
||||
pTcpTable,
|
||||
|
||||
Reference in New Issue
Block a user