Win32 API 日本語リファレンス
ホームDevices.AllJoyn › alljoyn_busattachment_getkeyexpiration

alljoyn_busattachment_getkeyexpiration

関数
指定GUIDのピアの鍵有効期限を取得する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

QStatus alljoyn_busattachment_getkeyexpiration(
    alljoyn_busattachment bus,
    LPCSTR guid,
    DWORD* timeout
);

パラメーター

名前方向
busalljoyn_busattachmentin
guidLPCSTRin
timeoutDWORD*inout

戻り値の型: QStatus

各言語での呼び出し定義

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

QStatus alljoyn_busattachment_getkeyexpiration(
    alljoyn_busattachment bus,
    LPCSTR guid,
    DWORD* timeout
);
[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern int alljoyn_busattachment_getkeyexpiration(
    IntPtr bus,   // alljoyn_busattachment
    [MarshalAs(UnmanagedType.LPStr)] string guid,   // LPCSTR
    ref uint timeout   // DWORD* in/out
);
<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_busattachment_getkeyexpiration(
    bus As IntPtr,   ' alljoyn_busattachment
    <MarshalAs(UnmanagedType.LPStr)> guid As String,   ' LPCSTR
    ByRef timeout As UInteger   ' DWORD* in/out
) As Integer
End Function
' bus : alljoyn_busattachment
' guid : LPCSTR
' timeout : DWORD* in/out
Declare PtrSafe Function alljoyn_busattachment_getkeyexpiration Lib "msajapi" ( _
    ByVal bus As LongPtr, _
    ByVal guid As String, _
    ByRef timeout As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

alljoyn_busattachment_getkeyexpiration = ctypes.windll.msajapi.alljoyn_busattachment_getkeyexpiration
alljoyn_busattachment_getkeyexpiration.restype = ctypes.c_int
alljoyn_busattachment_getkeyexpiration.argtypes = [
    ctypes.c_ssize_t,  # bus : alljoyn_busattachment
    wintypes.LPCSTR,  # guid : LPCSTR
    ctypes.POINTER(wintypes.DWORD),  # timeout : DWORD* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_busattachment_getkeyexpiration = Fiddle::Function.new(
  lib['alljoyn_busattachment_getkeyexpiration'],
  [
    Fiddle::TYPE_INTPTR_T,  # bus : alljoyn_busattachment
    Fiddle::TYPE_VOIDP,  # guid : LPCSTR
    Fiddle::TYPE_VOIDP,  # timeout : DWORD* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "msajapi")]
extern "system" {
    fn alljoyn_busattachment_getkeyexpiration(
        bus: isize,  // alljoyn_busattachment
        guid: *const u8,  // LPCSTR
        timeout: *mut u32  // DWORD* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSAJApi.dll")]
public static extern int alljoyn_busattachment_getkeyexpiration(IntPtr bus, [MarshalAs(UnmanagedType.LPStr)] string guid, ref uint timeout);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_busattachment_getkeyexpiration' -Namespace Win32 -PassThru
# $api::alljoyn_busattachment_getkeyexpiration(bus, guid, timeout)
#uselib "MSAJApi.dll"
#func global alljoyn_busattachment_getkeyexpiration "alljoyn_busattachment_getkeyexpiration" sptr, sptr, sptr
; alljoyn_busattachment_getkeyexpiration bus, guid, varptr(timeout)   ; 戻り値は stat
; bus : alljoyn_busattachment -> "sptr"
; guid : LPCSTR -> "sptr"
; timeout : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MSAJApi.dll"
#cfunc global alljoyn_busattachment_getkeyexpiration "alljoyn_busattachment_getkeyexpiration" sptr, str, var
; res = alljoyn_busattachment_getkeyexpiration(bus, guid, timeout)
; bus : alljoyn_busattachment -> "sptr"
; guid : LPCSTR -> "str"
; timeout : DWORD* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; QStatus alljoyn_busattachment_getkeyexpiration(alljoyn_busattachment bus, LPCSTR guid, DWORD* timeout)
#uselib "MSAJApi.dll"
#cfunc global alljoyn_busattachment_getkeyexpiration "alljoyn_busattachment_getkeyexpiration" intptr, str, var
; res = alljoyn_busattachment_getkeyexpiration(bus, guid, timeout)
; bus : alljoyn_busattachment -> "intptr"
; guid : LPCSTR -> "str"
; timeout : DWORD* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_busattachment_getkeyexpiration = msajapi.NewProc("alljoyn_busattachment_getkeyexpiration")
)

// bus (alljoyn_busattachment), guid (LPCSTR), timeout (DWORD* in/out)
r1, _, err := procalljoyn_busattachment_getkeyexpiration.Call(
	uintptr(bus),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(guid))),
	uintptr(timeout),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // QStatus
function alljoyn_busattachment_getkeyexpiration(
  bus: NativeInt;   // alljoyn_busattachment
  guid: PAnsiChar;   // LPCSTR
  timeout: Pointer   // DWORD* in/out
): Integer; stdcall;
  external 'MSAJApi.dll' name 'alljoyn_busattachment_getkeyexpiration';
result := DllCall("MSAJApi\alljoyn_busattachment_getkeyexpiration"
    , "Ptr", bus   ; alljoyn_busattachment
    , "AStr", guid   ; LPCSTR
    , "Ptr", timeout   ; DWORD* in/out
    , "Int")   ; return: QStatus
●alljoyn_busattachment_getkeyexpiration(bus, guid, timeout) = DLL("MSAJApi.dll", "int alljoyn_busattachment_getkeyexpiration(int, char*, void*)")
# 呼び出し: alljoyn_busattachment_getkeyexpiration(bus, guid, timeout)
# bus : alljoyn_busattachment -> "int"
# guid : LPCSTR -> "char*"
# timeout : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。