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