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

RpcNsProfileEltInqBeginW

関数
ネームサービスのプロファイル要素の列挙を開始する(Unicode版)。
DLLRPCNS4.dll文字セットUnicode (-W)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcNsProfileEltInqBeginW(
    DWORD ProfileNameSyntax,
    LPWSTR ProfileName,
    DWORD InquiryType,
    RPC_IF_ID* IfId,   // optional
    DWORD VersOption,
    DWORD MemberNameSyntax,
    LPWSTR MemberName,   // optional
    void** InquiryContext
);

パラメーター

名前方向
ProfileNameSyntaxDWORDin
ProfileNameLPWSTRin
InquiryTypeDWORDin
IfIdRPC_IF_ID*inoptional
VersOptionDWORDin
MemberNameSyntaxDWORDin
MemberNameLPWSTRinoptional
InquiryContextvoid**out

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

RPC_STATUS RpcNsProfileEltInqBeginW(
    DWORD ProfileNameSyntax,
    LPWSTR ProfileName,
    DWORD InquiryType,
    RPC_IF_ID* IfId,   // optional
    DWORD VersOption,
    DWORD MemberNameSyntax,
    LPWSTR MemberName,   // optional
    void** InquiryContext
);
[DllImport("RPCNS4.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RpcNsProfileEltInqBeginW(
    uint ProfileNameSyntax,   // DWORD
    [MarshalAs(UnmanagedType.LPWStr)] string ProfileName,   // LPWSTR
    uint InquiryType,   // DWORD
    IntPtr IfId,   // RPC_IF_ID* optional
    uint VersOption,   // DWORD
    uint MemberNameSyntax,   // DWORD
    [MarshalAs(UnmanagedType.LPWStr)] string MemberName,   // LPWSTR optional
    IntPtr InquiryContext   // void** out
);
<DllImport("RPCNS4.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RpcNsProfileEltInqBeginW(
    ProfileNameSyntax As UInteger,   ' DWORD
    <MarshalAs(UnmanagedType.LPWStr)> ProfileName As String,   ' LPWSTR
    InquiryType As UInteger,   ' DWORD
    IfId As IntPtr,   ' RPC_IF_ID* optional
    VersOption As UInteger,   ' DWORD
    MemberNameSyntax As UInteger,   ' DWORD
    <MarshalAs(UnmanagedType.LPWStr)> MemberName As String,   ' LPWSTR optional
    InquiryContext As IntPtr   ' void** out
) As Integer
End Function
' ProfileNameSyntax : DWORD
' ProfileName : LPWSTR
' InquiryType : DWORD
' IfId : RPC_IF_ID* optional
' VersOption : DWORD
' MemberNameSyntax : DWORD
' MemberName : LPWSTR optional
' InquiryContext : void** out
Declare PtrSafe Function RpcNsProfileEltInqBeginW Lib "rpcns4" ( _
    ByVal ProfileNameSyntax As Long, _
    ByVal ProfileName As LongPtr, _
    ByVal InquiryType As Long, _
    ByVal IfId As LongPtr, _
    ByVal VersOption As Long, _
    ByVal MemberNameSyntax As Long, _
    ByVal MemberName As LongPtr, _
    ByVal InquiryContext 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

RpcNsProfileEltInqBeginW = ctypes.windll.rpcns4.RpcNsProfileEltInqBeginW
RpcNsProfileEltInqBeginW.restype = ctypes.c_int
RpcNsProfileEltInqBeginW.argtypes = [
    wintypes.DWORD,  # ProfileNameSyntax : DWORD
    wintypes.LPCWSTR,  # ProfileName : LPWSTR
    wintypes.DWORD,  # InquiryType : DWORD
    ctypes.c_void_p,  # IfId : RPC_IF_ID* optional
    wintypes.DWORD,  # VersOption : DWORD
    wintypes.DWORD,  # MemberNameSyntax : DWORD
    wintypes.LPCWSTR,  # MemberName : LPWSTR optional
    ctypes.c_void_p,  # InquiryContext : void** out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcns4 = windows.NewLazySystemDLL("RPCNS4.dll")
	procRpcNsProfileEltInqBeginW = rpcns4.NewProc("RpcNsProfileEltInqBeginW")
)

// ProfileNameSyntax (DWORD), ProfileName (LPWSTR), InquiryType (DWORD), IfId (RPC_IF_ID* optional), VersOption (DWORD), MemberNameSyntax (DWORD), MemberName (LPWSTR optional), InquiryContext (void** out)
r1, _, err := procRpcNsProfileEltInqBeginW.Call(
	uintptr(ProfileNameSyntax),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(ProfileName))),
	uintptr(InquiryType),
	uintptr(IfId),
	uintptr(VersOption),
	uintptr(MemberNameSyntax),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(MemberName))),
	uintptr(InquiryContext),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function RpcNsProfileEltInqBeginW(
  ProfileNameSyntax: DWORD;   // DWORD
  ProfileName: PWideChar;   // LPWSTR
  InquiryType: DWORD;   // DWORD
  IfId: Pointer;   // RPC_IF_ID* optional
  VersOption: DWORD;   // DWORD
  MemberNameSyntax: DWORD;   // DWORD
  MemberName: PWideChar;   // LPWSTR optional
  InquiryContext: Pointer   // void** out
): Integer; stdcall;
  external 'RPCNS4.dll' name 'RpcNsProfileEltInqBeginW';
result := DllCall("RPCNS4\RpcNsProfileEltInqBeginW"
    , "UInt", ProfileNameSyntax   ; DWORD
    , "WStr", ProfileName   ; LPWSTR
    , "UInt", InquiryType   ; DWORD
    , "Ptr", IfId   ; RPC_IF_ID* optional
    , "UInt", VersOption   ; DWORD
    , "UInt", MemberNameSyntax   ; DWORD
    , "WStr", MemberName   ; LPWSTR optional
    , "Ptr", InquiryContext   ; void** out
    , "Int")   ; return: RPC_STATUS
●RpcNsProfileEltInqBeginW(ProfileNameSyntax, ProfileName, InquiryType, IfId, VersOption, MemberNameSyntax, MemberName, InquiryContext) = DLL("RPCNS4.dll", "int RpcNsProfileEltInqBeginW(dword, char*, dword, void*, dword, dword, char*, void*)")
# 呼び出し: RpcNsProfileEltInqBeginW(ProfileNameSyntax, ProfileName, InquiryType, IfId, VersOption, MemberNameSyntax, MemberName, InquiryContext)
# ProfileNameSyntax : DWORD -> "dword"
# ProfileName : LPWSTR -> "char*"
# InquiryType : DWORD -> "dword"
# IfId : RPC_IF_ID* optional -> "void*"
# VersOption : DWORD -> "dword"
# MemberNameSyntax : DWORD -> "dword"
# MemberName : LPWSTR optional -> "char*"
# InquiryContext : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。