ホーム › System.Rpc › RpcNsBindingUnexportA
RpcNsBindingUnexportA
関数ネームサービスからインターフェイスのバインディングをエクスポート解除する(ANSI版)。
シグネチャ
// RPCNS4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcNsBindingUnexportA(
DWORD EntryNameSyntax,
LPSTR EntryName, // optional
void* IfSpec, // optional
UUID_VECTOR* ObjectUuidVec // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| EntryNameSyntax | DWORD | in |
| EntryName | LPSTR | inoptional |
| IfSpec | void* | inoptional |
| ObjectUuidVec | UUID_VECTOR* | inoptional |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCNS4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcNsBindingUnexportA(
DWORD EntryNameSyntax,
LPSTR EntryName, // optional
void* IfSpec, // optional
UUID_VECTOR* ObjectUuidVec // optional
);[DllImport("RPCNS4.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int RpcNsBindingUnexportA(
uint EntryNameSyntax, // DWORD
[MarshalAs(UnmanagedType.LPStr)] string EntryName, // LPSTR optional
IntPtr IfSpec, // void* optional
IntPtr ObjectUuidVec // UUID_VECTOR* optional
);<DllImport("RPCNS4.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RpcNsBindingUnexportA(
EntryNameSyntax As UInteger, ' DWORD
<MarshalAs(UnmanagedType.LPStr)> EntryName As String, ' LPSTR optional
IfSpec As IntPtr, ' void* optional
ObjectUuidVec As IntPtr ' UUID_VECTOR* optional
) As Integer
End Function' EntryNameSyntax : DWORD
' EntryName : LPSTR optional
' IfSpec : void* optional
' ObjectUuidVec : UUID_VECTOR* optional
Declare PtrSafe Function RpcNsBindingUnexportA Lib "rpcns4" ( _
ByVal EntryNameSyntax As Long, _
ByVal EntryName As String, _
ByVal IfSpec As LongPtr, _
ByVal ObjectUuidVec As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RpcNsBindingUnexportA = ctypes.windll.rpcns4.RpcNsBindingUnexportA
RpcNsBindingUnexportA.restype = ctypes.c_int
RpcNsBindingUnexportA.argtypes = [
wintypes.DWORD, # EntryNameSyntax : DWORD
wintypes.LPCSTR, # EntryName : LPSTR optional
ctypes.POINTER(None), # IfSpec : void* optional
ctypes.c_void_p, # ObjectUuidVec : UUID_VECTOR* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCNS4.dll')
RpcNsBindingUnexportA = Fiddle::Function.new(
lib['RpcNsBindingUnexportA'],
[
-Fiddle::TYPE_INT, # EntryNameSyntax : DWORD
Fiddle::TYPE_VOIDP, # EntryName : LPSTR optional
Fiddle::TYPE_VOIDP, # IfSpec : void* optional
Fiddle::TYPE_VOIDP, # ObjectUuidVec : UUID_VECTOR* optional
],
Fiddle::TYPE_INT)#[link(name = "rpcns4")]
extern "system" {
fn RpcNsBindingUnexportA(
EntryNameSyntax: u32, // DWORD
EntryName: *mut u8, // LPSTR optional
IfSpec: *mut (), // void* optional
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 RpcNsBindingUnexportA(uint EntryNameSyntax, [MarshalAs(UnmanagedType.LPStr)] string EntryName, IntPtr IfSpec, IntPtr ObjectUuidVec);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCNS4_RpcNsBindingUnexportA' -Namespace Win32 -PassThru
# $api::RpcNsBindingUnexportA(EntryNameSyntax, EntryName, IfSpec, ObjectUuidVec)#uselib "RPCNS4.dll"
#func global RpcNsBindingUnexportA "RpcNsBindingUnexportA" sptr, sptr, sptr, sptr
; RpcNsBindingUnexportA EntryNameSyntax, EntryName, IfSpec, varptr(ObjectUuidVec) ; 戻り値は stat
; EntryNameSyntax : DWORD -> "sptr"
; EntryName : LPSTR optional -> "sptr"
; IfSpec : void* optional -> "sptr"
; ObjectUuidVec : UUID_VECTOR* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCNS4.dll" #cfunc global RpcNsBindingUnexportA "RpcNsBindingUnexportA" int, str, sptr, var ; res = RpcNsBindingUnexportA(EntryNameSyntax, EntryName, IfSpec, ObjectUuidVec) ; EntryNameSyntax : DWORD -> "int" ; EntryName : LPSTR optional -> "str" ; IfSpec : void* optional -> "sptr" ; ObjectUuidVec : UUID_VECTOR* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCNS4.dll" #cfunc global RpcNsBindingUnexportA "RpcNsBindingUnexportA" int, str, sptr, sptr ; res = RpcNsBindingUnexportA(EntryNameSyntax, EntryName, IfSpec, varptr(ObjectUuidVec)) ; EntryNameSyntax : DWORD -> "int" ; EntryName : LPSTR optional -> "str" ; IfSpec : void* optional -> "sptr" ; ObjectUuidVec : UUID_VECTOR* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; RPC_STATUS RpcNsBindingUnexportA(DWORD EntryNameSyntax, LPSTR EntryName, void* IfSpec, UUID_VECTOR* ObjectUuidVec) #uselib "RPCNS4.dll" #cfunc global RpcNsBindingUnexportA "RpcNsBindingUnexportA" int, str, intptr, var ; res = RpcNsBindingUnexportA(EntryNameSyntax, EntryName, IfSpec, ObjectUuidVec) ; EntryNameSyntax : DWORD -> "int" ; EntryName : LPSTR optional -> "str" ; IfSpec : void* optional -> "intptr" ; ObjectUuidVec : UUID_VECTOR* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS RpcNsBindingUnexportA(DWORD EntryNameSyntax, LPSTR EntryName, void* IfSpec, UUID_VECTOR* ObjectUuidVec) #uselib "RPCNS4.dll" #cfunc global RpcNsBindingUnexportA "RpcNsBindingUnexportA" int, str, intptr, intptr ; res = RpcNsBindingUnexportA(EntryNameSyntax, EntryName, IfSpec, varptr(ObjectUuidVec)) ; EntryNameSyntax : DWORD -> "int" ; EntryName : LPSTR optional -> "str" ; IfSpec : void* optional -> "intptr" ; ObjectUuidVec : UUID_VECTOR* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcns4 = windows.NewLazySystemDLL("RPCNS4.dll")
procRpcNsBindingUnexportA = rpcns4.NewProc("RpcNsBindingUnexportA")
)
// EntryNameSyntax (DWORD), EntryName (LPSTR optional), IfSpec (void* optional), ObjectUuidVec (UUID_VECTOR* optional)
r1, _, err := procRpcNsBindingUnexportA.Call(
uintptr(EntryNameSyntax),
uintptr(unsafe.Pointer(windows.BytePtrFromString(EntryName))),
uintptr(IfSpec),
uintptr(ObjectUuidVec),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcNsBindingUnexportA(
EntryNameSyntax: DWORD; // DWORD
EntryName: PAnsiChar; // LPSTR optional
IfSpec: Pointer; // void* optional
ObjectUuidVec: Pointer // UUID_VECTOR* optional
): Integer; stdcall;
external 'RPCNS4.dll' name 'RpcNsBindingUnexportA';result := DllCall("RPCNS4\RpcNsBindingUnexportA"
, "UInt", EntryNameSyntax ; DWORD
, "AStr", EntryName ; LPSTR optional
, "Ptr", IfSpec ; void* optional
, "Ptr", ObjectUuidVec ; UUID_VECTOR* optional
, "Int") ; return: RPC_STATUS●RpcNsBindingUnexportA(EntryNameSyntax, EntryName, IfSpec, ObjectUuidVec) = DLL("RPCNS4.dll", "int RpcNsBindingUnexportA(dword, char*, void*, void*)")
# 呼び出し: RpcNsBindingUnexportA(EntryNameSyntax, EntryName, IfSpec, ObjectUuidVec)
# EntryNameSyntax : DWORD -> "dword"
# EntryName : LPSTR optional -> "char*"
# IfSpec : void* optional -> "void*"
# ObjectUuidVec : UUID_VECTOR* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。