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

RpcNetworkInqProtseqsW

関数
利用可能なプロトコルシーケンス一覧を取得する(Unicode版)。
DLLRPCRT4.dll文字セットUnicode (-W)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS RpcNetworkInqProtseqsW(
    RPC_PROTSEQ_VECTORW** ProtseqVector
);

パラメーター

名前方向
ProtseqVectorRPC_PROTSEQ_VECTORW**out

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

RPC_STATUS RpcNetworkInqProtseqsW(
    RPC_PROTSEQ_VECTORW** ProtseqVector
);
[DllImport("RPCRT4.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int RpcNetworkInqProtseqsW(
    IntPtr ProtseqVector   // RPC_PROTSEQ_VECTORW** out
);
<DllImport("RPCRT4.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function RpcNetworkInqProtseqsW(
    ProtseqVector As IntPtr   ' RPC_PROTSEQ_VECTORW** out
) As Integer
End Function
' ProtseqVector : RPC_PROTSEQ_VECTORW** out
Declare PtrSafe Function RpcNetworkInqProtseqsW Lib "rpcrt4" ( _
    ByVal ProtseqVector 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

RpcNetworkInqProtseqsW = ctypes.windll.rpcrt4.RpcNetworkInqProtseqsW
RpcNetworkInqProtseqsW.restype = ctypes.c_int
RpcNetworkInqProtseqsW.argtypes = [
    ctypes.c_void_p,  # ProtseqVector : RPC_PROTSEQ_VECTORW** out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcNetworkInqProtseqsW = rpcrt4.NewProc("RpcNetworkInqProtseqsW")
)

// ProtseqVector (RPC_PROTSEQ_VECTORW** out)
r1, _, err := procRpcNetworkInqProtseqsW.Call(
	uintptr(ProtseqVector),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function RpcNetworkInqProtseqsW(
  ProtseqVector: Pointer   // RPC_PROTSEQ_VECTORW** out
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcNetworkInqProtseqsW';
result := DllCall("RPCRT4\RpcNetworkInqProtseqsW"
    , "Ptr", ProtseqVector   ; RPC_PROTSEQ_VECTORW** out
    , "Int")   ; return: RPC_STATUS
●RpcNetworkInqProtseqsW(ProtseqVector) = DLL("RPCRT4.dll", "int RpcNetworkInqProtseqsW(void*)")
# 呼び出し: RpcNetworkInqProtseqsW(ProtseqVector)
# ProtseqVector : RPC_PROTSEQ_VECTORW** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。