ホーム › System.Rpc › NdrAsyncServerCall
NdrAsyncServerCall
関数非同期RPCサーバー呼び出しをディスパッチする。
シグネチャ
// RPCRT4.dll
#include <windows.h>
void NdrAsyncServerCall(
RPC_MESSAGE* pRpcMsg
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pRpcMsg | RPC_MESSAGE* | inout |
戻り値の型: void
各言語での呼び出し定義
// RPCRT4.dll
#include <windows.h>
void NdrAsyncServerCall(
RPC_MESSAGE* pRpcMsg
);[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern void NdrAsyncServerCall(
IntPtr pRpcMsg // RPC_MESSAGE* in/out
);<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Sub NdrAsyncServerCall(
pRpcMsg As IntPtr ' RPC_MESSAGE* in/out
)
End Sub' pRpcMsg : RPC_MESSAGE* in/out
Declare PtrSafe Sub NdrAsyncServerCall Lib "rpcrt4" ( _
ByVal pRpcMsg As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
NdrAsyncServerCall = ctypes.windll.rpcrt4.NdrAsyncServerCall
NdrAsyncServerCall.restype = None
NdrAsyncServerCall.argtypes = [
ctypes.c_void_p, # pRpcMsg : RPC_MESSAGE* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RPCRT4.dll')
NdrAsyncServerCall = Fiddle::Function.new(
lib['NdrAsyncServerCall'],
[
Fiddle::TYPE_VOIDP, # pRpcMsg : RPC_MESSAGE* in/out
],
Fiddle::TYPE_VOID)#[link(name = "rpcrt4")]
extern "system" {
fn NdrAsyncServerCall(
pRpcMsg: *mut RPC_MESSAGE // RPC_MESSAGE* in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RPCRT4.dll")]
public static extern void NdrAsyncServerCall(IntPtr pRpcMsg);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_NdrAsyncServerCall' -Namespace Win32 -PassThru
# $api::NdrAsyncServerCall(pRpcMsg)#uselib "RPCRT4.dll"
#func global NdrAsyncServerCall "NdrAsyncServerCall" sptr
; NdrAsyncServerCall varptr(pRpcMsg)
; pRpcMsg : RPC_MESSAGE* in/out -> "sptr"出力引数:
#uselib "RPCRT4.dll" #func global NdrAsyncServerCall "NdrAsyncServerCall" var ; NdrAsyncServerCall pRpcMsg ; pRpcMsg : RPC_MESSAGE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #func global NdrAsyncServerCall "NdrAsyncServerCall" sptr ; NdrAsyncServerCall varptr(pRpcMsg) ; pRpcMsg : RPC_MESSAGE* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void NdrAsyncServerCall(RPC_MESSAGE* pRpcMsg) #uselib "RPCRT4.dll" #func global NdrAsyncServerCall "NdrAsyncServerCall" var ; NdrAsyncServerCall pRpcMsg ; pRpcMsg : RPC_MESSAGE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void NdrAsyncServerCall(RPC_MESSAGE* pRpcMsg) #uselib "RPCRT4.dll" #func global NdrAsyncServerCall "NdrAsyncServerCall" intptr ; NdrAsyncServerCall varptr(pRpcMsg) ; pRpcMsg : RPC_MESSAGE* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
procNdrAsyncServerCall = rpcrt4.NewProc("NdrAsyncServerCall")
)
// pRpcMsg (RPC_MESSAGE* in/out)
r1, _, err := procNdrAsyncServerCall.Call(
uintptr(pRpcMsg),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure NdrAsyncServerCall(
pRpcMsg: Pointer // RPC_MESSAGE* in/out
); stdcall;
external 'RPCRT4.dll' name 'NdrAsyncServerCall';result := DllCall("RPCRT4\NdrAsyncServerCall"
, "Ptr", pRpcMsg ; RPC_MESSAGE* in/out
, "Int") ; return: void●NdrAsyncServerCall(pRpcMsg) = DLL("RPCRT4.dll", "int NdrAsyncServerCall(void*)")
# 呼び出し: NdrAsyncServerCall(pRpcMsg)
# pRpcMsg : RPC_MESSAGE* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。