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