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

Tbsip_Context_Close

関数
TBSコンテキストを閉じてリソースを解放する。
DLLtbs.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD Tbsip_Context_Close(
    void* hContext
);

パラメーター

名前方向
hContextvoid*in

戻り値の型: DWORD

各言語での呼び出し定義

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

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

Tbsip_Context_Close = ctypes.windll.tbs.Tbsip_Context_Close
Tbsip_Context_Close.restype = wintypes.DWORD
Tbsip_Context_Close.argtypes = [
    ctypes.POINTER(None),  # hContext : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	tbs = windows.NewLazySystemDLL("tbs.dll")
	procTbsip_Context_Close = tbs.NewProc("Tbsip_Context_Close")
)

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