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