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