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

NdrComplexArrayUnmarshall

関数
NDRで複合配列をアンマーシャリングする。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BYTE* NdrComplexArrayUnmarshall(
    MIDL_STUB_MESSAGE* pStubMsg,
    BYTE** ppMemory,
    BYTE* pFormat,
    BYTE fMustAlloc
);

パラメーター

名前方向
pStubMsgMIDL_STUB_MESSAGE*inout
ppMemoryBYTE**inout
pFormatBYTE*inout
fMustAllocBYTEin

戻り値の型: BYTE*

各言語での呼び出し定義

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

BYTE* NdrComplexArrayUnmarshall(
    MIDL_STUB_MESSAGE* pStubMsg,
    BYTE** ppMemory,
    BYTE* pFormat,
    BYTE fMustAlloc
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern IntPtr NdrComplexArrayUnmarshall(
    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 NdrComplexArrayUnmarshall(
    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 NdrComplexArrayUnmarshall 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

NdrComplexArrayUnmarshall = ctypes.windll.rpcrt4.NdrComplexArrayUnmarshall
NdrComplexArrayUnmarshall.restype = ctypes.c_void_p
NdrComplexArrayUnmarshall.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')
NdrComplexArrayUnmarshall = Fiddle::Function.new(
  lib['NdrComplexArrayUnmarshall'],
  [
    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 NdrComplexArrayUnmarshall(
        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 NdrComplexArrayUnmarshall(IntPtr pStubMsg, IntPtr ppMemory, IntPtr pFormat, byte fMustAlloc);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_NdrComplexArrayUnmarshall' -Namespace Win32 -PassThru
# $api::NdrComplexArrayUnmarshall(pStubMsg, ppMemory, pFormat, fMustAlloc)
#uselib "RPCRT4.dll"
#func global NdrComplexArrayUnmarshall "NdrComplexArrayUnmarshall" sptr, sptr, sptr, sptr
; NdrComplexArrayUnmarshall 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 NdrComplexArrayUnmarshall "NdrComplexArrayUnmarshall" var, var, var, int
; res = NdrComplexArrayUnmarshall(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* NdrComplexArrayUnmarshall(MIDL_STUB_MESSAGE* pStubMsg, BYTE** ppMemory, BYTE* pFormat, BYTE fMustAlloc)
#uselib "RPCRT4.dll"
#cfunc global NdrComplexArrayUnmarshall "NdrComplexArrayUnmarshall" var, var, var, int
; res = NdrComplexArrayUnmarshall(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 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procNdrComplexArrayUnmarshall = rpcrt4.NewProc("NdrComplexArrayUnmarshall")
)

// pStubMsg (MIDL_STUB_MESSAGE* in/out), ppMemory (BYTE** in/out), pFormat (BYTE* in/out), fMustAlloc (BYTE)
r1, _, err := procNdrComplexArrayUnmarshall.Call(
	uintptr(pStubMsg),
	uintptr(ppMemory),
	uintptr(pFormat),
	uintptr(fMustAlloc),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BYTE*
function NdrComplexArrayUnmarshall(
  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 'NdrComplexArrayUnmarshall';
result := DllCall("RPCRT4\NdrComplexArrayUnmarshall"
    , "Ptr", pStubMsg   ; MIDL_STUB_MESSAGE* in/out
    , "Ptr", ppMemory   ; BYTE** in/out
    , "Ptr", pFormat   ; BYTE* in/out
    , "UChar", fMustAlloc   ; BYTE
    , "Ptr")   ; return: BYTE*
●NdrComplexArrayUnmarshall(pStubMsg, ppMemory, pFormat, fMustAlloc) = DLL("RPCRT4.dll", "void* NdrComplexArrayUnmarshall(void*, void*, void*, byte)")
# 呼び出し: NdrComplexArrayUnmarshall(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)。