MCPcopy Create free account
hub / github.com/codeyourweb/irma / CreateMutex

Function CreateMutex

w32.go:150–162  ·  view source on GitHub ↗

CreateMutex is a wrapper for CreateMutexW WIN32 API function https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createmutexw

(name string)

Source from the content-addressed store, hash-verified

148// CreateMutex is a wrapper for CreateMutexW WIN32 API function
149// https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createmutexw
150func CreateMutex(name string) (uintptr, error) {
151 ret, _, err := procCreateMutex.Call(
152 0,
153 0,
154 uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(name))),
155 )
156 switch int(err.(syscall.Errno)) {
157 case 0:
158 return ret, nil
159 default:
160 return ret, err
161 }
162}
163
164// VirtualProtect is a wrapper for the same WIN32 API function
165// https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualprotect

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected