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

RpcNsProfileEltRemoveA

関数
ネームサービスのプロファイルから要素を削除する(ANSI版)。
DLLRPCNS4.dll文字セットANSI (-A)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcNsProfileEltRemoveA(
    DWORD ProfileNameSyntax,
    LPSTR ProfileName,
    RPC_IF_ID* IfId,   // optional
    DWORD MemberNameSyntax,
    LPSTR MemberName
);

パラメーター

名前方向
ProfileNameSyntaxDWORDin
ProfileNameLPSTRin
IfIdRPC_IF_ID*inoptional
MemberNameSyntaxDWORDin
MemberNameLPSTRin

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

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

RpcNsProfileEltRemoveA = ctypes.windll.rpcns4.RpcNsProfileEltRemoveA
RpcNsProfileEltRemoveA.restype = ctypes.c_int
RpcNsProfileEltRemoveA.argtypes = [
    wintypes.DWORD,  # ProfileNameSyntax : DWORD
    wintypes.LPCSTR,  # ProfileName : LPSTR
    ctypes.c_void_p,  # IfId : RPC_IF_ID* optional
    wintypes.DWORD,  # MemberNameSyntax : DWORD
    wintypes.LPCSTR,  # MemberName : LPSTR
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcns4 = windows.NewLazySystemDLL("RPCNS4.dll")
	procRpcNsProfileEltRemoveA = rpcns4.NewProc("RpcNsProfileEltRemoveA")
)

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