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