Win32 API 日本語リファレンス
ホームSystem.Threading › ReleaseSRWLockExclusive

ReleaseSRWLockExclusive

関数
SRWロックの排他的所有権を解放する。
DLLKERNEL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// KERNEL32.dll
#include <windows.h>

void ReleaseSRWLockExclusive(
    SRWLOCK* SRWLock
);

パラメーター

名前方向
SRWLockSRWLOCK*inout

戻り値の型: void

各言語での呼び出し定義

// KERNEL32.dll
#include <windows.h>

void ReleaseSRWLockExclusive(
    SRWLOCK* SRWLock
);
[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern void ReleaseSRWLockExclusive(
    IntPtr SRWLock   // SRWLOCK* in/out
);
<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Sub ReleaseSRWLockExclusive(
    SRWLock As IntPtr   ' SRWLOCK* in/out
)
End Sub
' SRWLock : SRWLOCK* in/out
Declare PtrSafe Sub ReleaseSRWLockExclusive Lib "kernel32" ( _
    ByVal SRWLock As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ReleaseSRWLockExclusive = ctypes.windll.kernel32.ReleaseSRWLockExclusive
ReleaseSRWLockExclusive.restype = None
ReleaseSRWLockExclusive.argtypes = [
    ctypes.c_void_p,  # SRWLock : SRWLOCK* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('KERNEL32.dll')
ReleaseSRWLockExclusive = Fiddle::Function.new(
  lib['ReleaseSRWLockExclusive'],
  [
    Fiddle::TYPE_VOIDP,  # SRWLock : SRWLOCK* in/out
  ],
  Fiddle::TYPE_VOID)
#[link(name = "kernel32")]
extern "system" {
    fn ReleaseSRWLockExclusive(
        SRWLock: *mut SRWLOCK  // SRWLOCK* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("KERNEL32.dll")]
public static extern void ReleaseSRWLockExclusive(IntPtr SRWLock);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_ReleaseSRWLockExclusive' -Namespace Win32 -PassThru
# $api::ReleaseSRWLockExclusive(SRWLock)
#uselib "KERNEL32.dll"
#func global ReleaseSRWLockExclusive "ReleaseSRWLockExclusive" sptr
; ReleaseSRWLockExclusive varptr(SRWLock)
; SRWLock : SRWLOCK* in/out -> "sptr"
出力引数:
#uselib "KERNEL32.dll"
#func global ReleaseSRWLockExclusive "ReleaseSRWLockExclusive" var
; ReleaseSRWLockExclusive SRWLock
; SRWLock : SRWLOCK* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void ReleaseSRWLockExclusive(SRWLOCK* SRWLock)
#uselib "KERNEL32.dll"
#func global ReleaseSRWLockExclusive "ReleaseSRWLockExclusive" var
; ReleaseSRWLockExclusive SRWLock
; SRWLock : SRWLOCK* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procReleaseSRWLockExclusive = kernel32.NewProc("ReleaseSRWLockExclusive")
)

// SRWLock (SRWLOCK* in/out)
r1, _, err := procReleaseSRWLockExclusive.Call(
	uintptr(SRWLock),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure ReleaseSRWLockExclusive(
  SRWLock: Pointer   // SRWLOCK* in/out
); stdcall;
  external 'KERNEL32.dll' name 'ReleaseSRWLockExclusive';
result := DllCall("KERNEL32\ReleaseSRWLockExclusive"
    , "Ptr", SRWLock   ; SRWLOCK* in/out
    , "Int")   ; return: void
●ReleaseSRWLockExclusive(SRWLock) = DLL("KERNEL32.dll", "int ReleaseSRWLockExclusive(void*)")
# 呼び出し: ReleaseSRWLockExclusive(SRWLock)
# SRWLock : SRWLOCK* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。