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