保存本机管理命令与关闭旧重置路由检查点

This commit is contained in:
xuans committed 2026-09-21 01:12:17 +08:00
1 parent 55c56b518f
commit 325928ee1f
18 files changed
+1242 -32

No files matched your search

@@ -130,3 +130,13 @@ func Dial(ctx context.Context, path string, expectedUID uint32) (net.Conn, error
}
return conn, nil
}
func AuthorizeCurrentProcess() error {
token, err := windows.OpenCurrentProcessToken()
if err != nil {
return ErrUnauthorized
}
defer token.Close()
_, err = tokenPeer(token)
return err
}