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