ホーム › Devices.AllJoyn › alljoyn_interfacedescription_getpropertydescriptionforlanguage
alljoyn_interfacedescription_getpropertydescriptionforlanguage
関数指定言語のプロパティ説明文を取得する。
シグネチャ
// MSAJApi.dll
#include <windows.h>
UINT_PTR alljoyn_interfacedescription_getpropertydescriptionforlanguage(
alljoyn_interfacedescription iface,
LPCSTR property,
LPSTR description,
UINT_PTR maxLanguageLength,
LPCSTR languageTag
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| iface | alljoyn_interfacedescription | in | 対象のインターフェース記述ハンドル。 |
| property | LPCSTR | in | 説明を取得する対象プロパティの名前を指すNULL終端文字列。 |
| description | LPSTR | in | 取得した説明文を受け取るバッファ。NULLで必要長のみ取得可。 |
| maxLanguageLength | UINT_PTR | in | descriptionバッファのバイト容量を指定する。 |
| languageTag | LPCSTR | in | 取得する説明の言語タグを指すNULL終端文字列。 |
戻り値の型: UINT_PTR
各言語での呼び出し定義
// MSAJApi.dll
#include <windows.h>
UINT_PTR alljoyn_interfacedescription_getpropertydescriptionforlanguage(
alljoyn_interfacedescription iface,
LPCSTR property,
LPSTR description,
UINT_PTR maxLanguageLength,
LPCSTR languageTag
);[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern UIntPtr alljoyn_interfacedescription_getpropertydescriptionforlanguage(
IntPtr iface, // alljoyn_interfacedescription
[MarshalAs(UnmanagedType.LPStr)] string property, // LPCSTR
[MarshalAs(UnmanagedType.LPStr)] string description, // LPSTR
UIntPtr maxLanguageLength, // UINT_PTR
[MarshalAs(UnmanagedType.LPStr)] string languageTag // LPCSTR
);<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_interfacedescription_getpropertydescriptionforlanguage(
iface As IntPtr, ' alljoyn_interfacedescription
<MarshalAs(UnmanagedType.LPStr)> [property] As String, ' LPCSTR
<MarshalAs(UnmanagedType.LPStr)> description As String, ' LPSTR
maxLanguageLength As UIntPtr, ' UINT_PTR
<MarshalAs(UnmanagedType.LPStr)> languageTag As String ' LPCSTR
) As UIntPtr
End Function' iface : alljoyn_interfacedescription
' property : LPCSTR
' description : LPSTR
' maxLanguageLength : UINT_PTR
' languageTag : LPCSTR
Declare PtrSafe Function alljoyn_interfacedescription_getpropertydescriptionforlanguage Lib "msajapi" ( _
ByVal iface As LongPtr, _
ByVal property As String, _
ByVal description As String, _
ByVal maxLanguageLength As LongPtr, _
ByVal languageTag As String) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
alljoyn_interfacedescription_getpropertydescriptionforlanguage = ctypes.windll.msajapi.alljoyn_interfacedescription_getpropertydescriptionforlanguage
alljoyn_interfacedescription_getpropertydescriptionforlanguage.restype = ctypes.c_size_t
alljoyn_interfacedescription_getpropertydescriptionforlanguage.argtypes = [
ctypes.c_ssize_t, # iface : alljoyn_interfacedescription
wintypes.LPCSTR, # property : LPCSTR
wintypes.LPCSTR, # description : LPSTR
ctypes.c_size_t, # maxLanguageLength : UINT_PTR
wintypes.LPCSTR, # languageTag : LPCSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_interfacedescription_getpropertydescriptionforlanguage = Fiddle::Function.new(
lib['alljoyn_interfacedescription_getpropertydescriptionforlanguage'],
[
Fiddle::TYPE_INTPTR_T, # iface : alljoyn_interfacedescription
Fiddle::TYPE_VOIDP, # property : LPCSTR
Fiddle::TYPE_VOIDP, # description : LPSTR
Fiddle::TYPE_UINTPTR_T, # maxLanguageLength : UINT_PTR
Fiddle::TYPE_VOIDP, # languageTag : LPCSTR
],
Fiddle::TYPE_UINTPTR_T)#[link(name = "msajapi")]
extern "system" {
fn alljoyn_interfacedescription_getpropertydescriptionforlanguage(
iface: isize, // alljoyn_interfacedescription
property: *const u8, // LPCSTR
description: *mut u8, // LPSTR
maxLanguageLength: usize, // UINT_PTR
languageTag: *const u8 // LPCSTR
) -> usize;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSAJApi.dll")]
public static extern UIntPtr alljoyn_interfacedescription_getpropertydescriptionforlanguage(IntPtr iface, [MarshalAs(UnmanagedType.LPStr)] string property, [MarshalAs(UnmanagedType.LPStr)] string description, UIntPtr maxLanguageLength, [MarshalAs(UnmanagedType.LPStr)] string languageTag);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_interfacedescription_getpropertydescriptionforlanguage' -Namespace Win32 -PassThru
# $api::alljoyn_interfacedescription_getpropertydescriptionforlanguage(iface, property, description, maxLanguageLength, languageTag)#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_getpropertydescriptionforlanguage "alljoyn_interfacedescription_getpropertydescriptionforlanguage" sptr, sptr, sptr, sptr, sptr
; alljoyn_interfacedescription_getpropertydescriptionforlanguage iface, property, description, maxLanguageLength, languageTag ; 戻り値は stat
; iface : alljoyn_interfacedescription -> "sptr"
; property : LPCSTR -> "sptr"
; description : LPSTR -> "sptr"
; maxLanguageLength : UINT_PTR -> "sptr"
; languageTag : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_getpropertydescriptionforlanguage "alljoyn_interfacedescription_getpropertydescriptionforlanguage" sptr, str, str, sptr, str
; res = alljoyn_interfacedescription_getpropertydescriptionforlanguage(iface, property, description, maxLanguageLength, languageTag)
; iface : alljoyn_interfacedescription -> "sptr"
; property : LPCSTR -> "str"
; description : LPSTR -> "str"
; maxLanguageLength : UINT_PTR -> "sptr"
; languageTag : LPCSTR -> "str"; UINT_PTR alljoyn_interfacedescription_getpropertydescriptionforlanguage(alljoyn_interfacedescription iface, LPCSTR property, LPSTR description, UINT_PTR maxLanguageLength, LPCSTR languageTag)
#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_getpropertydescriptionforlanguage "alljoyn_interfacedescription_getpropertydescriptionforlanguage" intptr, str, str, intptr, str
; res = alljoyn_interfacedescription_getpropertydescriptionforlanguage(iface, property, description, maxLanguageLength, languageTag)
; iface : alljoyn_interfacedescription -> "intptr"
; property : LPCSTR -> "str"
; description : LPSTR -> "str"
; maxLanguageLength : UINT_PTR -> "intptr"
; languageTag : LPCSTR -> "str"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
procalljoyn_interfacedescription_getpropertydescriptionforlanguage = msajapi.NewProc("alljoyn_interfacedescription_getpropertydescriptionforlanguage")
)
// iface (alljoyn_interfacedescription), property (LPCSTR), description (LPSTR), maxLanguageLength (UINT_PTR), languageTag (LPCSTR)
r1, _, err := procalljoyn_interfacedescription_getpropertydescriptionforlanguage.Call(
uintptr(iface),
uintptr(unsafe.Pointer(windows.BytePtrFromString(property))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(description))),
uintptr(maxLanguageLength),
uintptr(unsafe.Pointer(windows.BytePtrFromString(languageTag))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // UINT_PTRfunction alljoyn_interfacedescription_getpropertydescriptionforlanguage(
iface: NativeInt; // alljoyn_interfacedescription
property: PAnsiChar; // LPCSTR
description: PAnsiChar; // LPSTR
maxLanguageLength: NativeUInt; // UINT_PTR
languageTag: PAnsiChar // LPCSTR
): NativeUInt; stdcall;
external 'MSAJApi.dll' name 'alljoyn_interfacedescription_getpropertydescriptionforlanguage';result := DllCall("MSAJApi\alljoyn_interfacedescription_getpropertydescriptionforlanguage"
, "Ptr", iface ; alljoyn_interfacedescription
, "AStr", property ; LPCSTR
, "AStr", description ; LPSTR
, "UPtr", maxLanguageLength ; UINT_PTR
, "AStr", languageTag ; LPCSTR
, "UPtr") ; return: UINT_PTR●alljoyn_interfacedescription_getpropertydescriptionforlanguage(iface, property, description, maxLanguageLength, languageTag) = DLL("MSAJApi.dll", "int alljoyn_interfacedescription_getpropertydescriptionforlanguage(int, char*, char*, int, char*)")
# 呼び出し: alljoyn_interfacedescription_getpropertydescriptionforlanguage(iface, property, description, maxLanguageLength, languageTag)
# iface : alljoyn_interfacedescription -> "int"
# property : LPCSTR -> "char*"
# description : LPSTR -> "char*"
# maxLanguageLength : UINT_PTR -> "int"
# languageTag : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "msajapi" fn alljoyn_interfacedescription_getpropertydescriptionforlanguage(
iface: isize, // alljoyn_interfacedescription
property: [*c]const u8, // LPCSTR
description: [*c]const u8, // LPSTR
maxLanguageLength: usize, // UINT_PTR
languageTag: [*c]const u8 // LPCSTR
) callconv(std.os.windows.WINAPI) usize;proc alljoyn_interfacedescription_getpropertydescriptionforlanguage(
iface: int, # alljoyn_interfacedescription
property: cstring, # LPCSTR
description: cstring, # LPSTR
maxLanguageLength: uint, # UINT_PTR
languageTag: cstring # LPCSTR
): uint {.importc: "alljoyn_interfacedescription_getpropertydescriptionforlanguage", stdcall, dynlib: "MSAJApi.dll".}pragma(lib, "msajapi");
extern(Windows)
size_t alljoyn_interfacedescription_getpropertydescriptionforlanguage(
ptrdiff_t iface, // alljoyn_interfacedescription
const(char)* property, // LPCSTR
const(char)* description, // LPSTR
size_t maxLanguageLength, // UINT_PTR
const(char)* languageTag // LPCSTR
);ccall((:alljoyn_interfacedescription_getpropertydescriptionforlanguage, "MSAJApi.dll"), stdcall, Csize_t,
(Int, Cstring, Cstring, Csize_t, Cstring),
iface, property, description, maxLanguageLength, languageTag)
# iface : alljoyn_interfacedescription -> Int
# property : LPCSTR -> Cstring
# description : LPSTR -> Cstring
# maxLanguageLength : UINT_PTR -> Csize_t
# languageTag : LPCSTR -> Cstring
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uintptr_t alljoyn_interfacedescription_getpropertydescriptionforlanguage(
intptr_t iface,
const char* property,
const char* description,
uintptr_t maxLanguageLength,
const char* languageTag);
]]
local msajapi = ffi.load("msajapi")
-- msajapi.alljoyn_interfacedescription_getpropertydescriptionforlanguage(iface, property, description, maxLanguageLength, languageTag)
-- iface : alljoyn_interfacedescription
-- property : LPCSTR
-- description : LPSTR
-- maxLanguageLength : UINT_PTR
-- languageTag : LPCSTR
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('MSAJApi.dll');
const alljoyn_interfacedescription_getpropertydescriptionforlanguage = lib.func('__stdcall', 'alljoyn_interfacedescription_getpropertydescriptionforlanguage', 'uintptr_t', ['intptr_t', 'str', 'str', 'uintptr_t', 'str']);
// alljoyn_interfacedescription_getpropertydescriptionforlanguage(iface, property, description, maxLanguageLength, languageTag)
// iface : alljoyn_interfacedescription -> 'intptr_t'
// property : LPCSTR -> 'str'
// description : LPSTR -> 'str'
// maxLanguageLength : UINT_PTR -> 'uintptr_t'
// languageTag : LPCSTR -> 'str'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("MSAJApi.dll", {
alljoyn_interfacedescription_getpropertydescriptionforlanguage: { parameters: ["isize", "buffer", "buffer", "usize", "buffer"], result: "usize" },
});
// lib.symbols.alljoyn_interfacedescription_getpropertydescriptionforlanguage(iface, property, description, maxLanguageLength, languageTag)
// iface : alljoyn_interfacedescription -> "isize"
// property : LPCSTR -> "buffer"
// description : LPSTR -> "buffer"
// maxLanguageLength : UINT_PTR -> "usize"
// languageTag : LPCSTR -> "buffer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
size_t alljoyn_interfacedescription_getpropertydescriptionforlanguage(
intptr_t iface,
const char* property,
const char* description,
size_t maxLanguageLength,
const char* languageTag);
C, "MSAJApi.dll");
// $ffi->alljoyn_interfacedescription_getpropertydescriptionforlanguage(iface, property, description, maxLanguageLength, languageTag);
// iface : alljoyn_interfacedescription
// property : LPCSTR
// description : LPSTR
// maxLanguageLength : UINT_PTR
// languageTag : LPCSTR
// 構造体/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);
long alljoyn_interfacedescription_getpropertydescriptionforlanguage(
long iface, // alljoyn_interfacedescription
String property, // LPCSTR
String description, // LPSTR
long maxLanguageLength, // UINT_PTR
String languageTag // LPCSTR
);
}@[Link("msajapi")]
lib LibMSAJApi
fun alljoyn_interfacedescription_getpropertydescriptionforlanguage = alljoyn_interfacedescription_getpropertydescriptionforlanguage(
iface : LibC::SSizeT, # alljoyn_interfacedescription
property : UInt8*, # LPCSTR
description : UInt8*, # LPSTR
maxLanguageLength : LibC::SizeT, # UINT_PTR
languageTag : UInt8* # LPCSTR
) : LibC::SizeT
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef alljoyn_interfacedescription_getpropertydescriptionforlanguageNative = UintPtr Function(IntPtr, Pointer<Utf8>, Pointer<Utf8>, UintPtr, Pointer<Utf8>);
typedef alljoyn_interfacedescription_getpropertydescriptionforlanguageDart = int Function(int, Pointer<Utf8>, Pointer<Utf8>, int, Pointer<Utf8>);
final alljoyn_interfacedescription_getpropertydescriptionforlanguage = DynamicLibrary.open('MSAJApi.dll')
.lookupFunction<alljoyn_interfacedescription_getpropertydescriptionforlanguageNative, alljoyn_interfacedescription_getpropertydescriptionforlanguageDart>('alljoyn_interfacedescription_getpropertydescriptionforlanguage');
// iface : alljoyn_interfacedescription -> IntPtr
// property : LPCSTR -> Pointer<Utf8>
// description : LPSTR -> Pointer<Utf8>
// maxLanguageLength : UINT_PTR -> UintPtr
// languageTag : LPCSTR -> Pointer<Utf8>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function alljoyn_interfacedescription_getpropertydescriptionforlanguage(
iface: NativeInt; // alljoyn_interfacedescription
property: PAnsiChar; // LPCSTR
description: PAnsiChar; // LPSTR
maxLanguageLength: NativeUInt; // UINT_PTR
languageTag: PAnsiChar // LPCSTR
): NativeUInt; stdcall;
external 'MSAJApi.dll' name 'alljoyn_interfacedescription_getpropertydescriptionforlanguage';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "alljoyn_interfacedescription_getpropertydescriptionforlanguage"
c_alljoyn_interfacedescription_getpropertydescriptionforlanguage :: CIntPtr -> CString -> CString -> CUIntPtr -> CString -> IO CUIntPtr
-- iface : alljoyn_interfacedescription -> CIntPtr
-- property : LPCSTR -> CString
-- description : LPSTR -> CString
-- maxLanguageLength : UINT_PTR -> CUIntPtr
-- languageTag : LPCSTR -> CString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let alljoyn_interfacedescription_getpropertydescriptionforlanguage =
foreign "alljoyn_interfacedescription_getpropertydescriptionforlanguage"
(intptr_t @-> string @-> string @-> size_t @-> string @-> returning size_t)
(* iface : alljoyn_interfacedescription -> intptr_t *)
(* property : LPCSTR -> string *)
(* description : LPSTR -> string *)
(* maxLanguageLength : UINT_PTR -> size_t *)
(* languageTag : LPCSTR -> string *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library msajapi (t "MSAJApi.dll"))
(cffi:use-foreign-library msajapi)
(cffi:defcfun ("alljoyn_interfacedescription_getpropertydescriptionforlanguage" alljoyn-interfacedescription-getpropertydescriptionforlanguage :convention :stdcall) :uint64
(iface :int64) ; alljoyn_interfacedescription
(property :string) ; LPCSTR
(description :string) ; LPSTR
(max-language-length :uint64) ; UINT_PTR
(language-tag :string)) ; LPCSTR
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $alljoyn_interfacedescription_getpropertydescriptionforlanguage = Win32::API::More->new('MSAJApi',
'WPARAM alljoyn_interfacedescription_getpropertydescriptionforlanguage(LPARAM iface, LPCSTR property, LPCSTR description, WPARAM maxLanguageLength, LPCSTR languageTag)');
# my $ret = $alljoyn_interfacedescription_getpropertydescriptionforlanguage->Call($iface, $property, $description, $maxLanguageLength, $languageTag);
# iface : alljoyn_interfacedescription -> LPARAM
# property : LPCSTR -> LPCSTR
# description : LPSTR -> LPCSTR
# maxLanguageLength : UINT_PTR -> WPARAM
# languageTag : LPCSTR -> LPCSTR
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。