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

RpcNsMgmtBindingUnexportA

関数
管理操作としてネームサービスからインターフェイスのバインディングをエクスポート解除する(ANSI版)。
DLLRPCNS4.dll文字セットANSI (-A)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// RPCNS4.dll  (ANSI / -A)
#include <windows.h>

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

パラメーター

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

戻り値の型: RPC_STATUS

各言語での呼び出し定義

// RPCNS4.dll  (ANSI / -A)
#include <windows.h>

RPC_STATUS RpcNsMgmtBindingUnexportA(
    DWORD EntryNameSyntax,
    LPSTR EntryName,
    RPC_IF_ID* IfId,   // optional
    DWORD VersOption,
    UUID_VECTOR* ObjectUuidVec   // optional
);
[DllImport("RPCNS4.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int RpcNsMgmtBindingUnexportA(
    uint EntryNameSyntax,   // DWORD
    [MarshalAs(UnmanagedType.LPStr)] string EntryName,   // LPSTR
    IntPtr IfId,   // RPC_IF_ID* optional
    uint VersOption,   // DWORD
    IntPtr ObjectUuidVec   // UUID_VECTOR* optional
);
<DllImport("RPCNS4.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RpcNsMgmtBindingUnexportA(
    EntryNameSyntax As UInteger,   ' DWORD
    <MarshalAs(UnmanagedType.LPStr)> EntryName As String,   ' LPSTR
    IfId As IntPtr,   ' RPC_IF_ID* optional
    VersOption As UInteger,   ' DWORD
    ObjectUuidVec As IntPtr   ' UUID_VECTOR* optional
) As Integer
End Function
' EntryNameSyntax : DWORD
' EntryName : LPSTR
' IfId : RPC_IF_ID* optional
' VersOption : DWORD
' ObjectUuidVec : UUID_VECTOR* optional
Declare PtrSafe Function RpcNsMgmtBindingUnexportA Lib "rpcns4" ( _
    ByVal EntryNameSyntax As Long, _
    ByVal EntryName As String, _
    ByVal IfId As LongPtr, _
    ByVal VersOption As Long, _
    ByVal ObjectUuidVec As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcNsMgmtBindingUnexportA = ctypes.windll.rpcns4.RpcNsMgmtBindingUnexportA
RpcNsMgmtBindingUnexportA.restype = ctypes.c_int
RpcNsMgmtBindingUnexportA.argtypes = [
    wintypes.DWORD,  # EntryNameSyntax : DWORD
    wintypes.LPCSTR,  # EntryName : LPSTR
    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')
RpcNsMgmtBindingUnexportA = Fiddle::Function.new(
  lib['RpcNsMgmtBindingUnexportA'],
  [
    -Fiddle::TYPE_INT,  # EntryNameSyntax : DWORD
    Fiddle::TYPE_VOIDP,  # EntryName : LPSTR
    Fiddle::TYPE_VOIDP,  # IfId : RPC_IF_ID* optional
    -Fiddle::TYPE_INT,  # VersOption : DWORD
    Fiddle::TYPE_VOIDP,  # ObjectUuidVec : UUID_VECTOR* optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "rpcns4")]
extern "system" {
    fn RpcNsMgmtBindingUnexportA(
        EntryNameSyntax: u32,  // DWORD
        EntryName: *mut u8,  // LPSTR
        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.Ansi)]
public static extern int RpcNsMgmtBindingUnexportA(uint EntryNameSyntax, [MarshalAs(UnmanagedType.LPStr)] string EntryName, IntPtr IfId, uint VersOption, IntPtr ObjectUuidVec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCNS4_RpcNsMgmtBindingUnexportA' -Namespace Win32 -PassThru
# $api::RpcNsMgmtBindingUnexportA(EntryNameSyntax, EntryName, IfId, VersOption, ObjectUuidVec)
#uselib "RPCNS4.dll"
#func global RpcNsMgmtBindingUnexportA "RpcNsMgmtBindingUnexportA" sptr, sptr, sptr, sptr, sptr
; RpcNsMgmtBindingUnexportA EntryNameSyntax, EntryName, varptr(IfId), VersOption, varptr(ObjectUuidVec)   ; 戻り値は stat
; EntryNameSyntax : DWORD -> "sptr"
; EntryName : LPSTR -> "sptr"
; IfId : RPC_IF_ID* optional -> "sptr"
; VersOption : DWORD -> "sptr"
; ObjectUuidVec : UUID_VECTOR* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "RPCNS4.dll"
#cfunc global RpcNsMgmtBindingUnexportA "RpcNsMgmtBindingUnexportA" int, str, var, int, var
; res = RpcNsMgmtBindingUnexportA(EntryNameSyntax, EntryName, IfId, VersOption, ObjectUuidVec)
; EntryNameSyntax : DWORD -> "int"
; EntryName : LPSTR -> "str"
; IfId : RPC_IF_ID* optional -> "var"
; VersOption : DWORD -> "int"
; ObjectUuidVec : UUID_VECTOR* optional -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; RPC_STATUS RpcNsMgmtBindingUnexportA(DWORD EntryNameSyntax, LPSTR EntryName, RPC_IF_ID* IfId, DWORD VersOption, UUID_VECTOR* ObjectUuidVec)
#uselib "RPCNS4.dll"
#cfunc global RpcNsMgmtBindingUnexportA "RpcNsMgmtBindingUnexportA" int, str, var, int, var
; res = RpcNsMgmtBindingUnexportA(EntryNameSyntax, EntryName, IfId, VersOption, ObjectUuidVec)
; EntryNameSyntax : DWORD -> "int"
; EntryName : LPSTR -> "str"
; 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")
	procRpcNsMgmtBindingUnexportA = rpcns4.NewProc("RpcNsMgmtBindingUnexportA")
)

// EntryNameSyntax (DWORD), EntryName (LPSTR), IfId (RPC_IF_ID* optional), VersOption (DWORD), ObjectUuidVec (UUID_VECTOR* optional)
r1, _, err := procRpcNsMgmtBindingUnexportA.Call(
	uintptr(EntryNameSyntax),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(EntryName))),
	uintptr(IfId),
	uintptr(VersOption),
	uintptr(ObjectUuidVec),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function RpcNsMgmtBindingUnexportA(
  EntryNameSyntax: DWORD;   // DWORD
  EntryName: PAnsiChar;   // LPSTR
  IfId: Pointer;   // RPC_IF_ID* optional
  VersOption: DWORD;   // DWORD
  ObjectUuidVec: Pointer   // UUID_VECTOR* optional
): Integer; stdcall;
  external 'RPCNS4.dll' name 'RpcNsMgmtBindingUnexportA';
result := DllCall("RPCNS4\RpcNsMgmtBindingUnexportA"
    , "UInt", EntryNameSyntax   ; DWORD
    , "AStr", EntryName   ; LPSTR
    , "Ptr", IfId   ; RPC_IF_ID* optional
    , "UInt", VersOption   ; DWORD
    , "Ptr", ObjectUuidVec   ; UUID_VECTOR* optional
    , "Int")   ; return: RPC_STATUS
●RpcNsMgmtBindingUnexportA(EntryNameSyntax, EntryName, IfId, VersOption, ObjectUuidVec) = DLL("RPCNS4.dll", "int RpcNsMgmtBindingUnexportA(dword, char*, void*, dword, void*)")
# 呼び出し: RpcNsMgmtBindingUnexportA(EntryNameSyntax, EntryName, IfId, VersOption, ObjectUuidVec)
# EntryNameSyntax : DWORD -> "dword"
# EntryName : LPSTR -> "char*"
# IfId : RPC_IF_ID* optional -> "void*"
# VersOption : DWORD -> "dword"
# ObjectUuidVec : UUID_VECTOR* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。