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