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

UlRelease

関数
COMオブジェクトの参照カウントを減らし解放する。
DLLMAPI32.dll呼出規約winapi

シグネチャ

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

DWORD UlRelease(
    void* lpunk
);

パラメーター

名前方向
lpunkvoid*inout

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD UlRelease(
    void* lpunk
);
[DllImport("MAPI32.dll", ExactSpelling = true)]
static extern uint UlRelease(
    IntPtr lpunk   // void* in/out
);
<DllImport("MAPI32.dll", ExactSpelling:=True)>
Public Shared Function UlRelease(
    lpunk As IntPtr   ' void* in/out
) As UInteger
End Function
' lpunk : void* in/out
Declare PtrSafe Function UlRelease Lib "mapi32" ( _
    ByVal lpunk As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

UlRelease = ctypes.windll.mapi32.UlRelease
UlRelease.restype = wintypes.DWORD
UlRelease.argtypes = [
    ctypes.POINTER(None),  # lpunk : void* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MAPI32.dll')
UlRelease = Fiddle::Function.new(
  lib['UlRelease'],
  [
    Fiddle::TYPE_VOIDP,  # lpunk : void* in/out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "mapi32")]
extern "system" {
    fn UlRelease(
        lpunk: *mut ()  // void* in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MAPI32.dll")]
public static extern uint UlRelease(IntPtr lpunk);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MAPI32_UlRelease' -Namespace Win32 -PassThru
# $api::UlRelease(lpunk)
#uselib "MAPI32.dll"
#func global UlRelease "UlRelease" sptr
; UlRelease lpunk   ; 戻り値は stat
; lpunk : void* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MAPI32.dll"
#cfunc global UlRelease "UlRelease" sptr
; res = UlRelease(lpunk)
; lpunk : void* in/out -> "sptr"
; DWORD UlRelease(void* lpunk)
#uselib "MAPI32.dll"
#cfunc global UlRelease "UlRelease" intptr
; res = UlRelease(lpunk)
; lpunk : void* in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mapi32 = windows.NewLazySystemDLL("MAPI32.dll")
	procUlRelease = mapi32.NewProc("UlRelease")
)

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