Win32 API 日本語リファレンス
ホームSystem.Rpc › RpcMgmtEpEltInqNextA

RpcMgmtEpEltInqNextA

関数
エンドポイントマッパー照会から次の登録要素を取得する(ANSI版)。
DLLRPCRT4.dll文字セットANSI (-A)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// RPCRT4.dll  (ANSI / -A)
#include <windows.h>

RPC_STATUS RpcMgmtEpEltInqNextA(
    void** InquiryContext,
    RPC_IF_ID* IfId,
    void** Binding,   // optional
    GUID* ObjectUuid,   // optional
    LPSTR* Annotation   // optional
);

パラメーター

名前方向説明
InquiryContextvoid**in列挙を進める照会コンテキストへのポインタ。
IfIdRPC_IF_ID*out取得した要素のインターフェイスIDを受け取る出力先。NULL可。
Bindingvoid**outoptional取得した要素のバインディングハンドルを受け取る出力先。NULL可。
ObjectUuidGUID*outoptional取得した要素のオブジェクトUUIDを受け取る出力先。NULL可。
AnnotationLPSTR*outoptional取得した要素の注釈文字列(ANSI)を受け取る出力先。NULL可。要解放。

戻り値の型: RPC_STATUS

各言語での呼び出し定義

// RPCRT4.dll  (ANSI / -A)
#include <windows.h>

RPC_STATUS RpcMgmtEpEltInqNextA(
    void** InquiryContext,
    RPC_IF_ID* IfId,
    void** Binding,   // optional
    GUID* ObjectUuid,   // optional
    LPSTR* Annotation   // optional
);
[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int RpcMgmtEpEltInqNextA(
    IntPtr InquiryContext,   // void**
    IntPtr IfId,   // RPC_IF_ID* out
    IntPtr Binding,   // void** optional, out
    IntPtr ObjectUuid,   // GUID* optional, out
    IntPtr Annotation   // LPSTR* optional, out
);
<DllImport("RPCRT4.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RpcMgmtEpEltInqNextA(
    InquiryContext As IntPtr,   ' void**
    IfId As IntPtr,   ' RPC_IF_ID* out
    Binding As IntPtr,   ' void** optional, out
    ObjectUuid As IntPtr,   ' GUID* optional, out
    Annotation As IntPtr   ' LPSTR* optional, out
) As Integer
End Function
' InquiryContext : void**
' IfId : RPC_IF_ID* out
' Binding : void** optional, out
' ObjectUuid : GUID* optional, out
' Annotation : LPSTR* optional, out
Declare PtrSafe Function RpcMgmtEpEltInqNextA Lib "rpcrt4" ( _
    ByVal InquiryContext As LongPtr, _
    ByVal IfId As LongPtr, _
    ByVal Binding As LongPtr, _
    ByVal ObjectUuid As LongPtr, _
    ByVal Annotation As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcMgmtEpEltInqNextA = ctypes.windll.rpcrt4.RpcMgmtEpEltInqNextA
RpcMgmtEpEltInqNextA.restype = ctypes.c_int
RpcMgmtEpEltInqNextA.argtypes = [
    ctypes.c_void_p,  # InquiryContext : void**
    ctypes.c_void_p,  # IfId : RPC_IF_ID* out
    ctypes.c_void_p,  # Binding : void** optional, out
    ctypes.c_void_p,  # ObjectUuid : GUID* optional, out
    ctypes.c_void_p,  # Annotation : LPSTR* optional, out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
RpcMgmtEpEltInqNextA = Fiddle::Function.new(
  lib['RpcMgmtEpEltInqNextA'],
  [
    Fiddle::TYPE_VOIDP,  # InquiryContext : void**
    Fiddle::TYPE_VOIDP,  # IfId : RPC_IF_ID* out
    Fiddle::TYPE_VOIDP,  # Binding : void** optional, out
    Fiddle::TYPE_VOIDP,  # ObjectUuid : GUID* optional, out
    Fiddle::TYPE_VOIDP,  # Annotation : LPSTR* optional, out
  ],
  Fiddle::TYPE_INT)
#[link(name = "rpcrt4")]
extern "system" {
    fn RpcMgmtEpEltInqNextA(
        InquiryContext: *mut *mut (),  // void**
        IfId: *mut RPC_IF_ID,  // RPC_IF_ID* out
        Binding: *mut *mut (),  // void** optional, out
        ObjectUuid: *mut GUID,  // GUID* optional, out
        Annotation: *mut *mut u8  // LPSTR* optional, out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi)]
public static extern int RpcMgmtEpEltInqNextA(IntPtr InquiryContext, IntPtr IfId, IntPtr Binding, IntPtr ObjectUuid, IntPtr Annotation);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcMgmtEpEltInqNextA' -Namespace Win32 -PassThru
# $api::RpcMgmtEpEltInqNextA(InquiryContext, IfId, Binding, ObjectUuid, Annotation)
#uselib "RPCRT4.dll"
#func global RpcMgmtEpEltInqNextA "RpcMgmtEpEltInqNextA" sptr, sptr, sptr, sptr, sptr
; RpcMgmtEpEltInqNextA InquiryContext, varptr(IfId), Binding, varptr(ObjectUuid), varptr(Annotation)   ; 戻り値は stat
; InquiryContext : void** -> "sptr"
; IfId : RPC_IF_ID* out -> "sptr"
; Binding : void** optional, out -> "sptr"
; ObjectUuid : GUID* optional, out -> "sptr"
; Annotation : LPSTR* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "RPCRT4.dll"
#cfunc global RpcMgmtEpEltInqNextA "RpcMgmtEpEltInqNextA" sptr, var, sptr, var, var
; res = RpcMgmtEpEltInqNextA(InquiryContext, IfId, Binding, ObjectUuid, Annotation)
; InquiryContext : void** -> "sptr"
; IfId : RPC_IF_ID* out -> "var"
; Binding : void** optional, out -> "sptr"
; ObjectUuid : GUID* optional, out -> "var"
; Annotation : LPSTR* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; RPC_STATUS RpcMgmtEpEltInqNextA(void** InquiryContext, RPC_IF_ID* IfId, void** Binding, GUID* ObjectUuid, LPSTR* Annotation)
#uselib "RPCRT4.dll"
#cfunc global RpcMgmtEpEltInqNextA "RpcMgmtEpEltInqNextA" intptr, var, intptr, var, var
; res = RpcMgmtEpEltInqNextA(InquiryContext, IfId, Binding, ObjectUuid, Annotation)
; InquiryContext : void** -> "intptr"
; IfId : RPC_IF_ID* out -> "var"
; Binding : void** optional, out -> "intptr"
; ObjectUuid : GUID* optional, out -> "var"
; Annotation : LPSTR* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcMgmtEpEltInqNextA = rpcrt4.NewProc("RpcMgmtEpEltInqNextA")
)

// InquiryContext (void**), IfId (RPC_IF_ID* out), Binding (void** optional, out), ObjectUuid (GUID* optional, out), Annotation (LPSTR* optional, out)
r1, _, err := procRpcMgmtEpEltInqNextA.Call(
	uintptr(InquiryContext),
	uintptr(IfId),
	uintptr(Binding),
	uintptr(ObjectUuid),
	uintptr(Annotation),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function RpcMgmtEpEltInqNextA(
  InquiryContext: Pointer;   // void**
  IfId: Pointer;   // RPC_IF_ID* out
  Binding: Pointer;   // void** optional, out
  ObjectUuid: PGUID;   // GUID* optional, out
  Annotation: PPAnsiChar   // LPSTR* optional, out
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcMgmtEpEltInqNextA';
result := DllCall("RPCRT4\RpcMgmtEpEltInqNextA"
    , "Ptr", InquiryContext   ; void**
    , "Ptr", IfId   ; RPC_IF_ID* out
    , "Ptr", Binding   ; void** optional, out
    , "Ptr", ObjectUuid   ; GUID* optional, out
    , "Ptr", Annotation   ; LPSTR* optional, out
    , "Int")   ; return: RPC_STATUS
●RpcMgmtEpEltInqNextA(InquiryContext, IfId, Binding, ObjectUuid, Annotation) = DLL("RPCRT4.dll", "int RpcMgmtEpEltInqNextA(void*, void*, void*, void*, void*)")
# 呼び出し: RpcMgmtEpEltInqNextA(InquiryContext, IfId, Binding, ObjectUuid, Annotation)
# InquiryContext : void** -> "void*"
# IfId : RPC_IF_ID* out -> "void*"
# Binding : void** optional, out -> "void*"
# ObjectUuid : GUID* optional, out -> "void*"
# Annotation : LPSTR* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "rpcrt4" fn RpcMgmtEpEltInqNextA(
    InquiryContext: ?*anyopaque, // void**
    IfId: [*c]RPC_IF_ID, // RPC_IF_ID* out
    Binding: ?*anyopaque, // void** optional, out
    ObjectUuid: [*c]GUID, // GUID* optional, out
    Annotation: [*c][*c]u8 // LPSTR* optional, out
) callconv(std.os.windows.WINAPI) i32;
proc RpcMgmtEpEltInqNextA(
    InquiryContext: pointer,  # void**
    IfId: ptr RPC_IF_ID,  # RPC_IF_ID* out
    Binding: pointer,  # void** optional, out
    ObjectUuid: ptr GUID,  # GUID* optional, out
    Annotation: ptr cstring  # LPSTR* optional, out
): int32 {.importc: "RpcMgmtEpEltInqNextA", stdcall, dynlib: "RPCRT4.dll".}
pragma(lib, "rpcrt4");
extern(Windows)
int RpcMgmtEpEltInqNextA(
    void** InquiryContext,   // void**
    RPC_IF_ID* IfId,   // RPC_IF_ID* out
    void** Binding,   // void** optional, out
    GUID* ObjectUuid,   // GUID* optional, out
    char** Annotation   // LPSTR* optional, out
);
ccall((:RpcMgmtEpEltInqNextA, "RPCRT4.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Ptr{RPC_IF_ID}, Ptr{Cvoid}, Ptr{GUID}, Ptr{Ptr{UInt8}}),
      InquiryContext, IfId, Binding, ObjectUuid, Annotation)
# InquiryContext : void** -> Ptr{Cvoid}
# IfId : RPC_IF_ID* out -> Ptr{RPC_IF_ID}
# Binding : void** optional, out -> Ptr{Cvoid}
# ObjectUuid : GUID* optional, out -> Ptr{GUID}
# Annotation : LPSTR* optional, out -> Ptr{Ptr{UInt8}}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t RpcMgmtEpEltInqNextA(
    void** InquiryContext,
    void* IfId,
    void** Binding,
    void* ObjectUuid,
    char** Annotation);
]]
local rpcrt4 = ffi.load("rpcrt4")
-- rpcrt4.RpcMgmtEpEltInqNextA(InquiryContext, IfId, Binding, ObjectUuid, Annotation)
-- InquiryContext : void**
-- IfId : RPC_IF_ID* out
-- Binding : void** optional, out
-- ObjectUuid : GUID* optional, out
-- Annotation : LPSTR* optional, out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('RPCRT4.dll');
const RpcMgmtEpEltInqNextA = lib.func('__stdcall', 'RpcMgmtEpEltInqNextA', 'int32_t', ['void *', 'void *', 'void *', 'void *', 'void *']);
// RpcMgmtEpEltInqNextA(InquiryContext, IfId, Binding, ObjectUuid, Annotation)
// InquiryContext : void** -> 'void *'
// IfId : RPC_IF_ID* out -> 'void *'
// Binding : void** optional, out -> 'void *'
// ObjectUuid : GUID* optional, out -> 'void *'
// Annotation : LPSTR* optional, out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("RPCRT4.dll", {
  RpcMgmtEpEltInqNextA: { parameters: ["pointer", "pointer", "pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.RpcMgmtEpEltInqNextA(InquiryContext, IfId, Binding, ObjectUuid, Annotation)
// InquiryContext : void** -> "pointer"
// IfId : RPC_IF_ID* out -> "pointer"
// Binding : void** optional, out -> "pointer"
// ObjectUuid : GUID* optional, out -> "pointer"
// Annotation : LPSTR* optional, out -> "pointer"
// 文字列は "buffer"。ANSI(-A) は new TextEncoder() で UTF-8/ANSI バイト列(末尾に \x00)を渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t RpcMgmtEpEltInqNextA(
    void** InquiryContext,
    void* IfId,
    void** Binding,
    void* ObjectUuid,
    char** Annotation);
C, "RPCRT4.dll");
// $ffi->RpcMgmtEpEltInqNextA(InquiryContext, IfId, Binding, ObjectUuid, Annotation);
// InquiryContext : void**
// IfId : RPC_IF_ID* out
// Binding : void** optional, out
// ObjectUuid : GUID* optional, out
// Annotation : LPSTR* optional, 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 Rpcrt4 extends StdCallLibrary {
    Rpcrt4 INSTANCE = Native.load("rpcrt4", Rpcrt4.class, W32APIOptions.ASCII_OPTIONS);
    int RpcMgmtEpEltInqNextA(
        Pointer InquiryContext,   // void**
        Pointer IfId,   // RPC_IF_ID* out
        Pointer Binding,   // void** optional, out
        Pointer ObjectUuid,   // GUID* optional, out
        PointerByReference Annotation   // LPSTR* optional, out
    );
}
@[Link("rpcrt4")]
lib LibRPCRT4
  fun RpcMgmtEpEltInqNextA = RpcMgmtEpEltInqNextA(
    InquiryContext : Void**,   # void**
    IfId : RPC_IF_ID*,   # RPC_IF_ID* out
    Binding : Void**,   # void** optional, out
    ObjectUuid : GUID*,   # GUID* optional, out
    Annotation : UInt8**   # LPSTR* optional, out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef RpcMgmtEpEltInqNextANative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Pointer<Utf8>>);
typedef RpcMgmtEpEltInqNextADart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Pointer<Utf8>>);
final RpcMgmtEpEltInqNextA = DynamicLibrary.open('RPCRT4.dll')
    .lookupFunction<RpcMgmtEpEltInqNextANative, RpcMgmtEpEltInqNextADart>('RpcMgmtEpEltInqNextA');
// InquiryContext : void** -> Pointer<Void>
// IfId : RPC_IF_ID* out -> Pointer<Void>
// Binding : void** optional, out -> Pointer<Void>
// ObjectUuid : GUID* optional, out -> Pointer<Void>
// Annotation : LPSTR* optional, out -> Pointer<Pointer<Utf8>>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function RpcMgmtEpEltInqNextA(
  InquiryContext: Pointer;   // void**
  IfId: Pointer;   // RPC_IF_ID* out
  Binding: Pointer;   // void** optional, out
  ObjectUuid: PGUID;   // GUID* optional, out
  Annotation: PPAnsiChar   // LPSTR* optional, out
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcMgmtEpEltInqNextA';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "RpcMgmtEpEltInqNextA"
  c_RpcMgmtEpEltInqNextA :: Ptr () -> Ptr () -> Ptr () -> Ptr () -> Ptr CString -> IO Int32
-- InquiryContext : void** -> Ptr ()
-- IfId : RPC_IF_ID* out -> Ptr ()
-- Binding : void** optional, out -> Ptr ()
-- ObjectUuid : GUID* optional, out -> Ptr ()
-- Annotation : LPSTR* optional, out -> Ptr CString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let rpcmgmtepeltinqnexta =
  foreign "RpcMgmtEpEltInqNextA"
    ((ptr void) @-> (ptr void) @-> (ptr void) @-> (ptr void) @-> (ptr string) @-> returning int32_t)
(* InquiryContext : void** -> (ptr void) *)
(* IfId : RPC_IF_ID* out -> (ptr void) *)
(* Binding : void** optional, out -> (ptr void) *)
(* ObjectUuid : GUID* optional, out -> (ptr void) *)
(* Annotation : LPSTR* optional, out -> (ptr string) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library rpcrt4 (t "RPCRT4.dll"))
(cffi:use-foreign-library rpcrt4)

(cffi:defcfun ("RpcMgmtEpEltInqNextA" rpc-mgmt-ep-elt-inq-next-a :convention :stdcall) :int32
  (inquiry-context :pointer)   ; void**
  (if-id :pointer)   ; RPC_IF_ID* out
  (binding :pointer)   ; void** optional, out
  (object-uuid :pointer)   ; GUID* optional, out
  (annotation :pointer))   ; LPSTR* optional, out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $RpcMgmtEpEltInqNextA = Win32::API::More->new('RPCRT4',
    'int RpcMgmtEpEltInqNextA(LPVOID InquiryContext, LPVOID IfId, LPVOID Binding, LPVOID ObjectUuid, LPVOID Annotation)');
# my $ret = $RpcMgmtEpEltInqNextA->Call($InquiryContext, $IfId, $Binding, $ObjectUuid, $Annotation);
# InquiryContext : void** -> LPVOID
# IfId : RPC_IF_ID* out -> LPVOID
# Binding : void** optional, out -> LPVOID
# ObjectUuid : GUID* optional, out -> LPVOID
# Annotation : LPSTR* optional, out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

文字セット違い
使用する型