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

RpcServerUseAllProtseqsEx

関数
ポリシー指定で全プロトコルシーケンスを使用登録する。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// RPCRT4.dll
#include <windows.h>

RPC_STATUS RpcServerUseAllProtseqsEx(
    DWORD MaxCalls,
    void* SecurityDescriptor,   // optional
    RPC_POLICY* Policy
);

パラメーター

名前方向
MaxCallsDWORDin
SecurityDescriptorvoid*inoptional
PolicyRPC_POLICY*in

戻り値の型: RPC_STATUS

各言語での呼び出し定義

// RPCRT4.dll
#include <windows.h>

RPC_STATUS RpcServerUseAllProtseqsEx(
    DWORD MaxCalls,
    void* SecurityDescriptor,   // optional
    RPC_POLICY* Policy
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int RpcServerUseAllProtseqsEx(
    uint MaxCalls,   // DWORD
    IntPtr SecurityDescriptor,   // void* optional
    IntPtr Policy   // RPC_POLICY*
);
<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function RpcServerUseAllProtseqsEx(
    MaxCalls As UInteger,   ' DWORD
    SecurityDescriptor As IntPtr,   ' void* optional
    Policy As IntPtr   ' RPC_POLICY*
) As Integer
End Function
' MaxCalls : DWORD
' SecurityDescriptor : void* optional
' Policy : RPC_POLICY*
Declare PtrSafe Function RpcServerUseAllProtseqsEx Lib "rpcrt4" ( _
    ByVal MaxCalls As Long, _
    ByVal SecurityDescriptor As LongPtr, _
    ByVal Policy As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RpcServerUseAllProtseqsEx = ctypes.windll.rpcrt4.RpcServerUseAllProtseqsEx
RpcServerUseAllProtseqsEx.restype = ctypes.c_int
RpcServerUseAllProtseqsEx.argtypes = [
    wintypes.DWORD,  # MaxCalls : DWORD
    ctypes.POINTER(None),  # SecurityDescriptor : void* optional
    ctypes.c_void_p,  # Policy : RPC_POLICY*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procRpcServerUseAllProtseqsEx = rpcrt4.NewProc("RpcServerUseAllProtseqsEx")
)

// MaxCalls (DWORD), SecurityDescriptor (void* optional), Policy (RPC_POLICY*)
r1, _, err := procRpcServerUseAllProtseqsEx.Call(
	uintptr(MaxCalls),
	uintptr(SecurityDescriptor),
	uintptr(Policy),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function RpcServerUseAllProtseqsEx(
  MaxCalls: DWORD;   // DWORD
  SecurityDescriptor: Pointer;   // void* optional
  Policy: Pointer   // RPC_POLICY*
): Integer; stdcall;
  external 'RPCRT4.dll' name 'RpcServerUseAllProtseqsEx';
result := DllCall("RPCRT4\RpcServerUseAllProtseqsEx"
    , "UInt", MaxCalls   ; DWORD
    , "Ptr", SecurityDescriptor   ; void* optional
    , "Ptr", Policy   ; RPC_POLICY*
    , "Int")   ; return: RPC_STATUS
●RpcServerUseAllProtseqsEx(MaxCalls, SecurityDescriptor, Policy) = DLL("RPCRT4.dll", "int RpcServerUseAllProtseqsEx(dword, void*, void*)")
# 呼び出し: RpcServerUseAllProtseqsEx(MaxCalls, SecurityDescriptor, Policy)
# MaxCalls : DWORD -> "dword"
# SecurityDescriptor : void* optional -> "void*"
# Policy : RPC_POLICY* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。