本文整理汇总了Golang中syscall.Syscall12函数的典型用法代码示例。如果您正苦于以下问题:Golang Syscall12函数的具体用法?Golang Syscall12怎么用?Golang Syscall12使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Syscall12函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: AllocateAndInitializeSid
func AllocateAndInitializeSid(identifierAuthority *SID_IDENTIFIER_AUTHORITY, subAuthorityCount byte, subAuthority0 uint32, subAuthority1 uint32, subAuthority2 uint32, subAuthority3 uint32, subAuthority4 uint32, subAuthority5 uint32, subAuthority6 uint32, subAuthority7 uint32, sid **SID) error {
r1, _, e1 := syscall.Syscall12(
procAllocateAndInitializeSid.Addr(),
11,
uintptr(unsafe.Pointer(identifierAuthority)),
uintptr(subAuthorityCount),
uintptr(subAuthority0),
uintptr(subAuthority1),
uintptr(subAuthority2),
uintptr(subAuthority3),
uintptr(subAuthority4),
uintptr(subAuthority5),
uintptr(subAuthority6),
uintptr(subAuthority7),
uintptr(unsafe.Pointer(sid)),
0)
if r1 == 0 {
if e1 != ERROR_SUCCESS {
return e1
} else {
return syscall.EINVAL
}
}
return nil
}
示例2: CreateProcess
func CreateProcess(applicationName *uint16, commandLine *uint16, processAttributes *SECURITY_ATTRIBUTES, threadAttributes *SECURITY_ATTRIBUTES, inheritHandles bool, creationFlags uint32, environment *byte, currentDirectory *uint16, startupInfo *STARTUPINFO, processInformation *PROCESS_INFORMATION) error {
var inheritHandlesRaw int32
if inheritHandles {
inheritHandlesRaw = 1
} else {
inheritHandlesRaw = 0
}
r1, _, e1 := syscall.Syscall12(
procCreateProcessW.Addr(),
10,
uintptr(unsafe.Pointer(applicationName)),
uintptr(unsafe.Pointer(commandLine)),
uintptr(unsafe.Pointer(processAttributes)),
uintptr(unsafe.Pointer(threadAttributes)),
uintptr(inheritHandlesRaw),
uintptr(creationFlags),
uintptr(unsafe.Pointer(environment)),
uintptr(unsafe.Pointer(currentDirectory)),
uintptr(unsafe.Pointer(startupInfo)),
uintptr(unsafe.Pointer(processInformation)),
0,
0)
if r1 == 0 {
if e1 != ERROR_SUCCESS {
return e1
} else {
return syscall.EINVAL
}
}
return nil
}
示例3: ChangeServiceConfig
func ChangeServiceConfig(service syscall.Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) error {
r1, _, e1 := syscall.Syscall12(
procChangeServiceConfigW.Addr(),
11,
uintptr(service),
uintptr(serviceType),
uintptr(startType),
uintptr(errorControl),
uintptr(unsafe.Pointer(binaryPathName)),
uintptr(unsafe.Pointer(loadOrderGroup)),
uintptr(unsafe.Pointer(tagId)),
uintptr(unsafe.Pointer(dependencies)),
uintptr(unsafe.Pointer(serviceStartName)),
uintptr(unsafe.Pointer(password)),
uintptr(unsafe.Pointer(displayName)),
0)
if r1 == 0 {
if e1 != ERROR_SUCCESS {
return e1
} else {
return syscall.EINVAL
}
}
return nil
}
示例4: _AlphaBlend
func _AlphaBlend(dcdest syscall.Handle, xoriginDest int32, yoriginDest int32, wDest int32, hDest int32, dcsrc syscall.Handle, xoriginSrc int32, yoriginSrc int32, wsrc int32, hsrc int32, ftn uintptr) (err error) {
r1, _, e1 := syscall.Syscall12(procAlphaBlend.Addr(), 11, uintptr(dcdest), uintptr(xoriginDest), uintptr(yoriginDest), uintptr(wDest), uintptr(hDest), uintptr(dcsrc), uintptr(xoriginSrc), uintptr(yoriginSrc), uintptr(wsrc), uintptr(hsrc), uintptr(ftn), 0)
if r1 == 0 {
if e1 != 0 {
err = error(e1)
} else {
err = syscall.EINVAL
}
}
return
}
示例5: enumServicesStatus
func enumServicesStatus(h windows.Handle, InfoLevel SC_ENUM_TYPE, dwServiceType uint32, dwServiceState uint32, lpServices uintptr, cbBufSize uint32, pcbBytesNeeded *uint32, lpServicesReturned *uint32, lpResumeHandle *uint32, pszGroupName *uint32) (err error) {
r1, _, e1 := syscall.Syscall12(procEnumServicesStatusExW.Addr(), 10, uintptr(h), uintptr(InfoLevel), uintptr(dwServiceType), uintptr(dwServiceState), uintptr(lpServices), uintptr(cbBufSize), uintptr(unsafe.Pointer(pcbBytesNeeded)), uintptr(unsafe.Pointer(lpServicesReturned)), uintptr(unsafe.Pointer(lpResumeHandle)), uintptr(unsafe.Pointer(pszGroupName)), 0, 0)
if r1 == 0 {
if e1 != 0 {
err = error(e1)
} else {
err = syscall.EINVAL
}
}
return
}
示例6: gdiAlphaBlend
func gdiAlphaBlend(hdcDest Handle, xoriginDest int32, yoriginDest int32, wDest int32, hDest int32, hdcSrc Handle, xoriginSrc int32, yoriginSrc int32, wSrc int32, hSrc int32, ftn uint32) (err error) {
r1, _, e1 := syscall.Syscall12(procGdiAplhaBlend.Addr(), 11, uintptr(hdcDest), uintptr(xoriginDest), uintptr(yoriginDest), uintptr(wDest), uintptr(hDest), uintptr(hdcSrc), uintptr(xoriginSrc), uintptr(yoriginSrc), uintptr(wSrc), uintptr(hSrc), uintptr(ftn), 0)
if r1 == 0 {
if e1 != 0 {
err = error(e1)
} else {
err = syscall.EINVAL
}
}
return
}
示例7: AllocateAndInitializeSid
func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **syscall.SID) (err error) {
r1, _, e1 := syscall.Syscall12(procAllocateAndInitializeSid.Addr(), 11, uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid)), 0)
if r1 == 0 {
if e1 != 0 {
err = error(e1)
} else {
err = syscall.EINVAL
}
}
return
}
示例8: Call
func Call(proc uintptr, args ...uintptr) (r1, r2 uintptr, lastErr error) {
addr := proc
switch len(args) {
case 0:
return syscall.Syscall(addr, uintptr(len(args)), 0, 0, 0)
case 1:
return syscall.Syscall(addr, uintptr(len(args)), args[0], 0, 0)
case 2:
return syscall.Syscall(addr, uintptr(len(args)), args[0], args[1], 0)
case 3:
return syscall.Syscall(addr, uintptr(len(args)), args[0], args[1], args[2])
case 4:
return syscall.Syscall6(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], 0, 0)
case 5:
return syscall.Syscall6(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], 0)
case 6:
return syscall.Syscall6(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5])
case 7:
return syscall.Syscall9(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5], args[6], 0, 0)
case 8:
return syscall.Syscall9(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], 0)
case 9:
return syscall.Syscall9(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8])
case 10:
return syscall.Syscall12(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], 0, 0)
case 11:
return syscall.Syscall12(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], 0)
case 12:
return syscall.Syscall12(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11])
case 13:
return syscall.Syscall15(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], 0, 0)
case 14:
return syscall.Syscall15(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], 0)
case 15:
return syscall.Syscall15(addr, uintptr(len(args)), args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14])
default:
panic(fmt.Sprintf("Call \"%d\" with too many arguments @ %d.", proc, len(args)))
}
return
}
示例9: CreateWindowEx
func CreateWindowEx(exstyle uint32, classname *uint16, windowname *uint16, style uint32, x int32, y int32, width int32, height int32, wndparent uint32, menu uint32, instance uint32, param uintptr) (hwnd uint32, err syscall.Errno) {
r0, _, e1 := syscall.Syscall12(procCreateWindowExW.Addr(), 12, uintptr(exstyle), uintptr(unsafe.Pointer(classname)), uintptr(unsafe.Pointer(windowname)), uintptr(style), uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(wndparent), uintptr(menu), uintptr(instance), uintptr(param))
hwnd = uint32(r0)
if hwnd == 0 {
if e1 != 0 {
err = syscall.Errno(e1)
} else {
err = syscall.EINVAL
}
}
return
}
示例10: _CreateWindowEx
func _CreateWindowEx(exstyle uint32, className *uint16, windowText *uint16, style uint32, x int32, y int32, width int32, height int32, parent syscall.Handle, menu syscall.Handle, hInstance syscall.Handle, lpParam uintptr) (hwnd syscall.Handle, err error) {
r0, _, e1 := syscall.Syscall12(procCreateWindowExW.Addr(), 12, uintptr(exstyle), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(windowText)), uintptr(style), uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(parent), uintptr(menu), uintptr(hInstance), uintptr(lpParam))
hwnd = syscall.Handle(r0)
if hwnd == 0 {
if e1 != 0 {
err = error(e1)
} else {
err = syscall.EINVAL
}
}
return
}
示例11: CreateWindowEx
func CreateWindowEx(exStyle uint32, className *uint16, windowName *uint16, style uint32, x int, y int, width int, height int, wndParent Handle, menu Handle, instance Handle, param uintptr) (hwnd Handle, err error) {
r0, _, e1 := syscall.Syscall12(procCreateWindowExW.Addr(), 12, uintptr(exStyle), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(windowName)), uintptr(style), uintptr(x), uintptr(y), uintptr(width), uintptr(height), uintptr(wndParent), uintptr(menu), uintptr(instance), uintptr(param))
hwnd = Handle(r0)
if hwnd == 0 {
if e1 != 0 {
err = error(e1)
} else {
err = syscall.EINVAL
}
}
return
}
示例12: Call
// Call executes procedure p with arguments a. It will panic, if more then 15 arguments
// are supplied.
//
// The returned error is always non-nil, constructed from the result of GetLastError.
// Callers must inspect the primary return value to decide whether an error occurred
// (according to the semantics of the specific function being called) before consulting
// the error. The error will be guaranteed to contain windows.Errno.
func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) {
switch len(a) {
case 0:
return syscall.Syscall(p.Addr(), uintptr(len(a)), 0, 0, 0)
case 1:
return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], 0, 0)
case 2:
return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], 0)
case 3:
return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], a[2])
case 4:
return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], 0, 0)
case 5:
return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], 0)
case 6:
return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5])
case 7:
return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], 0, 0)
case 8:
return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], 0)
case 9:
return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8])
case 10:
return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], 0, 0)
case 11:
return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], 0)
case 12:
return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11])
case 13:
return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], 0, 0)
case 14:
return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], 0)
case 15:
return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14])
default:
panic("Call " + p.Name + " with too many arguments " + itoa(len(a)) + ".")
}
return
}
示例13: NextBytes
func (auth *SSPIAuth) NextBytes(bytes []byte) ([]byte, error) {
var in_buf, out_buf SecBuffer
var in_desc, out_desc SecBufferDesc
in_desc.ulVersion = SECBUFFER_VERSION
in_desc.cBuffers = 1
in_desc.pBuffers = &in_buf
out_desc.ulVersion = SECBUFFER_VERSION
out_desc.cBuffers = 1
out_desc.pBuffers = &out_buf
in_buf.BufferType = SECBUFFER_TOKEN
in_buf.pvBuffer = &bytes[0]
in_buf.cbBuffer = uint32(len(bytes))
outbuf := make([]byte, NTLMBUF_LEN)
out_buf.BufferType = SECBUFFER_TOKEN
out_buf.pvBuffer = &outbuf[0]
out_buf.cbBuffer = NTLMBUF_LEN
var attrs uint32
var ts TimeStamp
sec_ok, _, _ := syscall.Syscall12(sec_fn.InitializeSecurityContext,
12,
uintptr(unsafe.Pointer(&auth.cred)),
uintptr(unsafe.Pointer(&auth.ctxt)),
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(auth.Service))),
ISC_REQ,
0,
SECURITY_NETWORK_DREP,
uintptr(unsafe.Pointer(&in_desc)),
0,
uintptr(unsafe.Pointer(&auth.ctxt)),
uintptr(unsafe.Pointer(&out_desc)),
uintptr(unsafe.Pointer(&attrs)),
uintptr(unsafe.Pointer(&ts)))
if sec_ok == SEC_I_COMPLETE_AND_CONTINUE ||
sec_ok == SEC_I_COMPLETE_NEEDED {
syscall.Syscall6(sec_fn.CompleteAuthToken,
2,
uintptr(unsafe.Pointer(&auth.ctxt)),
uintptr(unsafe.Pointer(&out_desc)),
0, 0, 0, 0)
} else if sec_ok != SEC_E_OK &&
sec_ok != SEC_I_CONTINUE_NEEDED {
return nil, fmt.Errorf("NextBytes InitializeSecurityContext failed %x", sec_ok)
}
return outbuf[:out_buf.cbBuffer], nil
}
示例14: Call
func (p comProc) Call(a ...uintptr) (r1, r2 uintptr, lastErr syscall.Errno) {
switch len(a) {
case 0:
return syscall.Syscall(uintptr(p), uintptr(len(a)), 0, 0, 0)
case 1:
return syscall.Syscall(uintptr(p), uintptr(len(a)), a[0], 0, 0)
case 2:
return syscall.Syscall(uintptr(p), uintptr(len(a)), a[0], a[1], 0)
case 3:
return syscall.Syscall(uintptr(p), uintptr(len(a)), a[0], a[1], a[2])
case 4:
return syscall.Syscall6(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], 0, 0)
case 5:
return syscall.Syscall6(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], 0)
case 6:
return syscall.Syscall6(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5])
case 7:
return syscall.Syscall9(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], 0, 0)
case 8:
return syscall.Syscall9(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], 0)
case 9:
return syscall.Syscall9(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8])
case 10:
return syscall.Syscall12(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], 0, 0)
case 11:
return syscall.Syscall12(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], 0)
case 12:
return syscall.Syscall12(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11])
case 13:
return syscall.Syscall15(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], 0, 0)
case 14:
return syscall.Syscall15(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], 0)
case 15:
return syscall.Syscall15(uintptr(p), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14])
}
panic("too many arguments")
}
示例15: CallProc
//为调用DLL中的方法提供一个统一的接口
func CallProc(handle uintptr, args ...uintptr) (r1, r2 uintptr, err syscall.Errno) {
l := uintptr(len(args))
switch {
case l <= 3:
tmp := make([]uintptr, 3)
for i, v := range args {
tmp[i] = v
}
return syscall.Syscall(handle, l, tmp[0], tmp[1], tmp[2])
case l <= 6:
tmp := make([]uintptr, 6)
for i, v := range args {
tmp[i] = v
}
return syscall.Syscall6(handle, l, tmp[0], tmp[1], tmp[2],
tmp[3], tmp[4], tmp[5])
case l <= 9:
tmp := make([]uintptr, 9)
for i, v := range args {
tmp[i] = v
}
return syscall.Syscall9(handle, l, tmp[0], tmp[1], tmp[2],
tmp[3], tmp[4], tmp[5], tmp[6],
tmp[7], tmp[8])
case l <= 12:
tmp := make([]uintptr, 12)
for i, v := range args {
tmp[i] = v
}
return syscall.Syscall12(handle, l, tmp[0], tmp[1], tmp[2],
tmp[3], tmp[4], tmp[5], tmp[6],
tmp[7], tmp[8], tmp[9],
tmp[10], tmp[11])
case l <= 15:
tmp := make([]uintptr, 15)
for i, v := range args {
tmp[i] = v
}
return syscall.Syscall15(handle, l, tmp[0], tmp[1], tmp[2],
tmp[3], tmp[4], tmp[5], tmp[6],
tmp[7], tmp[8], tmp[9],
tmp[10], tmp[11], tmp[12],
tmp[13], tmp[14])
default:
return uintptr(0), uintptr(0), syscall.E2BIG
}
}