ホーム › UI.ColorSystem › WcsOpenColorProfileA
WcsOpenColorProfileA
関数WCSの複数プロファイルを開きハンドルを返す(ANSI版)。
シグネチャ
// mscms.dll (ANSI / -A)
#include <windows.h>
INT_PTR WcsOpenColorProfileA(
PROFILE* pCDMPProfile,
PROFILE* pCAMPProfile, // optional
PROFILE* pGMMPProfile, // optional
DWORD dwDesireAccess,
DWORD dwShareMode,
DWORD dwCreationMode,
DWORD dwFlags
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| pCDMPProfile | PROFILE* | in | デバイスモデルプロファイル(CDMP)を記述するPROFILE構造体(ANSI)へのポインタ。 |
| pCAMPProfile | PROFILE* | inoptional | 色外観モデルプロファイル(CAMP)を記述するPROFILE構造体へのポインタ。NULL可。 |
| pGMMPProfile | PROFILE* | inoptional | ガモットマップモデルプロファイル(GMMP)を記述するPROFILE構造体へのポインタ。NULL可。 |
| dwDesireAccess | DWORD | in | プロファイルへのアクセス権を指定するフラグ。 |
| dwShareMode | DWORD | in | 他プロセスとの共有モードを指定するフラグ。 |
| dwCreationMode | DWORD | in | プロファイルを開く際の作成動作を指定する値。 |
| dwFlags | DWORD | in | WCSプロファイルの取り扱い方法を制御するフラグ。 |
戻り値の型: INT_PTR
各言語での呼び出し定義
// mscms.dll (ANSI / -A)
#include <windows.h>
INT_PTR WcsOpenColorProfileA(
PROFILE* pCDMPProfile,
PROFILE* pCAMPProfile, // optional
PROFILE* pGMMPProfile, // optional
DWORD dwDesireAccess,
DWORD dwShareMode,
DWORD dwCreationMode,
DWORD dwFlags
);[DllImport("mscms.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern IntPtr WcsOpenColorProfileA(
IntPtr pCDMPProfile, // PROFILE*
IntPtr pCAMPProfile, // PROFILE* optional
IntPtr pGMMPProfile, // PROFILE* optional
uint dwDesireAccess, // DWORD
uint dwShareMode, // DWORD
uint dwCreationMode, // DWORD
uint dwFlags // DWORD
);<DllImport("mscms.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function WcsOpenColorProfileA(
pCDMPProfile As IntPtr, ' PROFILE*
pCAMPProfile As IntPtr, ' PROFILE* optional
pGMMPProfile As IntPtr, ' PROFILE* optional
dwDesireAccess As UInteger, ' DWORD
dwShareMode As UInteger, ' DWORD
dwCreationMode As UInteger, ' DWORD
dwFlags As UInteger ' DWORD
) As IntPtr
End Function' pCDMPProfile : PROFILE*
' pCAMPProfile : PROFILE* optional
' pGMMPProfile : PROFILE* optional
' dwDesireAccess : DWORD
' dwShareMode : DWORD
' dwCreationMode : DWORD
' dwFlags : DWORD
Declare PtrSafe Function WcsOpenColorProfileA Lib "mscms" ( _
ByVal pCDMPProfile As LongPtr, _
ByVal pCAMPProfile As LongPtr, _
ByVal pGMMPProfile As LongPtr, _
ByVal dwDesireAccess As Long, _
ByVal dwShareMode As Long, _
ByVal dwCreationMode As Long, _
ByVal dwFlags As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WcsOpenColorProfileA = ctypes.windll.mscms.WcsOpenColorProfileA
WcsOpenColorProfileA.restype = ctypes.c_ssize_t
WcsOpenColorProfileA.argtypes = [
ctypes.c_void_p, # pCDMPProfile : PROFILE*
ctypes.c_void_p, # pCAMPProfile : PROFILE* optional
ctypes.c_void_p, # pGMMPProfile : PROFILE* optional
wintypes.DWORD, # dwDesireAccess : DWORD
wintypes.DWORD, # dwShareMode : DWORD
wintypes.DWORD, # dwCreationMode : DWORD
wintypes.DWORD, # dwFlags : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('mscms.dll')
WcsOpenColorProfileA = Fiddle::Function.new(
lib['WcsOpenColorProfileA'],
[
Fiddle::TYPE_VOIDP, # pCDMPProfile : PROFILE*
Fiddle::TYPE_VOIDP, # pCAMPProfile : PROFILE* optional
Fiddle::TYPE_VOIDP, # pGMMPProfile : PROFILE* optional
-Fiddle::TYPE_INT, # dwDesireAccess : DWORD
-Fiddle::TYPE_INT, # dwShareMode : DWORD
-Fiddle::TYPE_INT, # dwCreationMode : DWORD
-Fiddle::TYPE_INT, # dwFlags : DWORD
],
Fiddle::TYPE_INTPTR_T)#[link(name = "mscms")]
extern "system" {
fn WcsOpenColorProfileA(
pCDMPProfile: *mut PROFILE, // PROFILE*
pCAMPProfile: *mut PROFILE, // PROFILE* optional
pGMMPProfile: *mut PROFILE, // PROFILE* optional
dwDesireAccess: u32, // DWORD
dwShareMode: u32, // DWORD
dwCreationMode: u32, // DWORD
dwFlags: u32 // DWORD
) -> isize;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("mscms.dll", CharSet = CharSet.Ansi)]
public static extern IntPtr WcsOpenColorProfileA(IntPtr pCDMPProfile, IntPtr pCAMPProfile, IntPtr pGMMPProfile, uint dwDesireAccess, uint dwShareMode, uint dwCreationMode, uint dwFlags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'mscms_WcsOpenColorProfileA' -Namespace Win32 -PassThru
# $api::WcsOpenColorProfileA(pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags)#uselib "mscms.dll"
#func global WcsOpenColorProfileA "WcsOpenColorProfileA" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; WcsOpenColorProfileA varptr(pCDMPProfile), varptr(pCAMPProfile), varptr(pGMMPProfile), dwDesireAccess, dwShareMode, dwCreationMode, dwFlags ; 戻り値は stat
; pCDMPProfile : PROFILE* -> "sptr"
; pCAMPProfile : PROFILE* optional -> "sptr"
; pGMMPProfile : PROFILE* optional -> "sptr"
; dwDesireAccess : DWORD -> "sptr"
; dwShareMode : DWORD -> "sptr"
; dwCreationMode : DWORD -> "sptr"
; dwFlags : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "mscms.dll" #cfunc global WcsOpenColorProfileA "WcsOpenColorProfileA" var, var, var, int, int, int, int ; res = WcsOpenColorProfileA(pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags) ; pCDMPProfile : PROFILE* -> "var" ; pCAMPProfile : PROFILE* optional -> "var" ; pGMMPProfile : PROFILE* optional -> "var" ; dwDesireAccess : DWORD -> "int" ; dwShareMode : DWORD -> "int" ; dwCreationMode : DWORD -> "int" ; dwFlags : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "mscms.dll" #cfunc global WcsOpenColorProfileA "WcsOpenColorProfileA" sptr, sptr, sptr, int, int, int, int ; res = WcsOpenColorProfileA(varptr(pCDMPProfile), varptr(pCAMPProfile), varptr(pGMMPProfile), dwDesireAccess, dwShareMode, dwCreationMode, dwFlags) ; pCDMPProfile : PROFILE* -> "sptr" ; pCAMPProfile : PROFILE* optional -> "sptr" ; pGMMPProfile : PROFILE* optional -> "sptr" ; dwDesireAccess : DWORD -> "int" ; dwShareMode : DWORD -> "int" ; dwCreationMode : DWORD -> "int" ; dwFlags : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT_PTR WcsOpenColorProfileA(PROFILE* pCDMPProfile, PROFILE* pCAMPProfile, PROFILE* pGMMPProfile, DWORD dwDesireAccess, DWORD dwShareMode, DWORD dwCreationMode, DWORD dwFlags) #uselib "mscms.dll" #cfunc global WcsOpenColorProfileA "WcsOpenColorProfileA" var, var, var, int, int, int, int ; res = WcsOpenColorProfileA(pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags) ; pCDMPProfile : PROFILE* -> "var" ; pCAMPProfile : PROFILE* optional -> "var" ; pGMMPProfile : PROFILE* optional -> "var" ; dwDesireAccess : DWORD -> "int" ; dwShareMode : DWORD -> "int" ; dwCreationMode : DWORD -> "int" ; dwFlags : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT_PTR WcsOpenColorProfileA(PROFILE* pCDMPProfile, PROFILE* pCAMPProfile, PROFILE* pGMMPProfile, DWORD dwDesireAccess, DWORD dwShareMode, DWORD dwCreationMode, DWORD dwFlags) #uselib "mscms.dll" #cfunc global WcsOpenColorProfileA "WcsOpenColorProfileA" intptr, intptr, intptr, int, int, int, int ; res = WcsOpenColorProfileA(varptr(pCDMPProfile), varptr(pCAMPProfile), varptr(pGMMPProfile), dwDesireAccess, dwShareMode, dwCreationMode, dwFlags) ; pCDMPProfile : PROFILE* -> "intptr" ; pCAMPProfile : PROFILE* optional -> "intptr" ; pGMMPProfile : PROFILE* optional -> "intptr" ; dwDesireAccess : DWORD -> "int" ; dwShareMode : DWORD -> "int" ; dwCreationMode : DWORD -> "int" ; dwFlags : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mscms = windows.NewLazySystemDLL("mscms.dll")
procWcsOpenColorProfileA = mscms.NewProc("WcsOpenColorProfileA")
)
// pCDMPProfile (PROFILE*), pCAMPProfile (PROFILE* optional), pGMMPProfile (PROFILE* optional), dwDesireAccess (DWORD), dwShareMode (DWORD), dwCreationMode (DWORD), dwFlags (DWORD)
r1, _, err := procWcsOpenColorProfileA.Call(
uintptr(pCDMPProfile),
uintptr(pCAMPProfile),
uintptr(pGMMPProfile),
uintptr(dwDesireAccess),
uintptr(dwShareMode),
uintptr(dwCreationMode),
uintptr(dwFlags),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INT_PTRfunction WcsOpenColorProfileA(
pCDMPProfile: Pointer; // PROFILE*
pCAMPProfile: Pointer; // PROFILE* optional
pGMMPProfile: Pointer; // PROFILE* optional
dwDesireAccess: DWORD; // DWORD
dwShareMode: DWORD; // DWORD
dwCreationMode: DWORD; // DWORD
dwFlags: DWORD // DWORD
): NativeInt; stdcall;
external 'mscms.dll' name 'WcsOpenColorProfileA';result := DllCall("mscms\WcsOpenColorProfileA"
, "Ptr", pCDMPProfile ; PROFILE*
, "Ptr", pCAMPProfile ; PROFILE* optional
, "Ptr", pGMMPProfile ; PROFILE* optional
, "UInt", dwDesireAccess ; DWORD
, "UInt", dwShareMode ; DWORD
, "UInt", dwCreationMode ; DWORD
, "UInt", dwFlags ; DWORD
, "Ptr") ; return: INT_PTR●WcsOpenColorProfileA(pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags) = DLL("mscms.dll", "int WcsOpenColorProfileA(void*, void*, void*, dword, dword, dword, dword)")
# 呼び出し: WcsOpenColorProfileA(pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags)
# pCDMPProfile : PROFILE* -> "void*"
# pCAMPProfile : PROFILE* optional -> "void*"
# pGMMPProfile : PROFILE* optional -> "void*"
# dwDesireAccess : DWORD -> "dword"
# dwShareMode : DWORD -> "dword"
# dwCreationMode : DWORD -> "dword"
# dwFlags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "mscms" fn WcsOpenColorProfileA(
pCDMPProfile: [*c]PROFILE, // PROFILE*
pCAMPProfile: [*c]PROFILE, // PROFILE* optional
pGMMPProfile: [*c]PROFILE, // PROFILE* optional
dwDesireAccess: u32, // DWORD
dwShareMode: u32, // DWORD
dwCreationMode: u32, // DWORD
dwFlags: u32 // DWORD
) callconv(std.os.windows.WINAPI) isize;proc WcsOpenColorProfileA(
pCDMPProfile: ptr PROFILE, # PROFILE*
pCAMPProfile: ptr PROFILE, # PROFILE* optional
pGMMPProfile: ptr PROFILE, # PROFILE* optional
dwDesireAccess: uint32, # DWORD
dwShareMode: uint32, # DWORD
dwCreationMode: uint32, # DWORD
dwFlags: uint32 # DWORD
): int {.importc: "WcsOpenColorProfileA", stdcall, dynlib: "mscms.dll".}pragma(lib, "mscms");
extern(Windows)
ptrdiff_t WcsOpenColorProfileA(
PROFILE* pCDMPProfile, // PROFILE*
PROFILE* pCAMPProfile, // PROFILE* optional
PROFILE* pGMMPProfile, // PROFILE* optional
uint dwDesireAccess, // DWORD
uint dwShareMode, // DWORD
uint dwCreationMode, // DWORD
uint dwFlags // DWORD
);ccall((:WcsOpenColorProfileA, "mscms.dll"), stdcall, Int,
(Ptr{PROFILE}, Ptr{PROFILE}, Ptr{PROFILE}, UInt32, UInt32, UInt32, UInt32),
pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags)
# pCDMPProfile : PROFILE* -> Ptr{PROFILE}
# pCAMPProfile : PROFILE* optional -> Ptr{PROFILE}
# pGMMPProfile : PROFILE* optional -> Ptr{PROFILE}
# dwDesireAccess : DWORD -> UInt32
# dwShareMode : DWORD -> UInt32
# dwCreationMode : DWORD -> UInt32
# dwFlags : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
intptr_t WcsOpenColorProfileA(
void* pCDMPProfile,
void* pCAMPProfile,
void* pGMMPProfile,
uint32_t dwDesireAccess,
uint32_t dwShareMode,
uint32_t dwCreationMode,
uint32_t dwFlags);
]]
local mscms = ffi.load("mscms")
-- mscms.WcsOpenColorProfileA(pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags)
-- pCDMPProfile : PROFILE*
-- pCAMPProfile : PROFILE* optional
-- pGMMPProfile : PROFILE* optional
-- dwDesireAccess : DWORD
-- dwShareMode : DWORD
-- dwCreationMode : DWORD
-- dwFlags : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('mscms.dll');
const WcsOpenColorProfileA = lib.func('__stdcall', 'WcsOpenColorProfileA', 'intptr_t', ['void *', 'void *', 'void *', 'uint32_t', 'uint32_t', 'uint32_t', 'uint32_t']);
// WcsOpenColorProfileA(pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags)
// pCDMPProfile : PROFILE* -> 'void *'
// pCAMPProfile : PROFILE* optional -> 'void *'
// pGMMPProfile : PROFILE* optional -> 'void *'
// dwDesireAccess : DWORD -> 'uint32_t'
// dwShareMode : DWORD -> 'uint32_t'
// dwCreationMode : DWORD -> 'uint32_t'
// dwFlags : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("mscms.dll", {
WcsOpenColorProfileA: { parameters: ["pointer", "pointer", "pointer", "u32", "u32", "u32", "u32"], result: "isize" },
});
// lib.symbols.WcsOpenColorProfileA(pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags)
// pCDMPProfile : PROFILE* -> "pointer"
// pCAMPProfile : PROFILE* optional -> "pointer"
// pGMMPProfile : PROFILE* optional -> "pointer"
// dwDesireAccess : DWORD -> "u32"
// dwShareMode : DWORD -> "u32"
// dwCreationMode : DWORD -> "u32"
// dwFlags : DWORD -> "u32"
// 文字列は "buffer"。ANSI(-A) は new TextEncoder() で UTF-8/ANSI バイト列(末尾に \x00)を渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
intptr_t WcsOpenColorProfileA(
void* pCDMPProfile,
void* pCAMPProfile,
void* pGMMPProfile,
uint32_t dwDesireAccess,
uint32_t dwShareMode,
uint32_t dwCreationMode,
uint32_t dwFlags);
C, "mscms.dll");
// $ffi->WcsOpenColorProfileA(pCDMPProfile, pCAMPProfile, pGMMPProfile, dwDesireAccess, dwShareMode, dwCreationMode, dwFlags);
// pCDMPProfile : PROFILE*
// pCAMPProfile : PROFILE* optional
// pGMMPProfile : PROFILE* optional
// dwDesireAccess : DWORD
// dwShareMode : DWORD
// dwCreationMode : DWORD
// dwFlags : DWORD
// 構造体/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 Mscms extends StdCallLibrary {
Mscms INSTANCE = Native.load("mscms", Mscms.class, W32APIOptions.ASCII_OPTIONS);
long WcsOpenColorProfileA(
Pointer pCDMPProfile, // PROFILE*
Pointer pCAMPProfile, // PROFILE* optional
Pointer pGMMPProfile, // PROFILE* optional
int dwDesireAccess, // DWORD
int dwShareMode, // DWORD
int dwCreationMode, // DWORD
int dwFlags // DWORD
);
}@[Link("mscms")]
lib Libmscms
fun WcsOpenColorProfileA = WcsOpenColorProfileA(
pCDMPProfile : PROFILE*, # PROFILE*
pCAMPProfile : PROFILE*, # PROFILE* optional
pGMMPProfile : PROFILE*, # PROFILE* optional
dwDesireAccess : UInt32, # DWORD
dwShareMode : UInt32, # DWORD
dwCreationMode : UInt32, # DWORD
dwFlags : UInt32 # DWORD
) : LibC::SSizeT
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WcsOpenColorProfileANative = IntPtr Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Uint32, Uint32, Uint32, Uint32);
typedef WcsOpenColorProfileADart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, int, int, int, int);
final WcsOpenColorProfileA = DynamicLibrary.open('mscms.dll')
.lookupFunction<WcsOpenColorProfileANative, WcsOpenColorProfileADart>('WcsOpenColorProfileA');
// pCDMPProfile : PROFILE* -> Pointer<Void>
// pCAMPProfile : PROFILE* optional -> Pointer<Void>
// pGMMPProfile : PROFILE* optional -> Pointer<Void>
// dwDesireAccess : DWORD -> Uint32
// dwShareMode : DWORD -> Uint32
// dwCreationMode : DWORD -> Uint32
// dwFlags : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function WcsOpenColorProfileA(
pCDMPProfile: Pointer; // PROFILE*
pCAMPProfile: Pointer; // PROFILE* optional
pGMMPProfile: Pointer; // PROFILE* optional
dwDesireAccess: DWORD; // DWORD
dwShareMode: DWORD; // DWORD
dwCreationMode: DWORD; // DWORD
dwFlags: DWORD // DWORD
): NativeInt; stdcall;
external 'mscms.dll' name 'WcsOpenColorProfileA';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WcsOpenColorProfileA"
c_WcsOpenColorProfileA :: Ptr () -> Ptr () -> Ptr () -> Word32 -> Word32 -> Word32 -> Word32 -> IO CIntPtr
-- pCDMPProfile : PROFILE* -> Ptr ()
-- pCAMPProfile : PROFILE* optional -> Ptr ()
-- pGMMPProfile : PROFILE* optional -> Ptr ()
-- dwDesireAccess : DWORD -> Word32
-- dwShareMode : DWORD -> Word32
-- dwCreationMode : DWORD -> Word32
-- dwFlags : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let wcsopencolorprofilea =
foreign "WcsOpenColorProfileA"
((ptr void) @-> (ptr void) @-> (ptr void) @-> uint32_t @-> uint32_t @-> uint32_t @-> uint32_t @-> returning intptr_t)
(* pCDMPProfile : PROFILE* -> (ptr void) *)
(* pCAMPProfile : PROFILE* optional -> (ptr void) *)
(* pGMMPProfile : PROFILE* optional -> (ptr void) *)
(* dwDesireAccess : DWORD -> uint32_t *)
(* dwShareMode : DWORD -> uint32_t *)
(* dwCreationMode : DWORD -> uint32_t *)
(* dwFlags : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library mscms (t "mscms.dll"))
(cffi:use-foreign-library mscms)
(cffi:defcfun ("WcsOpenColorProfileA" wcs-open-color-profile-a :convention :stdcall) :int64
(p-cdmpprofile :pointer) ; PROFILE*
(p-campprofile :pointer) ; PROFILE* optional
(p-gmmpprofile :pointer) ; PROFILE* optional
(dw-desire-access :uint32) ; DWORD
(dw-share-mode :uint32) ; DWORD
(dw-creation-mode :uint32) ; DWORD
(dw-flags :uint32)) ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WcsOpenColorProfileA = Win32::API::More->new('mscms',
'LPARAM WcsOpenColorProfileA(LPVOID pCDMPProfile, LPVOID pCAMPProfile, LPVOID pGMMPProfile, DWORD dwDesireAccess, DWORD dwShareMode, DWORD dwCreationMode, DWORD dwFlags)');
# my $ret = $WcsOpenColorProfileA->Call($pCDMPProfile, $pCAMPProfile, $pGMMPProfile, $dwDesireAccess, $dwShareMode, $dwCreationMode, $dwFlags);
# pCDMPProfile : PROFILE* -> LPVOID
# pCAMPProfile : PROFILE* optional -> LPVOID
# pGMMPProfile : PROFILE* optional -> LPVOID
# dwDesireAccess : DWORD -> DWORD
# dwShareMode : DWORD -> DWORD
# dwCreationMode : DWORD -> DWORD
# dwFlags : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
文字セット違い
- f WcsOpenColorProfileW (Unicode版) — WCSの複数プロファイルを開きハンドルを返す(Unicode版)。
使用する型