OleGetClipboardWithEnterpriseInfo
関数シグネチャ
// OLE32.dll
#include <windows.h>
HRESULT OleGetClipboardWithEnterpriseInfo(
IDataObject** dataObject,
LPWSTR* dataEnterpriseId,
LPWSTR* sourceDescription,
LPWSTR* targetDescription,
LPWSTR* dataDescription
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| dataObject | IDataObject** | out | クリップボードデータオブジェクトへのインターフェイスポインターを受け取る IDataObject ポインター変数のアドレスです。 |
| dataEnterpriseId | LPWSTR* | out | クリップボードデータを設定したアプリケーションのエンタープライズ ID です。 データが個人用の場合、これは空の文字列になります。 |
| sourceDescription | LPWSTR* | out | クリップボードを設定したアプリケーションの説明です。 |
| targetDescription | LPWSTR* | out | 監査に使用される、呼び出し元アプリケーションの説明です。 |
| dataDescription | LPWSTR* | out | 監査に使用される、データオブジェクトの説明です。 |
戻り値の型: HRESULT
公式ドキュメント
Windows Information Protection に対応したアプリケーションが、OLE クリップボードから IDataObject を取得する際に、そのデータおよびソースアプリケーションに関する Windows Information Protection 情報を併せて取得できるようにします。
戻り値
成功した場合、この関数は S_OK を返します。その他に返される可能性のある値は次のとおりです。
| 戻り値 | 説明 |
|---|---|
| OleFlushClipboard 内で使用される OpenClipboard 関数が失敗しました。 | |
| OleFlushClipboard 内で使用される CloseClipboard 関数が失敗しました。 |
解説(Remarks)
OleGetClipboardWithEnterpriseInfo は次の 3 つのケースを処理します。
- OleSetClipboard 関数でクリップボードにデータを配置したアプリケーションがまだ実行中である場合。
- OleSetClipboard 関数でクリップボードにデータを配置したアプリケーションが、その後 OleFlushClipboard 関数を呼び出した場合。
- OLE 以外のアプリケーションのデータがクリップボードにある場合。
2 つ目のケースでは、OLE は既定のデータオブジェクトを作成してユーザーに返します。クリップボード上のデータは OleSetClipboard 呼び出しに由来するため、OLE が提供するデータオブジェクトには、クリップボード上のデータの種類に関するより正確な情報が含まれます。特に、データが提供された元のメディウム (TYMED) が判明しています。したがって、データソースアプリケーションが特定のクリップボード形式 (たとえば cfFOO) をストレージオブジェクト上で提供して OleFlushClipboard 関数を呼び出すと、そのストレージオブジェクトがメモリにコピーされ、hglobal メモリハンドルがクリップボードに配置されます。その後、OleGetClipboardWithEnterpriseInfo 関数が既定のデータオブジェクトを作成すると、クリップボードの hglobal は再び IStorage オブジェクトになります。さらに、FORMATETC 列挙子と IDataObject::QueryGetData メソッドはいずれも、元のクリップボード形式 (cfFOO) が TYMED_ISTORAGE 上で再び利用可能であることを正しく示します。
3 つ目のケースでも OLE は既定のデータオブジェクトを作成しますが、クリップボード形式内のデータに関する特別な情報はありません (特にアプリケーション定義のクリップボード形式の場合)。したがって、hGlobal ベースのストレージメディウムが SetClipboardData 関数の呼び出しによってクリップボードに直接配置された場合、FORMATETC 列挙子と IDataObject::QueryGetData メソッドは、そのデータがストレージメディウム上で利用可能であることを示しません。ただし、TYMED_ISTORAGE に対する IDataObject::GetData メソッドの呼び出しは成功します。これらの制約があるため、OLE 対応アプリケーションは OLE クリップボード関数を使用してクリップボードを操作することを強く推奨します。
OleGetClipboardWithEnterpriseInfo 関数が作成するクリップボードデータオブジェクトは、かなり広範な IDataObject 実装を備えています。OLE が提供するデータオブジェクトは、OLE 1 のクリップボード形式データを、OLE 2 の呼び出し元が期待する表現に変換できます。また、構造化データはあらゆる構造化メディウムまたはフラットメディウム上で利用可能であり、フラットデータはあらゆるフラットメディウム上で利用可能です。ただし、GDI オブジェクト (メタファイルやビットマップなど) は、それぞれ対応するメディウム上でのみ利用可能です。
FORMATETC 列挙子で使用される FORMATETC 構造体の tymed メンバーには、サポートされるメディウムの和集合が含まれることに注意してください。特定の情報 (CF_TEXT が TYMED_HGLOBAL 上で利用可能かどうかなど) を確認するアプリケーションは、この値を調べる際に適切なビットマスク処理を行う必要があります。
OleGetClipboardWithEnterpriseInfo 関数を呼び出す場合は、返された IDataObject をごく短時間だけ保持するようにしてください。これは、提供元のアプリケーションのリソースを消費します。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// OLE32.dll
#include <windows.h>
HRESULT OleGetClipboardWithEnterpriseInfo(
IDataObject** dataObject,
LPWSTR* dataEnterpriseId,
LPWSTR* sourceDescription,
LPWSTR* targetDescription,
LPWSTR* dataDescription
);[DllImport("OLE32.dll", ExactSpelling = true)]
static extern int OleGetClipboardWithEnterpriseInfo(
IntPtr dataObject, // IDataObject** out
IntPtr dataEnterpriseId, // LPWSTR* out
IntPtr sourceDescription, // LPWSTR* out
IntPtr targetDescription, // LPWSTR* out
IntPtr dataDescription // LPWSTR* out
);<DllImport("OLE32.dll", ExactSpelling:=True)>
Public Shared Function OleGetClipboardWithEnterpriseInfo(
dataObject As IntPtr, ' IDataObject** out
dataEnterpriseId As IntPtr, ' LPWSTR* out
sourceDescription As IntPtr, ' LPWSTR* out
targetDescription As IntPtr, ' LPWSTR* out
dataDescription As IntPtr ' LPWSTR* out
) As Integer
End Function' dataObject : IDataObject** out
' dataEnterpriseId : LPWSTR* out
' sourceDescription : LPWSTR* out
' targetDescription : LPWSTR* out
' dataDescription : LPWSTR* out
Declare PtrSafe Function OleGetClipboardWithEnterpriseInfo Lib "ole32" ( _
ByVal dataObject As LongPtr, _
ByVal dataEnterpriseId As LongPtr, _
ByVal sourceDescription As LongPtr, _
ByVal targetDescription As LongPtr, _
ByVal dataDescription As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
OleGetClipboardWithEnterpriseInfo = ctypes.windll.ole32.OleGetClipboardWithEnterpriseInfo
OleGetClipboardWithEnterpriseInfo.restype = ctypes.c_int
OleGetClipboardWithEnterpriseInfo.argtypes = [
ctypes.c_void_p, # dataObject : IDataObject** out
ctypes.c_void_p, # dataEnterpriseId : LPWSTR* out
ctypes.c_void_p, # sourceDescription : LPWSTR* out
ctypes.c_void_p, # targetDescription : LPWSTR* out
ctypes.c_void_p, # dataDescription : LPWSTR* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OLE32.dll')
OleGetClipboardWithEnterpriseInfo = Fiddle::Function.new(
lib['OleGetClipboardWithEnterpriseInfo'],
[
Fiddle::TYPE_VOIDP, # dataObject : IDataObject** out
Fiddle::TYPE_VOIDP, # dataEnterpriseId : LPWSTR* out
Fiddle::TYPE_VOIDP, # sourceDescription : LPWSTR* out
Fiddle::TYPE_VOIDP, # targetDescription : LPWSTR* out
Fiddle::TYPE_VOIDP, # dataDescription : LPWSTR* out
],
Fiddle::TYPE_INT)#[link(name = "ole32")]
extern "system" {
fn OleGetClipboardWithEnterpriseInfo(
dataObject: *mut *mut core::ffi::c_void, // IDataObject** out
dataEnterpriseId: *mut *mut u16, // LPWSTR* out
sourceDescription: *mut *mut u16, // LPWSTR* out
targetDescription: *mut *mut u16, // LPWSTR* out
dataDescription: *mut *mut u16 // LPWSTR* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OLE32.dll")]
public static extern int OleGetClipboardWithEnterpriseInfo(IntPtr dataObject, IntPtr dataEnterpriseId, IntPtr sourceDescription, IntPtr targetDescription, IntPtr dataDescription);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OLE32_OleGetClipboardWithEnterpriseInfo' -Namespace Win32 -PassThru
# $api::OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)#uselib "OLE32.dll"
#func global OleGetClipboardWithEnterpriseInfo "OleGetClipboardWithEnterpriseInfo" sptr, sptr, sptr, sptr, sptr
; OleGetClipboardWithEnterpriseInfo dataObject, varptr(dataEnterpriseId), varptr(sourceDescription), varptr(targetDescription), varptr(dataDescription) ; 戻り値は stat
; dataObject : IDataObject** out -> "sptr"
; dataEnterpriseId : LPWSTR* out -> "sptr"
; sourceDescription : LPWSTR* out -> "sptr"
; targetDescription : LPWSTR* out -> "sptr"
; dataDescription : LPWSTR* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "OLE32.dll" #cfunc global OleGetClipboardWithEnterpriseInfo "OleGetClipboardWithEnterpriseInfo" sptr, var, var, var, var ; res = OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription) ; dataObject : IDataObject** out -> "sptr" ; dataEnterpriseId : LPWSTR* out -> "var" ; sourceDescription : LPWSTR* out -> "var" ; targetDescription : LPWSTR* out -> "var" ; dataDescription : LPWSTR* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "OLE32.dll" #cfunc global OleGetClipboardWithEnterpriseInfo "OleGetClipboardWithEnterpriseInfo" sptr, sptr, sptr, sptr, sptr ; res = OleGetClipboardWithEnterpriseInfo(dataObject, varptr(dataEnterpriseId), varptr(sourceDescription), varptr(targetDescription), varptr(dataDescription)) ; dataObject : IDataObject** out -> "sptr" ; dataEnterpriseId : LPWSTR* out -> "sptr" ; sourceDescription : LPWSTR* out -> "sptr" ; targetDescription : LPWSTR* out -> "sptr" ; dataDescription : LPWSTR* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
; HRESULT OleGetClipboardWithEnterpriseInfo(IDataObject** dataObject, LPWSTR* dataEnterpriseId, LPWSTR* sourceDescription, LPWSTR* targetDescription, LPWSTR* dataDescription) #uselib "OLE32.dll" #cfunc global OleGetClipboardWithEnterpriseInfo "OleGetClipboardWithEnterpriseInfo" intptr, var, var, var, var ; res = OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription) ; dataObject : IDataObject** out -> "intptr" ; dataEnterpriseId : LPWSTR* out -> "var" ; sourceDescription : LPWSTR* out -> "var" ; targetDescription : LPWSTR* out -> "var" ; dataDescription : LPWSTR* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT OleGetClipboardWithEnterpriseInfo(IDataObject** dataObject, LPWSTR* dataEnterpriseId, LPWSTR* sourceDescription, LPWSTR* targetDescription, LPWSTR* dataDescription) #uselib "OLE32.dll" #cfunc global OleGetClipboardWithEnterpriseInfo "OleGetClipboardWithEnterpriseInfo" intptr, intptr, intptr, intptr, intptr ; res = OleGetClipboardWithEnterpriseInfo(dataObject, varptr(dataEnterpriseId), varptr(sourceDescription), varptr(targetDescription), varptr(dataDescription)) ; dataObject : IDataObject** out -> "intptr" ; dataEnterpriseId : LPWSTR* out -> "intptr" ; sourceDescription : LPWSTR* out -> "intptr" ; targetDescription : LPWSTR* out -> "intptr" ; dataDescription : LPWSTR* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
ole32 = windows.NewLazySystemDLL("OLE32.dll")
procOleGetClipboardWithEnterpriseInfo = ole32.NewProc("OleGetClipboardWithEnterpriseInfo")
)
// dataObject (IDataObject** out), dataEnterpriseId (LPWSTR* out), sourceDescription (LPWSTR* out), targetDescription (LPWSTR* out), dataDescription (LPWSTR* out)
r1, _, err := procOleGetClipboardWithEnterpriseInfo.Call(
uintptr(dataObject),
uintptr(dataEnterpriseId),
uintptr(sourceDescription),
uintptr(targetDescription),
uintptr(dataDescription),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction OleGetClipboardWithEnterpriseInfo(
dataObject: Pointer; // IDataObject** out
dataEnterpriseId: PPWideChar; // LPWSTR* out
sourceDescription: PPWideChar; // LPWSTR* out
targetDescription: PPWideChar; // LPWSTR* out
dataDescription: PPWideChar // LPWSTR* out
): Integer; stdcall;
external 'OLE32.dll' name 'OleGetClipboardWithEnterpriseInfo';result := DllCall("OLE32\OleGetClipboardWithEnterpriseInfo"
, "Ptr", dataObject ; IDataObject** out
, "Ptr", dataEnterpriseId ; LPWSTR* out
, "Ptr", sourceDescription ; LPWSTR* out
, "Ptr", targetDescription ; LPWSTR* out
, "Ptr", dataDescription ; LPWSTR* out
, "Int") ; return: HRESULT●OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription) = DLL("OLE32.dll", "int OleGetClipboardWithEnterpriseInfo(void*, void*, void*, void*, void*)")
# 呼び出し: OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)
# dataObject : IDataObject** out -> "void*"
# dataEnterpriseId : LPWSTR* out -> "void*"
# sourceDescription : LPWSTR* out -> "void*"
# targetDescription : LPWSTR* out -> "void*"
# dataDescription : LPWSTR* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "ole32" fn OleGetClipboardWithEnterpriseInfo(
dataObject: ?*anyopaque, // IDataObject** out
dataEnterpriseId: [*c][*c]u16, // LPWSTR* out
sourceDescription: [*c][*c]u16, // LPWSTR* out
targetDescription: [*c][*c]u16, // LPWSTR* out
dataDescription: [*c][*c]u16 // LPWSTR* out
) callconv(std.os.windows.WINAPI) i32;proc OleGetClipboardWithEnterpriseInfo(
dataObject: pointer, # IDataObject** out
dataEnterpriseId: ptr WideCString, # LPWSTR* out
sourceDescription: ptr WideCString, # LPWSTR* out
targetDescription: ptr WideCString, # LPWSTR* out
dataDescription: ptr WideCString # LPWSTR* out
): int32 {.importc: "OleGetClipboardWithEnterpriseInfo", stdcall, dynlib: "OLE32.dll".}pragma(lib, "ole32");
extern(Windows)
int OleGetClipboardWithEnterpriseInfo(
void* dataObject, // IDataObject** out
wchar** dataEnterpriseId, // LPWSTR* out
wchar** sourceDescription, // LPWSTR* out
wchar** targetDescription, // LPWSTR* out
wchar** dataDescription // LPWSTR* out
);ccall((:OleGetClipboardWithEnterpriseInfo, "OLE32.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{Ptr{UInt16}}, Ptr{Ptr{UInt16}}, Ptr{Ptr{UInt16}}, Ptr{Ptr{UInt16}}),
dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)
# dataObject : IDataObject** out -> Ptr{Cvoid}
# dataEnterpriseId : LPWSTR* out -> Ptr{Ptr{UInt16}}
# sourceDescription : LPWSTR* out -> Ptr{Ptr{UInt16}}
# targetDescription : LPWSTR* out -> Ptr{Ptr{UInt16}}
# dataDescription : LPWSTR* out -> Ptr{Ptr{UInt16}}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t OleGetClipboardWithEnterpriseInfo(
void* dataObject,
uint16_t** dataEnterpriseId,
uint16_t** sourceDescription,
uint16_t** targetDescription,
uint16_t** dataDescription);
]]
local ole32 = ffi.load("ole32")
-- ole32.OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)
-- dataObject : IDataObject** out
-- dataEnterpriseId : LPWSTR* out
-- sourceDescription : LPWSTR* out
-- targetDescription : LPWSTR* out
-- dataDescription : LPWSTR* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('OLE32.dll');
const OleGetClipboardWithEnterpriseInfo = lib.func('__stdcall', 'OleGetClipboardWithEnterpriseInfo', 'int32_t', ['void *', 'void *', 'void *', 'void *', 'void *']);
// OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)
// dataObject : IDataObject** out -> 'void *'
// dataEnterpriseId : LPWSTR* out -> 'void *'
// sourceDescription : LPWSTR* out -> 'void *'
// targetDescription : LPWSTR* out -> 'void *'
// dataDescription : LPWSTR* out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("OLE32.dll", {
OleGetClipboardWithEnterpriseInfo: { parameters: ["pointer", "pointer", "pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)
// dataObject : IDataObject** out -> "pointer"
// dataEnterpriseId : LPWSTR* out -> "pointer"
// sourceDescription : LPWSTR* out -> "pointer"
// targetDescription : LPWSTR* out -> "pointer"
// dataDescription : LPWSTR* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t OleGetClipboardWithEnterpriseInfo(
void* dataObject,
uint16_t** dataEnterpriseId,
uint16_t** sourceDescription,
uint16_t** targetDescription,
uint16_t** dataDescription);
C, "OLE32.dll");
// $ffi->OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription);
// dataObject : IDataObject** out
// dataEnterpriseId : LPWSTR* out
// sourceDescription : LPWSTR* out
// targetDescription : LPWSTR* out
// dataDescription : LPWSTR* out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Ole32 extends StdCallLibrary {
Ole32 INSTANCE = Native.load("ole32", Ole32.class);
int OleGetClipboardWithEnterpriseInfo(
Pointer dataObject, // IDataObject** out
PointerByReference dataEnterpriseId, // LPWSTR* out
PointerByReference sourceDescription, // LPWSTR* out
PointerByReference targetDescription, // LPWSTR* out
PointerByReference dataDescription // LPWSTR* out
);
}@[Link("ole32")]
lib LibOLE32
fun OleGetClipboardWithEnterpriseInfo = OleGetClipboardWithEnterpriseInfo(
dataObject : Void*, # IDataObject** out
dataEnterpriseId : UInt16**, # LPWSTR* out
sourceDescription : UInt16**, # LPWSTR* out
targetDescription : UInt16**, # LPWSTR* out
dataDescription : UInt16** # LPWSTR* out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef OleGetClipboardWithEnterpriseInfoNative = Int32 Function(Pointer<Void>, Pointer<Pointer<Utf16>>, Pointer<Pointer<Utf16>>, Pointer<Pointer<Utf16>>, Pointer<Pointer<Utf16>>);
typedef OleGetClipboardWithEnterpriseInfoDart = int Function(Pointer<Void>, Pointer<Pointer<Utf16>>, Pointer<Pointer<Utf16>>, Pointer<Pointer<Utf16>>, Pointer<Pointer<Utf16>>);
final OleGetClipboardWithEnterpriseInfo = DynamicLibrary.open('OLE32.dll')
.lookupFunction<OleGetClipboardWithEnterpriseInfoNative, OleGetClipboardWithEnterpriseInfoDart>('OleGetClipboardWithEnterpriseInfo');
// dataObject : IDataObject** out -> Pointer<Void>
// dataEnterpriseId : LPWSTR* out -> Pointer<Pointer<Utf16>>
// sourceDescription : LPWSTR* out -> Pointer<Pointer<Utf16>>
// targetDescription : LPWSTR* out -> Pointer<Pointer<Utf16>>
// dataDescription : LPWSTR* out -> Pointer<Pointer<Utf16>>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function OleGetClipboardWithEnterpriseInfo(
dataObject: Pointer; // IDataObject** out
dataEnterpriseId: PPWideChar; // LPWSTR* out
sourceDescription: PPWideChar; // LPWSTR* out
targetDescription: PPWideChar; // LPWSTR* out
dataDescription: PPWideChar // LPWSTR* out
): Integer; stdcall;
external 'OLE32.dll' name 'OleGetClipboardWithEnterpriseInfo';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "OleGetClipboardWithEnterpriseInfo"
c_OleGetClipboardWithEnterpriseInfo :: Ptr () -> Ptr CWString -> Ptr CWString -> Ptr CWString -> Ptr CWString -> IO Int32
-- dataObject : IDataObject** out -> Ptr ()
-- dataEnterpriseId : LPWSTR* out -> Ptr CWString
-- sourceDescription : LPWSTR* out -> Ptr CWString
-- targetDescription : LPWSTR* out -> Ptr CWString
-- dataDescription : LPWSTR* out -> Ptr CWString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let olegetclipboardwithenterpriseinfo =
foreign "OleGetClipboardWithEnterpriseInfo"
((ptr void) @-> (ptr (ptr uint16_t)) @-> (ptr (ptr uint16_t)) @-> (ptr (ptr uint16_t)) @-> (ptr (ptr uint16_t)) @-> returning int32_t)
(* dataObject : IDataObject** out -> (ptr void) *)
(* dataEnterpriseId : LPWSTR* out -> (ptr (ptr uint16_t)) *)
(* sourceDescription : LPWSTR* out -> (ptr (ptr uint16_t)) *)
(* targetDescription : LPWSTR* out -> (ptr (ptr uint16_t)) *)
(* dataDescription : LPWSTR* out -> (ptr (ptr uint16_t)) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library ole32 (t "OLE32.dll"))
(cffi:use-foreign-library ole32)
(cffi:defcfun ("OleGetClipboardWithEnterpriseInfo" ole-get-clipboard-with-enterprise-info :convention :stdcall) :int32
(data-object :pointer) ; IDataObject** out
(data-enterprise-id :pointer) ; LPWSTR* out
(source-description :pointer) ; LPWSTR* out
(target-description :pointer) ; LPWSTR* out
(data-description :pointer)) ; LPWSTR* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $OleGetClipboardWithEnterpriseInfo = Win32::API::More->new('OLE32',
'int OleGetClipboardWithEnterpriseInfo(LPVOID dataObject, LPVOID dataEnterpriseId, LPVOID sourceDescription, LPVOID targetDescription, LPVOID dataDescription)');
# my $ret = $OleGetClipboardWithEnterpriseInfo->Call($dataObject, $dataEnterpriseId, $sourceDescription, $targetDescription, $dataDescription);
# dataObject : IDataObject** out -> LPVOID
# dataEnterpriseId : LPWSTR* out -> LPVOID
# sourceDescription : LPWSTR* out -> LPVOID
# targetDescription : LPWSTR* out -> LPVOID
# dataDescription : LPWSTR* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
- f OleSetClipboard — データオブジェクトをOLEクリップボードに設定する。