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

RpcMgmtEpEltInqNextW

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

シグネチャ

// RPCRT4.dll  (Unicode / -W)
#include <windows.h>

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

パラメーター

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

戻り値の型: RPC_STATUS

各言語での呼び出し定義

// RPCRT4.dll  (Unicode / -W)
#include <windows.h>

RPC_STATUS RpcMgmtEpEltInqNextW(
    void** InquiryContext,
    RPC_IF_ID* IfId,
    void** Binding,   // optional
    GUID* ObjectUuid,   // optional
    LPWSTR* Annotation   // optional
);
[DllImport("RPCRT4.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RpcMgmtEpEltInqNextW(
    IntPtr InquiryContext,   // void**
    IntPtr IfId,   // RPC_IF_ID* out
    IntPtr Binding,   // void** optional, out
    IntPtr ObjectUuid,   // GUID* optional, out
    IntPtr Annotation   // LPWSTR* optional, out
);
<DllImport("RPCRT4.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RpcMgmtEpEltInqNextW(
    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   ' LPWSTR* optional, out
) As Integer
End Function
' InquiryContext : void**
' IfId : RPC_IF_ID* out
' Binding : void** optional, out
' ObjectUuid : GUID* optional, out
' Annotation : LPWSTR* optional, out
Declare PtrSafe Function RpcMgmtEpEltInqNextW Lib "rpcrt4" ( _
    ByVal InquiryContext As LongPtr, _
    ByVal IfId As LongPtr, _
    ByVal Binding As LongPtr, _
    ByVal ObjectUuid As LongPtr, _
    ByVal Annotation As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcMgmtEpEltInqNextW = ctypes.windll.rpcrt4.RpcMgmtEpEltInqNextW
RpcMgmtEpEltInqNextW.restype = ctypes.c_int
RpcMgmtEpEltInqNextW.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 : LPWSTR* optional, out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcMgmtEpEltInqNextW = rpcrt4.NewProc("RpcMgmtEpEltInqNextW")
)

// InquiryContext (void**), IfId (RPC_IF_ID* out), Binding (void** optional, out), ObjectUuid (GUID* optional, out), Annotation (LPWSTR* optional, out)
r1, _, err := procRpcMgmtEpEltInqNextW.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 RpcMgmtEpEltInqNextW(
  InquiryContext: Pointer;   // void**
  IfId: Pointer;   // RPC_IF_ID* out
  Binding: Pointer;   // void** optional, out
  ObjectUuid: PGUID;   // GUID* optional, out
  Annotation: PPWideChar   // LPWSTR* optional, out
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcMgmtEpEltInqNextW';
result := DllCall("RPCRT4\RpcMgmtEpEltInqNextW"
    , "Ptr", InquiryContext   ; void**
    , "Ptr", IfId   ; RPC_IF_ID* out
    , "Ptr", Binding   ; void** optional, out
    , "Ptr", ObjectUuid   ; GUID* optional, out
    , "Ptr", Annotation   ; LPWSTR* optional, out
    , "Int")   ; return: RPC_STATUS
●RpcMgmtEpEltInqNextW(InquiryContext, IfId, Binding, ObjectUuid, Annotation) = DLL("RPCRT4.dll", "int RpcMgmtEpEltInqNextW(void*, void*, void*, void*, void*)")
# 呼び出し: RpcMgmtEpEltInqNextW(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 : LPWSTR* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。
const std = @import("std");

extern "rpcrt4" fn RpcMgmtEpEltInqNextW(
    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]u16 // LPWSTR* optional, out
) callconv(std.os.windows.WINAPI) i32;
// Unicode(-W): UTF-16LE のヌル終端バッファ([*c]const u16)を渡す。
proc RpcMgmtEpEltInqNextW(
    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 WideCString  # LPWSTR* optional, out
): int32 {.importc: "RpcMgmtEpEltInqNextW", stdcall, dynlib: "RPCRT4.dll".}
# Unicode(-W): WideCString は newWideCString("...") で生成。
pragma(lib, "rpcrt4");
extern(Windows)
int RpcMgmtEpEltInqNextW(
    void** InquiryContext,   // void**
    RPC_IF_ID* IfId,   // RPC_IF_ID* out
    void** Binding,   // void** optional, out
    GUID* ObjectUuid,   // GUID* optional, out
    wchar** Annotation   // LPWSTR* optional, out
);
ccall((:RpcMgmtEpEltInqNextW, "RPCRT4.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Ptr{RPC_IF_ID}, Ptr{Cvoid}, Ptr{GUID}, Ptr{Ptr{UInt16}}),
      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 : LPWSTR* optional, out -> Ptr{Ptr{UInt16}}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
# Unicode(-W): Cwstring には transcode(UInt16, "...") 等で UTF-16 を渡す。
local ffi = require("ffi")
ffi.cdef[[
int32_t RpcMgmtEpEltInqNextW(
    void** InquiryContext,
    void* IfId,
    void** Binding,
    void* ObjectUuid,
    uint16_t** Annotation);
]]
local rpcrt4 = ffi.load("rpcrt4")
-- rpcrt4.RpcMgmtEpEltInqNextW(InquiryContext, IfId, Binding, ObjectUuid, Annotation)
-- InquiryContext : void**
-- IfId : RPC_IF_ID* out
-- Binding : void** optional, out
-- ObjectUuid : GUID* optional, out
-- Annotation : LPWSTR* optional, out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
-- Unicode(-W): uint16_t* には UTF-16LE のバッファ(ffi.new("uint16_t[?]", ...))を渡す。
const koffi = require('koffi');
const lib = koffi.load('RPCRT4.dll');
const RpcMgmtEpEltInqNextW = lib.func('__stdcall', 'RpcMgmtEpEltInqNextW', 'int32_t', ['void *', 'void *', 'void *', 'void *', 'void *']);
// RpcMgmtEpEltInqNextW(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 : LPWSTR* optional, out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("RPCRT4.dll", {
  RpcMgmtEpEltInqNextW: { parameters: ["pointer", "pointer", "pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.RpcMgmtEpEltInqNextW(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 : LPWSTR* optional, out -> "pointer"
// 文字列は "buffer"。Unicode(-W) は new TextEncoder() ではなく UTF-16LE のバイト列(末尾に \x00\x00)を Uint8Array で渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t RpcMgmtEpEltInqNextW(
    void** InquiryContext,
    void* IfId,
    void** Binding,
    void* ObjectUuid,
    uint16_t** Annotation);
C, "RPCRT4.dll");
// $ffi->RpcMgmtEpEltInqNextW(InquiryContext, IfId, Binding, ObjectUuid, Annotation);
// InquiryContext : void**
// IfId : RPC_IF_ID* out
// Binding : void** optional, out
// ObjectUuid : GUID* optional, out
// Annotation : LPWSTR* 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.UNICODE_OPTIONS);
    int RpcMgmtEpEltInqNextW(
        Pointer InquiryContext,   // void**
        Pointer IfId,   // RPC_IF_ID* out
        Pointer Binding,   // void** optional, out
        Pointer ObjectUuid,   // GUID* optional, out
        PointerByReference Annotation   // LPWSTR* optional, out
    );
}
// Unicode(-W): WString(入力)/char[](出力)で UTF-16 をマーシャリング。
@[Link("rpcrt4")]
lib LibRPCRT4
  fun RpcMgmtEpEltInqNextW = RpcMgmtEpEltInqNextW(
    InquiryContext : Void**,   # void**
    IfId : RPC_IF_ID*,   # RPC_IF_ID* out
    Binding : Void**,   # void** optional, out
    ObjectUuid : GUID*,   # GUID* optional, out
    Annotation : UInt16**   # LPWSTR* 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 RpcMgmtEpEltInqNextWNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Pointer<Utf16>>);
typedef RpcMgmtEpEltInqNextWDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Pointer<Utf16>>);
final RpcMgmtEpEltInqNextW = DynamicLibrary.open('RPCRT4.dll')
    .lookupFunction<RpcMgmtEpEltInqNextWNative, RpcMgmtEpEltInqNextWDart>('RpcMgmtEpEltInqNextW');
// InquiryContext : void** -> Pointer<Void>
// IfId : RPC_IF_ID* out -> Pointer<Void>
// Binding : void** optional, out -> Pointer<Void>
// ObjectUuid : GUID* optional, out -> Pointer<Void>
// Annotation : LPWSTR* optional, out -> Pointer<Pointer<Utf16>>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function RpcMgmtEpEltInqNextW(
  InquiryContext: Pointer;   // void**
  IfId: Pointer;   // RPC_IF_ID* out
  Binding: Pointer;   // void** optional, out
  ObjectUuid: PGUID;   // GUID* optional, out
  Annotation: PPWideChar   // LPWSTR* optional, out
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcMgmtEpEltInqNextW';
import Foreign
import Foreign.C.Types
import Foreign.C.String

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

let rpcmgmtepeltinqnextw =
  foreign "RpcMgmtEpEltInqNextW"
    ((ptr void) @-> (ptr void) @-> (ptr void) @-> (ptr void) @-> (ptr (ptr uint16_t)) @-> 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 : LPWSTR* optional, out -> (ptr (ptr uint16_t)) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library rpcrt4 (t "RPCRT4.dll"))
(cffi:use-foreign-library rpcrt4)

(cffi:defcfun ("RpcMgmtEpEltInqNextW" rpc-mgmt-ep-elt-inq-next-w :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))   ; LPWSTR* optional, out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $RpcMgmtEpEltInqNextW = Win32::API::More->new('RPCRT4',
    'int RpcMgmtEpEltInqNextW(LPVOID InquiryContext, LPVOID IfId, LPVOID Binding, LPVOID ObjectUuid, LPVOID Annotation)');
# my $ret = $RpcMgmtEpEltInqNextW->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 : LPWSTR* optional, out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。
# Unicode(-W): LPCWSTR/LPWSTR は Win32::API が UTF-16 変換を行う。

関連項目

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