ホーム › System.Rpc › RpcNsEntryObjectInqBeginW
RpcNsEntryObjectInqBeginW
関数ネームサービスエントリのオブジェクトUUID列挙を開始する(Unicode版)。
シグネチャ
// RPCNS4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS RpcNsEntryObjectInqBeginW(
DWORD EntryNameSyntax,
LPWSTR EntryName,
void** InquiryContext
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| EntryNameSyntax | DWORD | in |
| EntryName | LPWSTR | in |
| InquiryContext | void** | out |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCNS4.dll (Unicode / -W)
#include <windows.h>
RPC_STATUS RpcNsEntryObjectInqBeginW(
DWORD EntryNameSyntax,
LPWSTR EntryName,
void** InquiryContext
);[DllImport("RPCNS4.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RpcNsEntryObjectInqBeginW(
uint EntryNameSyntax, // DWORD
[MarshalAs(UnmanagedType.LPWStr)] string EntryName, // LPWSTR
IntPtr InquiryContext // void** out
);<DllImport("RPCNS4.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RpcNsEntryObjectInqBeginW(
EntryNameSyntax As UInteger, ' DWORD
<MarshalAs(UnmanagedType.LPWStr)> EntryName As String, ' LPWSTR
InquiryContext As IntPtr ' void** out
) As Integer
End Function' EntryNameSyntax : DWORD
' EntryName : LPWSTR
' InquiryContext : void** out
Declare PtrSafe Function RpcNsEntryObjectInqBeginW Lib "rpcns4" ( _
ByVal EntryNameSyntax As Long, _
ByVal EntryName 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
RpcNsEntryObjectInqBeginW = ctypes.windll.rpcns4.RpcNsEntryObjectInqBeginW
RpcNsEntryObjectInqBeginW.restype = ctypes.c_int
RpcNsEntryObjectInqBeginW.argtypes = [
wintypes.DWORD, # EntryNameSyntax : DWORD
wintypes.LPCWSTR, # EntryName : LPWSTR
ctypes.c_void_p, # InquiryContext : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCNS4.dll')
RpcNsEntryObjectInqBeginW = Fiddle::Function.new(
lib['RpcNsEntryObjectInqBeginW'],
[
-Fiddle::TYPE_INT, # EntryNameSyntax : DWORD
Fiddle::TYPE_VOIDP, # EntryName : LPWSTR
Fiddle::TYPE_VOIDP, # InquiryContext : void** out
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "rpcns4")]
extern "system" {
fn RpcNsEntryObjectInqBeginW(
EntryNameSyntax: u32, // DWORD
EntryName: *mut u16, // LPWSTR
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 RpcNsEntryObjectInqBeginW(uint EntryNameSyntax, [MarshalAs(UnmanagedType.LPWStr)] string EntryName, IntPtr InquiryContext);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCNS4_RpcNsEntryObjectInqBeginW' -Namespace Win32 -PassThru
# $api::RpcNsEntryObjectInqBeginW(EntryNameSyntax, EntryName, InquiryContext)#uselib "RPCNS4.dll"
#func global RpcNsEntryObjectInqBeginW "RpcNsEntryObjectInqBeginW" wptr, wptr, wptr
; RpcNsEntryObjectInqBeginW EntryNameSyntax, EntryName, InquiryContext ; 戻り値は stat
; EntryNameSyntax : DWORD -> "wptr"
; EntryName : LPWSTR -> "wptr"
; InquiryContext : void** out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "RPCNS4.dll"
#cfunc global RpcNsEntryObjectInqBeginW "RpcNsEntryObjectInqBeginW" int, wstr, sptr
; res = RpcNsEntryObjectInqBeginW(EntryNameSyntax, EntryName, InquiryContext)
; EntryNameSyntax : DWORD -> "int"
; EntryName : LPWSTR -> "wstr"
; InquiryContext : void** out -> "sptr"; RPC_STATUS RpcNsEntryObjectInqBeginW(DWORD EntryNameSyntax, LPWSTR EntryName, void** InquiryContext)
#uselib "RPCNS4.dll"
#cfunc global RpcNsEntryObjectInqBeginW "RpcNsEntryObjectInqBeginW" int, wstr, intptr
; res = RpcNsEntryObjectInqBeginW(EntryNameSyntax, EntryName, InquiryContext)
; EntryNameSyntax : DWORD -> "int"
; EntryName : LPWSTR -> "wstr"
; InquiryContext : void** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcns4 = windows.NewLazySystemDLL("RPCNS4.dll")
procRpcNsEntryObjectInqBeginW = rpcns4.NewProc("RpcNsEntryObjectInqBeginW")
)
// EntryNameSyntax (DWORD), EntryName (LPWSTR), InquiryContext (void** out)
r1, _, err := procRpcNsEntryObjectInqBeginW.Call(
uintptr(EntryNameSyntax),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(EntryName))),
uintptr(InquiryContext),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcNsEntryObjectInqBeginW(
EntryNameSyntax: DWORD; // DWORD
EntryName: PWideChar; // LPWSTR
InquiryContext: Pointer // void** out
): Integer; stdcall;
external 'RPCNS4.dll' name 'RpcNsEntryObjectInqBeginW';result := DllCall("RPCNS4\RpcNsEntryObjectInqBeginW"
, "UInt", EntryNameSyntax ; DWORD
, "WStr", EntryName ; LPWSTR
, "Ptr", InquiryContext ; void** out
, "Int") ; return: RPC_STATUS●RpcNsEntryObjectInqBeginW(EntryNameSyntax, EntryName, InquiryContext) = DLL("RPCNS4.dll", "int RpcNsEntryObjectInqBeginW(dword, char*, void*)")
# 呼び出し: RpcNsEntryObjectInqBeginW(EntryNameSyntax, EntryName, InquiryContext)
# EntryNameSyntax : DWORD -> "dword"
# EntryName : LPWSTR -> "char*"
# InquiryContext : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。