23 #include "wine/unicode.h" 42 while (
i > 0 &&
path[
i - 1] !=
'\\' &&
path[
i - 1] !=
'/')
i--;
61 (
char)(
tag >> 24), (
char)(
tag >> 16), (
char)(
tag >> 8), (
char)(
tag) );
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',
'\\',
116 HKEY icm_key, class_key;
156 static const BYTE dummy_value[12];
290 static const WCHAR colorsubdir[] =
291 {
'\\',
's',
'p',
'o',
'o',
'l',
'\\',
'd',
'r',
'i',
'v',
'e',
'r',
's',
'\\',
'c',
'o',
'l',
'o',
'r',0};
341 TRACE(
"( %p, 0x%08x, %d, %p, %p, %p )\n",
handle,
type,
offset,
size,
buffer,
ref );
385 cmsInt32Number num_tags;
397 num_tags = cmsGetTagCount(
profile->cmsprofile );
398 if (num_tags < 0 || index > num_tags ||
index < 1)
403 if ((sig = cmsGetTagSignature(
profile->cmsprofile,
index - 1 )))
526 cmsInt32Number num_tags;
537 if ((num_tags = cmsGetTagCount(
profile->cmsprofile )) >= 0)
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 };
649 lstrcatW( rgbprofile, rgbprofilefile );
671 static const WCHAR slash[] = {
'\\',0};
681 WARN(
"Can't retrieve color directory\n" );
686 WARN(
"Filename too long\n" );
700 WARN(
"Can't open color profile\n" );
706 WARN(
"Can't retrieve color profile header\n" );
728 FIXME(
"ET_RESOLUTION: 0x%08x, 0x%08x\n",
782 TRACE(
"ET_ATTRIBUTES: 0x%08x, 0x%08x\n",
809 char spec[] =
"\\*.icm";
827 WARN(
"can't retrieve color directory\n" );
838 if (!profiles)
goto exit;
888 profiles,
sizeof(
char *) * (
count + 1) );
961 static const WCHAR spec[] = {
'\\',
'*',
'i',
'c',
'm',0};
978 WARN(
"Can't retrieve color directory\n" );
989 if (!profiles)
goto exit;
1021 if (!tmp)
goto exit;
1022 else profiles = tmp;
1115 static const WCHAR slash[] = {
'\\', 0 };
1164 *present = (cmsIsTag(
profile->cmsprofile,
type ) != 0);
1341 if (!
in->pProfileData)
return FALSE;
1346 out->dwType =
in->dwType;
1399 cmsHPROFILE cmsprofile =
NULL;
1415 if (!(cmsprofile = cmsOpenProfileFromMem(
data,
profile->cbDataSize )))
1459 ERR(
"Unable to retrieve size of color profile\n" );
1465 ERR(
"Unable to allocate memory for color profile\n" );
1471 ERR(
"Unable to read color profile\n" );
1477 if (!(cmsprofile = cmsOpenProfileFromMem(
data,
size )))
1486 ERR(
"Invalid profile type %u\n",
profile->dwType );
1499 profile.cmsprofile = cmsprofile;
1501 if ((hprof = create_profile( &
profile )))
return hprof;
1503 cmsCloseProfile( cmsprofile );
1561 PROFILE cdmW, campW = {0}, gmmpW = {0};
1564 TRACE(
"%p, %p, %p, %08x, %08x, %08x, %08x\n", cdm, camp, gmmp,
access,
sharing, creation,
flags );
1585 TRACE(
"%p, %p, %p, %08x, %08x, %08x, %08x\n", cdm, camp, gmmp,
access,
sharing, creation,
flags );
1586 FIXME(
"no support for WCS profiles\n" );
#define ERROR_INVALID_PARAMETER
#define ET_RENDERINGINTENT
static const WCHAR classW[]
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
static BOOL header_from_file(LPCWSTR file, PPROFILEHEADER header)
BOOL WINAPI AssociateColorProfileWithDeviceW(PCWSTR machine, PCWSTR profile, PCWSTR device)
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
#define ENUM_TYPE_VERSION
#define WideCharToMultiByte
GLsizei const GLchar ** path
static void basename(LPCWSTR path, LPWSTR name)
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
GLuint GLuint GLsizei count
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetLastError(VOID)
BOOL WINAPI GetColorProfileHeader(HPROFILE handle, PPROFILEHEADER header)
#define ERROR_INVALID_PROFILE
HPROFILE WINAPI OpenColorProfileW(PPROFILE profile, DWORD access, DWORD sharing, DWORD creation)
static LPWSTR strdupW(LPCSTR str)
BOOL WINAPI GetStandardColorSpaceProfileW(PCWSTR machine, DWORD id, PWSTR profile, PDWORD size)
#define INVALID_FILE_SIZE
BOOL WINAPI FindNextFileA(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAA lpFindFileData)
BOOL WINAPI IsColorProfileValid(HPROFILE handle, PBOOL valid)
HPROFILE WINAPI WcsOpenColorProfileW(PROFILE *cdm, PROFILE *camp, PROFILE *gmmp, DWORD access, DWORD sharing, DWORD creation, DWORD flags)
static const WCHAR deviceW[]
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
BOOL WINAPI UninstallColorProfileW(PCWSTR machine, PCWSTR profile, BOOL delete)
const char * wine_dbg_sprintf(const char *format,...)
BOOL WINAPI WcsEnumColorProfilesSize(WCS_PROFILE_MANAGEMENT_SCOPE scope, ENUMTYPEW *record, DWORD *size)
BOOL WINAPI GetColorProfileElement(HPROFILE handle, TAGTYPE type, DWORD offset, PDWORD size, PVOID buffer, PBOOL ref)
BOOL WINAPI GetStandardColorSpaceProfileA(PCSTR machine, DWORD id, PSTR profile, PDWORD size)
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
BOOL WINAPI InstallColorProfileW(PCWSTR machine, PCWSTR profile)
WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg)
static size_t double number
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
static const WCHAR sizeW[]
#define ET_DATACOLORSPACE
static BOOL match_profile(PENUMTYPEW rec, PPROFILEHEADER hdr)
#define ERROR_FILE_NOT_FOUND
WCS_PROFILE_MANAGEMENT_SCOPE
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
#define PROFILE_MEMBUFFER
BOOL WINAPI GetColorDirectoryW(PCWSTR machine, PWSTR buffer, PDWORD size)
HPROFILE WINAPI WcsOpenColorProfileA(PROFILE *cdm, PROFILE *camp, PROFILE *gmmp, DWORD access, DWORD sharing, DWORD creation, DWORD flags)
BOOL WINAPI IsColorProfileTagPresent(HPROFILE handle, TAGTYPE type, PBOOL present)
static BOOL set_profile_device_key(PCWSTR file, const BYTE *value, DWORD size)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
BOOL WINAPI SetColorProfileHeader(HPROFILE handle, PPROFILEHEADER header)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
BOOL WINAPI InstallColorProfileA(PCSTR machine, PCSTR profile)
BOOL WINAPI GetColorProfileElementTag(HPROFILE handle, DWORD index, PTAGTYPE type)
BOOL WINAPI AssociateColorProfileWithDeviceA(PCSTR machine, PCSTR profile, PCSTR device)
static BOOL profile_AtoW(const PROFILE *in, PROFILE *out)
static const char machine[]
#define memcpy(s1, s2, n)
BOOL WINAPI SetColorProfileElement(HPROFILE handle, TAGTYPE type, DWORD offset, PDWORD size, PVOID buffer)
HPROFILE WINAPI OpenColorProfileA(PPROFILE profile, DWORD access, DWORD sharing, DWORD creation)
BOOL WINAPI GetColorDirectoryA(PCSTR machine, PSTR buffer, PDWORD size)
#define ET_CONNECTIONSPACE
const char * dbgstr_tag(DWORD tag)
int WINAPI lstrlenA(LPCSTR lpString)
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
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
BOOL WINAPI UninstallColorProfileA(PCSTR machine, PCSTR profile, BOOL delete)
GLuint GLint GLboolean GLint GLenum access
BOOL WINAPI DisassociateColorProfileFromDeviceA(PCSTR machine, PCSTR profile, PCSTR device)
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI WcsGetUsePerUserProfiles(const WCHAR *name, DWORD class, BOOL *use_per_user_profile)
#define ReadFile(a, b, c, d, e)
char ** glob(const char *v)
BOOL WINAPI EnumColorProfilesW(PCWSTR machine, PENUMTYPEW record, PBYTE buffer, PDWORD size, PDWORD number)
#define PROFILE_READWRITE
BOOL WINAPI GetCountColorProfileElements(HPROFILE handle, PDWORD count)
#define MultiByteToWideChar
#define ERROR_NOT_SUPPORTED
#define ERROR_CALL_NOT_IMPLEMENTED
BOOL WINAPI DisassociateColorProfileFromDeviceW(PCWSTR machine, PCWSTR profile, PCWSTR device)
BOOL WINAPI CloseColorProfile(HPROFILE profile)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
GLuint GLuint GLsizei GLenum type
#define LCS_WINDOWS_COLOR_SPACE
BOOL WINAPI EnumColorProfilesA(PCSTR machine, PENUMTYPEA record, PBYTE buffer, PDWORD size, PDWORD number)
static const WCHAR fileW[]
HANDLE WINAPI FindFirstFileA(IN LPCSTR lpFileName, OUT LPWIN32_FIND_DATAA lpFindFileData)
#define HeapFree(x, y, z)
#define RegCloseKey(hKey)
BOOL WINAPI GetColorProfileFromHandle(HPROFILE handle, PBYTE buffer, PDWORD size)
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
#define HKEY_LOCAL_MACHINE
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI FindClose(HANDLE hFindFile)