* Sync to Wine 1.3.37.

svn path=/trunk/; revision=55234
This commit is contained in:
Amine Khaldi 2012-01-27 11:01:06 +00:00
parent d85e3f4b78
commit 5bade8d8fb
9 changed files with 105 additions and 71 deletions

View file

@ -21,5 +21,4 @@ add_library(mscms SHARED ${SOURCE})
set_module_type(mscms win32dll)
target_link_libraries(mscms wine)
add_importlibs(mscms msvcrt advapi32 kernel32 ntdll)
add_pch(mscms mscms_priv.h)
add_cd_file(TARGET mscms DESTINATION reactos/system32 FOR all)

View file

@ -60,6 +60,8 @@ void free_handle_tables( void )
HeapFree( GetProcessHeap(), 0, transformtable );
transformtable = NULL;
num_transform_handles = 0;
DeleteCriticalSection( &MSCMS_handle_cs );
}
struct profile *grab_profile( HPROFILE handle )

View file

@ -33,7 +33,7 @@
#ifdef HAVE_LCMS
static inline void MSCMS_adjust_endianess32( ULONG *ptr )
static inline void MSCMS_adjust_endianness32( ULONG *ptr )
{
#ifndef WORDS_BIGENDIAN
*ptr = RtlUlongByteSwap(*ptr);
@ -48,7 +48,7 @@ void MSCMS_get_profile_header( const icProfile *iccprofile, PROFILEHEADER *heade
/* ICC format is big-endian, swap bytes if necessary */
for (i = 0; i < sizeof(PROFILEHEADER) / sizeof(ULONG); i++)
MSCMS_adjust_endianess32( (ULONG *)header + i );
MSCMS_adjust_endianness32( (ULONG *)header + i );
}
void MSCMS_set_profile_header( icProfile *iccprofile, const PROFILEHEADER *header )
@ -60,14 +60,14 @@ void MSCMS_set_profile_header( icProfile *iccprofile, const PROFILEHEADER *heade
/* ICC format is big-endian, swap bytes if necessary */
for (i = 0; i < sizeof(icHeader) / sizeof(ULONG); i++)
MSCMS_adjust_endianess32( (ULONG *)iccheader + i );
MSCMS_adjust_endianness32( (ULONG *)iccheader + i );
}
DWORD MSCMS_get_tag_count( const icProfile *iccprofile )
{
ULONG count = iccprofile->count;
MSCMS_adjust_endianess32( &count );
MSCMS_adjust_endianness32( &count );
return count;
}
@ -79,9 +79,9 @@ void MSCMS_get_tag_by_index( icProfile *iccprofile, DWORD index, icTag *tag )
tag->offset = tmp->offset;
tag->size = tmp->size;
MSCMS_adjust_endianess32( &tag->sig );
MSCMS_adjust_endianess32( &tag->offset );
MSCMS_adjust_endianess32( &tag->size );
MSCMS_adjust_endianness32( &tag->sig );
MSCMS_adjust_endianness32( &tag->offset );
MSCMS_adjust_endianness32( &tag->size );
}
void MSCMS_get_tag_data( const icProfile *iccprofile, const icTag *tag, DWORD offset, void *buffer )
@ -98,7 +98,7 @@ DWORD MSCMS_get_profile_size( const icProfile *iccprofile )
{
DWORD size = ((const icHeader *)iccprofile)->size;
MSCMS_adjust_endianess32( &size );
MSCMS_adjust_endianness32( &size );
return size;
}

View file

@ -10,7 +10,6 @@
<file>stub.c</file>
<file>transform.c</file>
<file>version.rc</file>
<pch>mscms_priv.h</pch>
<library>wine</library>
<library>advapi32</library>
<library>ntdll</library>

View file

@ -87,28 +87,28 @@ struct transform
cmsHTRANSFORM cmstransform;
};
extern HPROFILE create_profile( struct profile * );
extern BOOL close_profile( HPROFILE );
extern HPROFILE create_profile( struct profile * ) DECLSPEC_HIDDEN;
extern BOOL close_profile( HPROFILE ) DECLSPEC_HIDDEN;
extern HTRANSFORM create_transform( struct transform * );
extern BOOL close_transform( HTRANSFORM );
extern HTRANSFORM create_transform( struct transform * ) DECLSPEC_HIDDEN;
extern BOOL close_transform( HTRANSFORM ) DECLSPEC_HIDDEN;
struct profile *grab_profile( HPROFILE );
struct transform *grab_transform( HTRANSFORM );
struct profile *grab_profile( HPROFILE ) DECLSPEC_HIDDEN;
struct transform *grab_transform( HTRANSFORM ) DECLSPEC_HIDDEN;
void release_profile( struct profile * );
void release_transform( struct transform * );
void release_profile( struct profile * ) DECLSPEC_HIDDEN;
void release_transform( struct transform * ) DECLSPEC_HIDDEN;
extern void free_handle_tables( void );
extern void free_handle_tables( void ) DECLSPEC_HIDDEN;
extern DWORD MSCMS_get_tag_count( const icProfile *iccprofile );
extern void MSCMS_get_tag_by_index( icProfile *iccprofile, DWORD index, icTag *tag );
extern void MSCMS_get_tag_data( const icProfile *iccprofile, const icTag *tag, DWORD offset, void *buffer );
extern void MSCMS_set_tag_data( icProfile *iccprofile, const icTag *tag, DWORD offset, const void *buffer );
extern void MSCMS_get_profile_header( const icProfile *iccprofile, PROFILEHEADER *header );
extern void MSCMS_set_profile_header( icProfile *iccprofile, const PROFILEHEADER *header );
extern DWORD MSCMS_get_profile_size( const icProfile *iccprofile );
extern const char *MSCMS_dbgstr_tag(DWORD);
extern DWORD MSCMS_get_tag_count( const icProfile *iccprofile ) DECLSPEC_HIDDEN;
extern void MSCMS_get_tag_by_index( icProfile *iccprofile, DWORD index, icTag *tag ) DECLSPEC_HIDDEN;
extern void MSCMS_get_tag_data( const icProfile *iccprofile, const icTag *tag, DWORD offset, void *buffer ) DECLSPEC_HIDDEN;
extern void MSCMS_set_tag_data( icProfile *iccprofile, const icTag *tag, DWORD offset, const void *buffer ) DECLSPEC_HIDDEN;
extern void MSCMS_get_profile_header( const icProfile *iccprofile, PROFILEHEADER *header ) DECLSPEC_HIDDEN;
extern void MSCMS_set_profile_header( icProfile *iccprofile, const PROFILEHEADER *header ) DECLSPEC_HIDDEN;
extern DWORD MSCMS_get_profile_size( const icProfile *iccprofile ) DECLSPEC_HIDDEN;
#endif /* HAVE_LCMS */
extern const char *MSCMS_dbgstr_tag(DWORD) DECLSPEC_HIDDEN;

View file

@ -30,6 +30,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "shlwapi.h"
#include "icm.h"
#include "mscms_priv.h"
@ -497,7 +498,7 @@ BOOL WINAPI GetColorProfileFromHandle( HPROFILE handle, PBYTE buffer, PDWORD siz
* Failure: FALSE
*
* NOTES
* The profile header returned will be adjusted for endianess.
* The profile header returned will be adjusted for endianness.
*/
BOOL WINAPI GetColorProfileHeader( HPROFILE handle, PPROFILEHEADER header )
{
@ -660,9 +661,9 @@ BOOL WINAPI GetStandardColorSpaceProfileW( PCWSTR machine, DWORD id, PWSTR profi
GetColorDirectoryW( machine, rgbprofile, &len );
switch (id)
{
case LCS_sRGB:
case LCS_WINDOWS_COLOR_SPACE: /* FIXME */
{
lstrcatW( rgbprofile, rgbprofilefile );
len = lstrlenW( rgbprofile ) * sizeof(WCHAR);
@ -1470,7 +1471,25 @@ HPROFILE WINAPI OpenColorProfileW( PPROFILE profile, DWORD access, DWORD sharing
if (!flags) return NULL;
if (!sharing) sharing = FILE_SHARE_READ;
handle = CreateFileW( profile->pProfileData, flags, sharing, NULL, creation, 0, NULL );
if (!PathIsRelativeW( profile->pProfileData ))
handle = CreateFileW( profile->pProfileData, flags, sharing, NULL, creation, 0, NULL );
else
{
DWORD size;
WCHAR *path;
if (!GetColorDirectoryW( NULL, NULL, &size ) && GetLastError() == ERROR_MORE_DATA)
{
size += (strlenW( profile->pProfileData ) + 2) * sizeof(WCHAR);
if (!(path = HeapAlloc( GetProcessHeap(), 0, size ))) return NULL;
GetColorDirectoryW( NULL, path, &size );
PathAddBackslashW( path );
strcatW( path, profile->pProfileData );
}
else return NULL;
handle = CreateFileW( path, flags, sharing, NULL, creation, 0, NULL );
HeapFree( GetProcessHeap(), 0, path );
}
if (handle == INVALID_HANDLE_VALUE)
{
WARN( "Unable to open color profile %u\n", GetLastError() );

View file

@ -137,21 +137,21 @@ BOOL WINAPI GetPS2ColorSpaceArray( HPROFILE profile, DWORD intent, DWORD type, P
BOOL WINAPI RegisterCMMA( PCSTR machine, DWORD id, PCSTR dll )
{
FIXME( "( %p, 0x%08x, %p ) stub\n", machine, id, dll );
FIXME( "( %p, %s, %p ) stub\n", machine, MSCMS_dbgstr_tag(id), dll );
return TRUE;
}
BOOL WINAPI RegisterCMMW( PCWSTR machine, DWORD id, PCWSTR dll )
{
FIXME( "( %p, 0x%08x, %p ) stub\n", machine, id, dll );
FIXME( "( %p, %s, %p ) stub\n", machine, MSCMS_dbgstr_tag(id), dll );
return TRUE;
}
BOOL WINAPI SelectCMM( DWORD id )
{
FIXME( "(%x) stub\n", id );
FIXME( "(%s) stub\n", MSCMS_dbgstr_tag(id) );
return TRUE;
}
@ -190,14 +190,14 @@ BOOL WINAPI SpoolerCopyFileEvent( LPWSTR printer, LPWSTR key, DWORD event )
BOOL WINAPI UnregisterCMMA( PCSTR machine, DWORD id )
{
FIXME( "( %p, 0x%08x ) stub\n", machine, id );
FIXME( "( %p, %s ) stub\n", machine, MSCMS_dbgstr_tag(id) );
return TRUE;
}
BOOL WINAPI UnregisterCMMW( PCWSTR machine, DWORD id )
{
FIXME( "( %p, 0x%08x ) stub\n", machine, id );
FIXME( "( %p, %s ) stub\n", machine, MSCMS_dbgstr_tag(id) );
return TRUE;
}

View file

@ -238,7 +238,7 @@ HTRANSFORM WINAPI CreateMultiProfileTransform( PHPROFILE profiles, DWORD nprofil
if (out_format == TYPE_Lab_16) cmsconvert = cmsCreateLabProfile( NULL );
}
cmsprofiles = HeapAlloc( GetProcessHeap(), 0, (nprofiles + 1) * sizeof(cmsHPROFILE *) );
cmsprofiles = HeapAlloc( GetProcessHeap(), 0, (nprofiles + 1) * sizeof(cmsHPROFILE) );
if (cmsprofiles)
{
cmsprofiles[0] = profile0->cmsprofile;
@ -355,8 +355,8 @@ BOOL WINAPI TranslateBitmapBits( HTRANSFORM handle, PVOID srcbits, BMFORMAT inpu
BOOL WINAPI TranslateColors( HTRANSFORM handle, PCOLOR in, DWORD count,
COLORTYPE input_type, PCOLOR out, COLORTYPE output_type )
{
BOOL ret = FALSE;
#ifdef HAVE_LCMS
BOOL ret = TRUE;
struct transform *transform = grab_transform( handle );
cmsHTRANSFORM xfrm;
unsigned int i;
@ -374,78 +374,93 @@ BOOL WINAPI TranslateColors( HTRANSFORM handle, PCOLOR in, DWORD count,
{
switch (output_type)
{
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].rgb, 1 ); return TRUE;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].Lab, 1 ); return TRUE;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].gray, 1 ); return TRUE;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].cmyk, 1 ); return TRUE;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].XYZ, 1 ); return TRUE;
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].rgb, 1 ); goto done;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].Lab, 1 ); goto done;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].gray, 1 ); goto done;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].cmyk, 1 ); goto done;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].rgb, &out[i].XYZ, 1 ); goto done;
default:
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
return FALSE;
ret = FALSE;
break;
}
break;
}
case COLOR_Lab:
{
switch (output_type)
{
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].rgb, 1 ); return TRUE;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].Lab, 1 ); return TRUE;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].gray, 1 ); return TRUE;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].cmyk, 1 ); return TRUE;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].XYZ, 1 ); return TRUE;
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].rgb, 1 ); goto done;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].Lab, 1 ); goto done;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].gray, 1 ); goto done;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].cmyk, 1 ); goto done;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].Lab, &out[i].XYZ, 1 ); goto done;
default:
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
return FALSE;
ret = FALSE;
break;
}
break;
}
case COLOR_GRAY:
{
switch (output_type)
{
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].rgb, 1 ); return TRUE;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].Lab, 1 ); return TRUE;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].gray, 1 ); return TRUE;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].cmyk, 1 ); return TRUE;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].XYZ, 1 ); return TRUE;
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].rgb, 1 ); goto done;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].Lab, 1 ); goto done;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].gray, 1 ); goto done;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].cmyk, 1 ); goto done;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].gray, &out[i].XYZ, 1 ); goto done;
default:
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
return FALSE;
ret = FALSE;
break;
}
break;
}
case COLOR_CMYK:
{
switch (output_type)
{
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].rgb, 1 ); return TRUE;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].Lab, 1 ); return TRUE;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].gray, 1 ); return TRUE;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].cmyk, 1 ); return TRUE;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].XYZ, 1 ); return TRUE;
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].rgb, 1 ); goto done;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].Lab, 1 ); goto done;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].gray, 1 ); goto done;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].cmyk, 1 ); goto done;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].cmyk, &out[i].XYZ, 1 ); goto done;
default:
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
return FALSE;
ret = FALSE;
break;
}
break;
}
case COLOR_XYZ:
{
switch (output_type)
{
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].rgb, 1 ); return TRUE;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].Lab, 1 ); return TRUE;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].gray, 1 ); return TRUE;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].cmyk, 1 ); return TRUE;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].XYZ, 1 ); return TRUE;
case COLOR_RGB: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].rgb, 1 ); goto done;
case COLOR_Lab: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].Lab, 1 ); goto done;
case COLOR_GRAY: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].gray, 1 ); goto done;
case COLOR_CMYK: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].cmyk, 1 ); goto done;
case COLOR_XYZ: for (i = 0; i < count; i++) cmsDoTransform( xfrm, &in[i].XYZ, &out[i].XYZ, 1 ); goto done;
default:
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
return FALSE;
ret = FALSE;
break;
}
break;
}
default:
FIXME("unhandled input/output pair: %d/%d\n", input_type, output_type);
ret = FALSE;
break;
}
release_transform( transform );
#endif /* HAVE_LCMS */
done:
release_transform( transform );
return ret;
#else /* HAVE_LCMS */
return FALSE;
#endif /* HAVE_LCMS */
}

View file

@ -94,7 +94,7 @@ reactos/dll/win32/mprapi # Autosync
reactos/dll/win32/msacm32 # Autosync
reactos/dll/win32/msadp32.acm # Synced to Wine-1.3.37
reactos/dll/win32/mscat32 # Autosync
reactos/dll/win32/mscms # Autosync
reactos/dll/win32/mscms # Synced to Wine-1.3.37
reactos/dll/win32/mscoree # Autosync
reactos/dll/win32/msctf # Autosync
reactos/dll/win32/msftedit # Synced to Wine-1.3.37