2 * MSCMS - Color Management System for Wine
4 * Copyright 2004, 2005, 2006, 2008 Hans Leidekker
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/debug.h"
23 #include "wine/unicode.h"
36 #include "mscms_priv.h"
38 static void basename( LPCWSTR path
, LPWSTR name
)
40 INT i
= lstrlenW( path
);
42 while (i
> 0 && path
[i
- 1] != '\\' && path
[i
- 1] != '/') i
--;
43 lstrcpyW( name
, &path
[i
] );
46 static inline LPWSTR
strdupW( LPCSTR str
)
51 DWORD len
= MultiByteToWideChar( CP_ACP
, 0, str
, -1, NULL
, 0 );
52 if ((ret
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) )))
53 MultiByteToWideChar( CP_ACP
, 0, str
, -1, ret
, len
);
58 const char *dbgstr_tag( DWORD tag
)
60 return wine_dbg_sprintf( "'%c%c%c%c'",
61 (char)(tag
>> 24), (char)(tag
>> 16), (char)(tag
>> 8), (char)(tag
) );
64 WINE_DEFAULT_DEBUG_CHANNEL(mscms
);
66 /******************************************************************************
67 * AssociateColorProfileWithDeviceA [MSCMS.@]
69 BOOL WINAPI
AssociateColorProfileWithDeviceA( PCSTR machine
, PCSTR profile
, PCSTR device
)
73 WCHAR
*profileW
, *deviceW
;
75 TRACE( "( %s, %s, %s )\n", debugstr_a(machine
), debugstr_a(profile
), debugstr_a(device
) );
77 if (!profile
|| !device
)
79 SetLastError( ERROR_INVALID_PARAMETER
);
84 SetLastError( ERROR_NOT_SUPPORTED
);
88 len
= MultiByteToWideChar( CP_ACP
, 0, profile
, -1, NULL
, 0 );
89 if (!(profileW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return FALSE
;
91 MultiByteToWideChar( CP_ACP
, 0, profile
, -1, profileW
, len
);
93 len
= MultiByteToWideChar( CP_ACP
, 0, device
, -1, NULL
, 0 );
94 if ((deviceW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) )))
96 MultiByteToWideChar( CP_ACP
, 0, device
, -1, deviceW
, len
);
97 ret
= AssociateColorProfileWithDeviceW( NULL
, profileW
, deviceW
);
100 HeapFree( GetProcessHeap(), 0, profileW
);
101 HeapFree( GetProcessHeap(), 0, deviceW
);
105 static BOOL
set_profile_device_key( PCWSTR file
, const BYTE
*value
, DWORD size
)
107 static const WCHAR fmtW
[] = {'%','c','%','c','%','c','%','c',0};
108 static const WCHAR icmW
[] = {'S','o','f','t','w','a','r','e','\\',
109 'M','i','c','r','o','s','o','f','t','\\',
110 'W','i','n','d','o','w','s',' ','N','T','\\',
111 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
113 PROFILEHEADER header
;
116 HKEY icm_key
, class_key
;
117 WCHAR basenameW
[MAX_PATH
], classW
[5];
119 profile
.dwType
= PROFILE_FILENAME
;
120 profile
.pProfileData
= (PVOID
)file
;
121 profile
.cbDataSize
= (lstrlenW( file
) + 1) * sizeof(WCHAR
);
123 /* FIXME is the profile installed? */
124 if (!(handle
= OpenColorProfileW( &profile
, PROFILE_READ
, 0, OPEN_EXISTING
)))
126 SetLastError( ERROR_INVALID_PROFILE
);
129 if (!GetColorProfileHeader( handle
, &header
))
131 CloseColorProfile( handle
);
132 SetLastError( ERROR_INVALID_PROFILE
);
135 RegCreateKeyExW( HKEY_LOCAL_MACHINE
, icmW
, 0, NULL
, 0, KEY_ALL_ACCESS
, NULL
, &icm_key
, NULL
);
137 basename( file
, basenameW
);
138 sprintfW( classW
, fmtW
, (header
.phClass
>> 24) & 0xff, (header
.phClass
>> 16) & 0xff,
139 (header
.phClass
>> 8) & 0xff, header
.phClass
& 0xff );
141 RegCreateKeyExW( icm_key
, classW
, 0, NULL
, 0, KEY_ALL_ACCESS
, NULL
, &class_key
, NULL
);
142 if (value
) RegSetValueExW( class_key
, basenameW
, 0, REG_BINARY
, value
, size
);
143 else RegDeleteValueW( class_key
, basenameW
);
145 RegCloseKey( class_key
);
146 RegCloseKey( icm_key
);
147 CloseColorProfile( handle
);
151 /******************************************************************************
152 * AssociateColorProfileWithDeviceW [MSCMS.@]
154 BOOL WINAPI
AssociateColorProfileWithDeviceW( PCWSTR machine
, PCWSTR profile
, PCWSTR device
)
156 static const BYTE dummy_value
[12];
158 TRACE( "( %s, %s, %s )\n", debugstr_w(machine
), debugstr_w(profile
), debugstr_w(device
) );
160 if (!profile
|| !device
)
162 SetLastError( ERROR_INVALID_PARAMETER
);
167 SetLastError( ERROR_NOT_SUPPORTED
);
171 return set_profile_device_key( profile
, dummy_value
, sizeof(dummy_value
) );
174 /******************************************************************************
175 * DisassociateColorProfileFromDeviceA [MSCMS.@]
177 BOOL WINAPI
DisassociateColorProfileFromDeviceA( PCSTR machine
, PCSTR profile
, PCSTR device
)
181 WCHAR
*profileW
, *deviceW
;
183 TRACE( "( %s, %s, %s )\n", debugstr_a(machine
), debugstr_a(profile
), debugstr_a(device
) );
185 if (!profile
|| !device
)
187 SetLastError( ERROR_INVALID_PARAMETER
);
192 SetLastError( ERROR_NOT_SUPPORTED
);
196 len
= MultiByteToWideChar( CP_ACP
, 0, profile
, -1, NULL
, 0 );
197 if (!(profileW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return FALSE
;
199 MultiByteToWideChar( CP_ACP
, 0, profile
, -1, profileW
, len
);
201 len
= MultiByteToWideChar( CP_ACP
, 0, device
, -1, NULL
, 0 );
202 if ((deviceW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) )))
204 MultiByteToWideChar( CP_ACP
, 0, device
, -1, deviceW
, len
);
205 ret
= DisassociateColorProfileFromDeviceW( NULL
, profileW
, deviceW
);
208 HeapFree( GetProcessHeap(), 0, profileW
);
209 HeapFree( GetProcessHeap(), 0, deviceW
);
213 /******************************************************************************
214 * DisassociateColorProfileFromDeviceW [MSCMS.@]
216 BOOL WINAPI
DisassociateColorProfileFromDeviceW( PCWSTR machine
, PCWSTR profile
, PCWSTR device
)
218 TRACE( "( %s, %s, %s )\n", debugstr_w(machine
), debugstr_w(profile
), debugstr_w(device
) );
220 if (!profile
|| !device
)
222 SetLastError( ERROR_INVALID_PARAMETER
);
227 SetLastError( ERROR_NOT_SUPPORTED
);
231 return set_profile_device_key( profile
, NULL
, 0 );
234 /******************************************************************************
235 * GetColorDirectoryA [MSCMS.@]
237 * See GetColorDirectoryW.
239 BOOL WINAPI
GetColorDirectoryA( PCSTR machine
, PSTR buffer
, PDWORD size
)
246 TRACE( "( %p, %p )\n", buffer
, size
);
248 if (machine
|| !size
) return FALSE
;
252 ret
= GetColorDirectoryW( NULL
, NULL
, &sizeW
);
253 *size
= sizeW
/ sizeof(WCHAR
);
257 sizeW
= *size
* sizeof(WCHAR
);
259 bufferW
= HeapAlloc( GetProcessHeap(), 0, sizeW
);
262 if ((ret
= GetColorDirectoryW( NULL
, bufferW
, &sizeW
)))
264 *size
= WideCharToMultiByte( CP_ACP
, 0, bufferW
, -1, NULL
, 0, NULL
, NULL
);
265 len
= WideCharToMultiByte( CP_ACP
, 0, bufferW
, -1, buffer
, *size
, NULL
, NULL
);
266 if (!len
) ret
= FALSE
;
268 else *size
= sizeW
/ sizeof(WCHAR
);
270 HeapFree( GetProcessHeap(), 0, bufferW
);
275 /******************************************************************************
276 * GetColorDirectoryW [MSCMS.@]
278 * Get the directory where color profiles are stored.
281 * machine [I] Name of the machine for which to get the color directory.
282 * Must be NULL, which indicates the local machine.
283 * buffer [I] Buffer to receive the path name.
284 * size [I/O] Size of the buffer in bytes. On return the variable holds
285 * the number of bytes actually needed.
287 BOOL WINAPI
GetColorDirectoryW( PCWSTR machine
, PWSTR buffer
, PDWORD size
)
289 WCHAR colordir
[MAX_PATH
];
290 static const WCHAR colorsubdir
[] =
291 {'\\','s','p','o','o','l','\\','d','r','i','v','e','r','s','\\','c','o','l','o','r',0};
294 TRACE( "( %p, %p )\n", buffer
, size
);
296 if (machine
|| !size
) return FALSE
;
298 GetSystemDirectoryW( colordir
, ARRAY_SIZE( colordir
));
299 lstrcatW( colordir
, colorsubdir
);
301 len
= lstrlenW( colordir
) * sizeof(WCHAR
);
303 if (buffer
&& len
<= *size
)
305 lstrcpyW( buffer
, colordir
);
310 SetLastError( ERROR_MORE_DATA
);
315 /******************************************************************************
316 * GetColorProfileElement [MSCMS.@]
318 * Retrieve data for a specified tag type.
321 * profile [I] Handle to a color profile.
322 * type [I] ICC tag type.
323 * offset [I] Offset in bytes to start copying from.
324 * size [I/O] Size of the buffer in bytes. On return the variable holds
325 * the number of bytes actually needed.
326 * buffer [O] Buffer to receive the tag data.
327 * ref [O] Pointer to a BOOL that specifies whether more than one tag
328 * references the data.
334 BOOL WINAPI
GetColorProfileElement( HPROFILE handle
, TAGTYPE type
, DWORD offset
, PDWORD size
,
335 PVOID buffer
, PBOOL ref
)
339 struct profile
*profile
= grab_profile( handle
);
341 TRACE( "( %p, 0x%08x, %d, %p, %p, %p )\n", handle
, type
, offset
, size
, buffer
, ref
);
343 if (!profile
) return FALSE
;
347 release_profile( profile
);
350 if (!get_tag_data( profile
, type
, offset
, buffer
, size
))
352 release_profile( profile
);
355 ret
= get_tag_data( profile
, type
, offset
, buffer
, size
);
356 *ref
= cmsTagLinkedTo( profile
->cmsprofile
, type
) != 0;
357 release_profile( profile
);
358 #endif /* HAVE_LCMS2 */
362 /******************************************************************************
363 * GetColorProfileElementTag [MSCMS.@]
365 * Get the tag type from a color profile by index.
368 * profile [I] Handle to a color profile.
369 * index [I] Index into the tag table of the color profile.
370 * type [O] Pointer to a variable that holds the ICC tag type on return.
377 * The tag table index starts at 1.
378 * Use GetCountColorProfileElements to retrieve a count of tagged elements.
380 BOOL WINAPI
GetColorProfileElementTag( HPROFILE handle
, DWORD index
, PTAGTYPE type
)
384 struct profile
*profile
= grab_profile( handle
);
385 cmsInt32Number num_tags
;
388 TRACE( "( %p, %d, %p )\n", handle
, index
, type
);
390 if (!profile
) return FALSE
;
394 release_profile( profile
);
397 num_tags
= cmsGetTagCount( profile
->cmsprofile
);
398 if (num_tags
< 0 || index
> num_tags
|| index
< 1)
400 release_profile( profile
);
403 if ((sig
= cmsGetTagSignature( profile
->cmsprofile
, index
- 1 )))
408 release_profile( profile
);
410 #endif /* HAVE_LCMS2 */
414 /******************************************************************************
415 * GetColorProfileFromHandle [MSCMS.@]
417 * Retrieve an ICC color profile by handle.
420 * profile [I] Handle to a color profile.
421 * buffer [O] Buffer to receive the ICC profile.
422 * size [I/O] Size of the buffer in bytes. On return the variable holds the
423 * number of bytes actually needed.
430 * The profile returned will be in big-endian format.
432 BOOL WINAPI
GetColorProfileFromHandle( HPROFILE handle
, PBYTE buffer
, PDWORD size
)
436 struct profile
*profile
= grab_profile( handle
);
437 PROFILEHEADER header
;
439 TRACE( "( %p, %p, %p )\n", handle
, buffer
, size
);
441 if (!profile
) return FALSE
;
445 release_profile( profile
);
448 get_profile_header( profile
, &header
);
450 if (!buffer
|| header
.phSize
> *size
)
452 *size
= header
.phSize
;
453 release_profile( profile
);
457 /* No endian conversion needed */
458 memcpy( buffer
, profile
->data
, profile
->size
);
459 *size
= profile
->size
;
461 release_profile( profile
);
464 #endif /* HAVE_LCMS2 */
468 /******************************************************************************
469 * GetColorProfileHeader [MSCMS.@]
471 * Retrieve a color profile header by handle.
474 * profile [I] Handle to a color profile.
475 * header [O] Buffer to receive the ICC profile header.
482 * The profile header returned will be adjusted for endianness.
484 BOOL WINAPI
GetColorProfileHeader( HPROFILE handle
, PPROFILEHEADER header
)
487 struct profile
*profile
= grab_profile( handle
);
489 TRACE( "( %p, %p )\n", handle
, header
);
491 if (!profile
) return FALSE
;
495 release_profile( profile
);
498 get_profile_header( profile
, header
);
499 release_profile( profile
);
504 #endif /* HAVE_LCMS2 */
507 /******************************************************************************
508 * GetCountColorProfileElements [MSCMS.@]
510 * Retrieve the number of elements in a color profile.
513 * profile [I] Handle to a color profile.
514 * count [O] Pointer to a variable which is set to the number of elements
515 * in the color profile.
521 BOOL WINAPI
GetCountColorProfileElements( HPROFILE handle
, PDWORD count
)
525 struct profile
*profile
= grab_profile( handle
);
526 cmsInt32Number num_tags
;
528 TRACE( "( %p, %p )\n", handle
, count
);
530 if (!profile
) return FALSE
;
534 release_profile( profile
);
537 if ((num_tags
= cmsGetTagCount( profile
->cmsprofile
)) >= 0)
542 release_profile( profile
);
544 #endif /* HAVE_LCMS2 */
548 /******************************************************************************
549 * GetStandardColorSpaceProfileA [MSCMS.@]
551 * See GetStandardColorSpaceProfileW.
553 BOOL WINAPI
GetStandardColorSpaceProfileA( PCSTR machine
, DWORD id
, PSTR profile
, PDWORD size
)
560 TRACE( "( 0x%08x, %p, %p )\n", id
, profile
, size
);
564 SetLastError( ERROR_NOT_SUPPORTED
);
570 SetLastError( ERROR_INVALID_PARAMETER
);
574 sizeW
= *size
* sizeof(WCHAR
);
578 ret
= GetStandardColorSpaceProfileW( NULL
, id
, NULL
, &sizeW
);
579 *size
= sizeW
/ sizeof(WCHAR
);
583 profileW
= HeapAlloc( GetProcessHeap(), 0, sizeW
);
586 if ((ret
= GetStandardColorSpaceProfileW( NULL
, id
, profileW
, &sizeW
)))
588 *size
= WideCharToMultiByte( CP_ACP
, 0, profileW
, -1, NULL
, 0, NULL
, NULL
);
589 len
= WideCharToMultiByte( CP_ACP
, 0, profileW
, -1, profile
, *size
, NULL
, NULL
);
590 if (!len
) ret
= FALSE
;
592 else *size
= sizeW
/ sizeof(WCHAR
);
594 HeapFree( GetProcessHeap(), 0, profileW
);
599 /******************************************************************************
600 * GetStandardColorSpaceProfileW [MSCMS.@]
602 * Retrieve the profile filename for a given standard color space id.
605 * machine [I] Name of the machine for which to get the standard color space.
606 * Must be NULL, which indicates the local machine.
607 * id [I] Id of a standard color space.
608 * profile [O] Buffer to receive the profile filename.
609 * size [I/O] Size of the filename buffer in bytes.
615 BOOL WINAPI
GetStandardColorSpaceProfileW( PCWSTR machine
, DWORD id
, PWSTR profile
, PDWORD size
)
617 static const WCHAR rgbprofilefile
[] =
618 { '\\','s','r','g','b',' ','c','o','l','o','r',' ',
619 's','p','a','c','e',' ','p','r','o','f','i','l','e','.','i','c','m',0 };
620 WCHAR rgbprofile
[MAX_PATH
];
621 DWORD len
= sizeof(rgbprofile
);
623 TRACE( "( 0x%08x, %p, %p )\n", id
, profile
, size
);
627 SetLastError( ERROR_NOT_SUPPORTED
);
633 SetLastError( ERROR_INVALID_PARAMETER
);
639 SetLastError( ERROR_INSUFFICIENT_BUFFER
);
643 GetColorDirectoryW( machine
, rgbprofile
, &len
);
648 case LCS_WINDOWS_COLOR_SPACE
: /* FIXME */
649 lstrcatW( rgbprofile
, rgbprofilefile
);
650 len
= lstrlenW( rgbprofile
) * sizeof(WCHAR
);
655 SetLastError( ERROR_MORE_DATA
);
659 lstrcpyW( profile
, rgbprofile
);
663 SetLastError( ERROR_FILE_NOT_FOUND
);
669 static BOOL
header_from_file( LPCWSTR file
, PPROFILEHEADER header
)
671 static const WCHAR slash
[] = {'\\',0};
674 WCHAR path
[MAX_PATH
];
675 DWORD size
= sizeof(path
);
678 ret
= GetColorDirectoryW( NULL
, path
, &size
);
681 WARN( "Can't retrieve color directory\n" );
684 if (size
+ sizeof(slash
) + sizeof(WCHAR
) * lstrlenW( file
) > sizeof(path
))
686 WARN( "Filename too long\n" );
690 lstrcatW( path
, slash
);
691 lstrcatW( path
, file
);
693 profile
.dwType
= PROFILE_FILENAME
;
694 profile
.pProfileData
= path
;
695 profile
.cbDataSize
= lstrlenW( path
) + 1;
697 handle
= OpenColorProfileW( &profile
, PROFILE_READ
, FILE_SHARE_READ
, OPEN_EXISTING
);
700 WARN( "Can't open color profile\n" );
704 ret
= GetColorProfileHeader( handle
, header
);
706 WARN( "Can't retrieve color profile header\n" );
708 CloseColorProfile( handle
);
712 static BOOL
match_profile( PENUMTYPEW rec
, PPROFILEHEADER hdr
)
714 if (rec
->dwFields
& ET_DEVICENAME
)
716 FIXME( "ET_DEVICENAME: %s\n", debugstr_w(rec
->pDeviceName
) );
718 if (rec
->dwFields
& ET_MEDIATYPE
)
720 FIXME( "ET_MEDIATYPE: 0x%08x\n", rec
->dwMediaType
);
722 if (rec
->dwFields
& ET_DITHERMODE
)
724 FIXME( "ET_DITHERMODE: 0x%08x\n", rec
->dwDitheringMode
);
726 if (rec
->dwFields
& ET_RESOLUTION
)
728 FIXME( "ET_RESOLUTION: 0x%08x, 0x%08x\n",
729 rec
->dwResolution
[0], rec
->dwResolution
[1] );
731 if (rec
->dwFields
& ET_DEVICECLASS
)
733 FIXME( "ET_DEVICECLASS: %s\n", dbgstr_tag(rec
->dwMediaType
) );
735 if (rec
->dwFields
& ET_CMMTYPE
)
737 TRACE( "ET_CMMTYPE: %s\n", dbgstr_tag(rec
->dwCMMType
) );
738 if (rec
->dwCMMType
!= hdr
->phCMMType
) return FALSE
;
740 if (rec
->dwFields
& ET_CLASS
)
742 TRACE( "ET_CLASS: %s\n", dbgstr_tag(rec
->dwClass
) );
743 if (rec
->dwClass
!= hdr
->phClass
) return FALSE
;
745 if (rec
->dwFields
& ET_DATACOLORSPACE
)
747 TRACE( "ET_DATACOLORSPACE: %s\n", dbgstr_tag(rec
->dwDataColorSpace
) );
748 if (rec
->dwDataColorSpace
!= hdr
->phDataColorSpace
) return FALSE
;
750 if (rec
->dwFields
& ET_CONNECTIONSPACE
)
752 TRACE( "ET_CONNECTIONSPACE: %s\n", dbgstr_tag(rec
->dwConnectionSpace
) );
753 if (rec
->dwConnectionSpace
!= hdr
->phConnectionSpace
) return FALSE
;
755 if (rec
->dwFields
& ET_SIGNATURE
)
757 TRACE( "ET_SIGNATURE: %s\n", dbgstr_tag(rec
->dwSignature
) );
758 if (rec
->dwSignature
!= hdr
->phSignature
) return FALSE
;
760 if (rec
->dwFields
& ET_PLATFORM
)
762 TRACE( "ET_PLATFORM: %s\n", dbgstr_tag(rec
->dwPlatform
) );
763 if (rec
->dwPlatform
!= hdr
->phPlatform
) return FALSE
;
765 if (rec
->dwFields
& ET_PROFILEFLAGS
)
767 TRACE( "ET_PROFILEFLAGS: 0x%08x\n", rec
->dwProfileFlags
);
768 if (rec
->dwProfileFlags
!= hdr
->phProfileFlags
) return FALSE
;
770 if (rec
->dwFields
& ET_MANUFACTURER
)
772 TRACE( "ET_MANUFACTURER: %s\n", dbgstr_tag(rec
->dwManufacturer
) );
773 if (rec
->dwManufacturer
!= hdr
->phManufacturer
) return FALSE
;
775 if (rec
->dwFields
& ET_MODEL
)
777 TRACE( "ET_MODEL: %s\n", dbgstr_tag(rec
->dwModel
) );
778 if (rec
->dwModel
!= hdr
->phModel
) return FALSE
;
780 if (rec
->dwFields
& ET_ATTRIBUTES
)
782 TRACE( "ET_ATTRIBUTES: 0x%08x, 0x%08x\n",
783 rec
->dwAttributes
[0], rec
->dwAttributes
[1] );
784 if (rec
->dwAttributes
[0] != hdr
->phAttributes
[0] ||
785 rec
->dwAttributes
[1] != hdr
->phAttributes
[1]) return FALSE
;
787 if (rec
->dwFields
& ET_RENDERINGINTENT
)
789 TRACE( "ET_RENDERINGINTENT: 0x%08x\n", rec
->dwRenderingIntent
);
790 if (rec
->dwRenderingIntent
!= hdr
->phRenderingIntent
) return FALSE
;
792 if (rec
->dwFields
& ET_CREATOR
)
794 TRACE( "ET_CREATOR: %s\n", dbgstr_tag(rec
->dwCreator
) );
795 if (rec
->dwCreator
!= hdr
->phCreator
) return FALSE
;
800 /******************************************************************************
801 * EnumColorProfilesA [MSCMS.@]
803 * See EnumColorProfilesW.
805 BOOL WINAPI
EnumColorProfilesA( PCSTR machine
, PENUMTYPEA record
, PBYTE buffer
,
806 PDWORD size
, PDWORD number
)
808 BOOL match
, ret
= FALSE
;
809 char spec
[] = "\\*.icm";
810 char colordir
[MAX_PATH
], glob
[MAX_PATH
], **profiles
= NULL
;
811 DWORD i
, len
= sizeof(colordir
), count
= 0, totalsize
= 0;
812 PROFILEHEADER header
;
813 WIN32_FIND_DATAA data
;
815 WCHAR
*fileW
= NULL
, *deviceW
= NULL
;
818 TRACE( "( %p, %p, %p, %p, %p )\n", machine
, record
, buffer
, size
, number
);
820 if (machine
|| !record
|| !size
||
821 record
->dwSize
!= sizeof(ENUMTYPEA
) ||
822 record
->dwVersion
!= ENUM_TYPE_VERSION
) return FALSE
;
824 ret
= GetColorDirectoryA( machine
, colordir
, &len
);
825 if (!ret
|| len
+ sizeof(spec
) > MAX_PATH
)
827 WARN( "can't retrieve color directory\n" );
831 lstrcpyA( glob
, colordir
);
832 lstrcatA( glob
, spec
);
834 find
= FindFirstFileA( glob
, &data
);
835 if (find
== INVALID_HANDLE_VALUE
) return FALSE
;
837 profiles
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(char *) + 1 );
838 if (!profiles
) goto exit
;
840 memcpy( &recordW
, record
, sizeof(ENUMTYPEA
) );
841 if (record
->pDeviceName
)
843 deviceW
= strdupW( record
->pDeviceName
);
844 if (!(recordW
.pDeviceName
= deviceW
)) goto exit
;
847 fileW
= strdupW( data
.cFileName
);
848 if (!fileW
) goto exit
;
850 ret
= header_from_file( fileW
, &header
);
853 match
= match_profile( &recordW
, &header
);
856 len
= sizeof(char) * (lstrlenA( data
.cFileName
) + 1);
857 profiles
[count
] = HeapAlloc( GetProcessHeap(), 0, len
);
859 if (!profiles
[count
]) goto exit
;
862 TRACE( "matching profile: %s\n", debugstr_a(data
.cFileName
) );
863 lstrcpyA( profiles
[count
], data
.cFileName
);
869 HeapFree( GetProcessHeap(), 0, fileW
);
872 while (FindNextFileA( find
, &data
))
874 fileW
= strdupW( data
.cFileName
);
875 if (!fileW
) goto exit
;
877 ret
= header_from_file( fileW
, &header
);
880 HeapFree( GetProcessHeap(), 0, fileW
);
884 match
= match_profile( &recordW
, &header
);
887 char **tmp
= HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
,
888 profiles
, sizeof(char *) * (count
+ 1) );
892 len
= sizeof(char) * (lstrlenA( data
.cFileName
) + 1);
893 profiles
[count
] = HeapAlloc( GetProcessHeap(), 0, len
);
895 if (!profiles
[count
]) goto exit
;
898 TRACE( "matching profile: %s\n", debugstr_a(data
.cFileName
) );
899 lstrcpyA( profiles
[count
], data
.cFileName
);
904 HeapFree( GetProcessHeap(), 0, fileW
);
909 if (buffer
&& *size
>= totalsize
)
911 char *p
= (char *)buffer
;
913 for (i
= 0; i
< count
; i
++)
915 lstrcpyA( p
, profiles
[i
] );
916 p
+= lstrlenA( profiles
[i
] ) + 1;
923 SetLastError( ERROR_INSUFFICIENT_BUFFER
);
928 if (number
) *number
= count
;
931 for (i
= 0; i
< count
; i
++)
932 HeapFree( GetProcessHeap(), 0, profiles
[i
] );
933 HeapFree( GetProcessHeap(), 0, profiles
);
934 HeapFree( GetProcessHeap(), 0, deviceW
);
935 HeapFree( GetProcessHeap(), 0, fileW
);
941 /******************************************************************************
942 * EnumColorProfilesW [MSCMS.@]
944 * Enumerate profiles that match given criteria.
947 * machine [I] Name of the machine for which to enumerate profiles.
948 * Must be NULL, which indicates the local machine.
949 * record [I] Record of criteria that a profile must match.
950 * buffer [O] Buffer to receive a string array of profile filenames.
951 * size [I/O] Size of the filename buffer in bytes.
952 * number [O] Number of filenames copied into buffer.
958 BOOL WINAPI
EnumColorProfilesW( PCWSTR machine
, PENUMTYPEW record
, PBYTE buffer
,
959 PDWORD size
, PDWORD number
)
961 static const WCHAR spec
[] = {'\\','*','i','c','m',0};
962 BOOL match
, ret
= FALSE
;
963 WCHAR colordir
[MAX_PATH
], glob
[MAX_PATH
], **profiles
= NULL
;
964 DWORD i
, len
= sizeof(colordir
), count
= 0, totalsize
= 0;
965 PROFILEHEADER header
;
966 WIN32_FIND_DATAW data
;
969 TRACE( "( %p, %p, %p, %p, %p )\n", machine
, record
, buffer
, size
, number
);
971 if (machine
|| !record
|| !size
||
972 record
->dwSize
!= sizeof(ENUMTYPEW
) ||
973 record
->dwVersion
!= ENUM_TYPE_VERSION
) return FALSE
;
975 ret
= GetColorDirectoryW( machine
, colordir
, &len
);
976 if (!ret
|| len
+ sizeof(spec
) > MAX_PATH
)
978 WARN( "Can't retrieve color directory\n" );
982 lstrcpyW( glob
, colordir
);
983 lstrcatW( glob
, spec
);
985 find
= FindFirstFileW( glob
, &data
);
986 if (find
== INVALID_HANDLE_VALUE
) return FALSE
;
988 profiles
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(WCHAR
*) + 1 );
989 if (!profiles
) goto exit
;
991 ret
= header_from_file( data
.cFileName
, &header
);
994 match
= match_profile( record
, &header
);
997 len
= sizeof(WCHAR
) * (lstrlenW( data
.cFileName
) + 1);
998 profiles
[count
] = HeapAlloc( GetProcessHeap(), 0, len
);
1000 if (!profiles
[count
]) goto exit
;
1003 TRACE( "matching profile: %s\n", debugstr_w(data
.cFileName
) );
1004 lstrcpyW( profiles
[count
], data
.cFileName
);
1011 while (FindNextFileW( find
, &data
))
1013 ret
= header_from_file( data
.cFileName
, &header
);
1016 match
= match_profile( record
, &header
);
1019 WCHAR
**tmp
= HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
,
1020 profiles
, sizeof(WCHAR
*) * (count
+ 1) );
1021 if (!tmp
) goto exit
;
1022 else profiles
= tmp
;
1024 len
= sizeof(WCHAR
) * (lstrlenW( data
.cFileName
) + 1);
1025 profiles
[count
] = HeapAlloc( GetProcessHeap(), 0, len
);
1027 if (!profiles
[count
]) goto exit
;
1030 TRACE( "matching profile: %s\n", debugstr_w(data
.cFileName
) );
1031 lstrcpyW( profiles
[count
], data
.cFileName
);
1039 if (buffer
&& *size
>= totalsize
)
1041 WCHAR
*p
= (WCHAR
*)buffer
;
1043 for (i
= 0; i
< count
; i
++)
1045 lstrcpyW( p
, profiles
[i
] );
1046 p
+= lstrlenW( profiles
[i
] ) + 1;
1053 SetLastError( ERROR_INSUFFICIENT_BUFFER
);
1058 if (number
) *number
= count
;
1061 for (i
= 0; i
< count
; i
++)
1062 HeapFree( GetProcessHeap(), 0, profiles
[i
] );
1063 HeapFree( GetProcessHeap(), 0, profiles
);
1069 /******************************************************************************
1070 * InstallColorProfileA [MSCMS.@]
1072 * See InstallColorProfileW.
1074 BOOL WINAPI
InstallColorProfileA( PCSTR machine
, PCSTR profile
)
1080 TRACE( "( %s )\n", debugstr_a(profile
) );
1082 if (machine
|| !profile
) return FALSE
;
1084 len
= MultiByteToWideChar( CP_ACP
, 0, profile
, -1, NULL
, 0 );
1085 profileW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) );
1089 MultiByteToWideChar( CP_ACP
, 0, profile
, -1, profileW
, len
);
1091 ret
= InstallColorProfileW( NULL
, profileW
);
1092 HeapFree( GetProcessHeap(), 0, profileW
);
1097 /******************************************************************************
1098 * InstallColorProfileW [MSCMS.@]
1100 * Install a color profile.
1103 * machine [I] Name of the machine to install the profile on. Must be NULL,
1104 * which indicates the local machine.
1105 * profile [I] Full path name of the profile to install.
1111 BOOL WINAPI
InstallColorProfileW( PCWSTR machine
, PCWSTR profile
)
1113 WCHAR dest
[MAX_PATH
], base
[MAX_PATH
];
1114 DWORD size
= sizeof(dest
);
1115 static const WCHAR slash
[] = { '\\', 0 };
1117 TRACE( "( %s )\n", debugstr_w(profile
) );
1119 if (machine
|| !profile
) return FALSE
;
1121 if (!GetColorDirectoryW( machine
, dest
, &size
)) return FALSE
;
1123 basename( profile
, base
);
1125 lstrcatW( dest
, slash
);
1126 lstrcatW( dest
, base
);
1128 /* Is source equal to destination? */
1129 if (!lstrcmpW( profile
, dest
)) return TRUE
;
1131 return CopyFileW( profile
, dest
, TRUE
);
1134 /******************************************************************************
1135 * IsColorProfileTagPresent [MSCMS.@]
1137 * Determine if a given ICC tag type is present in a color profile.
1140 * profile [I] Color profile handle.
1141 * tag [I] ICC tag type.
1142 * present [O] Pointer to a BOOL variable. Set to TRUE if tag type is present,
1149 BOOL WINAPI
IsColorProfileTagPresent( HPROFILE handle
, TAGTYPE type
, PBOOL present
)
1153 struct profile
*profile
= grab_profile( handle
);
1155 TRACE( "( %p, 0x%08x, %p )\n", handle
, type
, present
);
1157 if (!profile
) return FALSE
;
1161 release_profile( profile
);
1164 *present
= (cmsIsTag( profile
->cmsprofile
, type
) != 0);
1165 release_profile( profile
);
1168 #endif /* HAVE_LCMS2 */
1172 /******************************************************************************
1173 * IsColorProfileValid [MSCMS.@]
1175 * Determine if a given color profile is valid.
1178 * profile [I] Color profile handle.
1179 * valid [O] Pointer to a BOOL variable. Set to TRUE if profile is valid,
1186 BOOL WINAPI
IsColorProfileValid( HPROFILE handle
, PBOOL valid
)
1190 struct profile
*profile
= grab_profile( handle
);
1192 TRACE( "( %p, %p )\n", handle
, valid
);
1194 if (!profile
) return FALSE
;
1198 release_profile( profile
);
1201 if (profile
->data
) ret
= *valid
= TRUE
;
1202 release_profile( profile
);
1204 #endif /* HAVE_LCMS2 */
1208 /******************************************************************************
1209 * SetColorProfileElement [MSCMS.@]
1211 * Set data for a specified tag type.
1214 * profile [I] Handle to a color profile.
1215 * type [I] ICC tag type.
1216 * offset [I] Offset in bytes to start copying to.
1217 * size [I/O] Size of the buffer in bytes. On return the variable holds the
1218 * number of bytes actually needed.
1219 * buffer [O] Buffer holding the tag data.
1225 BOOL WINAPI
SetColorProfileElement( HPROFILE handle
, TAGTYPE type
, DWORD offset
, PDWORD size
,
1230 struct profile
*profile
= grab_profile( handle
);
1232 TRACE( "( %p, 0x%08x, %d, %p, %p )\n", handle
, type
, offset
, size
, buffer
);
1234 if (!profile
) return FALSE
;
1236 if (!size
|| !buffer
|| !(profile
->access
& PROFILE_READWRITE
))
1238 release_profile( profile
);
1241 ret
= set_tag_data( profile
, type
, offset
, buffer
, size
);
1242 release_profile( profile
);
1243 #endif /* HAVE_LCMS2 */
1247 /******************************************************************************
1248 * SetColorProfileHeader [MSCMS.@]
1250 * Set header data for a given profile.
1253 * profile [I] Handle to a color profile.
1254 * header [I] Buffer holding the header data.
1260 BOOL WINAPI
SetColorProfileHeader( HPROFILE handle
, PPROFILEHEADER header
)
1263 struct profile
*profile
= grab_profile( handle
);
1265 TRACE( "( %p, %p )\n", handle
, header
);
1267 if (!profile
) return FALSE
;
1269 if (!header
|| !(profile
->access
& PROFILE_READWRITE
))
1271 release_profile( profile
);
1274 set_profile_header( profile
, header
);
1275 release_profile( profile
);
1280 #endif /* HAVE_LCMS2 */
1283 /******************************************************************************
1284 * UninstallColorProfileA [MSCMS.@]
1286 * See UninstallColorProfileW.
1288 BOOL WINAPI
UninstallColorProfileA( PCSTR machine
, PCSTR profile
, BOOL
delete )
1294 TRACE( "( %s, %x )\n", debugstr_a(profile
), delete );
1296 if (machine
|| !profile
) return FALSE
;
1298 len
= MultiByteToWideChar( CP_ACP
, 0, profile
, -1, NULL
, 0 );
1299 profileW
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) );
1303 MultiByteToWideChar( CP_ACP
, 0, profile
, -1, profileW
, len
);
1305 ret
= UninstallColorProfileW( NULL
, profileW
, delete );
1307 HeapFree( GetProcessHeap(), 0, profileW
);
1312 /******************************************************************************
1313 * UninstallColorProfileW [MSCMS.@]
1315 * Uninstall a color profile.
1318 * machine [I] Name of the machine to uninstall the profile on. Must be NULL,
1319 * which indicates the local machine.
1320 * profile [I] Full path name of the profile to uninstall.
1321 * delete [I] Bool that specifies whether the profile file should be deleted.
1327 BOOL WINAPI
UninstallColorProfileW( PCWSTR machine
, PCWSTR profile
, BOOL
delete )
1329 TRACE( "( %s, %x )\n", debugstr_w(profile
), delete );
1331 if (machine
|| !profile
) return FALSE
;
1333 if (delete) return DeleteFileW( profile
);
1338 static BOOL
profile_AtoW( const PROFILE
*in
, PROFILE
*out
)
1341 if (!in
->pProfileData
) return FALSE
;
1342 len
= MultiByteToWideChar( CP_ACP
, 0, in
->pProfileData
, -1, NULL
, 0 );
1343 if (!(out
->pProfileData
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) ))) return FALSE
;
1344 out
->cbDataSize
= len
* sizeof(WCHAR
);
1345 MultiByteToWideChar( CP_ACP
, 0, in
->pProfileData
, -1, out
->pProfileData
, len
);
1346 out
->dwType
= in
->dwType
;
1350 /******************************************************************************
1351 * OpenColorProfileA [MSCMS.@]
1353 * See OpenColorProfileW.
1355 HPROFILE WINAPI
OpenColorProfileA( PPROFILE profile
, DWORD access
, DWORD sharing
, DWORD creation
)
1357 HPROFILE handle
= NULL
;
1360 TRACE( "( %p, 0x%08x, 0x%08x, 0x%08x )\n", profile
, access
, sharing
, creation
);
1362 if (!profile
|| !profile
->pProfileData
) return NULL
;
1364 /* No AW conversion needed for memory based profiles */
1365 if (profile
->dwType
& PROFILE_MEMBUFFER
)
1366 return OpenColorProfileW( profile
, access
, sharing
, creation
);
1368 if (!profile_AtoW( profile
, &profileW
)) return FALSE
;
1369 handle
= OpenColorProfileW( &profileW
, access
, sharing
, creation
);
1370 HeapFree( GetProcessHeap(), 0, profileW
.pProfileData
);
1374 /******************************************************************************
1375 * OpenColorProfileW [MSCMS.@]
1377 * Open a color profile.
1380 * profile [I] Pointer to a color profile structure.
1381 * access [I] Desired access.
1382 * sharing [I] Sharing mode.
1383 * creation [I] Creation mode.
1386 * Success: Handle to the opened profile.
1390 * Values for access: PROFILE_READ or PROFILE_READWRITE.
1391 * Values for sharing: 0 (no sharing), FILE_SHARE_READ and/or FILE_SHARE_WRITE.
1392 * Values for creation: one of CREATE_NEW, CREATE_ALWAYS, OPEN_EXISTING,
1393 * OPEN_ALWAYS, TRUNCATE_EXISTING.
1394 * Sharing and creation flags are ignored for memory based profiles.
1396 HPROFILE WINAPI
OpenColorProfileW( PPROFILE profile
, DWORD access
, DWORD sharing
, DWORD creation
)
1399 cmsHPROFILE cmsprofile
= NULL
;
1401 HANDLE handle
= INVALID_HANDLE_VALUE
;
1404 TRACE( "( %p, 0x%08x, 0x%08x, 0x%08x )\n", profile
, access
, sharing
, creation
);
1406 if (!profile
|| !profile
->pProfileData
) return NULL
;
1408 if (profile
->dwType
== PROFILE_MEMBUFFER
)
1410 /* FIXME: access flags not implemented for memory based profiles */
1412 if (!(data
= HeapAlloc( GetProcessHeap(), 0, profile
->cbDataSize
))) return NULL
;
1413 memcpy( data
, profile
->pProfileData
, profile
->cbDataSize
);
1415 if (!(cmsprofile
= cmsOpenProfileFromMem( data
, profile
->cbDataSize
)))
1417 HeapFree( GetProcessHeap(), 0, data
);
1420 size
= profile
->cbDataSize
;
1422 else if (profile
->dwType
== PROFILE_FILENAME
)
1424 DWORD read
, flags
= 0;
1426 TRACE( "profile file: %s\n", debugstr_w( profile
->pProfileData
) );
1428 if (access
& PROFILE_READ
) flags
= GENERIC_READ
;
1429 if (access
& PROFILE_READWRITE
) flags
= GENERIC_READ
|GENERIC_WRITE
;
1431 if (!flags
) return NULL
;
1432 if (!sharing
) sharing
= FILE_SHARE_READ
;
1434 if (!PathIsRelativeW( profile
->pProfileData
))
1435 handle
= CreateFileW( profile
->pProfileData
, flags
, sharing
, NULL
, creation
, 0, NULL
);
1440 if (!GetColorDirectoryW( NULL
, NULL
, &size
) && GetLastError() == ERROR_MORE_DATA
)
1442 size
+= (strlenW( profile
->pProfileData
) + 2) * sizeof(WCHAR
);
1443 if (!(path
= HeapAlloc( GetProcessHeap(), 0, size
))) return NULL
;
1444 GetColorDirectoryW( NULL
, path
, &size
);
1445 PathAddBackslashW( path
);
1446 strcatW( path
, profile
->pProfileData
);
1449 handle
= CreateFileW( path
, flags
, sharing
, NULL
, creation
, 0, NULL
);
1450 HeapFree( GetProcessHeap(), 0, path
);
1452 if (handle
== INVALID_HANDLE_VALUE
)
1454 WARN( "Unable to open color profile %u\n", GetLastError() );
1457 if ((size
= GetFileSize( handle
, NULL
)) == INVALID_FILE_SIZE
)
1459 ERR( "Unable to retrieve size of color profile\n" );
1460 CloseHandle( handle
);
1463 if (!(data
= HeapAlloc( GetProcessHeap(), 0, size
)))
1465 ERR( "Unable to allocate memory for color profile\n" );
1466 CloseHandle( handle
);
1469 if (!ReadFile( handle
, data
, size
, &read
, NULL
) || read
!= size
)
1471 ERR( "Unable to read color profile\n" );
1473 CloseHandle( handle
);
1474 HeapFree( GetProcessHeap(), 0, data
);
1477 if (!(cmsprofile
= cmsOpenProfileFromMem( data
, size
)))
1479 CloseHandle( handle
);
1480 HeapFree( GetProcessHeap(), 0, data
);
1486 ERR( "Invalid profile type %u\n", profile
->dwType
);
1492 struct profile profile
;
1495 profile
.file
= handle
;
1496 profile
.access
= access
;
1497 profile
.data
= data
;
1498 profile
.size
= size
;
1499 profile
.cmsprofile
= cmsprofile
;
1501 if ((hprof
= create_profile( &profile
))) return hprof
;
1502 HeapFree( GetProcessHeap(), 0, data
);
1503 cmsCloseProfile( cmsprofile
);
1505 CloseHandle( handle
);
1507 #endif /* HAVE_LCMS2 */
1511 /******************************************************************************
1512 * CloseColorProfile [MSCMS.@]
1514 * Close a color profile.
1517 * profile [I] Handle to the profile.
1523 BOOL WINAPI
CloseColorProfile( HPROFILE profile
)
1528 TRACE( "( %p )\n", profile
);
1529 ret
= close_profile( profile
);
1531 #endif /* HAVE_LCMS2 */
1535 /******************************************************************************
1536 * WcsGetUsePerUserProfiles [MSCMS.@]
1538 BOOL WINAPI
WcsGetUsePerUserProfiles( const WCHAR
* name
, DWORD
class, BOOL
* use_per_user_profile
)
1540 FIXME( "%s %s %p\n", debugstr_w(name
), dbgstr_tag(class), use_per_user_profile
);
1541 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
1545 /******************************************************************************
1546 * WcsEnumColorProfilesSize [MSCMS.@]
1548 BOOL WINAPI
WcsEnumColorProfilesSize( WCS_PROFILE_MANAGEMENT_SCOPE scope
, ENUMTYPEW
*record
, DWORD
*size
)
1550 FIXME( "%d %p %p\n", scope
, record
, size
);
1551 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
1555 /******************************************************************************
1556 * WcsGetDefaultColorProfileSize [MSCMS.@]
1558 BOOL WINAPI
WcsGetDefaultColorProfileSize( WCS_PROFILE_MANAGEMENT_SCOPE scope
, PCWSTR device_name
,
1559 COLORPROFILETYPE type
, COLORPROFILESUBTYPE subtype
,
1560 DWORD profile_id
, PDWORD profile_size
)
1562 FIXME( "%d %s %d %d %d %p\n", scope
, debugstr_w(device_name
), type
, subtype
, profile_id
, profile_size
);
1563 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
1567 /******************************************************************************
1568 * WcsGetDefaultRednderingIntent [MSCMS.@]
1570 BOOL WINAPI
WcsGetDefaultRenderingIntent( WCS_PROFILE_MANAGEMENT_SCOPE scope
, PDWORD intent
)
1572 FIXME( "%d %p\n", scope
, intent
);
1573 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);
1577 /******************************************************************************
1578 * WcsOpenColorProfileA [MSCMS.@]
1580 HPROFILE WINAPI
WcsOpenColorProfileA( PROFILE
*cdm
, PROFILE
*camp
, PROFILE
*gmmp
, DWORD access
, DWORD sharing
,
1581 DWORD creation
, DWORD flags
)
1583 PROFILE cdmW
, campW
= {0}, gmmpW
= {0};
1584 HPROFILE ret
= NULL
;
1586 TRACE( "%p, %p, %p, %08x, %08x, %08x, %08x\n", cdm
, camp
, gmmp
, access
, sharing
, creation
, flags
);
1588 if (!cdm
|| !profile_AtoW( cdm
, &cdmW
)) return NULL
;
1589 if (camp
&& !profile_AtoW( camp
, &campW
)) goto done
;
1590 if (gmmp
&& !profile_AtoW( gmmp
, &gmmpW
)) goto done
;
1592 ret
= WcsOpenColorProfileW( &cdmW
, &campW
, &gmmpW
, access
, sharing
, creation
, flags
);
1595 HeapFree( GetProcessHeap(), 0, cdmW
.pProfileData
);
1596 HeapFree( GetProcessHeap(), 0, campW
.pProfileData
);
1597 HeapFree( GetProcessHeap(), 0, gmmpW
.pProfileData
);
1601 /******************************************************************************
1602 * WcsOpenColorProfileW [MSCMS.@]
1604 HPROFILE WINAPI
WcsOpenColorProfileW( PROFILE
*cdm
, PROFILE
*camp
, PROFILE
*gmmp
, DWORD access
, DWORD sharing
,
1605 DWORD creation
, DWORD flags
)
1607 TRACE( "%p, %p, %p, %08x, %08x, %08x, %08x\n", cdm
, camp
, gmmp
, access
, sharing
, creation
, flags
);
1608 FIXME("no support for WCS profiles\n" );
1610 return OpenColorProfileW( cdm
, access
, sharing
, creation
);