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