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

alljoyn_interfacedescription_getannotationatindex

関数
インターフェイス記述の指定インデックスの注釈名と値を取得する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

void alljoyn_interfacedescription_getannotationatindex(
    alljoyn_interfacedescription iface,
    UINT_PTR index,
    LPSTR name,
    UINT_PTR* name_size,
    LPSTR value,
    UINT_PTR* value_size
);

パラメーター

名前方向説明
ifacealljoyn_interfacedescriptionin注釈を取得する対象のインターフェイス記述ハンドル。
indexUINT_PTRin取得する注釈の0始まりインデックス。
nameLPSTRin注釈名を受け取るバッファ。
name_sizeUINT_PTR*inout入力でnameバッファサイズ、出力で必要サイズを受け取るポインタ。
valueLPSTRin注釈値を受け取るバッファ。
value_sizeUINT_PTR*inout入力でvalueバッファサイズ、出力で必要サイズを受け取るポインタ。

戻り値の型: void

各言語での呼び出し定義

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

void alljoyn_interfacedescription_getannotationatindex(
    alljoyn_interfacedescription iface,
    UINT_PTR index,
    LPSTR name,
    UINT_PTR* name_size,
    LPSTR value,
    UINT_PTR* value_size
);
[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern void alljoyn_interfacedescription_getannotationatindex(
    IntPtr iface,   // alljoyn_interfacedescription
    UIntPtr index,   // UINT_PTR
    [MarshalAs(UnmanagedType.LPStr)] string name,   // LPSTR
    ref UIntPtr name_size,   // UINT_PTR* in/out
    [MarshalAs(UnmanagedType.LPStr)] string value,   // LPSTR
    ref UIntPtr value_size   // UINT_PTR* in/out
);
<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Sub alljoyn_interfacedescription_getannotationatindex(
    iface As IntPtr,   ' alljoyn_interfacedescription
    index As UIntPtr,   ' UINT_PTR
    <MarshalAs(UnmanagedType.LPStr)> name As String,   ' LPSTR
    ByRef name_size As UIntPtr,   ' UINT_PTR* in/out
    <MarshalAs(UnmanagedType.LPStr)> value As String,   ' LPSTR
    ByRef value_size As UIntPtr   ' UINT_PTR* in/out
)
End Sub
' iface : alljoyn_interfacedescription
' index : UINT_PTR
' name : LPSTR
' name_size : UINT_PTR* in/out
' value : LPSTR
' value_size : UINT_PTR* in/out
Declare PtrSafe Sub alljoyn_interfacedescription_getannotationatindex Lib "msajapi" ( _
    ByVal iface As LongPtr, _
    ByVal index As LongPtr, _
    ByVal name As String, _
    ByRef name_size As LongPtr, _
    ByVal value As String, _
    ByRef value_size As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

alljoyn_interfacedescription_getannotationatindex = ctypes.windll.msajapi.alljoyn_interfacedescription_getannotationatindex
alljoyn_interfacedescription_getannotationatindex.restype = None
alljoyn_interfacedescription_getannotationatindex.argtypes = [
    ctypes.c_ssize_t,  # iface : alljoyn_interfacedescription
    ctypes.c_size_t,  # index : UINT_PTR
    wintypes.LPCSTR,  # name : LPSTR
    ctypes.POINTER(ctypes.c_size_t),  # name_size : UINT_PTR* in/out
    wintypes.LPCSTR,  # value : LPSTR
    ctypes.POINTER(ctypes.c_size_t),  # value_size : UINT_PTR* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_interfacedescription_getannotationatindex = Fiddle::Function.new(
  lib['alljoyn_interfacedescription_getannotationatindex'],
  [
    Fiddle::TYPE_INTPTR_T,  # iface : alljoyn_interfacedescription
    Fiddle::TYPE_UINTPTR_T,  # index : UINT_PTR
    Fiddle::TYPE_VOIDP,  # name : LPSTR
    Fiddle::TYPE_VOIDP,  # name_size : UINT_PTR* in/out
    Fiddle::TYPE_VOIDP,  # value : LPSTR
    Fiddle::TYPE_VOIDP,  # value_size : UINT_PTR* in/out
  ],
  Fiddle::TYPE_VOID)
#[link(name = "msajapi")]
extern "system" {
    fn alljoyn_interfacedescription_getannotationatindex(
        iface: isize,  // alljoyn_interfacedescription
        index: usize,  // UINT_PTR
        name: *mut u8,  // LPSTR
        name_size: *mut usize,  // UINT_PTR* in/out
        value: *mut u8,  // LPSTR
        value_size: *mut usize  // UINT_PTR* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSAJApi.dll")]
public static extern void alljoyn_interfacedescription_getannotationatindex(IntPtr iface, UIntPtr index, [MarshalAs(UnmanagedType.LPStr)] string name, ref UIntPtr name_size, [MarshalAs(UnmanagedType.LPStr)] string value, ref UIntPtr value_size);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_interfacedescription_getannotationatindex' -Namespace Win32 -PassThru
# $api::alljoyn_interfacedescription_getannotationatindex(iface, index, name, name_size, value, value_size)
#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_getannotationatindex "alljoyn_interfacedescription_getannotationatindex" sptr, sptr, sptr, sptr, sptr, sptr
; alljoyn_interfacedescription_getannotationatindex iface, index, name, varptr(name_size), value, varptr(value_size)
; iface : alljoyn_interfacedescription -> "sptr"
; index : UINT_PTR -> "sptr"
; name : LPSTR -> "sptr"
; name_size : UINT_PTR* in/out -> "sptr"
; value : LPSTR -> "sptr"
; value_size : UINT_PTR* in/out -> "sptr"
出力引数:
#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_getannotationatindex "alljoyn_interfacedescription_getannotationatindex" sptr, sptr, str, var, str, var
; alljoyn_interfacedescription_getannotationatindex iface, index, name, name_size, value, value_size
; iface : alljoyn_interfacedescription -> "sptr"
; index : UINT_PTR -> "sptr"
; name : LPSTR -> "str"
; name_size : UINT_PTR* in/out -> "var"
; value : LPSTR -> "str"
; value_size : UINT_PTR* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void alljoyn_interfacedescription_getannotationatindex(alljoyn_interfacedescription iface, UINT_PTR index, LPSTR name, UINT_PTR* name_size, LPSTR value, UINT_PTR* value_size)
#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_getannotationatindex "alljoyn_interfacedescription_getannotationatindex" intptr, intptr, str, var, str, var
; alljoyn_interfacedescription_getannotationatindex iface, index, name, name_size, value, value_size
; iface : alljoyn_interfacedescription -> "intptr"
; index : UINT_PTR -> "intptr"
; name : LPSTR -> "str"
; name_size : UINT_PTR* in/out -> "var"
; value : LPSTR -> "str"
; value_size : UINT_PTR* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_interfacedescription_getannotationatindex = msajapi.NewProc("alljoyn_interfacedescription_getannotationatindex")
)

// iface (alljoyn_interfacedescription), index (UINT_PTR), name (LPSTR), name_size (UINT_PTR* in/out), value (LPSTR), value_size (UINT_PTR* in/out)
r1, _, err := procalljoyn_interfacedescription_getannotationatindex.Call(
	uintptr(iface),
	uintptr(index),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(name))),
	uintptr(name_size),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(value))),
	uintptr(value_size),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure alljoyn_interfacedescription_getannotationatindex(
  iface: NativeInt;   // alljoyn_interfacedescription
  index: NativeUInt;   // UINT_PTR
  name: PAnsiChar;   // LPSTR
  name_size: Pointer;   // UINT_PTR* in/out
  value: PAnsiChar;   // LPSTR
  value_size: Pointer   // UINT_PTR* in/out
); stdcall;
  external 'MSAJApi.dll' name 'alljoyn_interfacedescription_getannotationatindex';
result := DllCall("MSAJApi\alljoyn_interfacedescription_getannotationatindex"
    , "Ptr", iface   ; alljoyn_interfacedescription
    , "UPtr", index   ; UINT_PTR
    , "AStr", name   ; LPSTR
    , "Ptr", name_size   ; UINT_PTR* in/out
    , "AStr", value   ; LPSTR
    , "Ptr", value_size   ; UINT_PTR* in/out
    , "Int")   ; return: void
●alljoyn_interfacedescription_getannotationatindex(iface, index, name, name_size, value, value_size) = DLL("MSAJApi.dll", "int alljoyn_interfacedescription_getannotationatindex(int, int, char*, void*, char*, void*)")
# 呼び出し: alljoyn_interfacedescription_getannotationatindex(iface, index, name, name_size, value, value_size)
# iface : alljoyn_interfacedescription -> "int"
# index : UINT_PTR -> "int"
# name : LPSTR -> "char*"
# name_size : UINT_PTR* in/out -> "void*"
# value : LPSTR -> "char*"
# value_size : UINT_PTR* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "msajapi" fn alljoyn_interfacedescription_getannotationatindex(
    iface: isize, // alljoyn_interfacedescription
    index: usize, // UINT_PTR
    name: [*c]const u8, // LPSTR
    name_size: [*c]usize, // UINT_PTR* in/out
    value: [*c]const u8, // LPSTR
    value_size: [*c]usize // UINT_PTR* in/out
) callconv(std.os.windows.WINAPI) void;
proc alljoyn_interfacedescription_getannotationatindex(
    iface: int,  # alljoyn_interfacedescription
    index: uint,  # UINT_PTR
    name: cstring,  # LPSTR
    name_size: ptr uint,  # UINT_PTR* in/out
    value: cstring,  # LPSTR
    value_size: ptr uint  # UINT_PTR* in/out
) {.importc: "alljoyn_interfacedescription_getannotationatindex", stdcall, dynlib: "MSAJApi.dll".}
pragma(lib, "msajapi");
extern(Windows)
void alljoyn_interfacedescription_getannotationatindex(
    ptrdiff_t iface,   // alljoyn_interfacedescription
    size_t index,   // UINT_PTR
    const(char)* name,   // LPSTR
    size_t* name_size,   // UINT_PTR* in/out
    const(char)* value,   // LPSTR
    size_t* value_size   // UINT_PTR* in/out
);
ccall((:alljoyn_interfacedescription_getannotationatindex, "MSAJApi.dll"), stdcall, Cvoid,
      (Int, Csize_t, Cstring, Ptr{Csize_t}, Cstring, Ptr{Csize_t}),
      iface, index, name, name_size, value, value_size)
# iface : alljoyn_interfacedescription -> Int
# index : UINT_PTR -> Csize_t
# name : LPSTR -> Cstring
# name_size : UINT_PTR* in/out -> Ptr{Csize_t}
# value : LPSTR -> Cstring
# value_size : UINT_PTR* in/out -> Ptr{Csize_t}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
void alljoyn_interfacedescription_getannotationatindex(
    intptr_t iface,
    uintptr_t index,
    const char* name,
    uintptr_t* name_size,
    const char* value,
    uintptr_t* value_size);
]]
local msajapi = ffi.load("msajapi")
-- msajapi.alljoyn_interfacedescription_getannotationatindex(iface, index, name, name_size, value, value_size)
-- iface : alljoyn_interfacedescription
-- index : UINT_PTR
-- name : LPSTR
-- name_size : UINT_PTR* in/out
-- value : LPSTR
-- value_size : UINT_PTR* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('MSAJApi.dll');
const alljoyn_interfacedescription_getannotationatindex = lib.func('__stdcall', 'alljoyn_interfacedescription_getannotationatindex', 'void', ['intptr_t', 'uintptr_t', 'str', 'uintptr_t *', 'str', 'uintptr_t *']);
// alljoyn_interfacedescription_getannotationatindex(iface, index, name, name_size, value, value_size)
// iface : alljoyn_interfacedescription -> 'intptr_t'
// index : UINT_PTR -> 'uintptr_t'
// name : LPSTR -> 'str'
// name_size : UINT_PTR* in/out -> 'uintptr_t *'
// value : LPSTR -> 'str'
// value_size : UINT_PTR* in/out -> 'uintptr_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("MSAJApi.dll", {
  alljoyn_interfacedescription_getannotationatindex: { parameters: ["isize", "usize", "buffer", "pointer", "buffer", "pointer"], result: "void" },
});
// lib.symbols.alljoyn_interfacedescription_getannotationatindex(iface, index, name, name_size, value, value_size)
// iface : alljoyn_interfacedescription -> "isize"
// index : UINT_PTR -> "usize"
// name : LPSTR -> "buffer"
// name_size : UINT_PTR* in/out -> "pointer"
// value : LPSTR -> "buffer"
// value_size : UINT_PTR* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void alljoyn_interfacedescription_getannotationatindex(
    intptr_t iface,
    size_t index,
    const char* name,
    size_t* name_size,
    const char* value,
    size_t* value_size);
C, "MSAJApi.dll");
// $ffi->alljoyn_interfacedescription_getannotationatindex(iface, index, name, name_size, value, value_size);
// iface : alljoyn_interfacedescription
// index : UINT_PTR
// name : LPSTR
// name_size : UINT_PTR* in/out
// value : LPSTR
// value_size : UINT_PTR* in/out
// 構造体/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);
    void alljoyn_interfacedescription_getannotationatindex(
        long iface,   // alljoyn_interfacedescription
        long index,   // UINT_PTR
        String name,   // LPSTR
        LongByReference name_size,   // UINT_PTR* in/out
        String value,   // LPSTR
        LongByReference value_size   // UINT_PTR* in/out
    );
}
@[Link("msajapi")]
lib LibMSAJApi
  fun alljoyn_interfacedescription_getannotationatindex = alljoyn_interfacedescription_getannotationatindex(
    iface : LibC::SSizeT,   # alljoyn_interfacedescription
    index : LibC::SizeT,   # UINT_PTR
    name : UInt8*,   # LPSTR
    name_size : LibC::SizeT*,   # UINT_PTR* in/out
    value : UInt8*,   # LPSTR
    value_size : LibC::SizeT*   # UINT_PTR* in/out
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef alljoyn_interfacedescription_getannotationatindexNative = Void Function(IntPtr, UintPtr, Pointer<Utf8>, Pointer<UintPtr>, Pointer<Utf8>, Pointer<UintPtr>);
typedef alljoyn_interfacedescription_getannotationatindexDart = void Function(int, int, Pointer<Utf8>, Pointer<UintPtr>, Pointer<Utf8>, Pointer<UintPtr>);
final alljoyn_interfacedescription_getannotationatindex = DynamicLibrary.open('MSAJApi.dll')
    .lookupFunction<alljoyn_interfacedescription_getannotationatindexNative, alljoyn_interfacedescription_getannotationatindexDart>('alljoyn_interfacedescription_getannotationatindex');
// iface : alljoyn_interfacedescription -> IntPtr
// index : UINT_PTR -> UintPtr
// name : LPSTR -> Pointer<Utf8>
// name_size : UINT_PTR* in/out -> Pointer<UintPtr>
// value : LPSTR -> Pointer<Utf8>
// value_size : UINT_PTR* in/out -> Pointer<UintPtr>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure alljoyn_interfacedescription_getannotationatindex(
  iface: NativeInt;   // alljoyn_interfacedescription
  index: NativeUInt;   // UINT_PTR
  name: PAnsiChar;   // LPSTR
  name_size: Pointer;   // UINT_PTR* in/out
  value: PAnsiChar;   // LPSTR
  value_size: Pointer   // UINT_PTR* in/out
); stdcall;
  external 'MSAJApi.dll' name 'alljoyn_interfacedescription_getannotationatindex';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "alljoyn_interfacedescription_getannotationatindex"
  c_alljoyn_interfacedescription_getannotationatindex :: CIntPtr -> CUIntPtr -> CString -> Ptr CUIntPtr -> CString -> Ptr CUIntPtr -> IO ()
-- iface : alljoyn_interfacedescription -> CIntPtr
-- index : UINT_PTR -> CUIntPtr
-- name : LPSTR -> CString
-- name_size : UINT_PTR* in/out -> Ptr CUIntPtr
-- value : LPSTR -> CString
-- value_size : UINT_PTR* in/out -> Ptr CUIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let alljoyn_interfacedescription_getannotationatindex =
  foreign "alljoyn_interfacedescription_getannotationatindex"
    (intptr_t @-> size_t @-> string @-> (ptr size_t) @-> string @-> (ptr size_t) @-> returning void)
(* iface : alljoyn_interfacedescription -> intptr_t *)
(* index : UINT_PTR -> size_t *)
(* name : LPSTR -> string *)
(* name_size : UINT_PTR* in/out -> (ptr size_t) *)
(* value : LPSTR -> string *)
(* value_size : UINT_PTR* in/out -> (ptr size_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library msajapi (t "MSAJApi.dll"))
(cffi:use-foreign-library msajapi)

(cffi:defcfun ("alljoyn_interfacedescription_getannotationatindex" alljoyn-interfacedescription-getannotationatindex :convention :stdcall) :void
  (iface :int64)   ; alljoyn_interfacedescription
  (index :uint64)   ; UINT_PTR
  (name :string)   ; LPSTR
  (name-size :pointer)   ; UINT_PTR* in/out
  (value :string)   ; LPSTR
  (value-size :pointer))   ; UINT_PTR* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $alljoyn_interfacedescription_getannotationatindex = Win32::API::More->new('MSAJApi',
    'void alljoyn_interfacedescription_getannotationatindex(LPARAM iface, WPARAM index, LPCSTR name, LPVOID name_size, LPCSTR value, LPVOID value_size)');
# my $ret = $alljoyn_interfacedescription_getannotationatindex->Call($iface, $index, $name, $name_size, $value, $value_size);
# iface : alljoyn_interfacedescription -> LPARAM
# index : UINT_PTR -> WPARAM
# name : LPSTR -> LPCSTR
# name_size : UINT_PTR* in/out -> LPVOID
# value : LPSTR -> LPCSTR
# value_size : UINT_PTR* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。