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

SafeArrayDestroyDescriptor

関数
SAFEARRAYの記述子を破棄する。
DLLOLEAUT32.dll呼出規約winapi

シグネチャ

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

HRESULT SafeArrayDestroyDescriptor(
    SAFEARRAY* psa
);

パラメーター

名前方向
psaSAFEARRAY*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT SafeArrayDestroyDescriptor(
    SAFEARRAY* psa
);
[DllImport("OLEAUT32.dll", ExactSpelling = true)]
static extern int SafeArrayDestroyDescriptor(
    IntPtr psa   // SAFEARRAY*
);
<DllImport("OLEAUT32.dll", ExactSpelling:=True)>
Public Shared Function SafeArrayDestroyDescriptor(
    psa As IntPtr   ' SAFEARRAY*
) As Integer
End Function
' psa : SAFEARRAY*
Declare PtrSafe Function SafeArrayDestroyDescriptor Lib "oleaut32" ( _
    ByVal psa As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SafeArrayDestroyDescriptor = ctypes.windll.oleaut32.SafeArrayDestroyDescriptor
SafeArrayDestroyDescriptor.restype = ctypes.c_int
SafeArrayDestroyDescriptor.argtypes = [
    ctypes.c_void_p,  # psa : SAFEARRAY*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('OLEAUT32.dll')
SafeArrayDestroyDescriptor = Fiddle::Function.new(
  lib['SafeArrayDestroyDescriptor'],
  [
    Fiddle::TYPE_VOIDP,  # psa : SAFEARRAY*
  ],
  Fiddle::TYPE_INT)
#[link(name = "oleaut32")]
extern "system" {
    fn SafeArrayDestroyDescriptor(
        psa: *mut SAFEARRAY  // SAFEARRAY*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("OLEAUT32.dll")]
public static extern int SafeArrayDestroyDescriptor(IntPtr psa);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OLEAUT32_SafeArrayDestroyDescriptor' -Namespace Win32 -PassThru
# $api::SafeArrayDestroyDescriptor(psa)
#uselib "OLEAUT32.dll"
#func global SafeArrayDestroyDescriptor "SafeArrayDestroyDescriptor" sptr
; SafeArrayDestroyDescriptor varptr(psa)   ; 戻り値は stat
; psa : SAFEARRAY* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "OLEAUT32.dll"
#cfunc global SafeArrayDestroyDescriptor "SafeArrayDestroyDescriptor" var
; res = SafeArrayDestroyDescriptor(psa)
; psa : SAFEARRAY* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT SafeArrayDestroyDescriptor(SAFEARRAY* psa)
#uselib "OLEAUT32.dll"
#cfunc global SafeArrayDestroyDescriptor "SafeArrayDestroyDescriptor" var
; res = SafeArrayDestroyDescriptor(psa)
; psa : SAFEARRAY* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	oleaut32 = windows.NewLazySystemDLL("OLEAUT32.dll")
	procSafeArrayDestroyDescriptor = oleaut32.NewProc("SafeArrayDestroyDescriptor")
)

// psa (SAFEARRAY*)
r1, _, err := procSafeArrayDestroyDescriptor.Call(
	uintptr(psa),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function SafeArrayDestroyDescriptor(
  psa: Pointer   // SAFEARRAY*
): Integer; stdcall;
  external 'OLEAUT32.dll' name 'SafeArrayDestroyDescriptor';
result := DllCall("OLEAUT32\SafeArrayDestroyDescriptor"
    , "Ptr", psa   ; SAFEARRAY*
    , "Int")   ; return: HRESULT
●SafeArrayDestroyDescriptor(psa) = DLL("OLEAUT32.dll", "int SafeArrayDestroyDescriptor(void*)")
# 呼び出し: SafeArrayDestroyDescriptor(psa)
# psa : SAFEARRAY* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。