mscms: Move repetitive code to helper macros.
[wine] / dlls / mscms / tests / profile.c
1 /*
2  * Tests for color profile functions
3  *
4  * Copyright 2004, 2005 Hans Leidekker
5  *
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.
10  *
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.
15  *
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winnls.h"
26 #include "wingdi.h"
27 #include "winuser.h"
28 #include "icm.h"
29
30 #include "wine/test.h"
31
32 HMODULE hmscms;
33
34 static BOOL     (WINAPI *pCloseColorProfile)(HPROFILE);
35 static BOOL     (WINAPI *pGetColorDirectoryA)(PCHAR,PCHAR,PDWORD);
36 static BOOL     (WINAPI *pGetColorDirectoryW)(PWCHAR,PWCHAR,PDWORD);
37 static BOOL     (WINAPI *pGetColorProfileElement)(HPROFILE,TAGTYPE,DWORD,PDWORD,PVOID,PBOOL);
38 static BOOL     (WINAPI *pGetColorProfileElementTag)(HPROFILE,DWORD,PTAGTYPE);
39 static BOOL     (WINAPI *pGetColorProfileFromHandle)(HPROFILE,PBYTE,PDWORD);
40 static BOOL     (WINAPI *pGetColorProfileHeader)(HPROFILE,PPROFILEHEADER);
41 static BOOL     (WINAPI *pGetCountColorProfileElements)(HPROFILE,PDWORD);
42 static BOOL     (WINAPI *pGetStandardColorSpaceProfileA)(PCSTR,DWORD,PSTR,PDWORD);
43 static BOOL     (WINAPI *pGetStandardColorSpaceProfileW)(PCWSTR,DWORD,PWSTR,PDWORD);
44 static BOOL     (WINAPI *pInstallColorProfileA)(PCSTR,PCSTR);
45 static BOOL     (WINAPI *pInstallColorProfileW)(PCWSTR,PCWSTR);
46 static BOOL     (WINAPI *pIsColorProfileTagPresent)(HPROFILE,TAGTYPE,PBOOL);
47 static HPROFILE (WINAPI *pOpenColorProfileA)(PPROFILE,DWORD,DWORD,DWORD);
48 static HPROFILE (WINAPI *pOpenColorProfileW)(PPROFILE,DWORD,DWORD,DWORD);
49 static BOOL     (WINAPI *pSetColorProfileElement)(HPROFILE,TAGTYPE,DWORD,PDWORD,PVOID);
50 static BOOL     (WINAPI *pSetColorProfileHeader)(HPROFILE,PPROFILEHEADER);
51 static BOOL     (WINAPI *pSetStandardColorSpaceProfileA)(PCSTR,DWORD,PSTR);
52 static BOOL     (WINAPI *pSetStandardColorSpaceProfileW)(PCWSTR,DWORD,PWSTR);
53 static BOOL     (WINAPI *pUninstallColorProfileA)(PCSTR,PCSTR,BOOL);
54 static BOOL     (WINAPI *pUninstallColorProfileW)(PCWSTR,PCWSTR,BOOL);
55
56 #define GETFUNCPTR(func) p##func = (void *)GetProcAddress( hmscms, #func ); \
57     if (!p##func) return FALSE;
58
59 static BOOL init_function_ptrs( void )
60 {
61     GETFUNCPTR( CloseColorProfile )
62     GETFUNCPTR( GetColorDirectoryA )
63     GETFUNCPTR( GetColorDirectoryW )
64     GETFUNCPTR( GetColorProfileElement )
65     GETFUNCPTR( GetColorProfileElementTag )
66     GETFUNCPTR( GetColorProfileFromHandle )
67     GETFUNCPTR( GetColorProfileHeader )
68     GETFUNCPTR( GetCountColorProfileElements )
69     GETFUNCPTR( GetStandardColorSpaceProfileA )
70     GETFUNCPTR( GetStandardColorSpaceProfileW )
71     GETFUNCPTR( InstallColorProfileA )
72     GETFUNCPTR( InstallColorProfileW )
73     GETFUNCPTR( IsColorProfileTagPresent )
74     GETFUNCPTR( OpenColorProfileA )
75     GETFUNCPTR( OpenColorProfileW )
76     GETFUNCPTR( SetColorProfileElement )
77     GETFUNCPTR( SetColorProfileHeader )
78     GETFUNCPTR( SetStandardColorSpaceProfileA )
79     GETFUNCPTR( SetStandardColorSpaceProfileW )
80     GETFUNCPTR( UninstallColorProfileA )
81     GETFUNCPTR( UninstallColorProfileW )
82
83     return TRUE;
84 }
85
86 static const char machine[] = "dummy";
87 static const WCHAR machineW[] = { 'd','u','m','m','y',0 };
88
89 /*  To do any real functionality testing with this suite you need a copy of
90  *  the freely distributable standard RGB color space profile. It comes
91  *  standard with Windows, but on Wine you probably need to install it yourself
92  *  in one of the locations mentioned below. Here's a link to the profile in
93  *  a self extracting zip file:
94  *
95  *  http://download.microsoft.com/download/whistler/hwdev1/1.0/wxp/en-us/ColorProfile.exe
96  */
97
98 /* Two common places to find the standard color space profile, relative
99  * to the system directory.
100  */
101 static const char profile1[] =
102 "\\color\\srgb color space profile.icm";
103 static const char profile2[] =
104 "\\spool\\drivers\\color\\srgb color space profile.icm";
105
106 static const WCHAR profile1W[] =
107 { '\\','c','o','l','o','r','\\','s','r','g','b',' ','c','o','l','o','r',' ',
108   's','p','a','c','e',' ','p','r','o','f','i','l','e','.','i','c','m',0 };
109 static const WCHAR profile2W[] =
110 { '\\','s','p','o','o','l','\\','d','r','i','v','e','r','s','\\',
111   'c','o','l','o','r','\\','s','r','g','b',' ','c','o','l','o','r',' ',
112   's','p','a','c','e',' ','p','r','o','f','i','l','e','.','i','c','m',0 };
113
114 static const unsigned char rgbheader[] =
115 { 0x48, 0x0c, 0x00, 0x00, 0x6f, 0x6e, 0x69, 0x4c, 0x00, 0x00, 0x10, 0x02,
116   0x72, 0x74, 0x6e, 0x6d, 0x20, 0x42, 0x47, 0x52, 0x20, 0x5a, 0x59, 0x58,
117   0x02, 0x00, 0xce, 0x07, 0x06, 0x00, 0x09, 0x00, 0x00, 0x00, 0x31, 0x00,
118   0x70, 0x73, 0x63, 0x61, 0x54, 0x46, 0x53, 0x4d, 0x00, 0x00, 0x00, 0x00,
119   0x20, 0x43, 0x45, 0x49, 0x42, 0x47, 0x52, 0x73, 0x00, 0x00, 0x00, 0x00,
120   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xf6, 0x00, 0x00,
121   0x00, 0x00, 0x01, 0x00, 0x2d, 0xd3, 0x00, 0x00, 0x20, 0x20, 0x50, 0x48 };
122
123 static LPSTR standardprofile;
124 static LPWSTR standardprofileW;
125
126 static LPSTR testprofile;
127 static LPWSTR testprofileW;
128
129 #define IS_SEPARATOR(ch)  ((ch) == '\\' || (ch) == '/')
130
131 static void MSCMS_basenameA( LPCSTR path, LPSTR name )
132 {
133     INT i = strlen( path );
134
135     while (i > 0 && !IS_SEPARATOR(path[i - 1])) i--;
136     strcpy( name, &path[i] );
137 }
138
139 static void MSCMS_basenameW( LPCWSTR path, LPWSTR name )
140 {
141     INT i = lstrlenW( path );
142
143     while (i > 0 && !IS_SEPARATOR(path[i - 1])) i--;
144     lstrcpyW( name, &path[i] );
145 }
146
147 static void test_GetColorDirectoryA(void)
148 {
149     BOOL ret;
150     DWORD size;
151     char buffer[MAX_PATH];
152
153     /* Parameter checks */
154
155     ret = pGetColorDirectoryA( NULL, NULL, NULL );
156     ok( !ret, "GetColorDirectoryA() succeeded (%ld)\n", GetLastError() );
157
158     size = 0;
159
160     ret = pGetColorDirectoryA( NULL, NULL, &size );
161     ok( !ret && size > 0, "GetColorDirectoryA() succeeded (%ld)\n", GetLastError() );
162
163     size = 0;
164
165     ret = pGetColorDirectoryA( NULL, buffer, &size );
166     ok( !ret && size > 0, "GetColorDirectoryA() succeeded (%ld)\n", GetLastError() );
167
168     size = 1;
169
170     ret = pGetColorDirectoryA( NULL, buffer, &size );
171     ok( !ret && size > 0, "GetColorDirectoryA() succeeded (%ld)\n", GetLastError() );
172
173     /* Functional checks */
174
175     size = sizeof(buffer);
176
177     ret = pGetColorDirectoryA( NULL, buffer, &size );
178     ok( ret && size > 0, "GetColorDirectoryA() failed (%ld)\n", GetLastError() );
179 }
180
181 static void test_GetColorDirectoryW(void)
182 {
183     BOOL ret;
184     DWORD size;
185     WCHAR buffer[MAX_PATH];
186
187     /* Parameter checks */
188
189     /* This one crashes win2k
190     
191     ret = pGetColorDirectoryW( NULL, NULL, NULL );
192     ok( !ret, "GetColorDirectoryW() succeeded (%ld)\n", GetLastError() );
193
194      */
195
196     size = 0;
197
198     ret = pGetColorDirectoryW( NULL, NULL, &size );
199     ok( !ret && size > 0, "GetColorDirectoryW() succeeded (%ld)\n", GetLastError() );
200
201     size = 0;
202
203     ret = pGetColorDirectoryW( NULL, buffer, &size );
204     ok( !ret && size > 0, "GetColorDirectoryW() succeeded (%ld)\n", GetLastError() );
205
206     size = 1;
207
208     ret = pGetColorDirectoryW( NULL, buffer, &size );
209     ok( !ret && size > 0, "GetColorDirectoryW() succeeded (%ld)\n", GetLastError() );
210
211     /* Functional checks */
212
213     size = sizeof(buffer);
214
215     ret = pGetColorDirectoryW( NULL, buffer, &size );
216     ok( ret && size > 0, "GetColorDirectoryW() failed (%ld)\n", GetLastError() );
217 }
218
219 static void test_GetColorProfileElement(void)
220 {
221     if (standardprofile)
222     {
223         PROFILE profile;
224         HPROFILE handle;
225         BOOL ret, ref;
226         DWORD size;
227         TAGTYPE tag = 0x63707274;  /* 'cprt' */
228         static char buffer[51];
229         static const char expect[] =
230             { 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x70,
231               0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x63, 0x29, 0x20,
232               0x31, 0x39, 0x39, 0x38, 0x20, 0x48, 0x65, 0x77, 0x6c, 0x65, 0x74,
233               0x74, 0x2d, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x72, 0x64, 0x20, 0x43,
234               0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x00 };
235
236         profile.dwType = PROFILE_FILENAME;
237         profile.pProfileData = standardprofile;
238         profile.cbDataSize = strlen(standardprofile);
239
240         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
241         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
242
243         /* Parameter checks */
244
245         ret = pGetColorProfileElement( handle, tag, 0, NULL, NULL, &ref );
246         ok( !ret, "GetColorProfileElement() succeeded (%ld)\n", GetLastError() );
247
248         ret = pGetColorProfileElement( handle, tag, 0, &size, NULL, NULL );
249         ok( !ret, "GetColorProfileElement() succeeded (%ld)\n", GetLastError() );
250
251         size = 0;
252
253         ret = pGetColorProfileElement( handle, tag, 0, &size, NULL, &ref );
254         ok( !ret && size > 0, "GetColorProfileElement() succeeded (%ld)\n", GetLastError() );
255
256         size = sizeof(buffer);
257
258         /* Functional checks */
259
260         ret = pGetColorProfileElement( handle, tag, 0, &size, buffer, &ref );
261         ok( ret && size > 0, "GetColorProfileElement() failed (%ld)\n", GetLastError() );
262
263         ok( !memcmp( buffer, expect, sizeof(expect) ), "Unexpected tag data\n" );
264
265         pCloseColorProfile( handle );
266     }
267 }
268
269 static void test_GetColorProfileElementTag(void)
270 {
271     if (standardprofile)
272     {
273         PROFILE profile;
274         HPROFILE handle;
275         BOOL ret;
276         DWORD index = 1;
277         TAGTYPE tag, expect = 0x63707274;  /* 'cprt' */
278
279         profile.dwType = PROFILE_FILENAME;
280         profile.pProfileData = standardprofile;
281         profile.cbDataSize = strlen(standardprofile);
282
283         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
284         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
285
286         /* Parameter checks */
287
288         ret = pGetColorProfileElementTag( NULL, index, &tag );
289         ok( !ret, "GetColorProfileElementTag() succeeded (%ld)\n", GetLastError() );
290
291         ret = pGetColorProfileElementTag( handle, 0, &tag );
292         ok( !ret, "GetColorProfileElementTag() succeeded (%ld)\n", GetLastError() );
293
294         ret = pGetColorProfileElementTag( handle, index, NULL );
295         ok( !ret, "GetColorProfileElementTag() succeeded (%ld)\n", GetLastError() );
296
297         ret = pGetColorProfileElementTag( handle, 18, NULL );
298         ok( !ret, "GetColorProfileElementTag() succeeded (%ld)\n", GetLastError() );
299
300         /* Functional checks */
301
302         ret = pGetColorProfileElementTag( handle, index, &tag );
303         ok( ret && tag == expect, "GetColorProfileElementTag() failed (%ld)\n",
304             GetLastError() );
305
306         pCloseColorProfile( handle );
307     }
308 }
309
310 static void test_GetColorProfileFromHandle(void)
311 {
312     if (testprofile)
313     {
314         PROFILE profile;
315         HPROFILE handle;
316         DWORD size;
317         BOOL ret;
318         static const unsigned char expect[] =
319             { 0x00, 0x00, 0x0c, 0x48, 0x4c, 0x69, 0x6e, 0x6f, 0x02, 0x10, 0x00,
320               0x00, 0x6d, 0x6e, 0x74, 0x72, 0x52, 0x47, 0x42, 0x20, 0x58, 0x59,
321               0x5a, 0x20, 0x07, 0xce, 0x00, 0x02, 0x00, 0x09, 0x00, 0x06, 0x00,
322               0x31, 0x00, 0x00, 0x61, 0x63, 0x73, 0x70, 0x4d, 0x53, 0x46, 0x54,
323               0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x43, 0x20, 0x73, 0x52, 0x47,
324               0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
325               0x00, 0x00, 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00,
326               0x00, 0xd3, 0x2d, 0x48, 0x50, 0x20, 0x20 };
327
328         unsigned char *buffer;
329
330         profile.dwType = PROFILE_FILENAME;
331         profile.pProfileData = testprofile;
332         profile.cbDataSize = strlen(testprofile);
333
334         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
335         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
336
337         /* Parameter checks */
338
339         size = 0;
340
341         ret = pGetColorProfileFromHandle( handle, NULL, &size );
342         ok( !ret && size > 0, "GetColorProfileFromHandle() failed (%ld)\n", GetLastError() );
343
344         buffer = HeapAlloc( GetProcessHeap(), 0, size );
345
346         if (buffer)
347         {
348             ret = pGetColorProfileFromHandle( NULL, buffer, &size );
349             ok( !ret, "GetColorProfileFromHandle() succeeded (%ld)\n", GetLastError() );
350
351             ret = pGetColorProfileFromHandle( handle, buffer, NULL );
352             ok( !ret, "GetColorProfileFromHandle() succeeded (%ld)\n", GetLastError() );
353
354             /* Functional checks */
355
356             ret = pGetColorProfileFromHandle( handle, buffer, &size );
357             ok( ret && size > 0, "GetColorProfileFromHandle() failed (%ld)\n", GetLastError() );
358
359             ok( !memcmp( buffer, expect, sizeof(expect) ), "Unexpected header data\n" );
360
361             HeapFree( GetProcessHeap(), 0, buffer );
362         }
363
364         pCloseColorProfile( handle );
365     }
366 }
367
368 static void test_GetColorProfileHeader(void)
369 {
370     if (testprofile)
371     {
372         PROFILE profile;
373         HPROFILE handle;
374         BOOL ret;
375         PROFILEHEADER header;
376
377         profile.dwType = PROFILE_FILENAME;
378         profile.pProfileData = testprofile;
379         profile.cbDataSize = strlen(testprofile);
380
381         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
382         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
383
384         /* Parameter checks */
385
386         ret = pGetColorProfileHeader( NULL, NULL );
387         ok( !ret, "GetColorProfileHeader() succeeded (%ld)\n", GetLastError() );
388
389         ret = pGetColorProfileHeader( NULL, &header );
390         ok( !ret, "GetColorProfileHeader() succeeded (%ld)\n", GetLastError() );
391
392         ret = pGetColorProfileHeader( handle, NULL );
393         ok( !ret, "GetColorProfileHeader() succeeded (%ld)\n", GetLastError() );
394
395         /* Functional checks */
396
397         ret = pGetColorProfileHeader( handle, &header );
398         ok( ret, "GetColorProfileHeader() failed (%ld)\n", GetLastError() );
399
400         ok( !memcmp( &header, rgbheader, sizeof(rgbheader) ), "Unexpected header data\n" );
401
402         pCloseColorProfile( handle );
403     }
404 }
405
406 static void test_GetCountColorProfileElements(void)
407 {
408     if (standardprofile)
409     {
410         PROFILE profile;
411         HPROFILE handle;
412         BOOL ret;
413         DWORD count, expect = 17;
414
415         profile.dwType = PROFILE_FILENAME;
416         profile.pProfileData = standardprofile;
417         profile.cbDataSize = strlen(standardprofile);
418
419         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
420         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
421
422         /* Parameter checks */
423
424         ret = pGetCountColorProfileElements( NULL, &count );
425         ok( !ret, "GetCountColorProfileElements() succeeded (%ld)\n",
426             GetLastError() );
427
428         ret = pGetCountColorProfileElements( handle, NULL );
429         ok( !ret, "GetCountColorProfileElements() succeeded (%ld)\n",
430             GetLastError() );
431
432         /* Functional checks */
433
434         ret = pGetCountColorProfileElements( handle, &count );
435         ok( ret && count == expect,
436             "GetCountColorProfileElements() failed (%ld)\n", GetLastError() );
437
438         pCloseColorProfile( handle );
439     }
440 }
441
442 #define fail_GSCSPA(pMachName, dwProfID, pProfName, pdwSz, dwSz, GLE_OK)        \
443 do {                                                                            \
444     size = dwSz;                                                                \
445     SetLastError(0);                                                            \
446     ret = pGetStandardColorSpaceProfileA(pMachName, dwProfID, pProfName, pdwSz);\
447     GLE = GetLastError();                                                       \
448     ok( !ret && GLE_OK,                                                         \
449         "GetStandardColorSpaceProfileA() returns %d (GLE=%ld)\n", ret, GLE );   \
450 } while (0)
451
452 static void test_GetStandardColorSpaceProfileA(void)
453 {
454     BOOL ret;
455     DWORD size, sizeP, GLE;
456     CHAR oldprofile[MAX_PATH];
457     CHAR newprofile[MAX_PATH];
458
459     sizeP = sizeof(newprofile);
460
461     /* Parameter checks */
462
463     todo_wine 
464     fail_GSCSPA(machine,  0, newprofile, &size, 0,     (GLE == ERROR_INVALID_PARAMETER || GLE == ERROR_NOT_SUPPORTED));
465     todo_wine 
466     fail_GSCSPA(NULL,     0, newprofile, NULL,  0,     (GLE == ERROR_INVALID_PARAMETER));
467     todo_wine 
468     fail_GSCSPA(NULL,     0, NULL,       &size, 0,     (GLE == ERROR_INSUFFICIENT_BUFFER || GLE == ERROR_FILE_NOT_FOUND));
469     todo_wine 
470     fail_GSCSPA(NULL,     0, newprofile, &size, sizeP, (GLE == ERROR_FILE_NOT_FOUND));
471
472     /* Functional checks */
473
474     if (standardprofile)
475     {
476         size = sizeof(oldprofile);
477
478         ret = pGetStandardColorSpaceProfileA( NULL, SPACE_RGB, oldprofile, &size );
479         ok( ret, "GetStandardColorSpaceProfileA() failed (%ld)\n", GetLastError() );
480
481         ret = pSetStandardColorSpaceProfileA( NULL, SPACE_RGB, standardprofile );
482         ok( ret, "SetStandardColorSpaceProfileA() failed (%ld)\n", GetLastError() );
483
484         size = sizeof(newprofile);
485
486         ret = pGetStandardColorSpaceProfileA( NULL, SPACE_RGB, newprofile, &size );
487         ok( ret, "GetStandardColorSpaceProfileA() failed (%ld)\n", GetLastError() );
488
489         ok( !lstrcmpiA( (LPSTR)&newprofile, standardprofile ), "Unexpected profile\n" );
490
491         ret = pSetStandardColorSpaceProfileA( NULL, SPACE_RGB, oldprofile );
492         ok( ret, "SetStandardColorSpaceProfileA() failed (%ld)\n", GetLastError() );
493     }
494 }
495
496 #define fail_GSCSPW(pMachName, dwProfID, pProfName, pdwSz, dwSz, GLE_OK)        \
497 do {                                                                            \
498     size = dwSz;                                                                \
499     SetLastError(0);                                                            \
500     ret = pGetStandardColorSpaceProfileW(pMachName, dwProfID, pProfName, pdwSz);\
501     GLE = GetLastError();                                                       \
502     ok( !ret && GLE_OK,                                                         \
503         "GetStandardColorSpaceProfileW() returns %d (GLE=%ld)\n", ret, GLE );   \
504 } while (0)
505
506 static void test_GetStandardColorSpaceProfileW(void)
507 {
508     BOOL ret;
509     DWORD size, sizeP, GLE;
510     WCHAR oldprofile[MAX_PATH];
511     WCHAR newprofile[MAX_PATH];
512
513     sizeP = sizeof(newprofile);
514
515     /* Parameter checks */
516
517     todo_wine 
518     fail_GSCSPW(machineW,  0, newprofile, &size, 0,     (GLE == ERROR_INVALID_PARAMETER));
519     todo_wine 
520     fail_GSCSPW(NULL,      0, newprofile, NULL,  0,     (GLE == ERROR_INVALID_PARAMETER));
521     todo_wine 
522     fail_GSCSPW(NULL,      0, NULL,       &size, 0,     (GLE == ERROR_INSUFFICIENT_BUFFER || GLE == ERROR_FILE_NOT_FOUND));
523     todo_wine 
524     fail_GSCSPW(NULL,      0, newprofile, &size, sizeP, (GLE == ERROR_FILE_NOT_FOUND));
525
526     /* Functional checks */
527
528     if (standardprofileW)
529     {
530         size = sizeof(oldprofile);
531
532         ret = pGetStandardColorSpaceProfileW( NULL, SPACE_RGB, oldprofile, &size );
533         ok( ret, "GetStandardColorSpaceProfileW() failed (%ld)\n", GetLastError() );
534
535         ret = pSetStandardColorSpaceProfileW( NULL, SPACE_RGB, standardprofileW );
536         ok( ret, "SetStandardColorSpaceProfileW() failed (%ld)\n", GetLastError() );
537
538         size = sizeof(newprofile);
539
540         ret = pGetStandardColorSpaceProfileW( NULL, SPACE_RGB, newprofile, &size );
541         ok( ret, "GetStandardColorSpaceProfileW() failed (%ld)\n", GetLastError() );
542
543         ok( !lstrcmpiW( (LPWSTR)&newprofile, standardprofileW ), "Unexpected profile\n" );
544
545         ret = pSetStandardColorSpaceProfileW( NULL, SPACE_RGB, oldprofile );
546         ok( ret, "SetStandardColorSpaceProfileW() failed (%ld)\n", GetLastError() );
547     }
548 }
549
550 static void test_InstallColorProfileA(void)
551 {
552     BOOL ret;
553
554     /* Parameter checks */
555
556     ret = pInstallColorProfileA( NULL, NULL );
557     ok( !ret, "InstallColorProfileA() succeeded (%ld)\n", GetLastError() );
558
559     ret = pInstallColorProfileA( machine, NULL );
560     ok( !ret, "InstallColorProfileA() succeeded (%ld)\n", GetLastError() );
561
562     ret = pInstallColorProfileA( NULL, machine );
563     ok( !ret, "InstallColorProfileA() succeeded (%ld)\n", GetLastError() );
564
565     if (standardprofile)
566     {
567         ret = pInstallColorProfileA( NULL, standardprofile );
568         ok( ret, "InstallColorProfileA() failed (%ld)\n", GetLastError() );
569     }
570
571     /* Functional checks */
572
573     if (testprofile)
574     {
575         CHAR dest[MAX_PATH], base[MAX_PATH];
576         DWORD size = sizeof(dest);
577         CHAR slash[] = "\\";
578         HANDLE handle;
579
580         ret = pInstallColorProfileA( NULL, testprofile );
581         ok( ret, "InstallColorProfileA() failed (%ld)\n", GetLastError() );
582
583         ret = pGetColorDirectoryA( NULL, dest, &size );
584         ok( ret, "GetColorDirectoryA() failed (%ld)\n", GetLastError() );
585
586         MSCMS_basenameA( testprofile, base );
587
588         lstrcatA( dest, slash );
589         lstrcatA( dest, base );
590
591         /* Check if the profile is really there */ 
592         handle = CreateFileA( dest, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
593         ok( handle != INVALID_HANDLE_VALUE, "Couldn't find the profile (%ld)\n", GetLastError() );
594         CloseHandle( handle );
595         
596         ret = pUninstallColorProfileA( NULL, dest, TRUE );
597         ok( ret, "UninstallColorProfileA() failed (%ld)\n", GetLastError() );
598     }
599 }
600
601 static void test_InstallColorProfileW(void)
602 {
603     BOOL ret;
604
605     /* Parameter checks */
606
607     ret = pInstallColorProfileW( NULL, NULL );
608     ok( !ret, "InstallColorProfileW() succeeded (%ld)\n", GetLastError() );
609
610     ret = pInstallColorProfileW( machineW, NULL );
611     ok( !ret, "InstallColorProfileW() succeeded (%ld)\n", GetLastError() );
612
613     ret = pInstallColorProfileW( NULL, machineW );
614     ok( !ret, "InstallColorProfileW() failed (%ld)\n", GetLastError() );
615
616     if (standardprofileW)
617     {
618         ret = pInstallColorProfileW( NULL, standardprofileW );
619         ok( ret, "InstallColorProfileW() failed (%ld)\n", GetLastError() );
620     }
621
622     /* Functional checks */
623
624     if (testprofileW)
625     {
626         WCHAR dest[MAX_PATH], base[MAX_PATH];
627         DWORD size = sizeof(dest);
628         WCHAR slash[] = { '\\', 0 };
629         HANDLE handle;
630
631         ret = pInstallColorProfileW( NULL, testprofileW );
632         ok( ret, "InstallColorProfileW() failed (%ld)\n", GetLastError() );
633
634         ret = pGetColorDirectoryW( NULL, dest, &size );
635         ok( ret, "GetColorDirectoryW() failed (%ld)\n", GetLastError() );
636
637         MSCMS_basenameW( testprofileW, base );
638
639         lstrcatW( dest, slash );
640         lstrcatW( dest, base );
641
642         /* Check if the profile is really there */
643         handle = CreateFileW( dest, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
644         ok( handle != INVALID_HANDLE_VALUE, "Couldn't find the profile (%ld)\n", GetLastError() );
645         CloseHandle( handle );
646
647         ret = pUninstallColorProfileW( NULL, dest, TRUE );
648         ok( ret, "UninstallColorProfileW() failed (%ld)\n", GetLastError() );
649     }
650 }
651
652 static void test_IsColorProfileTagPresent(void)
653 {
654     if (standardprofile)
655     {
656         PROFILE profile;
657         HPROFILE handle;
658         BOOL ret, present;
659         TAGTYPE tag;
660
661         profile.dwType = PROFILE_FILENAME;
662         profile.pProfileData = standardprofile;
663         profile.cbDataSize = strlen(standardprofile);
664
665         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
666         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
667
668         /* Parameter checks */
669
670         tag = 0;
671
672         ret = pIsColorProfileTagPresent( handle, tag, &present );
673         ok( !(ret && present), "IsColorProfileTagPresent() succeeded (%ld)\n", GetLastError() );
674
675         tag = 0x63707274;  /* 'cprt' */
676
677         ret = pIsColorProfileTagPresent( NULL, tag, &present );
678         ok( !ret, "IsColorProfileTagPresent() succeeded (%ld)\n", GetLastError() );
679
680         ret = pIsColorProfileTagPresent( handle, tag, NULL );
681         ok( !ret, "IsColorProfileTagPresent() succeeded (%ld)\n", GetLastError() );
682
683         /* Functional checks */
684
685         ret = pIsColorProfileTagPresent( handle, tag, &present );
686         ok( ret && present, "IsColorProfileTagPresent() failed (%ld)\n", GetLastError() );
687
688         pCloseColorProfile( handle );
689     }
690 }
691
692 static void test_OpenColorProfileA(void)
693 {
694     PROFILE profile;
695     HPROFILE handle;
696     BOOL ret;
697
698     profile.dwType = PROFILE_FILENAME;
699     profile.pProfileData = NULL;
700     profile.cbDataSize = 0;
701
702     /* Parameter checks */
703
704     handle = pOpenColorProfileA( NULL, 0, 0, 0 );
705     ok( handle == NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
706
707     handle = pOpenColorProfileA( &profile, 0, 0, 0 );
708     ok( handle == NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
709
710     handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, 0 );
711     ok( handle == NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
712
713     handle = pOpenColorProfileA( &profile, PROFILE_READWRITE, 0, 0 );
714     ok( handle == NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
715
716     ok ( !pCloseColorProfile( NULL ), "CloseColorProfile() succeeded\n" );
717
718     if (standardprofile)
719     {
720         profile.pProfileData = standardprofile;
721         profile.cbDataSize = strlen(standardprofile);
722
723         handle = pOpenColorProfileA( &profile, 0, 0, 0 );
724         ok( handle == NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
725
726         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, 0 );
727         ok( handle == NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
728
729         handle = pOpenColorProfileA( &profile, PROFILE_READ|PROFILE_READWRITE, 0, 0 );
730         ok( handle == NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
731
732         /* Functional checks */
733
734         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
735         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
736
737         ret = pCloseColorProfile( handle );
738         ok( ret, "CloseColorProfile() failed (%ld)\n", GetLastError() );
739     }
740 }
741
742 static void test_OpenColorProfileW(void)
743 {
744     PROFILE profile;
745     HPROFILE handle;
746     BOOL ret;
747
748     profile.dwType = PROFILE_FILENAME;
749     profile.pProfileData = NULL;
750     profile.cbDataSize = 0;
751
752     /* Parameter checks */
753
754     handle = pOpenColorProfileW( NULL, 0, 0, 0 );
755     ok( handle == NULL, "OpenColorProfileW() failed (%ld)\n", GetLastError() );
756
757     handle = pOpenColorProfileW( &profile, 0, 0, 0 );
758     ok( handle == NULL, "OpenColorProfileW() failed (%ld)\n", GetLastError() );
759
760     handle = pOpenColorProfileW( &profile, PROFILE_READ, 0, 0 );
761     ok( handle == NULL, "OpenColorProfileW() failed (%ld)\n", GetLastError() );
762
763     handle = pOpenColorProfileW( &profile, PROFILE_READWRITE, 0, 0 );
764     ok( handle == NULL, "OpenColorProfileW() failed (%ld)\n", GetLastError() );
765
766     ok ( !pCloseColorProfile( NULL ), "CloseColorProfile() succeeded\n" );
767
768     if (standardprofileW)
769     {
770         profile.pProfileData = standardprofileW;
771         profile.cbDataSize = lstrlenW(standardprofileW) * sizeof(WCHAR);
772
773         handle = pOpenColorProfileW( &profile, 0, 0, 0 );
774         ok( handle == NULL, "OpenColorProfileW() failed (%ld)\n", GetLastError() );
775
776         handle = pOpenColorProfileW( &profile, PROFILE_READ, 0, 0 );
777         ok( handle == NULL, "OpenColorProfileW() failed (%ld)\n", GetLastError() );
778
779         handle = pOpenColorProfileW( &profile, PROFILE_READ|PROFILE_READWRITE, 0, 0 );
780         ok( handle == NULL, "OpenColorProfileW() failed (%ld)\n", GetLastError() );
781
782         /* Functional checks */
783
784         handle = pOpenColorProfileW( &profile, PROFILE_READ, 0, OPEN_EXISTING );
785         ok( handle != NULL, "OpenColorProfileW() failed (%ld)\n", GetLastError() );
786
787         ret = pCloseColorProfile( handle );
788         ok( ret, "CloseColorProfile() failed (%ld)\n", GetLastError() );
789     }
790 }
791
792 static void test_SetColorProfileElement(void)
793 {
794     if (testprofile)
795     {
796         PROFILE profile;
797         HPROFILE handle;
798         DWORD size;
799         BOOL ret, ref;
800
801         TAGTYPE tag = 0x63707274;  /* 'cprt' */
802         static char data[] = "(c) The Wine Project";
803         static char buffer[51];
804
805         profile.dwType = PROFILE_FILENAME;
806         profile.pProfileData = testprofile;
807         profile.cbDataSize = strlen(testprofile);
808
809         /* Parameter checks */
810
811         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
812         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
813
814         ret = pSetColorProfileElement( handle, tag, 0, &size, data );
815         ok( !ret, "SetColorProfileElement() succeeded (%ld)\n", GetLastError() );
816
817         pCloseColorProfile( handle );
818
819         handle = pOpenColorProfileA( &profile, PROFILE_READWRITE, 0, OPEN_EXISTING );
820         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
821
822         ret = pSetColorProfileElement( NULL, 0, 0, NULL, NULL );
823         ok( !ret, "SetColorProfileElement() succeeded (%ld)\n", GetLastError() );
824
825         ret = pSetColorProfileElement( handle, 0, 0, NULL, NULL );
826         ok( !ret, "SetColorProfileElement() succeeded (%ld)\n", GetLastError() );
827
828         ret = pSetColorProfileElement( handle, tag, 0, NULL, NULL );
829         ok( !ret, "SetColorProfileElement() succeeded (%ld)\n", GetLastError() );
830
831         ret = pSetColorProfileElement( handle, tag, 0, &size, NULL );
832         ok( !ret, "SetColorProfileElement() succeeded (%ld)\n", GetLastError() );
833
834         /* Functional checks */
835
836         size = sizeof(data);
837
838         ret = pSetColorProfileElement( handle, tag, 0, &size, data );
839         ok( ret, "SetColorProfileElement() failed (%ld)\n", GetLastError() );
840
841         size = sizeof(buffer);
842
843         ret = pGetColorProfileElement( handle, tag, 0, &size, buffer, &ref );
844         ok( ret && size > 0, "GetColorProfileElement() failed (%ld)\n", GetLastError() );
845
846         ok( !memcmp( data, buffer, sizeof(data) ),
847             "Unexpected tag data, expected %s, got %s (%ld)\n",
848             data, buffer, GetLastError() );
849
850         pCloseColorProfile( handle );
851     }
852 }
853
854 static void test_SetColorProfileHeader(void)
855 {
856     if (testprofile)
857     {
858         PROFILE profile;
859         HPROFILE handle;
860         BOOL ret;
861         PROFILEHEADER header;
862
863         profile.dwType = PROFILE_FILENAME;
864         profile.pProfileData = testprofile;
865         profile.cbDataSize = strlen(testprofile);
866
867         header.phSize = 0x00000c48;
868         header.phCMMType = 0x4c696e6f;
869         header.phVersion = 0x02100000;
870         header.phClass = 0x6d6e7472;
871         header.phDataColorSpace = 0x52474220;
872         header.phConnectionSpace  = 0x58595a20;
873         header.phDateTime[0] = 0x07ce0002;
874         header.phDateTime[1] = 0x00090006;
875         header.phDateTime[2] = 0x00310000;
876         header.phSignature = 0x61637370;
877         header.phPlatform = 0x4d534654;
878         header.phProfileFlags = 0x00000000;
879         header.phManufacturer = 0x49454320;
880         header.phModel = 0x73524742;
881         header.phAttributes[0] = 0x00000000;
882         header.phAttributes[1] = 0x00000000;
883         header.phRenderingIntent = 0x00000000;
884         header.phIlluminant.ciexyzX = 0x0000f6d6;
885         header.phIlluminant.ciexyzY = 0x00010000;
886         header.phIlluminant.ciexyzZ = 0x0000d32d;
887         header.phCreator = 0x48502020;
888
889         /* Parameter checks */
890
891         handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
892         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
893
894         ret = pSetColorProfileHeader( handle, &header );
895         ok( !ret, "SetColorProfileHeader() succeeded (%ld)\n", GetLastError() );
896
897         pCloseColorProfile( handle );
898
899         handle = pOpenColorProfileA( &profile, PROFILE_READWRITE, 0, OPEN_EXISTING );
900         ok( handle != NULL, "OpenColorProfileA() failed (%ld)\n", GetLastError() );
901
902         ret = pSetColorProfileHeader( NULL, NULL );
903         ok( !ret, "SetColorProfileHeader() succeeded (%ld)\n", GetLastError() );
904
905         ret = pSetColorProfileHeader( handle, NULL );
906         ok( !ret, "SetColorProfileHeader() succeeded (%ld)\n", GetLastError() );
907
908         ret = pSetColorProfileHeader( NULL, &header );
909         ok( !ret, "SetColorProfileHeader() succeeded (%ld)\n", GetLastError() );
910
911         /* Functional checks */
912
913         ret = pSetColorProfileHeader( handle, &header );
914         ok( ret, "SetColorProfileHeader() failed (%ld)\n", GetLastError() );
915
916         ret = pGetColorProfileHeader( handle, &header );
917         ok( ret, "GetColorProfileHeader() failed (%ld)\n", GetLastError() );
918
919         ok( !memcmp( &header, rgbheader, sizeof(rgbheader) ), "Unexpected header data\n" );
920
921         pCloseColorProfile( handle );
922     }
923 }
924
925 static void test_UninstallColorProfileA(void)
926 {
927     BOOL ret;
928
929     /* Parameter checks */
930
931     ret = pUninstallColorProfileA( NULL, NULL, FALSE );
932     ok( !ret, "UninstallColorProfileA() succeeded (%ld)\n", GetLastError() );
933
934     ret = pUninstallColorProfileA( machine, NULL, FALSE );
935     ok( !ret, "UninstallColorProfileA() succeeded (%ld)\n", GetLastError() );
936
937     /* Functional checks */
938
939     if (testprofile)
940     {
941         CHAR dest[MAX_PATH], base[MAX_PATH];
942         DWORD size = sizeof(dest);
943         CHAR slash[] = "\\";
944         HANDLE handle;
945
946         ret = pInstallColorProfileA( NULL, testprofile );
947         ok( ret, "InstallColorProfileA() failed (%ld)\n", GetLastError() );
948
949         ret = pGetColorDirectoryA( NULL, dest, &size );
950         ok( ret, "GetColorDirectoryA() failed (%ld)\n", GetLastError() );
951
952         MSCMS_basenameA( testprofile, base );
953
954         lstrcatA( dest, slash );
955         lstrcatA( dest, base );
956
957         ret = pUninstallColorProfileA( NULL, dest, TRUE );
958         ok( ret, "UninstallColorProfileA() failed (%ld)\n", GetLastError() );
959
960         /* Check if the profile is really gone */
961         handle = CreateFileA( dest, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
962         ok( handle == INVALID_HANDLE_VALUE, "Found the profile (%ld)\n", GetLastError() );
963         CloseHandle( handle );
964     }
965 }
966
967 static void test_UninstallColorProfileW(void)
968 {
969     BOOL ret;
970
971     /* Parameter checks */
972
973     ret = pUninstallColorProfileW( NULL, NULL, FALSE );
974     ok( !ret, "UninstallColorProfileW() succeeded (%ld)\n", GetLastError() );
975
976     ret = pUninstallColorProfileW( machineW, NULL, FALSE );
977     ok( !ret, "UninstallColorProfileW() succeeded (%ld)\n", GetLastError() );
978
979     /* Functional checks */
980
981     if (testprofileW)
982     {
983         WCHAR dest[MAX_PATH], base[MAX_PATH];
984         char destA[MAX_PATH];
985         DWORD size = sizeof(dest);
986         WCHAR slash[] = { '\\', 0 };
987         HANDLE handle;
988         int bytes_copied;
989
990         ret = pInstallColorProfileW( NULL, testprofileW );
991         ok( ret, "InstallColorProfileW() failed (%ld)\n", GetLastError() );
992
993         ret = pGetColorDirectoryW( NULL, dest, &size );
994         ok( ret, "GetColorDirectoryW() failed (%ld)\n", GetLastError() );
995
996         MSCMS_basenameW( testprofileW, base );
997
998         lstrcatW( dest, slash );
999         lstrcatW( dest, base );
1000
1001         ret = pUninstallColorProfileW( NULL, dest, TRUE );
1002         ok( ret, "UninstallColorProfileW() failed (%ld)\n", GetLastError() );
1003
1004         bytes_copied = WideCharToMultiByte(CP_ACP, 0, dest, -1, destA, MAX_PATH, NULL, NULL);
1005         ok( bytes_copied > 0 , "WideCharToMultiByte() returns %d\n", bytes_copied);
1006         /* Check if the profile is really gone */
1007         handle = CreateFileA( destA, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
1008         ok( handle == INVALID_HANDLE_VALUE, "Found the profile (%ld)\n", GetLastError() );
1009         CloseHandle( handle );
1010     }
1011 }
1012
1013 START_TEST(profile)
1014 {
1015     UINT len;
1016     HANDLE handle;
1017     char path[MAX_PATH], file[MAX_PATH];
1018     char profilefile1[MAX_PATH], profilefile2[MAX_PATH];
1019     WCHAR profilefile1W[MAX_PATH], profilefile2W[MAX_PATH];
1020     WCHAR fileW[MAX_PATH];
1021     UINT ret;
1022
1023     hmscms = LoadLibraryA( "mscms.dll" );
1024     if (!hmscms) return;
1025
1026     if (!init_function_ptrs())
1027     {
1028         FreeLibrary( hmscms );
1029         return;
1030     }
1031
1032     /* See if we can find the standard color profile */
1033     ret = GetSystemDirectoryA( profilefile1, sizeof(profilefile1) );
1034     ok( ret > 0, "GetSystemDirectoryA() returns %d, LastError = %ld\n", ret, GetLastError());
1035     ok( lstrlenA(profilefile1) > 0 && lstrlenA(profilefile1) < MAX_PATH, 
1036         "GetSystemDirectoryA() returns %d, LastError = %ld\n", ret, GetLastError());
1037     MultiByteToWideChar(CP_ACP, 0, profilefile1, -1, profilefile1W, MAX_PATH);
1038     ok( lstrlenW(profilefile1W) > 0 && lstrlenW(profilefile1W) < MAX_PATH, 
1039         "GetSystemDirectoryA() returns %d, LastError = %ld\n", ret, GetLastError());
1040     lstrcpyA(profilefile2, profilefile1);
1041     lstrcpyW(profilefile2W, profilefile1W);
1042
1043     lstrcatA( profilefile1, profile1 );
1044     lstrcatW( profilefile1W, profile1W );
1045     handle = CreateFileA( profilefile1, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
1046
1047     if (handle != INVALID_HANDLE_VALUE)
1048     {
1049         standardprofile = profilefile1;
1050         standardprofileW = profilefile1W;
1051         CloseHandle( handle );
1052     }
1053
1054     lstrcatA( profilefile2, profile2 );
1055     lstrcatW( profilefile2W, profile2W );
1056     handle = CreateFileA( profilefile2, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
1057
1058     if (handle != INVALID_HANDLE_VALUE)
1059     {
1060         standardprofile = profilefile2;
1061         standardprofileW = profilefile2W;
1062         CloseHandle( handle );
1063     }
1064
1065     /* If found, create a temporary copy for testing purposes */
1066     if (standardprofile && GetTempPath( sizeof(path), path ))
1067     {
1068         if (GetTempFileName( path, "rgb", 0, file ))
1069         {
1070             if (CopyFileA( standardprofile, file, FALSE ))
1071             {
1072                 testprofile = (LPSTR)&file;
1073
1074                 len = MultiByteToWideChar( CP_ACP, 0, testprofile, -1, NULL, 0 );
1075                 MultiByteToWideChar( CP_ACP, 0, testprofile, -1, fileW, len );
1076
1077                 testprofileW = (LPWSTR)&fileW;
1078             }
1079         }
1080     }
1081
1082     test_GetColorDirectoryA();
1083     test_GetColorDirectoryW();
1084
1085     test_GetColorProfileElement();
1086     test_GetColorProfileElementTag();
1087
1088     test_GetColorProfileFromHandle();
1089     test_GetColorProfileHeader();
1090
1091     test_GetCountColorProfileElements();
1092
1093     test_GetStandardColorSpaceProfileA();
1094     test_GetStandardColorSpaceProfileW();
1095
1096     test_InstallColorProfileA();
1097     test_InstallColorProfileW();
1098
1099     test_IsColorProfileTagPresent();
1100
1101     test_OpenColorProfileA();
1102     test_OpenColorProfileW();
1103
1104     test_SetColorProfileElement();
1105     test_SetColorProfileHeader();
1106
1107     test_UninstallColorProfileA();
1108     test_UninstallColorProfileW();
1109
1110     /* Clean up */
1111     if (testprofile)
1112         DeleteFileA( testprofile );
1113     
1114     FreeLibrary( hmscms );
1115 }