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