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

RpcNsMgmtBindingUnexportW

関数
名前エントリからバインディング情報のエクスポートを解除する(Unicode版)。
DLLRPCNS4.dll文字セットUnicode (-W)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcNsMgmtBindingUnexportW(
    DWORD EntryNameSyntax,
    LPWSTR EntryName,
    RPC_IF_ID* IfId,   // optional
    DWORD VersOption,
    UUID_VECTOR* ObjectUuidVec   // optional
);

パラメーター

名前方向
EntryNameSyntaxDWORDin
EntryNameLPWSTRin
IfIdRPC_IF_ID*inoptional
VersOptionDWORDin
ObjectUuidVecUUID_VECTOR*inoptional

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

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

RpcNsMgmtBindingUnexportW = ctypes.windll.rpcns4.RpcNsMgmtBindingUnexportW
RpcNsMgmtBindingUnexportW.restype = ctypes.c_int
RpcNsMgmtBindingUnexportW.argtypes = [
    wintypes.DWORD,  # EntryNameSyntax : DWORD
    wintypes.LPCWSTR,  # EntryName : LPWSTR
    ctypes.c_void_p,  # IfId : RPC_IF_ID* optional
    wintypes.DWORD,  # VersOption : DWORD
    ctypes.c_void_p,  # ObjectUuidVec : UUID_VECTOR* optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcns4 = windows.NewLazySystemDLL("RPCNS4.dll")
	procRpcNsMgmtBindingUnexportW = rpcns4.NewProc("RpcNsMgmtBindingUnexportW")
)

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