ホーム › System.Rpc › RpcNsProfileEltAddA
RpcNsProfileEltAddA
関数ネームサービスのプロファイルに要素を追加する(ANSI版)。
シグネチャ
// RPCNS4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcNsProfileEltAddA(
DWORD ProfileNameSyntax,
LPSTR ProfileName,
RPC_IF_ID* IfId, // optional
DWORD MemberNameSyntax,
LPSTR MemberName,
DWORD Priority,
LPSTR Annotation // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ProfileNameSyntax | DWORD | in | ProfileNameの名前構文を指定するDWORD。0で既定構文を使用する。 |
| ProfileName | LPSTR | in | 要素を追加する対象プロファイルのエントリ名(ANSI文字列)。 |
| IfId | RPC_IF_ID* | inoptional | 追加する要素のインターフェイス識別子(RPC_IF_ID)へのポインタ。 |
| MemberNameSyntax | DWORD | in | MemberNameの名前構文を指定するDWORD。0で既定構文を使用する。 |
| MemberName | LPSTR | in | プロファイル要素が参照するメンバーのエントリ名(ANSI文字列)。 |
| Priority | DWORD | in | 要素の検索優先順位。0が最優先で値が小さいほど優先される。 |
| Annotation | LPSTR | inoptional | 要素に付与する注釈文字列(ANSI)。NULL可。 |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCNS4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcNsProfileEltAddA(
DWORD ProfileNameSyntax,
LPSTR ProfileName,
RPC_IF_ID* IfId, // optional
DWORD MemberNameSyntax,
LPSTR MemberName,
DWORD Priority,
LPSTR Annotation // optional
);[DllImport("RPCNS4.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int RpcNsProfileEltAddA(
uint ProfileNameSyntax, // DWORD
[MarshalAs(UnmanagedType.LPStr)] string ProfileName, // LPSTR
IntPtr IfId, // RPC_IF_ID* optional
uint MemberNameSyntax, // DWORD
[MarshalAs(UnmanagedType.LPStr)] string MemberName, // LPSTR
uint Priority, // DWORD
[MarshalAs(UnmanagedType.LPStr)] string Annotation // LPSTR optional
);<DllImport("RPCNS4.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RpcNsProfileEltAddA(
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
Priority As UInteger, ' DWORD
<MarshalAs(UnmanagedType.LPStr)> Annotation As String ' LPSTR optional
) As Integer
End Function' ProfileNameSyntax : DWORD
' ProfileName : LPSTR
' IfId : RPC_IF_ID* optional
' MemberNameSyntax : DWORD
' MemberName : LPSTR
' Priority : DWORD
' Annotation : LPSTR optional
Declare PtrSafe Function RpcNsProfileEltAddA Lib "rpcns4" ( _
ByVal ProfileNameSyntax As Long, _
ByVal ProfileName As String, _
ByVal IfId As LongPtr, _
ByVal MemberNameSyntax As Long, _
ByVal MemberName As String, _
ByVal Priority As Long, _
ByVal Annotation As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RpcNsProfileEltAddA = ctypes.windll.rpcns4.RpcNsProfileEltAddA
RpcNsProfileEltAddA.restype = ctypes.c_int
RpcNsProfileEltAddA.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
wintypes.DWORD, # Priority : DWORD
wintypes.LPCSTR, # Annotation : LPSTR optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCNS4.dll')
RpcNsProfileEltAddA = Fiddle::Function.new(
lib['RpcNsProfileEltAddA'],
[
-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, # Priority : DWORD
Fiddle::TYPE_VOIDP, # Annotation : LPSTR optional
],
Fiddle::TYPE_INT)#[link(name = "rpcns4")]
extern "system" {
fn RpcNsProfileEltAddA(
ProfileNameSyntax: u32, // DWORD
ProfileName: *mut u8, // LPSTR
IfId: *mut RPC_IF_ID, // RPC_IF_ID* optional
MemberNameSyntax: u32, // DWORD
MemberName: *mut u8, // LPSTR
Priority: u32, // DWORD
Annotation: *mut u8 // LPSTR optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCNS4.dll", CharSet = CharSet.Ansi)]
public static extern int RpcNsProfileEltAddA(uint ProfileNameSyntax, [MarshalAs(UnmanagedType.LPStr)] string ProfileName, IntPtr IfId, uint MemberNameSyntax, [MarshalAs(UnmanagedType.LPStr)] string MemberName, uint Priority, [MarshalAs(UnmanagedType.LPStr)] string Annotation);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCNS4_RpcNsProfileEltAddA' -Namespace Win32 -PassThru
# $api::RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation)#uselib "RPCNS4.dll"
#func global RpcNsProfileEltAddA "RpcNsProfileEltAddA" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; RpcNsProfileEltAddA ProfileNameSyntax, ProfileName, varptr(IfId), MemberNameSyntax, MemberName, Priority, Annotation ; 戻り値は stat
; ProfileNameSyntax : DWORD -> "sptr"
; ProfileName : LPSTR -> "sptr"
; IfId : RPC_IF_ID* optional -> "sptr"
; MemberNameSyntax : DWORD -> "sptr"
; MemberName : LPSTR -> "sptr"
; Priority : DWORD -> "sptr"
; Annotation : LPSTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCNS4.dll" #cfunc global RpcNsProfileEltAddA "RpcNsProfileEltAddA" int, str, var, int, str, int, str ; res = RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation) ; ProfileNameSyntax : DWORD -> "int" ; ProfileName : LPSTR -> "str" ; IfId : RPC_IF_ID* optional -> "var" ; MemberNameSyntax : DWORD -> "int" ; MemberName : LPSTR -> "str" ; Priority : DWORD -> "int" ; Annotation : LPSTR optional -> "str" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCNS4.dll" #cfunc global RpcNsProfileEltAddA "RpcNsProfileEltAddA" int, str, sptr, int, str, int, str ; res = RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, varptr(IfId), MemberNameSyntax, MemberName, Priority, Annotation) ; ProfileNameSyntax : DWORD -> "int" ; ProfileName : LPSTR -> "str" ; IfId : RPC_IF_ID* optional -> "sptr" ; MemberNameSyntax : DWORD -> "int" ; MemberName : LPSTR -> "str" ; Priority : DWORD -> "int" ; Annotation : LPSTR optional -> "str" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; RPC_STATUS RpcNsProfileEltAddA(DWORD ProfileNameSyntax, LPSTR ProfileName, RPC_IF_ID* IfId, DWORD MemberNameSyntax, LPSTR MemberName, DWORD Priority, LPSTR Annotation) #uselib "RPCNS4.dll" #cfunc global RpcNsProfileEltAddA "RpcNsProfileEltAddA" int, str, var, int, str, int, str ; res = RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation) ; ProfileNameSyntax : DWORD -> "int" ; ProfileName : LPSTR -> "str" ; IfId : RPC_IF_ID* optional -> "var" ; MemberNameSyntax : DWORD -> "int" ; MemberName : LPSTR -> "str" ; Priority : DWORD -> "int" ; Annotation : LPSTR optional -> "str" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; RPC_STATUS RpcNsProfileEltAddA(DWORD ProfileNameSyntax, LPSTR ProfileName, RPC_IF_ID* IfId, DWORD MemberNameSyntax, LPSTR MemberName, DWORD Priority, LPSTR Annotation) #uselib "RPCNS4.dll" #cfunc global RpcNsProfileEltAddA "RpcNsProfileEltAddA" int, str, intptr, int, str, int, str ; res = RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, varptr(IfId), MemberNameSyntax, MemberName, Priority, Annotation) ; ProfileNameSyntax : DWORD -> "int" ; ProfileName : LPSTR -> "str" ; IfId : RPC_IF_ID* optional -> "intptr" ; MemberNameSyntax : DWORD -> "int" ; MemberName : LPSTR -> "str" ; Priority : DWORD -> "int" ; Annotation : LPSTR optional -> "str" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcns4 = windows.NewLazySystemDLL("RPCNS4.dll")
procRpcNsProfileEltAddA = rpcns4.NewProc("RpcNsProfileEltAddA")
)
// ProfileNameSyntax (DWORD), ProfileName (LPSTR), IfId (RPC_IF_ID* optional), MemberNameSyntax (DWORD), MemberName (LPSTR), Priority (DWORD), Annotation (LPSTR optional)
r1, _, err := procRpcNsProfileEltAddA.Call(
uintptr(ProfileNameSyntax),
uintptr(unsafe.Pointer(windows.BytePtrFromString(ProfileName))),
uintptr(IfId),
uintptr(MemberNameSyntax),
uintptr(unsafe.Pointer(windows.BytePtrFromString(MemberName))),
uintptr(Priority),
uintptr(unsafe.Pointer(windows.BytePtrFromString(Annotation))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcNsProfileEltAddA(
ProfileNameSyntax: DWORD; // DWORD
ProfileName: PAnsiChar; // LPSTR
IfId: Pointer; // RPC_IF_ID* optional
MemberNameSyntax: DWORD; // DWORD
MemberName: PAnsiChar; // LPSTR
Priority: DWORD; // DWORD
Annotation: PAnsiChar // LPSTR optional
): Integer; stdcall;
external 'RPCNS4.dll' name 'RpcNsProfileEltAddA';result := DllCall("RPCNS4\RpcNsProfileEltAddA"
, "UInt", ProfileNameSyntax ; DWORD
, "AStr", ProfileName ; LPSTR
, "Ptr", IfId ; RPC_IF_ID* optional
, "UInt", MemberNameSyntax ; DWORD
, "AStr", MemberName ; LPSTR
, "UInt", Priority ; DWORD
, "AStr", Annotation ; LPSTR optional
, "Int") ; return: RPC_STATUS●RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation) = DLL("RPCNS4.dll", "int RpcNsProfileEltAddA(dword, char*, void*, dword, char*, dword, char*)")
# 呼び出し: RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation)
# ProfileNameSyntax : DWORD -> "dword"
# ProfileName : LPSTR -> "char*"
# IfId : RPC_IF_ID* optional -> "void*"
# MemberNameSyntax : DWORD -> "dword"
# MemberName : LPSTR -> "char*"
# Priority : DWORD -> "dword"
# Annotation : LPSTR optional -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "rpcns4" fn RpcNsProfileEltAddA(
ProfileNameSyntax: u32, // DWORD
ProfileName: [*c]const u8, // LPSTR
IfId: [*c]RPC_IF_ID, // RPC_IF_ID* optional
MemberNameSyntax: u32, // DWORD
MemberName: [*c]const u8, // LPSTR
Priority: u32, // DWORD
Annotation: [*c]const u8 // LPSTR optional
) callconv(std.os.windows.WINAPI) i32;proc RpcNsProfileEltAddA(
ProfileNameSyntax: uint32, # DWORD
ProfileName: cstring, # LPSTR
IfId: ptr RPC_IF_ID, # RPC_IF_ID* optional
MemberNameSyntax: uint32, # DWORD
MemberName: cstring, # LPSTR
Priority: uint32, # DWORD
Annotation: cstring # LPSTR optional
): int32 {.importc: "RpcNsProfileEltAddA", stdcall, dynlib: "RPCNS4.dll".}pragma(lib, "rpcns4");
extern(Windows)
int RpcNsProfileEltAddA(
uint ProfileNameSyntax, // DWORD
const(char)* ProfileName, // LPSTR
RPC_IF_ID* IfId, // RPC_IF_ID* optional
uint MemberNameSyntax, // DWORD
const(char)* MemberName, // LPSTR
uint Priority, // DWORD
const(char)* Annotation // LPSTR optional
);ccall((:RpcNsProfileEltAddA, "RPCNS4.dll"), stdcall, Int32,
(UInt32, Cstring, Ptr{RPC_IF_ID}, UInt32, Cstring, UInt32, Cstring),
ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation)
# ProfileNameSyntax : DWORD -> UInt32
# ProfileName : LPSTR -> Cstring
# IfId : RPC_IF_ID* optional -> Ptr{RPC_IF_ID}
# MemberNameSyntax : DWORD -> UInt32
# MemberName : LPSTR -> Cstring
# Priority : DWORD -> UInt32
# Annotation : LPSTR optional -> Cstring
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t RpcNsProfileEltAddA(
uint32_t ProfileNameSyntax,
const char* ProfileName,
void* IfId,
uint32_t MemberNameSyntax,
const char* MemberName,
uint32_t Priority,
const char* Annotation);
]]
local rpcns4 = ffi.load("rpcns4")
-- rpcns4.RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation)
-- ProfileNameSyntax : DWORD
-- ProfileName : LPSTR
-- IfId : RPC_IF_ID* optional
-- MemberNameSyntax : DWORD
-- MemberName : LPSTR
-- Priority : DWORD
-- Annotation : LPSTR optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('RPCNS4.dll');
const RpcNsProfileEltAddA = lib.func('__stdcall', 'RpcNsProfileEltAddA', 'int32_t', ['uint32_t', 'str', 'void *', 'uint32_t', 'str', 'uint32_t', 'str']);
// RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation)
// ProfileNameSyntax : DWORD -> 'uint32_t'
// ProfileName : LPSTR -> 'str'
// IfId : RPC_IF_ID* optional -> 'void *'
// MemberNameSyntax : DWORD -> 'uint32_t'
// MemberName : LPSTR -> 'str'
// Priority : DWORD -> 'uint32_t'
// Annotation : LPSTR optional -> 'str'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("RPCNS4.dll", {
RpcNsProfileEltAddA: { parameters: ["u32", "buffer", "pointer", "u32", "buffer", "u32", "buffer"], result: "i32" },
});
// lib.symbols.RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation)
// ProfileNameSyntax : DWORD -> "u32"
// ProfileName : LPSTR -> "buffer"
// IfId : RPC_IF_ID* optional -> "pointer"
// MemberNameSyntax : DWORD -> "u32"
// MemberName : LPSTR -> "buffer"
// Priority : DWORD -> "u32"
// Annotation : LPSTR optional -> "buffer"
// 文字列は "buffer"。ANSI(-A) は new TextEncoder() で UTF-8/ANSI バイト列(末尾に \x00)を渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t RpcNsProfileEltAddA(
uint32_t ProfileNameSyntax,
const char* ProfileName,
void* IfId,
uint32_t MemberNameSyntax,
const char* MemberName,
uint32_t Priority,
const char* Annotation);
C, "RPCNS4.dll");
// $ffi->RpcNsProfileEltAddA(ProfileNameSyntax, ProfileName, IfId, MemberNameSyntax, MemberName, Priority, Annotation);
// ProfileNameSyntax : DWORD
// ProfileName : LPSTR
// IfId : RPC_IF_ID* optional
// MemberNameSyntax : DWORD
// MemberName : LPSTR
// Priority : DWORD
// Annotation : LPSTR optional
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Rpcns4 extends StdCallLibrary {
Rpcns4 INSTANCE = Native.load("rpcns4", Rpcns4.class, W32APIOptions.ASCII_OPTIONS);
int RpcNsProfileEltAddA(
int ProfileNameSyntax, // DWORD
String ProfileName, // LPSTR
Pointer IfId, // RPC_IF_ID* optional
int MemberNameSyntax, // DWORD
String MemberName, // LPSTR
int Priority, // DWORD
String Annotation // LPSTR optional
);
}@[Link("rpcns4")]
lib LibRPCNS4
fun RpcNsProfileEltAddA = RpcNsProfileEltAddA(
ProfileNameSyntax : UInt32, # DWORD
ProfileName : UInt8*, # LPSTR
IfId : RPC_IF_ID*, # RPC_IF_ID* optional
MemberNameSyntax : UInt32, # DWORD
MemberName : UInt8*, # LPSTR
Priority : UInt32, # DWORD
Annotation : UInt8* # LPSTR optional
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef RpcNsProfileEltAddANative = Int32 Function(Uint32, Pointer<Utf8>, Pointer<Void>, Uint32, Pointer<Utf8>, Uint32, Pointer<Utf8>);
typedef RpcNsProfileEltAddADart = int Function(int, Pointer<Utf8>, Pointer<Void>, int, Pointer<Utf8>, int, Pointer<Utf8>);
final RpcNsProfileEltAddA = DynamicLibrary.open('RPCNS4.dll')
.lookupFunction<RpcNsProfileEltAddANative, RpcNsProfileEltAddADart>('RpcNsProfileEltAddA');
// ProfileNameSyntax : DWORD -> Uint32
// ProfileName : LPSTR -> Pointer<Utf8>
// IfId : RPC_IF_ID* optional -> Pointer<Void>
// MemberNameSyntax : DWORD -> Uint32
// MemberName : LPSTR -> Pointer<Utf8>
// Priority : DWORD -> Uint32
// Annotation : LPSTR optional -> Pointer<Utf8>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function RpcNsProfileEltAddA(
ProfileNameSyntax: DWORD; // DWORD
ProfileName: PAnsiChar; // LPSTR
IfId: Pointer; // RPC_IF_ID* optional
MemberNameSyntax: DWORD; // DWORD
MemberName: PAnsiChar; // LPSTR
Priority: DWORD; // DWORD
Annotation: PAnsiChar // LPSTR optional
): Integer; stdcall;
external 'RPCNS4.dll' name 'RpcNsProfileEltAddA';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "RpcNsProfileEltAddA"
c_RpcNsProfileEltAddA :: Word32 -> CString -> Ptr () -> Word32 -> CString -> Word32 -> CString -> IO Int32
-- ProfileNameSyntax : DWORD -> Word32
-- ProfileName : LPSTR -> CString
-- IfId : RPC_IF_ID* optional -> Ptr ()
-- MemberNameSyntax : DWORD -> Word32
-- MemberName : LPSTR -> CString
-- Priority : DWORD -> Word32
-- Annotation : LPSTR optional -> CString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let rpcnsprofileeltadda =
foreign "RpcNsProfileEltAddA"
(uint32_t @-> string @-> (ptr void) @-> uint32_t @-> string @-> uint32_t @-> string @-> returning int32_t)
(* ProfileNameSyntax : DWORD -> uint32_t *)
(* ProfileName : LPSTR -> string *)
(* IfId : RPC_IF_ID* optional -> (ptr void) *)
(* MemberNameSyntax : DWORD -> uint32_t *)
(* MemberName : LPSTR -> string *)
(* Priority : DWORD -> uint32_t *)
(* Annotation : LPSTR optional -> string *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library rpcns4 (t "RPCNS4.dll"))
(cffi:use-foreign-library rpcns4)
(cffi:defcfun ("RpcNsProfileEltAddA" rpc-ns-profile-elt-add-a :convention :stdcall) :int32
(profile-name-syntax :uint32) ; DWORD
(profile-name :string) ; LPSTR
(if-id :pointer) ; RPC_IF_ID* optional
(member-name-syntax :uint32) ; DWORD
(member-name :string) ; LPSTR
(priority :uint32) ; DWORD
(annotation :string)) ; LPSTR optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $RpcNsProfileEltAddA = Win32::API::More->new('RPCNS4',
'int RpcNsProfileEltAddA(DWORD ProfileNameSyntax, LPCSTR ProfileName, LPVOID IfId, DWORD MemberNameSyntax, LPCSTR MemberName, DWORD Priority, LPCSTR Annotation)');
# my $ret = $RpcNsProfileEltAddA->Call($ProfileNameSyntax, $ProfileName, $IfId, $MemberNameSyntax, $MemberName, $Priority, $Annotation);
# ProfileNameSyntax : DWORD -> DWORD
# ProfileName : LPSTR -> LPCSTR
# IfId : RPC_IF_ID* optional -> LPVOID
# MemberNameSyntax : DWORD -> DWORD
# MemberName : LPSTR -> LPCSTR
# Priority : DWORD -> DWORD
# Annotation : LPSTR optional -> LPCSTR
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
文字セット違い
- f RpcNsProfileEltAddW (Unicode版) — ネームサービスのプロファイルに要素を追加する(Unicode版)。