ホーム › Security.Credentials › SCardBeginTransaction
SCardBeginTransaction
関数スマートカードへのトランザクションを開始する。
シグネチャ
// WinSCard.dll
#include <windows.h>
INT SCardBeginTransaction(
UINT_PTR hCard
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hCard | UINT_PTR | in |
戻り値の型: INT
各言語での呼び出し定義
// WinSCard.dll
#include <windows.h>
INT SCardBeginTransaction(
UINT_PTR hCard
);[DllImport("WinSCard.dll", ExactSpelling = true)]
static extern int SCardBeginTransaction(
UIntPtr hCard // UINT_PTR
);<DllImport("WinSCard.dll", ExactSpelling:=True)>
Public Shared Function SCardBeginTransaction(
hCard As UIntPtr ' UINT_PTR
) As Integer
End Function' hCard : UINT_PTR
Declare PtrSafe Function SCardBeginTransaction Lib "winscard" ( _
ByVal hCard As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SCardBeginTransaction = ctypes.windll.winscard.SCardBeginTransaction
SCardBeginTransaction.restype = ctypes.c_int
SCardBeginTransaction.argtypes = [
ctypes.c_size_t, # hCard : UINT_PTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WinSCard.dll')
SCardBeginTransaction = Fiddle::Function.new(
lib['SCardBeginTransaction'],
[
Fiddle::TYPE_UINTPTR_T, # hCard : UINT_PTR
],
Fiddle::TYPE_INT)#[link(name = "winscard")]
extern "system" {
fn SCardBeginTransaction(
hCard: usize // UINT_PTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WinSCard.dll")]
public static extern int SCardBeginTransaction(UIntPtr hCard);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WinSCard_SCardBeginTransaction' -Namespace Win32 -PassThru
# $api::SCardBeginTransaction(hCard)#uselib "WinSCard.dll"
#func global SCardBeginTransaction "SCardBeginTransaction" sptr
; SCardBeginTransaction hCard ; 戻り値は stat
; hCard : UINT_PTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WinSCard.dll"
#cfunc global SCardBeginTransaction "SCardBeginTransaction" sptr
; res = SCardBeginTransaction(hCard)
; hCard : UINT_PTR -> "sptr"; INT SCardBeginTransaction(UINT_PTR hCard)
#uselib "WinSCard.dll"
#cfunc global SCardBeginTransaction "SCardBeginTransaction" intptr
; res = SCardBeginTransaction(hCard)
; hCard : UINT_PTR -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winscard = windows.NewLazySystemDLL("WinSCard.dll")
procSCardBeginTransaction = winscard.NewProc("SCardBeginTransaction")
)
// hCard (UINT_PTR)
r1, _, err := procSCardBeginTransaction.Call(
uintptr(hCard),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction SCardBeginTransaction(
hCard: NativeUInt // UINT_PTR
): Integer; stdcall;
external 'WinSCard.dll' name 'SCardBeginTransaction';result := DllCall("WinSCard\SCardBeginTransaction"
, "UPtr", hCard ; UINT_PTR
, "Int") ; return: INT●SCardBeginTransaction(hCard) = DLL("WinSCard.dll", "int SCardBeginTransaction(int)")
# 呼び出し: SCardBeginTransaction(hCard)
# hCard : UINT_PTR -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。