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

MesIncrementalHandleReset

関数
増分シリアル化ハンドルを再利用のため再設定する。
DLLRPCRT4.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

RPC_STATUS MesIncrementalHandleReset(
    void* Handle,
    void* UserState,
    MIDL_ES_ALLOC AllocFn,
    MIDL_ES_WRITE WriteFn,
    MIDL_ES_READ ReadFn,
    MIDL_ES_CODE Operation
);

パラメーター

名前方向
Handlevoid*inout
UserStatevoid*inout
AllocFnMIDL_ES_ALLOCin
WriteFnMIDL_ES_WRITEin
ReadFnMIDL_ES_READin
OperationMIDL_ES_CODEin

戻り値の型: RPC_STATUS

各言語での呼び出し定義

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

RPC_STATUS MesIncrementalHandleReset(
    void* Handle,
    void* UserState,
    MIDL_ES_ALLOC AllocFn,
    MIDL_ES_WRITE WriteFn,
    MIDL_ES_READ ReadFn,
    MIDL_ES_CODE Operation
);
[DllImport("RPCRT4.dll", ExactSpelling = true)]
static extern int MesIncrementalHandleReset(
    IntPtr Handle,   // void* in/out
    IntPtr UserState,   // void* in/out
    IntPtr AllocFn,   // MIDL_ES_ALLOC
    IntPtr WriteFn,   // MIDL_ES_WRITE
    IntPtr ReadFn,   // MIDL_ES_READ
    int Operation   // MIDL_ES_CODE
);
<DllImport("RPCRT4.dll", ExactSpelling:=True)>
Public Shared Function MesIncrementalHandleReset(
    Handle As IntPtr,   ' void* in/out
    UserState As IntPtr,   ' void* in/out
    AllocFn As IntPtr,   ' MIDL_ES_ALLOC
    WriteFn As IntPtr,   ' MIDL_ES_WRITE
    ReadFn As IntPtr,   ' MIDL_ES_READ
    Operation As Integer   ' MIDL_ES_CODE
) As Integer
End Function
' Handle : void* in/out
' UserState : void* in/out
' AllocFn : MIDL_ES_ALLOC
' WriteFn : MIDL_ES_WRITE
' ReadFn : MIDL_ES_READ
' Operation : MIDL_ES_CODE
Declare PtrSafe Function MesIncrementalHandleReset Lib "rpcrt4" ( _
    ByVal Handle As LongPtr, _
    ByVal UserState As LongPtr, _
    ByVal AllocFn As LongPtr, _
    ByVal WriteFn As LongPtr, _
    ByVal ReadFn As LongPtr, _
    ByVal Operation As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MesIncrementalHandleReset = ctypes.windll.rpcrt4.MesIncrementalHandleReset
MesIncrementalHandleReset.restype = ctypes.c_int
MesIncrementalHandleReset.argtypes = [
    ctypes.POINTER(None),  # Handle : void* in/out
    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,  # ReadFn : MIDL_ES_READ
    ctypes.c_int,  # Operation : MIDL_ES_CODE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RPCRT4.dll')
MesIncrementalHandleReset = Fiddle::Function.new(
  lib['MesIncrementalHandleReset'],
  [
    Fiddle::TYPE_VOIDP,  # Handle : void* in/out
    Fiddle::TYPE_VOIDP,  # UserState : void* in/out
    Fiddle::TYPE_VOIDP,  # AllocFn : MIDL_ES_ALLOC
    Fiddle::TYPE_VOIDP,  # WriteFn : MIDL_ES_WRITE
    Fiddle::TYPE_VOIDP,  # ReadFn : MIDL_ES_READ
    Fiddle::TYPE_INT,  # Operation : MIDL_ES_CODE
  ],
  Fiddle::TYPE_INT)
#[link(name = "rpcrt4")]
extern "system" {
    fn MesIncrementalHandleReset(
        Handle: *mut (),  // void* in/out
        UserState: *mut (),  // void* in/out
        AllocFn: *const core::ffi::c_void,  // MIDL_ES_ALLOC
        WriteFn: *const core::ffi::c_void,  // MIDL_ES_WRITE
        ReadFn: *const core::ffi::c_void,  // MIDL_ES_READ
        Operation: i32  // MIDL_ES_CODE
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RPCRT4.dll")]
public static extern int MesIncrementalHandleReset(IntPtr Handle, IntPtr UserState, IntPtr AllocFn, IntPtr WriteFn, IntPtr ReadFn, int Operation);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RPCRT4_MesIncrementalHandleReset' -Namespace Win32 -PassThru
# $api::MesIncrementalHandleReset(Handle, UserState, AllocFn, WriteFn, ReadFn, Operation)
#uselib "RPCRT4.dll"
#func global MesIncrementalHandleReset "MesIncrementalHandleReset" sptr, sptr, sptr, sptr, sptr, sptr
; MesIncrementalHandleReset Handle, UserState, AllocFn, WriteFn, ReadFn, Operation   ; 戻り値は stat
; Handle : void* in/out -> "sptr"
; UserState : void* in/out -> "sptr"
; AllocFn : MIDL_ES_ALLOC -> "sptr"
; WriteFn : MIDL_ES_WRITE -> "sptr"
; ReadFn : MIDL_ES_READ -> "sptr"
; Operation : MIDL_ES_CODE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "RPCRT4.dll"
#cfunc global MesIncrementalHandleReset "MesIncrementalHandleReset" sptr, sptr, sptr, sptr, sptr, int
; res = MesIncrementalHandleReset(Handle, UserState, AllocFn, WriteFn, ReadFn, Operation)
; Handle : void* in/out -> "sptr"
; UserState : void* in/out -> "sptr"
; AllocFn : MIDL_ES_ALLOC -> "sptr"
; WriteFn : MIDL_ES_WRITE -> "sptr"
; ReadFn : MIDL_ES_READ -> "sptr"
; Operation : MIDL_ES_CODE -> "int"
; RPC_STATUS MesIncrementalHandleReset(void* Handle, void* UserState, MIDL_ES_ALLOC AllocFn, MIDL_ES_WRITE WriteFn, MIDL_ES_READ ReadFn, MIDL_ES_CODE Operation)
#uselib "RPCRT4.dll"
#cfunc global MesIncrementalHandleReset "MesIncrementalHandleReset" intptr, intptr, intptr, intptr, intptr, int
; res = MesIncrementalHandleReset(Handle, UserState, AllocFn, WriteFn, ReadFn, Operation)
; Handle : void* in/out -> "intptr"
; UserState : void* in/out -> "intptr"
; AllocFn : MIDL_ES_ALLOC -> "intptr"
; WriteFn : MIDL_ES_WRITE -> "intptr"
; ReadFn : MIDL_ES_READ -> "intptr"
; Operation : MIDL_ES_CODE -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	rpcrt4 = windows.NewLazySystemDLL("RPCRT4.dll")
	procMesIncrementalHandleReset = rpcrt4.NewProc("MesIncrementalHandleReset")
)

// Handle (void* in/out), UserState (void* in/out), AllocFn (MIDL_ES_ALLOC), WriteFn (MIDL_ES_WRITE), ReadFn (MIDL_ES_READ), Operation (MIDL_ES_CODE)
r1, _, err := procMesIncrementalHandleReset.Call(
	uintptr(Handle),
	uintptr(UserState),
	uintptr(AllocFn),
	uintptr(WriteFn),
	uintptr(ReadFn),
	uintptr(Operation),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // RPC_STATUS
function MesIncrementalHandleReset(
  Handle: Pointer;   // void* in/out
  UserState: Pointer;   // void* in/out
  AllocFn: Pointer;   // MIDL_ES_ALLOC
  WriteFn: Pointer;   // MIDL_ES_WRITE
  ReadFn: Pointer;   // MIDL_ES_READ
  Operation: Integer   // MIDL_ES_CODE
): Integer; stdcall;
  external 'RPCRT4.dll' name 'MesIncrementalHandleReset';
result := DllCall("RPCRT4\MesIncrementalHandleReset"
    , "Ptr", Handle   ; void* in/out
    , "Ptr", UserState   ; void* in/out
    , "Ptr", AllocFn   ; MIDL_ES_ALLOC
    , "Ptr", WriteFn   ; MIDL_ES_WRITE
    , "Ptr", ReadFn   ; MIDL_ES_READ
    , "Int", Operation   ; MIDL_ES_CODE
    , "Int")   ; return: RPC_STATUS
●MesIncrementalHandleReset(Handle, UserState, AllocFn, WriteFn, ReadFn, Operation) = DLL("RPCRT4.dll", "int MesIncrementalHandleReset(void*, void*, void*, void*, void*, int)")
# 呼び出し: MesIncrementalHandleReset(Handle, UserState, AllocFn, WriteFn, ReadFn, Operation)
# Handle : void* in/out -> "void*"
# UserState : void* in/out -> "void*"
# AllocFn : MIDL_ES_ALLOC -> "void*"
# WriteFn : MIDL_ES_WRITE -> "void*"
# ReadFn : MIDL_ES_READ -> "void*"
# Operation : MIDL_ES_CODE -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。