66#define GETFUNCPTR(func) p##func = (void *)GetProcAddress( hmscms, #func ); \
67 if (!p##func) return FALSE;
117"\\color\\srgb color space profile.icm";
119"\\spool\\drivers\\color\\srgb color space profile.icm";
122{
'\\',
'c',
'o',
'l',
'o',
'r',
'\\',
's',
'r',
'g',
'b',
' ',
'c',
'o',
'l',
'o',
'r',
' ',
123 's',
'p',
'a',
'c',
'e',
' ',
'p',
'r',
'o',
'f',
'i',
'l',
'e',
'.',
'i',
'c',
'm',0 };
125{
'\\',
's',
'p',
'o',
'o',
'l',
'\\',
'd',
'r',
'i',
'v',
'e',
'r',
's',
'\\',
126 'c',
'o',
'l',
'o',
'r',
'\\',
's',
'r',
'g',
'b',
' ',
'c',
'o',
'l',
'o',
'r',
' ',
127 's',
'p',
'a',
'c',
'e',
' ',
'p',
'r',
'o',
'f',
'i',
'l',
'e',
'.',
'i',
'c',
'm',0 };
132{ 0x48, 0x0c, 0x00, 0x00, 0x6f, 0x6e, 0x69, 0x4c, 0x00, 0x00, 0x10, 0x02,
133 0x72, 0x74, 0x6e, 0x6d, 0x20, 0x42, 0x47, 0x52, 0x20, 0x5a, 0x59, 0x58,
134 0x02, 0x00, 0xce, 0x07, 0x06, 0x00, 0x09, 0x00, 0x00, 0x00, 0x31, 0x00,
135 0x70, 0x73, 0x63, 0x61, 0x54, 0x46, 0x53, 0x4d, 0x00, 0x00, 0x00, 0x00,
136 0x20, 0x43, 0x45, 0x49, 0x42, 0x47, 0x52, 0x73, 0x00, 0x00, 0x00, 0x00,
137 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xf6, 0x00, 0x00,
138 0x00, 0x00, 0x01, 0x00, 0x2d, 0xd3, 0x00, 0x00, 0x20, 0x20, 0x50, 0x48 };
140#define IS_SEPARATOR(ch) ((ch) == '\\' || (ch) == '/')
240 static const char expect[] =
241 { 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x70,
242 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x63, 0x29, 0x20,
243 0x31, 0x39, 0x39, 0x38, 0x20, 0x48, 0x65, 0x77, 0x6c, 0x65, 0x74,
244 0x74, 0x2d, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x72, 0x64, 0x20, 0x43,
245 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x00 };
248 profile.pProfileData = standardprofile;
264 ok( !
ret,
"GetColorProfileElement() succeeded\n" );
265 ok(
size > 0,
"wrong size\n" );
272 ok(
size > 0,
"wrong size\n" );
275 pCloseColorProfile(
handle );
290 profile.pProfileData = standardprofile;
313 ok(
ret &&
tag ==
expect,
"GetColorProfileElementTag() failed (%d)\n",
316 pCloseColorProfile(
handle );
328 static const unsigned char expect[] =
329 { 0x00, 0x00, 0x0c, 0x48, 0x4c, 0x69, 0x6e, 0x6f, 0x02, 0x10, 0x00,
330 0x00, 0x6d, 0x6e, 0x74, 0x72, 0x52, 0x47, 0x42, 0x20, 0x58, 0x59,
331 0x5a, 0x20, 0x07, 0xce, 0x00, 0x02, 0x00, 0x09, 0x00, 0x06, 0x00,
332 0x31, 0x00, 0x00, 0x61, 0x63, 0x73, 0x70, 0x4d, 0x53, 0x46, 0x54,
333 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x43, 0x20, 0x73, 0x52, 0x47,
334 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
335 0x00, 0x00, 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00,
336 0x00, 0xd3, 0x2d, 0x48, 0x50, 0x20, 0x20 };
341 profile.pProfileData = testprofile;
374 pCloseColorProfile(
handle );
388 profile.pProfileData = testprofile;
415 pCloseColorProfile(
handle );
429 profile.pProfileData = standardprofile;
438 ok( !
ret,
"GetCountColorProfileElements() succeeded (%d)\n",
442 ok( !
ret,
"GetCountColorProfileElements() succeeded (%d)\n",
449 "GetCountColorProfileElements() failed (%d)\n",
GetLastError() );
451 pCloseColorProfile(
handle );
466 size =
sizeof(newprofile);
471 size =
sizeof(newprofile);
476 size =
sizeof(newprofile);
481 size =
sizeof(newprofile);
490 "GetStandardColorSpaceProfileA() returns %d (GLE=%d)\n",
ret,
GetLastError() );
496 ret = pGetStandardColorSpaceProfileA(
machine, 0, newprofile, &
size);
498 "GetStandardColorSpaceProfileA() returns %d (GLE=%d)\n",
ret,
GetLastError() );
501 ret = pGetStandardColorSpaceProfileA(
NULL, 0, newprofile,
NULL);
508 "GetStandardColorSpaceProfileA() returns %d (GLE=%d)\n",
ret,
GetLastError() );
510 size =
sizeof(newprofile);
512 ret = pGetStandardColorSpaceProfileA(
NULL, 0, newprofile, &
size);
515 "GetStandardColorSpaceProfileA() returns %d (GLE=%d)\n",
ret,
GetLastError() );
519 size =
sizeof(oldprofile);
524 ret = pSetStandardColorSpaceProfileA(
NULL,
LCS_sRGB, standardprofile );
527 skip(
"Not enough rights for SetStandardColorSpaceProfileA\n");
532 size =
sizeof(newprofile);
552 size =
sizeof(newprofile);
557 size =
sizeof(newprofile);
562 size =
sizeof(newprofile);
564 ret = pGetStandardColorSpaceProfileW(
NULL, 0, newprofile, &
size);
567 "GetStandardColorSpaceProfileW() returns %d (GLE=%d)\n",
ret,
GetLastError() );
569 size =
sizeof(newprofile);
572 ok( !
ret ||
broken(
ret) ,
"GetStandardColorSpaceProfileW succeeded\n" );
575 "GetStandardColorSpaceProfileW() returns GLE=%u\n",
GetLastError() );
577 size =
sizeof(newprofile);
585 ok( !
ret ||
broken(
ret) ,
"GetStandardColorSpaceProfileW succeeded\n" );
589 "GetStandardColorSpaceProfileW() returns GLE=%u\n",
GetLastError() );
597 "GetStandardColorSpaceProfileW() returns %d (GLE=%d)\n",
ret,
GetLastError() );
600 ret = pGetStandardColorSpaceProfileW(
NULL, 0, newprofile,
NULL);
606 ok( !
ret ||
broken(
ret) ,
"GetStandardColorSpaceProfileW succeeded\n" );
610 "GetStandardColorSpaceProfileW() returns GLE=%u\n",
GetLastError() );
612 size =
sizeof(newprofile);
614 ret = pGetStandardColorSpaceProfileW(
NULL, 0, newprofile, &
size);
620 "GetStandardColorSpaceProfileW() returns %d (GLE=%d)\n",
ret,
GetLastError() );
625 size =
sizeof(oldprofile);
630 ret = pSetStandardColorSpaceProfileW(
NULL,
LCS_sRGB, standardprofileW );
633 skip(
"Not enough rights for SetStandardColorSpaceProfileW\n");
638 size =
sizeof(newprofile);
665 ok( !
ret,
"EnumColorProfilesA succeeded\n" );
671 ok( !
ret,
"EnumColorProfilesA succeeded\n" );
674 ok( !
ret,
"EnumColorProfilesA succeeded\n" );
677 ok( !
ret,
"EnumColorProfilesA succeeded\n" );
685 ok( !
ret,
"EnumColorProfilesA succeeded\n" );
716 ok( !
ret,
"EnumColorProfilesW succeeded\n" );
722 ok( !
ret,
"EnumColorProfilesW succeeded\n" );
725 ok( !
ret,
"EnumColorProfilesW succeeded\n" );
728 ok( !
ret,
"EnumColorProfilesW succeeded\n" );
736 ok( !
ret,
"EnumColorProfilesW succeeded\n" );
765 ret = pInstallColorProfileA(
NULL, standardprofile );
779 ret = pInstallColorProfileA(
NULL, testprofile );
782 skip(
"Not enough rights for InstallColorProfileA\n");
820 if (standardprofileW)
822 ret = pInstallColorProfileW(
NULL, standardprofileW );
832 WCHAR slash[] = {
'\\', 0 };
836 ret = pInstallColorProfileW(
NULL, testprofileW );
839 skip(
"Not enough rights for InstallColorProfileW\n");
872 profile.pProfileData = standardprofile;
882 ret = pIsColorProfileTagPresent(
handle,
tag, &present );
883 ok( !(
ret && present),
"IsColorProfileTagPresent() succeeded (%d)\n",
GetLastError() );
887 ret = pIsColorProfileTagPresent(
NULL,
tag, &present );
895 ret = pIsColorProfileTagPresent(
handle,
tag, &present );
896 ok(
ret && present,
"IsColorProfileTagPresent() failed (%d)\n",
GetLastError() );
898 pCloseColorProfile(
handle );
926 ok ( !pCloseColorProfile(
NULL ),
"CloseColorProfile() succeeded\n" );
930 profile.pProfileData = standardprofile;
951 profile.pProfileData = (
void *)
"sRGB Color Space Profile.icm";
952 profile.cbDataSize =
sizeof(
"sRGB Color Space Profile.icm");
986 ok ( !pCloseColorProfile(
NULL ),
"CloseColorProfile() succeeded\n" );
988 if (standardprofileW)
990 profile.pProfileData = standardprofileW;
1022 static char data[] =
"(c) The Wine Project";
1026 profile.pProfileData = testprofile;
1037 pCloseColorProfile(
handle );
1063 ok(
size > 0,
"wrong size\n" );
1068 pCloseColorProfile(
handle );
1082 profile.pProfileData = testprofile;
1085 header.phSize = 0x00000c48;
1086 header.phCMMType = 0x4c696e6f;
1087 header.phVersion = 0x02100000;
1088 header.phClass = 0x6d6e7472;
1089 header.phDataColorSpace = 0x52474220;
1090 header.phConnectionSpace = 0x58595a20;
1091 header.phDateTime[0] = 0x07ce0002;
1092 header.phDateTime[1] = 0x00090006;
1093 header.phDateTime[2] = 0x00310000;
1094 header.phSignature = 0x61637370;
1095 header.phPlatform = 0x4d534654;
1096 header.phProfileFlags = 0x00000000;
1097 header.phManufacturer = 0x49454320;
1098 header.phModel = 0x73524742;
1099 header.phAttributes[0] = 0x00000000;
1100 header.phAttributes[1] = 0x00000000;
1101 header.phRenderingIntent = 0x00000000;
1102 header.phIlluminant.ciexyzX = 0x0000f6d6;
1103 header.phIlluminant.ciexyzY = 0x00010000;
1104 header.phIlluminant.ciexyzZ = 0x0000d32d;
1105 header.phCreator = 0x48502020;
1115 pCloseColorProfile(
handle );
1139 pCloseColorProfile(
handle );
1161 CHAR slash[] =
"\\";
1165 ret = pInstallColorProfileA(
NULL, testprofile );
1168 skip(
"Not enough rights for InstallColorProfileA\n");
1210 WCHAR slash[] = {
'\\', 0 };
1215 ret = pInstallColorProfileW(
NULL, testprofileW );
1218 skip(
"Not enough rights for InstallColorProfileW\n");
1235 ok( bytes_copied > 0 ,
"WideCharToMultiByte() returns %d\n", bytes_copied);
1251 if (testprofile && pEnumDisplayDevicesA)
1255 ok(
res,
"Can't get display info\n" );
1258 res = pEnumDisplayDevicesA(
display.DeviceName, 0, &monitor, 0 );
1262 ret = pAssociateColorProfileWithDeviceA(
"machine", testprofile,
NULL );
1264 ok( !
ret,
"AssociateColorProfileWithDevice() succeeded\n" );
1268 ret = pAssociateColorProfileWithDeviceA(
"machine",
NULL, monitor.
DeviceID );
1270 ok( !
ret,
"AssociateColorProfileWithDevice() succeeded\n" );
1274 ret = pAssociateColorProfileWithDeviceA(
"machine", testprofile, monitor.
DeviceID );
1276 ok( !
ret,
"AssociateColorProfileWithDevice() succeeded\n" );
1279 ret = pInstallColorProfileA(
NULL, testprofile );
1293 ret = pDisassociateColorProfileFromDeviceA(
"machine",
profile,
NULL );
1295 ok( !
ret,
"DisassociateColorProfileFromDeviceA() succeeded\n" );
1299 ret = pDisassociateColorProfileFromDeviceA(
"machine",
NULL, monitor.
DeviceID );
1301 ok( !
ret,
"DisassociateColorProfileFromDeviceA() succeeded\n" );
1307 ok( !
ret,
"DisassociateColorProfileFromDeviceA() succeeded\n" );
1311 ok(
ret,
"DisassociateColorProfileFromDeviceA() failed (%u)\n",
GetLastError() );
1317 skip(
"Unable to obtain monitor name\n");
1346 profile.pProfileData = standardprofile;
1353 profile.pProfileData = testprofile;
1359 transform = pCreateMultiProfileTransform(
handle, 2, intents, 2, 0, 0 );
1363 pCloseColorProfile(
handle[0] );
1364 pCloseColorProfile(
handle[1] );
1374 char *standardprofile =
NULL, *testprofile =
NULL;
1399 "Expected length between 0 and MAX_PATH, got %d\n",
lstrlenA(profilefile1));
1402 "Expected length between 0 and MAX_PATH, got %d\n",
lstrlenW(profilefile1W));
1403 lstrcpyA(profilefile2, profilefile1);
1404 lstrcpyW(profilefile2W, profilefile1W);
1412 standardprofile = profilefile1;
1413 standardprofileW = profilefile1W;
1423 standardprofile = profilefile2;
1424 standardprofileW = profilefile2W;
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#define ERROR_INSUFFICIENT_BUFFER
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define ERROR_NOT_SUPPORTED
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
BOOL WINAPI CopyFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
HANDLE WINAPI FindFirstFileA(IN LPCSTR lpFileName, OUT LPWIN32_FIND_DATAA lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
BOOL WINAPI GetStandardColorSpaceProfileA(PCSTR machine, DWORD id, PSTR profile, PDWORD size)
HPROFILE WINAPI OpenColorProfileW(PPROFILE profile, DWORD access, DWORD sharing, DWORD creation)
BOOL WINAPI EnumColorProfilesA(PCSTR machine, PENUMTYPEA record, PBYTE buffer, PDWORD size, PDWORD number)
BOOL WINAPI AssociateColorProfileWithDeviceA(PCSTR machine, PCSTR profile, PCSTR device)
BOOL WINAPI GetColorProfileElementTag(HPROFILE handle, DWORD index, PTAGTYPE type)
BOOL WINAPI UninstallColorProfileW(PCWSTR machine, PCWSTR profile, BOOL delete)
BOOL WINAPI GetColorProfileFromHandle(HPROFILE handle, PBYTE buffer, PDWORD size)
BOOL WINAPI InstallColorProfileA(PCSTR machine, PCSTR profile)
BOOL WINAPI GetColorDirectoryA(PCSTR machine, PSTR buffer, PDWORD size)
BOOL WINAPI IsColorProfileTagPresent(HPROFILE handle, TAGTYPE type, PBOOL present)
BOOL WINAPI DisassociateColorProfileFromDeviceA(PCSTR machine, PCSTR profile, PCSTR device)
BOOL WINAPI SetColorProfileHeader(HPROFILE handle, PPROFILEHEADER header)
BOOL WINAPI UninstallColorProfileA(PCSTR machine, PCSTR profile, BOOL delete)
BOOL WINAPI CloseColorProfile(HPROFILE profile)
BOOL WINAPI GetColorProfileHeader(HPROFILE handle, PPROFILEHEADER header)
BOOL WINAPI GetColorProfileElement(HPROFILE handle, TAGTYPE type, DWORD offset, PDWORD size, PVOID buffer, PBOOL ref)
BOOL WINAPI EnumColorProfilesW(PCWSTR machine, PENUMTYPEW record, PBYTE buffer, PDWORD size, PDWORD number)
BOOL WINAPI SetColorProfileElement(HPROFILE handle, TAGTYPE type, DWORD offset, PDWORD size, PVOID buffer)
static void basename(LPCWSTR path, LPWSTR name)
HPROFILE WINAPI OpenColorProfileA(PPROFILE profile, DWORD access, DWORD sharing, DWORD creation)
BOOL WINAPI GetColorDirectoryW(PCWSTR machine, PWSTR buffer, PDWORD size)
BOOL WINAPI InstallColorProfileW(PCWSTR machine, PCWSTR profile)
BOOL WINAPI GetStandardColorSpaceProfileW(PCWSTR machine, DWORD id, PWSTR profile, PDWORD size)
BOOL WINAPI GetCountColorProfileElements(HPROFILE handle, PDWORD count)
BOOL WINAPI SetStandardColorSpaceProfileW(PCWSTR machine, DWORD id, PWSTR profile)
BOOL WINAPI SetStandardColorSpaceProfileA(PCSTR machine, DWORD id, PSTR profile)
static const WCHAR fileW[]
char ** glob(const char *v)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLuint GLenum GLenum transform
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
struct _PROFILE * PPROFILE
#define ET_DATACOLORSPACE
#define ENUM_TYPE_VERSION
struct tagENUMTYPEW ENUMTYPEW
#define INTENT_PERCEPTUAL
struct tagENUMTYPEA ENUMTYPEA
#define PROFILE_READWRITE
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define ERROR_FILE_NOT_FOUND
static unsigned int number
static const unsigned char rgbheader[]
static void test_GetColorDirectoryA(void)
static void test_UninstallColorProfileA(char *testprofile)
static void test_SetColorProfileElement(char *testprofile)
static void test_SetColorProfileHeader(char *testprofile)
static const WCHAR machineW[]
static void test_GetStandardColorSpaceProfileW(WCHAR *standardprofileW)
static void test_AssociateColorProfileWithDeviceA(char *testprofile)
static void test_GetStandardColorSpaceProfileA(char *standardprofile)
static const WCHAR profile2W[]
static const char profile1[]
static void test_OpenColorProfileW(WCHAR *standardprofileW)
static BOOL have_color_profile
static void test_GetColorProfileElementTag(char *standardprofile)
static void test_CreateMultiProfileTransform(char *standardprofile, char *testprofile)
static void test_GetCountColorProfileElements(char *standardprofile)
static void MSCMS_basenameA(LPCSTR path, LPSTR name)
static void test_InstallColorProfileA(char *standardprofile, char *testprofile)
static void test_GetColorProfileFromHandle(char *testprofile)
static void MSCMS_basenameW(LPCWSTR path, LPWSTR name)
static void test_IsColorProfileTagPresent(char *standardprofile)
static BOOL have_profile(void)
static void test_GetColorProfileElement(char *standardprofile)
static void test_GetColorProfileHeader(char *testprofile)
static void test_UninstallColorProfileW(WCHAR *testprofileW)
static void test_InstallColorProfileW(WCHAR *standardprofileW, WCHAR *testprofileW)
static BOOL init_function_ptrs(void)
static void test_EnumColorProfilesA(char *standardprofile)
static const char profile2[]
static const WCHAR profile1W[]
static void test_EnumColorProfilesW(WCHAR *standardprofileW)
static void test_GetColorDirectoryW(void)
static const char machine[]
static void test_OpenColorProfileA(char *standardprofile)
#define todo_wine_if(is_todo)
DWORD WINAPI GetLastError(void)
struct _DISPLAY_DEVICEA DISPLAY_DEVICEA