ホーム › Devices.AllJoyn › alljoyn_interfacedescription_activate
alljoyn_interfacedescription_activate
関数インターフェイス記述を確定し変更不可として有効化する。
シグネチャ
// MSAJApi.dll
#include <windows.h>
void alljoyn_interfacedescription_activate(
alljoyn_interfacedescription iface
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| iface | alljoyn_interfacedescription | in | アクティブ化する対象のインターフェイス記述ハンドル。以後は変更不可となる。 |
戻り値の型: void
各言語での呼び出し定義
// MSAJApi.dll
#include <windows.h>
void alljoyn_interfacedescription_activate(
alljoyn_interfacedescription iface
);[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern void alljoyn_interfacedescription_activate(
IntPtr iface // alljoyn_interfacedescription
);<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Sub alljoyn_interfacedescription_activate(
iface As IntPtr ' alljoyn_interfacedescription
)
End Sub' iface : alljoyn_interfacedescription
Declare PtrSafe Sub alljoyn_interfacedescription_activate Lib "msajapi" ( _
ByVal iface As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
alljoyn_interfacedescription_activate = ctypes.windll.msajapi.alljoyn_interfacedescription_activate
alljoyn_interfacedescription_activate.restype = None
alljoyn_interfacedescription_activate.argtypes = [
ctypes.c_ssize_t, # iface : alljoyn_interfacedescription
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_interfacedescription_activate = Fiddle::Function.new(
lib['alljoyn_interfacedescription_activate'],
[
Fiddle::TYPE_INTPTR_T, # iface : alljoyn_interfacedescription
],
Fiddle::TYPE_VOID)#[link(name = "msajapi")]
extern "system" {
fn alljoyn_interfacedescription_activate(
iface: isize // alljoyn_interfacedescription
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSAJApi.dll")]
public static extern void alljoyn_interfacedescription_activate(IntPtr iface);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_interfacedescription_activate' -Namespace Win32 -PassThru
# $api::alljoyn_interfacedescription_activate(iface)#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_activate "alljoyn_interfacedescription_activate" sptr
; alljoyn_interfacedescription_activate iface
; iface : alljoyn_interfacedescription -> "sptr"#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_activate "alljoyn_interfacedescription_activate" sptr
; alljoyn_interfacedescription_activate iface
; iface : alljoyn_interfacedescription -> "sptr"; void alljoyn_interfacedescription_activate(alljoyn_interfacedescription iface)
#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_activate "alljoyn_interfacedescription_activate" intptr
; alljoyn_interfacedescription_activate iface
; iface : alljoyn_interfacedescription -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
procalljoyn_interfacedescription_activate = msajapi.NewProc("alljoyn_interfacedescription_activate")
)
// iface (alljoyn_interfacedescription)
r1, _, err := procalljoyn_interfacedescription_activate.Call(
uintptr(iface),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure alljoyn_interfacedescription_activate(
iface: NativeInt // alljoyn_interfacedescription
); stdcall;
external 'MSAJApi.dll' name 'alljoyn_interfacedescription_activate';result := DllCall("MSAJApi\alljoyn_interfacedescription_activate"
, "Ptr", iface ; alljoyn_interfacedescription
, "Int") ; return: void●alljoyn_interfacedescription_activate(iface) = DLL("MSAJApi.dll", "int alljoyn_interfacedescription_activate(int)")
# 呼び出し: alljoyn_interfacedescription_activate(iface)
# iface : alljoyn_interfacedescription -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "msajapi" fn alljoyn_interfacedescription_activate(
iface: isize // alljoyn_interfacedescription
) callconv(std.os.windows.WINAPI) void;proc alljoyn_interfacedescription_activate(
iface: int # alljoyn_interfacedescription
) {.importc: "alljoyn_interfacedescription_activate", stdcall, dynlib: "MSAJApi.dll".}pragma(lib, "msajapi");
extern(Windows)
void alljoyn_interfacedescription_activate(
ptrdiff_t iface // alljoyn_interfacedescription
);ccall((:alljoyn_interfacedescription_activate, "MSAJApi.dll"), stdcall, Cvoid,
(Int,),
iface)
# iface : alljoyn_interfacedescription -> Int
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
void alljoyn_interfacedescription_activate(
intptr_t iface);
]]
local msajapi = ffi.load("msajapi")
-- msajapi.alljoyn_interfacedescription_activate(iface)
-- iface : alljoyn_interfacedescription
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('MSAJApi.dll');
const alljoyn_interfacedescription_activate = lib.func('__stdcall', 'alljoyn_interfacedescription_activate', 'void', ['intptr_t']);
// alljoyn_interfacedescription_activate(iface)
// iface : alljoyn_interfacedescription -> 'intptr_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("MSAJApi.dll", {
alljoyn_interfacedescription_activate: { parameters: ["isize"], result: "void" },
});
// lib.symbols.alljoyn_interfacedescription_activate(iface)
// iface : alljoyn_interfacedescription -> "isize"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void alljoyn_interfacedescription_activate(
intptr_t iface);
C, "MSAJApi.dll");
// $ffi->alljoyn_interfacedescription_activate(iface);
// iface : alljoyn_interfacedescription
// 構造体/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_activate(
long iface // alljoyn_interfacedescription
);
}@[Link("msajapi")]
lib LibMSAJApi
fun alljoyn_interfacedescription_activate = alljoyn_interfacedescription_activate(
iface : LibC::SSizeT # alljoyn_interfacedescription
) : 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_activateNative = Void Function(IntPtr);
typedef alljoyn_interfacedescription_activateDart = void Function(int);
final alljoyn_interfacedescription_activate = DynamicLibrary.open('MSAJApi.dll')
.lookupFunction<alljoyn_interfacedescription_activateNative, alljoyn_interfacedescription_activateDart>('alljoyn_interfacedescription_activate');
// iface : alljoyn_interfacedescription -> IntPtr
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
procedure alljoyn_interfacedescription_activate(
iface: NativeInt // alljoyn_interfacedescription
); stdcall;
external 'MSAJApi.dll' name 'alljoyn_interfacedescription_activate';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "alljoyn_interfacedescription_activate"
c_alljoyn_interfacedescription_activate :: CIntPtr -> IO ()
-- iface : alljoyn_interfacedescription -> CIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let alljoyn_interfacedescription_activate =
foreign "alljoyn_interfacedescription_activate"
(intptr_t @-> returning void)
(* iface : alljoyn_interfacedescription -> 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_interfacedescription_activate" alljoyn-interfacedescription-activate :convention :stdcall) :void
(iface :int64)) ; alljoyn_interfacedescription
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $alljoyn_interfacedescription_activate = Win32::API::More->new('MSAJApi',
'void alljoyn_interfacedescription_activate(LPARAM iface)');
# my $ret = $alljoyn_interfacedescription_activate->Call($iface);
# iface : alljoyn_interfacedescription -> LPARAM
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。