1 Star 0 Fork 0

简约/govcl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
advapi32dll.go 912 Bytes
一键复制 编辑 原始数据 按行查看 历史
// +build windows
package win
import (
"syscall"
"unsafe"
)
var (
// advapi32.dll
advapi32dll = syscall.NewLazyDLL("advapi32.dll")
_OpenProcessToken = advapi32dll.NewProc("OpenProcessToken")
_GetTokenInformation = advapi32dll.NewProc("GetTokenInformation")
)
// OpenProcessToken
func OpenProcessToken(ProcessHandle uintptr, DesiredAccess uint32, TokenHandle *uintptr) bool {
r, _, _ := _OpenProcessToken.Call(ProcessHandle, uintptr(DesiredAccess), uintptr(unsafe.Pointer(TokenHandle)))
return r != 0
}
// GetTokenInformation
func GetTokenInformation(TokenHandle uintptr, TokenInformationClass TTokenInformationClass, TokenInformation uintptr, TokenInformationLength uint32,
ReturnLength *uint32) bool {
r, _, _ := _GetTokenInformation.Call(TokenHandle, uintptr(TokenInformationClass), TokenInformation, uintptr(TokenInformationLength), uintptr(unsafe.Pointer(ReturnLength)))
return r != 0
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/jianyue/govcl.git
git@gitee.com:jianyue/govcl.git
jianyue
govcl
govcl
v1.2.5

搜索帮助