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

alljoyn_authlistener_requestcredentialsresponse

関数
資格情報要求コールバックに対し非同期で資格情報を応答する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

QStatus alljoyn_authlistener_requestcredentialsresponse(
    alljoyn_authlistener listener,
    void* authContext,
    INT accept,
    alljoyn_credentials credentials
);

パラメーター

名前方向説明
listeneralljoyn_authlistenerin応答を返す対象の認証リスナーハンドル。
authContextvoid*inout対応する認証要求を識別するコンテキストポインタ。
acceptINTin資格情報要求を受諾するか否か。非0で受諾、0で拒否。
credentialsalljoyn_credentialsin提供する資格情報を保持するハンドル。

戻り値の型: QStatus

各言語での呼び出し定義

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

QStatus alljoyn_authlistener_requestcredentialsresponse(
    alljoyn_authlistener listener,
    void* authContext,
    INT accept,
    alljoyn_credentials credentials
);
[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern int alljoyn_authlistener_requestcredentialsresponse(
    IntPtr listener,   // alljoyn_authlistener
    IntPtr authContext,   // void* in/out
    int accept,   // INT
    IntPtr credentials   // alljoyn_credentials
);
<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_authlistener_requestcredentialsresponse(
    listener As IntPtr,   ' alljoyn_authlistener
    authContext As IntPtr,   ' void* in/out
    accept As Integer,   ' INT
    credentials As IntPtr   ' alljoyn_credentials
) As Integer
End Function
' listener : alljoyn_authlistener
' authContext : void* in/out
' accept : INT
' credentials : alljoyn_credentials
Declare PtrSafe Function alljoyn_authlistener_requestcredentialsresponse Lib "msajapi" ( _
    ByVal listener As LongPtr, _
    ByVal authContext As LongPtr, _
    ByVal accept As Long, _
    ByVal credentials As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

alljoyn_authlistener_requestcredentialsresponse = ctypes.windll.msajapi.alljoyn_authlistener_requestcredentialsresponse
alljoyn_authlistener_requestcredentialsresponse.restype = ctypes.c_int
alljoyn_authlistener_requestcredentialsresponse.argtypes = [
    ctypes.c_ssize_t,  # listener : alljoyn_authlistener
    ctypes.POINTER(None),  # authContext : void* in/out
    ctypes.c_int,  # accept : INT
    ctypes.c_ssize_t,  # credentials : alljoyn_credentials
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_authlistener_requestcredentialsresponse = msajapi.NewProc("alljoyn_authlistener_requestcredentialsresponse")
)

// listener (alljoyn_authlistener), authContext (void* in/out), accept (INT), credentials (alljoyn_credentials)
r1, _, err := procalljoyn_authlistener_requestcredentialsresponse.Call(
	uintptr(listener),
	uintptr(authContext),
	uintptr(accept),
	uintptr(credentials),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // QStatus
function alljoyn_authlistener_requestcredentialsresponse(
  listener: NativeInt;   // alljoyn_authlistener
  authContext: Pointer;   // void* in/out
  accept: Integer;   // INT
  credentials: NativeInt   // alljoyn_credentials
): Integer; stdcall;
  external 'MSAJApi.dll' name 'alljoyn_authlistener_requestcredentialsresponse';
result := DllCall("MSAJApi\alljoyn_authlistener_requestcredentialsresponse"
    , "Ptr", listener   ; alljoyn_authlistener
    , "Ptr", authContext   ; void* in/out
    , "Int", accept   ; INT
    , "Ptr", credentials   ; alljoyn_credentials
    , "Int")   ; return: QStatus
●alljoyn_authlistener_requestcredentialsresponse(listener, authContext, accept, credentials) = DLL("MSAJApi.dll", "int alljoyn_authlistener_requestcredentialsresponse(int, void*, int, int)")
# 呼び出し: alljoyn_authlistener_requestcredentialsresponse(listener, authContext, accept, credentials)
# listener : alljoyn_authlistener -> "int"
# authContext : void* in/out -> "void*"
# accept : INT -> "int"
# credentials : alljoyn_credentials -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "msajapi" fn alljoyn_authlistener_requestcredentialsresponse(
    listener: isize, // alljoyn_authlistener
    authContext: ?*anyopaque, // void* in/out
    accept: i32, // INT
    credentials: isize // alljoyn_credentials
) callconv(std.os.windows.WINAPI) i32;
proc alljoyn_authlistener_requestcredentialsresponse(
    listener: int,  # alljoyn_authlistener
    authContext: pointer,  # void* in/out
    accept: int32,  # INT
    credentials: int  # alljoyn_credentials
): int32 {.importc: "alljoyn_authlistener_requestcredentialsresponse", stdcall, dynlib: "MSAJApi.dll".}
pragma(lib, "msajapi");
extern(Windows)
int alljoyn_authlistener_requestcredentialsresponse(
    ptrdiff_t listener,   // alljoyn_authlistener
    void* authContext,   // void* in/out
    int accept,   // INT
    ptrdiff_t credentials   // alljoyn_credentials
);
ccall((:alljoyn_authlistener_requestcredentialsresponse, "MSAJApi.dll"), stdcall, Int32,
      (Int, Ptr{Cvoid}, Int32, Int),
      listener, authContext, accept, credentials)
# listener : alljoyn_authlistener -> Int
# authContext : void* in/out -> Ptr{Cvoid}
# accept : INT -> Int32
# credentials : alljoyn_credentials -> Int
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t alljoyn_authlistener_requestcredentialsresponse(
    intptr_t listener,
    void* authContext,
    int32_t accept,
    intptr_t credentials);
]]
local msajapi = ffi.load("msajapi")
-- msajapi.alljoyn_authlistener_requestcredentialsresponse(listener, authContext, accept, credentials)
-- listener : alljoyn_authlistener
-- authContext : void* in/out
-- accept : INT
-- credentials : alljoyn_credentials
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('MSAJApi.dll');
const alljoyn_authlistener_requestcredentialsresponse = lib.func('__stdcall', 'alljoyn_authlistener_requestcredentialsresponse', 'int32_t', ['intptr_t', 'void *', 'int32_t', 'intptr_t']);
// alljoyn_authlistener_requestcredentialsresponse(listener, authContext, accept, credentials)
// listener : alljoyn_authlistener -> 'intptr_t'
// authContext : void* in/out -> 'void *'
// accept : INT -> 'int32_t'
// credentials : alljoyn_credentials -> 'intptr_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("MSAJApi.dll", {
  alljoyn_authlistener_requestcredentialsresponse: { parameters: ["isize", "pointer", "i32", "isize"], result: "i32" },
});
// lib.symbols.alljoyn_authlistener_requestcredentialsresponse(listener, authContext, accept, credentials)
// listener : alljoyn_authlistener -> "isize"
// authContext : void* in/out -> "pointer"
// accept : INT -> "i32"
// credentials : alljoyn_credentials -> "isize"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t alljoyn_authlistener_requestcredentialsresponse(
    intptr_t listener,
    void* authContext,
    int32_t accept,
    intptr_t credentials);
C, "MSAJApi.dll");
// $ffi->alljoyn_authlistener_requestcredentialsresponse(listener, authContext, accept, credentials);
// listener : alljoyn_authlistener
// authContext : void* in/out
// accept : INT
// credentials : alljoyn_credentials
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Msajapi extends StdCallLibrary {
    Msajapi INSTANCE = Native.load("msajapi", Msajapi.class);
    int alljoyn_authlistener_requestcredentialsresponse(
        long listener,   // alljoyn_authlistener
        Pointer authContext,   // void* in/out
        int accept,   // INT
        long credentials   // alljoyn_credentials
    );
}
@[Link("msajapi")]
lib LibMSAJApi
  fun alljoyn_authlistener_requestcredentialsresponse = alljoyn_authlistener_requestcredentialsresponse(
    listener : LibC::SSizeT,   # alljoyn_authlistener
    authContext : Void*,   # void* in/out
    accept : Int32,   # INT
    credentials : LibC::SSizeT   # alljoyn_credentials
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef alljoyn_authlistener_requestcredentialsresponseNative = Int32 Function(IntPtr, Pointer<Void>, Int32, IntPtr);
typedef alljoyn_authlistener_requestcredentialsresponseDart = int Function(int, Pointer<Void>, int, int);
final alljoyn_authlistener_requestcredentialsresponse = DynamicLibrary.open('MSAJApi.dll')
    .lookupFunction<alljoyn_authlistener_requestcredentialsresponseNative, alljoyn_authlistener_requestcredentialsresponseDart>('alljoyn_authlistener_requestcredentialsresponse');
// listener : alljoyn_authlistener -> IntPtr
// authContext : void* in/out -> Pointer<Void>
// accept : INT -> Int32
// credentials : alljoyn_credentials -> IntPtr
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function alljoyn_authlistener_requestcredentialsresponse(
  listener: NativeInt;   // alljoyn_authlistener
  authContext: Pointer;   // void* in/out
  accept: Integer;   // INT
  credentials: NativeInt   // alljoyn_credentials
): Integer; stdcall;
  external 'MSAJApi.dll' name 'alljoyn_authlistener_requestcredentialsresponse';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "alljoyn_authlistener_requestcredentialsresponse"
  c_alljoyn_authlistener_requestcredentialsresponse :: CIntPtr -> Ptr () -> Int32 -> CIntPtr -> IO Int32
-- listener : alljoyn_authlistener -> CIntPtr
-- authContext : void* in/out -> Ptr ()
-- accept : INT -> Int32
-- credentials : alljoyn_credentials -> CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let alljoyn_authlistener_requestcredentialsresponse =
  foreign "alljoyn_authlistener_requestcredentialsresponse"
    (intptr_t @-> (ptr void) @-> int32_t @-> intptr_t @-> returning int32_t)
(* listener : alljoyn_authlistener -> intptr_t *)
(* authContext : void* in/out -> (ptr void) *)
(* accept : INT -> int32_t *)
(* credentials : alljoyn_credentials -> intptr_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library msajapi (t "MSAJApi.dll"))
(cffi:use-foreign-library msajapi)

(cffi:defcfun ("alljoyn_authlistener_requestcredentialsresponse" alljoyn-authlistener-requestcredentialsresponse :convention :stdcall) :int32
  (listener :int64)   ; alljoyn_authlistener
  (auth-context :pointer)   ; void* in/out
  (accept :int32)   ; INT
  (credentials :int64))   ; alljoyn_credentials
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $alljoyn_authlistener_requestcredentialsresponse = Win32::API::More->new('MSAJApi',
    'int alljoyn_authlistener_requestcredentialsresponse(LPARAM listener, LPVOID authContext, int accept, LPARAM credentials)');
# my $ret = $alljoyn_authlistener_requestcredentialsresponse->Call($listener, $authContext, $accept, $credentials);
# listener : alljoyn_authlistener -> LPARAM
# authContext : void* in/out -> LPVOID
# accept : INT -> int
# credentials : alljoyn_credentials -> LPARAM
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型