Win32 API 日本語リファレンス
ホームUI.ColorSystem › CMCreateMultiProfileTransform

CMCreateMultiProfileTransform

関数
CMMで複数プロファイルの色変換を作成する。
DLLICM32.dll呼出規約winapi

シグネチャ

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

INT_PTR CMCreateMultiProfileTransform(
    INT_PTR* pahProfiles,
    DWORD nProfiles,
    DWORD* padwIntents,
    DWORD nIntents,
    DWORD dwFlags
);

パラメーター

名前方向
pahProfilesINT_PTR*in
nProfilesDWORDin
padwIntentsDWORD*in
nIntentsDWORDin
dwFlagsDWORDin

戻り値の型: INT_PTR

各言語での呼び出し定義

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

INT_PTR CMCreateMultiProfileTransform(
    INT_PTR* pahProfiles,
    DWORD nProfiles,
    DWORD* padwIntents,
    DWORD nIntents,
    DWORD dwFlags
);
[DllImport("ICM32.dll", ExactSpelling = true)]
static extern IntPtr CMCreateMultiProfileTransform(
    ref IntPtr pahProfiles,   // INT_PTR*
    uint nProfiles,   // DWORD
    ref uint padwIntents,   // DWORD*
    uint nIntents,   // DWORD
    uint dwFlags   // DWORD
);
<DllImport("ICM32.dll", ExactSpelling:=True)>
Public Shared Function CMCreateMultiProfileTransform(
    ByRef pahProfiles As IntPtr,   ' INT_PTR*
    nProfiles As UInteger,   ' DWORD
    ByRef padwIntents As UInteger,   ' DWORD*
    nIntents As UInteger,   ' DWORD
    dwFlags As UInteger   ' DWORD
) As IntPtr
End Function
' pahProfiles : INT_PTR*
' nProfiles : DWORD
' padwIntents : DWORD*
' nIntents : DWORD
' dwFlags : DWORD
Declare PtrSafe Function CMCreateMultiProfileTransform Lib "icm32" ( _
    ByRef pahProfiles As LongPtr, _
    ByVal nProfiles As Long, _
    ByRef padwIntents As Long, _
    ByVal nIntents 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

CMCreateMultiProfileTransform = ctypes.windll.icm32.CMCreateMultiProfileTransform
CMCreateMultiProfileTransform.restype = ctypes.c_ssize_t
CMCreateMultiProfileTransform.argtypes = [
    ctypes.POINTER(ctypes.c_ssize_t),  # pahProfiles : INT_PTR*
    wintypes.DWORD,  # nProfiles : DWORD
    ctypes.POINTER(wintypes.DWORD),  # padwIntents : DWORD*
    wintypes.DWORD,  # nIntents : DWORD
    wintypes.DWORD,  # dwFlags : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	icm32 = windows.NewLazySystemDLL("ICM32.dll")
	procCMCreateMultiProfileTransform = icm32.NewProc("CMCreateMultiProfileTransform")
)

// pahProfiles (INT_PTR*), nProfiles (DWORD), padwIntents (DWORD*), nIntents (DWORD), dwFlags (DWORD)
r1, _, err := procCMCreateMultiProfileTransform.Call(
	uintptr(pahProfiles),
	uintptr(nProfiles),
	uintptr(padwIntents),
	uintptr(nIntents),
	uintptr(dwFlags),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT_PTR
function CMCreateMultiProfileTransform(
  pahProfiles: Pointer;   // INT_PTR*
  nProfiles: DWORD;   // DWORD
  padwIntents: Pointer;   // DWORD*
  nIntents: DWORD;   // DWORD
  dwFlags: DWORD   // DWORD
): NativeInt; stdcall;
  external 'ICM32.dll' name 'CMCreateMultiProfileTransform';
result := DllCall("ICM32\CMCreateMultiProfileTransform"
    , "Ptr", pahProfiles   ; INT_PTR*
    , "UInt", nProfiles   ; DWORD
    , "Ptr", padwIntents   ; DWORD*
    , "UInt", nIntents   ; DWORD
    , "UInt", dwFlags   ; DWORD
    , "Ptr")   ; return: INT_PTR
●CMCreateMultiProfileTransform(pahProfiles, nProfiles, padwIntents, nIntents, dwFlags) = DLL("ICM32.dll", "int CMCreateMultiProfileTransform(void*, dword, void*, dword, dword)")
# 呼び出し: CMCreateMultiProfileTransform(pahProfiles, nProfiles, padwIntents, nIntents, dwFlags)
# pahProfiles : INT_PTR* -> "void*"
# nProfiles : DWORD -> "dword"
# padwIntents : DWORD* -> "void*"
# nIntents : DWORD -> "dword"
# dwFlags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。