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

CreateMultiProfileTransform

関数
複数プロファイルを連結した色変換を作成する。
DLLmscms.dll呼出規約winapi

シグネチャ

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

INT_PTR CreateMultiProfileTransform(
    INT_PTR* pahProfiles,
    DWORD nProfiles,
    DWORD* padwIntent,
    DWORD nIntents,
    DWORD dwFlags,
    DWORD indexPreferredCMM
);

パラメーター

名前方向
pahProfilesINT_PTR*in
nProfilesDWORDin
padwIntentDWORD*in
nIntentsDWORDin
dwFlagsDWORDin
indexPreferredCMMDWORDin

戻り値の型: INT_PTR

各言語での呼び出し定義

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

INT_PTR CreateMultiProfileTransform(
    INT_PTR* pahProfiles,
    DWORD nProfiles,
    DWORD* padwIntent,
    DWORD nIntents,
    DWORD dwFlags,
    DWORD indexPreferredCMM
);
[DllImport("mscms.dll", ExactSpelling = true)]
static extern IntPtr CreateMultiProfileTransform(
    ref IntPtr pahProfiles,   // INT_PTR*
    uint nProfiles,   // DWORD
    ref uint padwIntent,   // DWORD*
    uint nIntents,   // DWORD
    uint dwFlags,   // DWORD
    uint indexPreferredCMM   // DWORD
);
<DllImport("mscms.dll", ExactSpelling:=True)>
Public Shared Function CreateMultiProfileTransform(
    ByRef pahProfiles As IntPtr,   ' INT_PTR*
    nProfiles As UInteger,   ' DWORD
    ByRef padwIntent As UInteger,   ' DWORD*
    nIntents As UInteger,   ' DWORD
    dwFlags As UInteger,   ' DWORD
    indexPreferredCMM As UInteger   ' DWORD
) As IntPtr
End Function
' pahProfiles : INT_PTR*
' nProfiles : DWORD
' padwIntent : DWORD*
' nIntents : DWORD
' dwFlags : DWORD
' indexPreferredCMM : DWORD
Declare PtrSafe Function CreateMultiProfileTransform Lib "mscms" ( _
    ByRef pahProfiles As LongPtr, _
    ByVal nProfiles As Long, _
    ByRef padwIntent As Long, _
    ByVal nIntents As Long, _
    ByVal dwFlags As Long, _
    ByVal indexPreferredCMM As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

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

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

var (
	mscms = windows.NewLazySystemDLL("mscms.dll")
	procCreateMultiProfileTransform = mscms.NewProc("CreateMultiProfileTransform")
)

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