ホーム › System.Rpc › RpcServerUseProtseqA
RpcServerUseProtseqA
関数指定プロトコルシーケンスを使用登録する(ANSI版)。
シグネチャ
// RPCRT4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcServerUseProtseqA(
LPSTR Protseq,
DWORD MaxCalls,
void* SecurityDescriptor // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Protseq | LPSTR | in |
| MaxCalls | DWORD | in |
| SecurityDescriptor | void* | inoptional |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCRT4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcServerUseProtseqA(
LPSTR Protseq,
DWORD MaxCalls,
void* SecurityDescriptor // optional
);[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int RpcServerUseProtseqA(
[MarshalAs(UnmanagedType.LPStr)] string Protseq, // LPSTR
uint MaxCalls, // DWORD
IntPtr SecurityDescriptor // void* optional
);<DllImport("RPCRT4.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RpcServerUseProtseqA(
<MarshalAs(UnmanagedType.LPStr)> Protseq As String, ' LPSTR
MaxCalls As UInteger, ' DWORD
SecurityDescriptor As IntPtr ' void* optional
) As Integer
End Function' Protseq : LPSTR
' MaxCalls : DWORD
' SecurityDescriptor : void* optional
Declare PtrSafe Function RpcServerUseProtseqA Lib "rpcrt4" ( _
ByVal Protseq As String, _
ByVal MaxCalls As Long, _
ByVal SecurityDescriptor As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RpcServerUseProtseqA = ctypes.windll.rpcrt4.RpcServerUseProtseqA
RpcServerUseProtseqA.restype = ctypes.c_int
RpcServerUseProtseqA.argtypes = [
wintypes.LPCSTR, # Protseq : LPSTR
wintypes.DWORD, # MaxCalls : DWORD
ctypes.POINTER(None), # SecurityDescriptor : void* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
RpcServerUseProtseqA = Fiddle::Function.new(
lib['RpcServerUseProtseqA'],
[
Fiddle::TYPE_VOIDP, # Protseq : LPSTR
-Fiddle::TYPE_INT, # MaxCalls : DWORD
Fiddle::TYPE_VOIDP, # SecurityDescriptor : void* optional
],
Fiddle::TYPE_INT)#[link(name = "rpcrt4")]
extern "system" {
fn RpcServerUseProtseqA(
Protseq: *mut u8, // LPSTR
MaxCalls: u32, // DWORD
SecurityDescriptor: *mut () // void* optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi)]
public static extern int RpcServerUseProtseqA([MarshalAs(UnmanagedType.LPStr)] string Protseq, uint MaxCalls, IntPtr SecurityDescriptor);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcServerUseProtseqA' -Namespace Win32 -PassThru
# $api::RpcServerUseProtseqA(Protseq, MaxCalls, SecurityDescriptor)#uselib "RPCRT4.dll"
#func global RpcServerUseProtseqA "RpcServerUseProtseqA" sptr, sptr, sptr
; RpcServerUseProtseqA Protseq, MaxCalls, SecurityDescriptor ; 戻り値は stat
; Protseq : LPSTR -> "sptr"
; MaxCalls : DWORD -> "sptr"
; SecurityDescriptor : void* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "RPCRT4.dll"
#cfunc global RpcServerUseProtseqA "RpcServerUseProtseqA" str, int, sptr
; res = RpcServerUseProtseqA(Protseq, MaxCalls, SecurityDescriptor)
; Protseq : LPSTR -> "str"
; MaxCalls : DWORD -> "int"
; SecurityDescriptor : void* optional -> "sptr"; RPC_STATUS RpcServerUseProtseqA(LPSTR Protseq, DWORD MaxCalls, void* SecurityDescriptor)
#uselib "RPCRT4.dll"
#cfunc global RpcServerUseProtseqA "RpcServerUseProtseqA" str, int, intptr
; res = RpcServerUseProtseqA(Protseq, MaxCalls, SecurityDescriptor)
; Protseq : LPSTR -> "str"
; MaxCalls : DWORD -> "int"
; SecurityDescriptor : void* optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procRpcServerUseProtseqA = rpcrt4.NewProc("RpcServerUseProtseqA")
)
// Protseq (LPSTR), MaxCalls (DWORD), SecurityDescriptor (void* optional)
r1, _, err := procRpcServerUseProtseqA.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(Protseq))),
uintptr(MaxCalls),
uintptr(SecurityDescriptor),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcServerUseProtseqA(
Protseq: PAnsiChar; // LPSTR
MaxCalls: DWORD; // DWORD
SecurityDescriptor: Pointer // void* optional
): Integer; stdcall;
external 'RPCRT4.dll' name 'RpcServerUseProtseqA';result := DllCall("RPCRT4\RpcServerUseProtseqA"
, "AStr", Protseq ; LPSTR
, "UInt", MaxCalls ; DWORD
, "Ptr", SecurityDescriptor ; void* optional
, "Int") ; return: RPC_STATUS●RpcServerUseProtseqA(Protseq, MaxCalls, SecurityDescriptor) = DLL("RPCRT4.dll", "int RpcServerUseProtseqA(char*, dword, void*)")
# 呼び出し: RpcServerUseProtseqA(Protseq, MaxCalls, SecurityDescriptor)
# Protseq : LPSTR -> "char*"
# MaxCalls : DWORD -> "dword"
# SecurityDescriptor : void* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。