ホーム › System.Rpc › RpcServerInqCallAttributesA
RpcServerInqCallAttributesA
関数サーバー側で現在のRPC呼び出しの属性を照会する(ANSI版)。
シグネチャ
// RPCRT4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcServerInqCallAttributesA(
void* ClientBinding, // optional
void* RpcCallAttributes
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| ClientBinding | void* | inoptional | 属性を問い合わせるクライアントバインディングハンドル。NULL可で現在の呼び出しを対象とする。 |
| RpcCallAttributes | void* | inout | 呼び出し属性を受け取るRPC_CALL_ATTRIBUTES構造体(ANSI版)へのポインタ。 |
戻り値の型: RPC_STATUS
各言語での呼び出し定義
// RPCRT4.dll (ANSI / -A)
#include <windows.h>
RPC_STATUS RpcServerInqCallAttributesA(
void* ClientBinding, // optional
void* RpcCallAttributes
);[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int RpcServerInqCallAttributesA(
IntPtr ClientBinding, // void* optional
IntPtr RpcCallAttributes // void* in/out
);<DllImport("RPCRT4.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function RpcServerInqCallAttributesA(
ClientBinding As IntPtr, ' void* optional
RpcCallAttributes As IntPtr ' void* in/out
) As Integer
End Function' ClientBinding : void* optional
' RpcCallAttributes : void* in/out
Declare PtrSafe Function RpcServerInqCallAttributesA Lib "rpcrt4" ( _
ByVal ClientBinding As LongPtr, _
ByVal RpcCallAttributes As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RpcServerInqCallAttributesA = ctypes.windll.rpcrt4.RpcServerInqCallAttributesA
RpcServerInqCallAttributesA.restype = ctypes.c_int
RpcServerInqCallAttributesA.argtypes = [
ctypes.POINTER(None), # ClientBinding : void* optional
ctypes.POINTER(None), # RpcCallAttributes : void* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
RpcServerInqCallAttributesA = Fiddle::Function.new(
lib['RpcServerInqCallAttributesA'],
[
Fiddle::TYPE_VOIDP, # ClientBinding : void* optional
Fiddle::TYPE_VOIDP, # RpcCallAttributes : void* in/out
],
Fiddle::TYPE_INT)#[link(name = "rpcrt4")]
extern "system" {
fn RpcServerInqCallAttributesA(
ClientBinding: *mut (), // void* optional
RpcCallAttributes: *mut () // void* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll", CharSet = CharSet.Ansi)]
public static extern int RpcServerInqCallAttributesA(IntPtr ClientBinding, IntPtr RpcCallAttributes);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_RpcServerInqCallAttributesA' -Namespace Win32 -PassThru
# $api::RpcServerInqCallAttributesA(ClientBinding, RpcCallAttributes)#uselib "RPCRT4.dll"
#func global RpcServerInqCallAttributesA "RpcServerInqCallAttributesA" sptr, sptr
; RpcServerInqCallAttributesA ClientBinding, RpcCallAttributes ; 戻り値は stat
; ClientBinding : void* optional -> "sptr"
; RpcCallAttributes : void* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "RPCRT4.dll"
#cfunc global RpcServerInqCallAttributesA "RpcServerInqCallAttributesA" sptr, sptr
; res = RpcServerInqCallAttributesA(ClientBinding, RpcCallAttributes)
; ClientBinding : void* optional -> "sptr"
; RpcCallAttributes : void* in/out -> "sptr"; RPC_STATUS RpcServerInqCallAttributesA(void* ClientBinding, void* RpcCallAttributes)
#uselib "RPCRT4.dll"
#cfunc global RpcServerInqCallAttributesA "RpcServerInqCallAttributesA" intptr, intptr
; res = RpcServerInqCallAttributesA(ClientBinding, RpcCallAttributes)
; ClientBinding : void* optional -> "intptr"
; RpcCallAttributes : void* in/out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procRpcServerInqCallAttributesA = rpcrt4.NewProc("RpcServerInqCallAttributesA")
)
// ClientBinding (void* optional), RpcCallAttributes (void* in/out)
r1, _, err := procRpcServerInqCallAttributesA.Call(
uintptr(ClientBinding),
uintptr(RpcCallAttributes),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // RPC_STATUSfunction RpcServerInqCallAttributesA(
ClientBinding: Pointer; // void* optional
RpcCallAttributes: Pointer // void* in/out
): Integer; stdcall;
external 'RPCRT4.dll' name 'RpcServerInqCallAttributesA';result := DllCall("RPCRT4\RpcServerInqCallAttributesA"
, "Ptr", ClientBinding ; void* optional
, "Ptr", RpcCallAttributes ; void* in/out
, "Int") ; return: RPC_STATUS●RpcServerInqCallAttributesA(ClientBinding, RpcCallAttributes) = DLL("RPCRT4.dll", "int RpcServerInqCallAttributesA(void*, void*)")
# 呼び出し: RpcServerInqCallAttributesA(ClientBinding, RpcCallAttributes)
# ClientBinding : void* optional -> "void*"
# RpcCallAttributes : void* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "rpcrt4" fn RpcServerInqCallAttributesA(
ClientBinding: ?*anyopaque, // void* optional
RpcCallAttributes: ?*anyopaque // void* in/out
) callconv(std.os.windows.WINAPI) i32;proc RpcServerInqCallAttributesA(
ClientBinding: pointer, # void* optional
RpcCallAttributes: pointer # void* in/out
): int32 {.importc: "RpcServerInqCallAttributesA", stdcall, dynlib: "RPCRT4.dll".}pragma(lib, "rpcrt4");
extern(Windows)
int RpcServerInqCallAttributesA(
void* ClientBinding, // void* optional
void* RpcCallAttributes // void* in/out
);ccall((:RpcServerInqCallAttributesA, "RPCRT4.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{Cvoid}),
ClientBinding, RpcCallAttributes)
# ClientBinding : void* optional -> Ptr{Cvoid}
# RpcCallAttributes : void* in/out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t RpcServerInqCallAttributesA(
void* ClientBinding,
void* RpcCallAttributes);
]]
local rpcrt4 = ffi.load("rpcrt4")
-- rpcrt4.RpcServerInqCallAttributesA(ClientBinding, RpcCallAttributes)
-- ClientBinding : void* optional
-- RpcCallAttributes : void* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('RPCRT4.dll');
const RpcServerInqCallAttributesA = lib.func('__stdcall', 'RpcServerInqCallAttributesA', 'int32_t', ['void *', 'void *']);
// RpcServerInqCallAttributesA(ClientBinding, RpcCallAttributes)
// ClientBinding : void* optional -> 'void *'
// RpcCallAttributes : void* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("RPCRT4.dll", {
RpcServerInqCallAttributesA: { parameters: ["pointer", "pointer"], result: "i32" },
});
// lib.symbols.RpcServerInqCallAttributesA(ClientBinding, RpcCallAttributes)
// ClientBinding : void* optional -> "pointer"
// RpcCallAttributes : void* in/out -> "pointer"
// 文字列は "buffer"。ANSI(-A) は new TextEncoder() で UTF-8/ANSI バイト列(末尾に \x00)を渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t RpcServerInqCallAttributesA(
void* ClientBinding,
void* RpcCallAttributes);
C, "RPCRT4.dll");
// $ffi->RpcServerInqCallAttributesA(ClientBinding, RpcCallAttributes);
// ClientBinding : void* optional
// RpcCallAttributes : void* in/out
// 構造体/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 Rpcrt4 extends StdCallLibrary {
Rpcrt4 INSTANCE = Native.load("rpcrt4", Rpcrt4.class, W32APIOptions.ASCII_OPTIONS);
int RpcServerInqCallAttributesA(
Pointer ClientBinding, // void* optional
Pointer RpcCallAttributes // void* in/out
);
}@[Link("rpcrt4")]
lib LibRPCRT4
fun RpcServerInqCallAttributesA = RpcServerInqCallAttributesA(
ClientBinding : Void*, # void* optional
RpcCallAttributes : Void* # void* in/out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef RpcServerInqCallAttributesANative = Int32 Function(Pointer<Void>, Pointer<Void>);
typedef RpcServerInqCallAttributesADart = int Function(Pointer<Void>, Pointer<Void>);
final RpcServerInqCallAttributesA = DynamicLibrary.open('RPCRT4.dll')
.lookupFunction<RpcServerInqCallAttributesANative, RpcServerInqCallAttributesADart>('RpcServerInqCallAttributesA');
// ClientBinding : void* optional -> Pointer<Void>
// RpcCallAttributes : void* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function RpcServerInqCallAttributesA(
ClientBinding: Pointer; // void* optional
RpcCallAttributes: Pointer // void* in/out
): Integer; stdcall;
external 'RPCRT4.dll' name 'RpcServerInqCallAttributesA';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "RpcServerInqCallAttributesA"
c_RpcServerInqCallAttributesA :: Ptr () -> Ptr () -> IO Int32
-- ClientBinding : void* optional -> Ptr ()
-- RpcCallAttributes : void* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let rpcserverinqcallattributesa =
foreign "RpcServerInqCallAttributesA"
((ptr void) @-> (ptr void) @-> returning int32_t)
(* ClientBinding : void* optional -> (ptr void) *)
(* RpcCallAttributes : void* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library rpcrt4 (t "RPCRT4.dll"))
(cffi:use-foreign-library rpcrt4)
(cffi:defcfun ("RpcServerInqCallAttributesA" rpc-server-inq-call-attributes-a :convention :stdcall) :int32
(client-binding :pointer) ; void* optional
(rpc-call-attributes :pointer)) ; void* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $RpcServerInqCallAttributesA = Win32::API::More->new('RPCRT4',
'int RpcServerInqCallAttributesA(LPVOID ClientBinding, LPVOID RpcCallAttributes)');
# my $ret = $RpcServerInqCallAttributesA->Call($ClientBinding, $RpcCallAttributes);
# ClientBinding : void* optional -> LPVOID
# RpcCallAttributes : void* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
文字セット違い
- f RpcServerInqCallAttributesW (Unicode版) — サーバー側で現在のRPC呼び出しの属性を照会する(Unicode版)。
使用する型