ホーム › NetworkManagement.Rras › RtmGetOpaqueInformationPointer
RtmGetOpaqueInformationPointer
関数宛先に関連付けられた不透明情報へのポインタを取得する。
シグネチャ
// rtm.dll
#include <windows.h>
DWORD RtmGetOpaqueInformationPointer(
INT_PTR RtmRegHandle,
INT_PTR DestHandle,
void** OpaqueInfoPointer
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| RtmRegHandle | INT_PTR | in | RtmRegisterEntityで取得したRTM登録ハンドル。 |
| DestHandle | INT_PTR | in | 不透明情報領域を取得する対象宛先のハンドル。 |
| OpaqueInfoPointer | void** | inout | 宛先に予約された不透明情報領域へのポインタを受け取る。 |
戻り値の型: DWORD
各言語での呼び出し定義
// rtm.dll
#include <windows.h>
DWORD RtmGetOpaqueInformationPointer(
INT_PTR RtmRegHandle,
INT_PTR DestHandle,
void** OpaqueInfoPointer
);[DllImport("rtm.dll", ExactSpelling = true)]
static extern uint RtmGetOpaqueInformationPointer(
IntPtr RtmRegHandle, // INT_PTR
IntPtr DestHandle, // INT_PTR
IntPtr OpaqueInfoPointer // void** in/out
);<DllImport("rtm.dll", ExactSpelling:=True)>
Public Shared Function RtmGetOpaqueInformationPointer(
RtmRegHandle As IntPtr, ' INT_PTR
DestHandle As IntPtr, ' INT_PTR
OpaqueInfoPointer As IntPtr ' void** in/out
) As UInteger
End Function' RtmRegHandle : INT_PTR
' DestHandle : INT_PTR
' OpaqueInfoPointer : void** in/out
Declare PtrSafe Function RtmGetOpaqueInformationPointer Lib "rtm" ( _
ByVal RtmRegHandle As LongPtr, _
ByVal DestHandle As LongPtr, _
ByVal OpaqueInfoPointer As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RtmGetOpaqueInformationPointer = ctypes.windll.rtm.RtmGetOpaqueInformationPointer
RtmGetOpaqueInformationPointer.restype = wintypes.DWORD
RtmGetOpaqueInformationPointer.argtypes = [
ctypes.c_ssize_t, # RtmRegHandle : INT_PTR
ctypes.c_ssize_t, # DestHandle : INT_PTR
ctypes.c_void_p, # OpaqueInfoPointer : void** in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('rtm.dll')
RtmGetOpaqueInformationPointer = Fiddle::Function.new(
lib['RtmGetOpaqueInformationPointer'],
[
Fiddle::TYPE_INTPTR_T, # RtmRegHandle : INT_PTR
Fiddle::TYPE_INTPTR_T, # DestHandle : INT_PTR
Fiddle::TYPE_VOIDP, # OpaqueInfoPointer : void** in/out
],
-Fiddle::TYPE_INT)#[link(name = "rtm")]
extern "system" {
fn RtmGetOpaqueInformationPointer(
RtmRegHandle: isize, // INT_PTR
DestHandle: isize, // INT_PTR
OpaqueInfoPointer: *mut *mut () // void** in/out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("rtm.dll")]
public static extern uint RtmGetOpaqueInformationPointer(IntPtr RtmRegHandle, IntPtr DestHandle, IntPtr OpaqueInfoPointer);
"@
$api = Add-Type -MemberDefinition $sig -Name 'rtm_RtmGetOpaqueInformationPointer' -Namespace Win32 -PassThru
# $api::RtmGetOpaqueInformationPointer(RtmRegHandle, DestHandle, OpaqueInfoPointer)#uselib "rtm.dll"
#func global RtmGetOpaqueInformationPointer "RtmGetOpaqueInformationPointer" sptr, sptr, sptr
; RtmGetOpaqueInformationPointer RtmRegHandle, DestHandle, OpaqueInfoPointer ; 戻り値は stat
; RtmRegHandle : INT_PTR -> "sptr"
; DestHandle : INT_PTR -> "sptr"
; OpaqueInfoPointer : void** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "rtm.dll"
#cfunc global RtmGetOpaqueInformationPointer "RtmGetOpaqueInformationPointer" sptr, sptr, sptr
; res = RtmGetOpaqueInformationPointer(RtmRegHandle, DestHandle, OpaqueInfoPointer)
; RtmRegHandle : INT_PTR -> "sptr"
; DestHandle : INT_PTR -> "sptr"
; OpaqueInfoPointer : void** in/out -> "sptr"; DWORD RtmGetOpaqueInformationPointer(INT_PTR RtmRegHandle, INT_PTR DestHandle, void** OpaqueInfoPointer)
#uselib "rtm.dll"
#cfunc global RtmGetOpaqueInformationPointer "RtmGetOpaqueInformationPointer" intptr, intptr, intptr
; res = RtmGetOpaqueInformationPointer(RtmRegHandle, DestHandle, OpaqueInfoPointer)
; RtmRegHandle : INT_PTR -> "intptr"
; DestHandle : INT_PTR -> "intptr"
; OpaqueInfoPointer : void** in/out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rtm = windows.NewLazySystemDLL("rtm.dll")
procRtmGetOpaqueInformationPointer = rtm.NewProc("RtmGetOpaqueInformationPointer")
)
// RtmRegHandle (INT_PTR), DestHandle (INT_PTR), OpaqueInfoPointer (void** in/out)
r1, _, err := procRtmGetOpaqueInformationPointer.Call(
uintptr(RtmRegHandle),
uintptr(DestHandle),
uintptr(OpaqueInfoPointer),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction RtmGetOpaqueInformationPointer(
RtmRegHandle: NativeInt; // INT_PTR
DestHandle: NativeInt; // INT_PTR
OpaqueInfoPointer: Pointer // void** in/out
): DWORD; stdcall;
external 'rtm.dll' name 'RtmGetOpaqueInformationPointer';result := DllCall("rtm\RtmGetOpaqueInformationPointer"
, "Ptr", RtmRegHandle ; INT_PTR
, "Ptr", DestHandle ; INT_PTR
, "Ptr", OpaqueInfoPointer ; void** in/out
, "UInt") ; return: DWORD●RtmGetOpaqueInformationPointer(RtmRegHandle, DestHandle, OpaqueInfoPointer) = DLL("rtm.dll", "dword RtmGetOpaqueInformationPointer(int, int, void*)")
# 呼び出し: RtmGetOpaqueInformationPointer(RtmRegHandle, DestHandle, OpaqueInfoPointer)
# RtmRegHandle : INT_PTR -> "int"
# DestHandle : INT_PTR -> "int"
# OpaqueInfoPointer : void** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "rtm" fn RtmGetOpaqueInformationPointer(
RtmRegHandle: isize, // INT_PTR
DestHandle: isize, // INT_PTR
OpaqueInfoPointer: ?*anyopaque // void** in/out
) callconv(std.os.windows.WINAPI) u32;proc RtmGetOpaqueInformationPointer(
RtmRegHandle: int, # INT_PTR
DestHandle: int, # INT_PTR
OpaqueInfoPointer: pointer # void** in/out
): uint32 {.importc: "RtmGetOpaqueInformationPointer", stdcall, dynlib: "rtm.dll".}pragma(lib, "rtm");
extern(Windows)
uint RtmGetOpaqueInformationPointer(
ptrdiff_t RtmRegHandle, // INT_PTR
ptrdiff_t DestHandle, // INT_PTR
void** OpaqueInfoPointer // void** in/out
);ccall((:RtmGetOpaqueInformationPointer, "rtm.dll"), stdcall, UInt32,
(Int, Int, Ptr{Cvoid}),
RtmRegHandle, DestHandle, OpaqueInfoPointer)
# RtmRegHandle : INT_PTR -> Int
# DestHandle : INT_PTR -> Int
# OpaqueInfoPointer : void** in/out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t RtmGetOpaqueInformationPointer(
intptr_t RtmRegHandle,
intptr_t DestHandle,
void** OpaqueInfoPointer);
]]
local rtm = ffi.load("rtm")
-- rtm.RtmGetOpaqueInformationPointer(RtmRegHandle, DestHandle, OpaqueInfoPointer)
-- RtmRegHandle : INT_PTR
-- DestHandle : INT_PTR
-- OpaqueInfoPointer : void** in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('rtm.dll');
const RtmGetOpaqueInformationPointer = lib.func('__stdcall', 'RtmGetOpaqueInformationPointer', 'uint32_t', ['intptr_t', 'intptr_t', 'void *']);
// RtmGetOpaqueInformationPointer(RtmRegHandle, DestHandle, OpaqueInfoPointer)
// RtmRegHandle : INT_PTR -> 'intptr_t'
// DestHandle : INT_PTR -> 'intptr_t'
// OpaqueInfoPointer : void** in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("rtm.dll", {
RtmGetOpaqueInformationPointer: { parameters: ["isize", "isize", "pointer"], result: "u32" },
});
// lib.symbols.RtmGetOpaqueInformationPointer(RtmRegHandle, DestHandle, OpaqueInfoPointer)
// RtmRegHandle : INT_PTR -> "isize"
// DestHandle : INT_PTR -> "isize"
// OpaqueInfoPointer : void** in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t RtmGetOpaqueInformationPointer(
intptr_t RtmRegHandle,
intptr_t DestHandle,
void** OpaqueInfoPointer);
C, "rtm.dll");
// $ffi->RtmGetOpaqueInformationPointer(RtmRegHandle, DestHandle, OpaqueInfoPointer);
// RtmRegHandle : INT_PTR
// DestHandle : INT_PTR
// OpaqueInfoPointer : void** 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 Rtm extends StdCallLibrary {
Rtm INSTANCE = Native.load("rtm", Rtm.class);
int RtmGetOpaqueInformationPointer(
long RtmRegHandle, // INT_PTR
long DestHandle, // INT_PTR
Pointer OpaqueInfoPointer // void** in/out
);
}@[Link("rtm")]
lib Librtm
fun RtmGetOpaqueInformationPointer = RtmGetOpaqueInformationPointer(
RtmRegHandle : LibC::SSizeT, # INT_PTR
DestHandle : LibC::SSizeT, # INT_PTR
OpaqueInfoPointer : Void** # void** in/out
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef RtmGetOpaqueInformationPointerNative = Uint32 Function(IntPtr, IntPtr, Pointer<Void>);
typedef RtmGetOpaqueInformationPointerDart = int Function(int, int, Pointer<Void>);
final RtmGetOpaqueInformationPointer = DynamicLibrary.open('rtm.dll')
.lookupFunction<RtmGetOpaqueInformationPointerNative, RtmGetOpaqueInformationPointerDart>('RtmGetOpaqueInformationPointer');
// RtmRegHandle : INT_PTR -> IntPtr
// DestHandle : INT_PTR -> IntPtr
// OpaqueInfoPointer : void** in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function RtmGetOpaqueInformationPointer(
RtmRegHandle: NativeInt; // INT_PTR
DestHandle: NativeInt; // INT_PTR
OpaqueInfoPointer: Pointer // void** in/out
): DWORD; stdcall;
external 'rtm.dll' name 'RtmGetOpaqueInformationPointer';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "RtmGetOpaqueInformationPointer"
c_RtmGetOpaqueInformationPointer :: CIntPtr -> CIntPtr -> Ptr () -> IO Word32
-- RtmRegHandle : INT_PTR -> CIntPtr
-- DestHandle : INT_PTR -> CIntPtr
-- OpaqueInfoPointer : void** in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let rtmgetopaqueinformationpointer =
foreign "RtmGetOpaqueInformationPointer"
(intptr_t @-> intptr_t @-> (ptr void) @-> returning uint32_t)
(* RtmRegHandle : INT_PTR -> intptr_t *)
(* DestHandle : INT_PTR -> intptr_t *)
(* OpaqueInfoPointer : void** in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library rtm (t "rtm.dll"))
(cffi:use-foreign-library rtm)
(cffi:defcfun ("RtmGetOpaqueInformationPointer" rtm-get-opaque-information-pointer :convention :stdcall) :uint32
(rtm-reg-handle :int64) ; INT_PTR
(dest-handle :int64) ; INT_PTR
(opaque-info-pointer :pointer)) ; void** in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $RtmGetOpaqueInformationPointer = Win32::API::More->new('rtm',
'DWORD RtmGetOpaqueInformationPointer(LPARAM RtmRegHandle, LPARAM DestHandle, LPVOID OpaqueInfoPointer)');
# my $ret = $RtmGetOpaqueInformationPointer->Call($RtmRegHandle, $DestHandle, $OpaqueInfoPointer);
# RtmRegHandle : INT_PTR -> LPARAM
# DestHandle : INT_PTR -> LPARAM
# OpaqueInfoPointer : void** in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。