Win32 API 日本語リファレンス
ホームSystem.Rpc › NdrClientContextUnmarshall

NdrClientContextUnmarshall

関数
NDRでクライアント側コンテキストハンドルをアンマーシャリングする。
DLLRPCRT4.dll呼出規約winapi

シグネチャ

// RPCRT4.dll
#include <windows.h>

void NdrClientContextUnmarshall(
    MIDL_STUB_MESSAGE* pStubMsg,
    INT_PTR* pContextHandle,
    void* BindHandle
);

パラメーター

名前方向
pStubMsgMIDL_STUB_MESSAGE*inout
pContextHandleINT_PTR*inout
BindHandlevoid*inout

戻り値の型: void

各言語での呼び出し定義

// RPCRT4.dll
#include <windows.h>

void NdrClientContextUnmarshall(
    MIDL_STUB_MESSAGE* pStubMsg,
    INT_PTR* pContextHandle,
    void* BindHandle
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern void NdrClientContextUnmarshall(
    IntPtr pStubMsg,   // MIDL_STUB_MESSAGE* in/out
    ref IntPtr pContextHandle,   // INT_PTR* in/out
    IntPtr BindHandle   // void* in/out
);
<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Sub NdrClientContextUnmarshall(
    pStubMsg As IntPtr,   ' MIDL_STUB_MESSAGE* in/out
    ByRef pContextHandle As IntPtr,   ' INT_PTR* in/out
    BindHandle As IntPtr   ' void* in/out
)
End Sub
' pStubMsg : MIDL_STUB_MESSAGE* in/out
' pContextHandle : INT_PTR* in/out
' BindHandle : void* in/out
Declare PtrSafe Sub NdrClientContextUnmarshall Lib "rpcrt4" ( _
    ByVal pStubMsg As LongPtr, _
    ByRef pContextHandle As LongPtr, _
    ByVal BindHandle As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

NdrClientContextUnmarshall = ctypes.windll.rpcrt4.NdrClientContextUnmarshall
NdrClientContextUnmarshall.restype = None
NdrClientContextUnmarshall.argtypes = [
    ctypes.c_void_p,  # pStubMsg : MIDL_STUB_MESSAGE* in/out
    ctypes.POINTER(ctypes.c_ssize_t),  # pContextHandle : INT_PTR* in/out
    ctypes.POINTER(None),  # BindHandle : void* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
NdrClientContextUnmarshall = Fiddle::Function.new(
  lib['NdrClientContextUnmarshall'],
  [
    Fiddle::TYPE_VOIDP,  # pStubMsg : MIDL_STUB_MESSAGE* in/out
    Fiddle::TYPE_VOIDP,  # pContextHandle : INT_PTR* in/out
    Fiddle::TYPE_VOIDP,  # BindHandle : void* in/out
  ],
  Fiddle::TYPE_VOID)
#[link(name = "rpcrt4")]
extern "system" {
    fn NdrClientContextUnmarshall(
        pStubMsg: *mut MIDL_STUB_MESSAGE,  // MIDL_STUB_MESSAGE* in/out
        pContextHandle: *mut isize,  // INT_PTR* in/out
        BindHandle: *mut ()  // void* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll")]
public static extern void NdrClientContextUnmarshall(IntPtr pStubMsg, ref IntPtr pContextHandle, IntPtr BindHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_NdrClientContextUnmarshall' -Namespace Win32 -PassThru
# $api::NdrClientContextUnmarshall(pStubMsg, pContextHandle, BindHandle)
#uselib "RPCRT4.dll"
#func global NdrClientContextUnmarshall "NdrClientContextUnmarshall" sptr, sptr, sptr
; NdrClientContextUnmarshall varptr(pStubMsg), varptr(pContextHandle), BindHandle
; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "sptr"
; pContextHandle : INT_PTR* in/out -> "sptr"
; BindHandle : void* in/out -> "sptr"
出力引数:
#uselib "RPCRT4.dll"
#func global NdrClientContextUnmarshall "NdrClientContextUnmarshall" var, var, sptr
; NdrClientContextUnmarshall pStubMsg, pContextHandle, BindHandle
; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "var"
; pContextHandle : INT_PTR* in/out -> "var"
; BindHandle : void* in/out -> "sptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void NdrClientContextUnmarshall(MIDL_STUB_MESSAGE* pStubMsg, INT_PTR* pContextHandle, void* BindHandle)
#uselib "RPCRT4.dll"
#func global NdrClientContextUnmarshall "NdrClientContextUnmarshall" var, var, intptr
; NdrClientContextUnmarshall pStubMsg, pContextHandle, BindHandle
; pStubMsg : MIDL_STUB_MESSAGE* in/out -> "var"
; pContextHandle : INT_PTR* in/out -> "var"
; BindHandle : void* in/out -> "intptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procNdrClientContextUnmarshall = rpcrt4.NewProc("NdrClientContextUnmarshall")
)

// pStubMsg (MIDL_STUB_MESSAGE* in/out), pContextHandle (INT_PTR* in/out), BindHandle (void* in/out)
r1, _, err := procNdrClientContextUnmarshall.Call(
	uintptr(pStubMsg),
	uintptr(pContextHandle),
	uintptr(BindHandle),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure NdrClientContextUnmarshall(
  pStubMsg: Pointer;   // MIDL_STUB_MESSAGE* in/out
  pContextHandle: Pointer;   // INT_PTR* in/out
  BindHandle: Pointer   // void* in/out
); stdcall;
  external 'RPCRT4.dll' name 'NdrClientContextUnmarshall';
result := DllCall("RPCRT4\NdrClientContextUnmarshall"
    , "Ptr", pStubMsg   ; MIDL_STUB_MESSAGE* in/out
    , "Ptr", pContextHandle   ; INT_PTR* in/out
    , "Ptr", BindHandle   ; void* in/out
    , "Int")   ; return: void
●NdrClientContextUnmarshall(pStubMsg, pContextHandle, BindHandle) = DLL("RPCRT4.dll", "int NdrClientContextUnmarshall(void*, void*, void*)")
# 呼び出し: NdrClientContextUnmarshall(pStubMsg, pContextHandle, BindHandle)
# pStubMsg : MIDL_STUB_MESSAGE* in/out -> "void*"
# pContextHandle : INT_PTR* in/out -> "void*"
# BindHandle : void* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。