ホーム › System.Rpc › Ndr64DcomAsyncStubCall
Ndr64DcomAsyncStubCall
関数64ビットNDRのDCOM非同期スタブ呼び出しを処理する。
シグネチャ
// RPCRT4.dll
#include <windows.h>
INT Ndr64DcomAsyncStubCall(
IRpcStubBuffer* pThis,
IRpcChannelBuffer* pChannel,
RPC_MESSAGE* pRpcMsg,
DWORD* pdwStubPhase
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pThis | IRpcStubBuffer* | in |
| pChannel | IRpcChannelBuffer* | in |
| pRpcMsg | RPC_MESSAGE* | inout |
| pdwStubPhase | DWORD* | inout |
戻り値の型: INT
各言語での呼び出し定義
// RPCRT4.dll
#include <windows.h>
INT Ndr64DcomAsyncStubCall(
IRpcStubBuffer* pThis,
IRpcChannelBuffer* pChannel,
RPC_MESSAGE* pRpcMsg,
DWORD* pdwStubPhase
);[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int Ndr64DcomAsyncStubCall(
IntPtr pThis, // IRpcStubBuffer*
IntPtr pChannel, // IRpcChannelBuffer*
IntPtr pRpcMsg, // RPC_MESSAGE* in/out
ref uint pdwStubPhase // DWORD* in/out
);<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function Ndr64DcomAsyncStubCall(
pThis As IntPtr, ' IRpcStubBuffer*
pChannel As IntPtr, ' IRpcChannelBuffer*
pRpcMsg As IntPtr, ' RPC_MESSAGE* in/out
ByRef pdwStubPhase As UInteger ' DWORD* in/out
) As Integer
End Function' pThis : IRpcStubBuffer*
' pChannel : IRpcChannelBuffer*
' pRpcMsg : RPC_MESSAGE* in/out
' pdwStubPhase : DWORD* in/out
Declare PtrSafe Function Ndr64DcomAsyncStubCall 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
Ndr64DcomAsyncStubCall = ctypes.windll.rpcrt4.Ndr64DcomAsyncStubCall
Ndr64DcomAsyncStubCall.restype = ctypes.c_int
Ndr64DcomAsyncStubCall.argtypes = [
ctypes.c_void_p, # pThis : IRpcStubBuffer*
ctypes.c_void_p, # pChannel : IRpcChannelBuffer*
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')
Ndr64DcomAsyncStubCall = Fiddle::Function.new(
lib['Ndr64DcomAsyncStubCall'],
[
Fiddle::TYPE_VOIDP, # pThis : IRpcStubBuffer*
Fiddle::TYPE_VOIDP, # pChannel : IRpcChannelBuffer*
Fiddle::TYPE_VOIDP, # pRpcMsg : RPC_MESSAGE* in/out
Fiddle::TYPE_VOIDP, # pdwStubPhase : DWORD* in/out
],
Fiddle::TYPE_INT)#[link(name = "rpcrt4")]
extern "system" {
fn Ndr64DcomAsyncStubCall(
pThis: *mut core::ffi::c_void, // IRpcStubBuffer*
pChannel: *mut core::ffi::c_void, // IRpcChannelBuffer*
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 Ndr64DcomAsyncStubCall(IntPtr pThis, IntPtr pChannel, IntPtr pRpcMsg, ref uint pdwStubPhase);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_Ndr64DcomAsyncStubCall' -Namespace Win32 -PassThru
# $api::Ndr64DcomAsyncStubCall(pThis, pChannel, pRpcMsg, pdwStubPhase)#uselib "RPCRT4.dll"
#func global Ndr64DcomAsyncStubCall "Ndr64DcomAsyncStubCall" sptr, sptr, sptr, sptr
; Ndr64DcomAsyncStubCall pThis, pChannel, varptr(pRpcMsg), varptr(pdwStubPhase) ; 戻り値は stat
; pThis : IRpcStubBuffer* -> "sptr"
; pChannel : IRpcChannelBuffer* -> "sptr"
; pRpcMsg : RPC_MESSAGE* in/out -> "sptr"
; pdwStubPhase : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RPCRT4.dll" #cfunc global Ndr64DcomAsyncStubCall "Ndr64DcomAsyncStubCall" sptr, sptr, var, var ; res = Ndr64DcomAsyncStubCall(pThis, pChannel, pRpcMsg, pdwStubPhase) ; pThis : IRpcStubBuffer* -> "sptr" ; pChannel : IRpcChannelBuffer* -> "sptr" ; pRpcMsg : RPC_MESSAGE* in/out -> "var" ; pdwStubPhase : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RPCRT4.dll" #cfunc global Ndr64DcomAsyncStubCall "Ndr64DcomAsyncStubCall" sptr, sptr, sptr, sptr ; res = Ndr64DcomAsyncStubCall(pThis, pChannel, varptr(pRpcMsg), varptr(pdwStubPhase)) ; pThis : IRpcStubBuffer* -> "sptr" ; pChannel : IRpcChannelBuffer* -> "sptr" ; pRpcMsg : RPC_MESSAGE* in/out -> "sptr" ; pdwStubPhase : DWORD* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT Ndr64DcomAsyncStubCall(IRpcStubBuffer* pThis, IRpcChannelBuffer* pChannel, RPC_MESSAGE* pRpcMsg, DWORD* pdwStubPhase) #uselib "RPCRT4.dll" #cfunc global Ndr64DcomAsyncStubCall "Ndr64DcomAsyncStubCall" intptr, intptr, var, var ; res = Ndr64DcomAsyncStubCall(pThis, pChannel, pRpcMsg, pdwStubPhase) ; pThis : IRpcStubBuffer* -> "intptr" ; pChannel : IRpcChannelBuffer* -> "intptr" ; pRpcMsg : RPC_MESSAGE* in/out -> "var" ; pdwStubPhase : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT Ndr64DcomAsyncStubCall(IRpcStubBuffer* pThis, IRpcChannelBuffer* pChannel, RPC_MESSAGE* pRpcMsg, DWORD* pdwStubPhase) #uselib "RPCRT4.dll" #cfunc global Ndr64DcomAsyncStubCall "Ndr64DcomAsyncStubCall" intptr, intptr, intptr, intptr ; res = Ndr64DcomAsyncStubCall(pThis, pChannel, varptr(pRpcMsg), varptr(pdwStubPhase)) ; pThis : IRpcStubBuffer* -> "intptr" ; pChannel : IRpcChannelBuffer* -> "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")
procNdr64DcomAsyncStubCall = rpcrt4.NewProc("Ndr64DcomAsyncStubCall")
)
// pThis (IRpcStubBuffer*), pChannel (IRpcChannelBuffer*), pRpcMsg (RPC_MESSAGE* in/out), pdwStubPhase (DWORD* in/out)
r1, _, err := procNdr64DcomAsyncStubCall.Call(
uintptr(pThis),
uintptr(pChannel),
uintptr(pRpcMsg),
uintptr(pdwStubPhase),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction Ndr64DcomAsyncStubCall(
pThis: Pointer; // IRpcStubBuffer*
pChannel: Pointer; // IRpcChannelBuffer*
pRpcMsg: Pointer; // RPC_MESSAGE* in/out
pdwStubPhase: Pointer // DWORD* in/out
): Integer; stdcall;
external 'RPCRT4.dll' name 'Ndr64DcomAsyncStubCall';result := DllCall("RPCRT4\Ndr64DcomAsyncStubCall"
, "Ptr", pThis ; IRpcStubBuffer*
, "Ptr", pChannel ; IRpcChannelBuffer*
, "Ptr", pRpcMsg ; RPC_MESSAGE* in/out
, "Ptr", pdwStubPhase ; DWORD* in/out
, "Int") ; return: INT●Ndr64DcomAsyncStubCall(pThis, pChannel, pRpcMsg, pdwStubPhase) = DLL("RPCRT4.dll", "int Ndr64DcomAsyncStubCall(void*, void*, void*, void*)")
# 呼び出し: Ndr64DcomAsyncStubCall(pThis, pChannel, pRpcMsg, pdwStubPhase)
# pThis : IRpcStubBuffer* -> "void*"
# pChannel : IRpcChannelBuffer* -> "void*"
# pRpcMsg : RPC_MESSAGE* in/out -> "void*"
# pdwStubPhase : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。