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

RpcMgmtEpEltInqBegin

関数
エンドポイントマッパーデータベースの照会を開始しコンテキストを取得する。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcMgmtEpEltInqBegin(
    void* EpBinding,   // optional
    DWORD InquiryType,
    RPC_IF_ID* IfId,   // optional
    DWORD VersOption,   // optional
    GUID* ObjectUuid,   // optional
    void*** InquiryContext
);

パラメーター

名前方向説明
EpBindingvoid*inoptional照会対象エンドポイントマッパーのバインディングハンドル。NULLでローカルホスト。
InquiryTypeDWORDin照会の絞り込み方法を示す種別(RPC_C_EP_ALL_ELTS等)。
IfIdRPC_IF_ID*inoptional絞り込みに使用するインターフェイスIDへのポインタ。種別に応じNULL可。
VersOptionDWORDinoptionalインターフェイスバージョンの照合方法を示すオプション値。
ObjectUuidGUID*inoptional絞り込みに使用するオブジェクトUUIDへのポインタ。種別に応じNULL可。
InquiryContextvoid***out後続の列挙呼び出しで使用する照会コンテキストを受け取る出力先。

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

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

RpcMgmtEpEltInqBegin = ctypes.windll.rpcrt4.RpcMgmtEpEltInqBegin
RpcMgmtEpEltInqBegin.restype = ctypes.c_int
RpcMgmtEpEltInqBegin.argtypes = [
    ctypes.POINTER(None),  # EpBinding : void* optional
    wintypes.DWORD,  # InquiryType : DWORD
    ctypes.c_void_p,  # IfId : RPC_IF_ID* optional
    wintypes.DWORD,  # VersOption : DWORD optional
    ctypes.c_void_p,  # ObjectUuid : GUID* optional
    ctypes.c_void_p,  # InquiryContext : void*** out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcMgmtEpEltInqBegin = rpcrt4.NewProc("RpcMgmtEpEltInqBegin")
)

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

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

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

foreign import stdcall safe "RpcMgmtEpEltInqBegin"
  c_RpcMgmtEpEltInqBegin :: Ptr () -> Word32 -> Ptr () -> Word32 -> Ptr () -> Ptr () -> IO Int32
-- EpBinding : void* optional -> Ptr ()
-- InquiryType : DWORD -> Word32
-- IfId : RPC_IF_ID* optional -> Ptr ()
-- VersOption : DWORD optional -> Word32
-- ObjectUuid : GUID* optional -> Ptr ()
-- InquiryContext : void*** out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let rpcmgmtepeltinqbegin =
  foreign "RpcMgmtEpEltInqBegin"
    ((ptr void) @-> uint32_t @-> (ptr void) @-> uint32_t @-> (ptr void) @-> (ptr void) @-> returning int32_t)
(* EpBinding : void* optional -> (ptr void) *)
(* InquiryType : DWORD -> uint32_t *)
(* IfId : RPC_IF_ID* optional -> (ptr void) *)
(* VersOption : DWORD optional -> uint32_t *)
(* ObjectUuid : GUID* optional -> (ptr void) *)
(* InquiryContext : void*** out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library rpcrt4 (t "RPCRT4.dll"))
(cffi:use-foreign-library rpcrt4)

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

関連項目

使用する型