Index: dll/win32/mscms/CMakeLists.txt =================================================================== --- dll/win32/mscms/CMakeLists.txt (revision 75929) +++ dll/win32/mscms/CMakeLists.txt (working copy) @@ -1,6 +1,8 @@ -add_definitions(-D__WINESRC__) +add_definitions(-D__WINESRC__ -DHAVE_LCMS2) include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) +include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/lcms2) + spec2def(mscms.dll mscms.spec) list(APPEND SOURCE @@ -15,6 +17,6 @@ add_library(mscms SHARED ${SOURCE} version.rc) set_module_type(mscms win32dll) -target_link_libraries(mscms wine) -add_importlibs(mscms advapi32 msvcrt kernel32 ntdll) +target_link_libraries(mscms lcms2 wine) +add_importlibs(mscms advapi32 msvcrt kernel32 ntdll shlwapi) add_cd_file(TARGET mscms DESTINATION reactos/system32 FOR all) Index: dll/win32/mscms/handle.c =================================================================== --- dll/win32/mscms/handle.c (revision 75929) +++ dll/win32/mscms/handle.c (working copy) @@ -1,35 +1,35 @@ /* - * MSCMS - Color Management System for Wine - * - * Copyright 2004, 2005, 2008 Hans Leidekker - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ +* MSCMS - Color Management System for Wine +* +* Copyright 2004, 2005, 2008 Hans Leidekker +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +*/ -#include -#include +#include "config.h" +#include "wine/debug.h" -//#include +#include -//#include "windef.h" -//#include "winbase.h" -//#include "wingdi.h" -//#include "winuser.h" -//#include "icm.h" +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "icm.h" -//#include "mscms_priv.h" +#include "mscms_priv.h" #ifdef HAVE_LCMS2 @@ -38,8 +38,8 @@ { 0, 0, &mscms_handle_cs, { &mscms_handle_cs_debug.ProcessLocksList, - &mscms_handle_cs_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": mscms_handle_cs") } + &mscms_handle_cs_debug.ProcessLocksList }, + 0, 0,{ (DWORD_PTR)(__FILE__ ": mscms_handle_cs") } }; static CRITICAL_SECTION mscms_handle_cs = { &mscms_handle_cs_debug, -1, 0, 0, 0, 0 }; @@ -51,60 +51,60 @@ WINE_DEFAULT_DEBUG_CHANNEL(mscms); -void free_handle_tables( void ) +void free_handle_tables(void) { - HeapFree( GetProcessHeap(), 0, profiletable ); + HeapFree(GetProcessHeap(), 0, profiletable); profiletable = NULL; num_profile_handles = 0; - HeapFree( GetProcessHeap(), 0, transformtable ); + HeapFree(GetProcessHeap(), 0, transformtable); transformtable = NULL; num_transform_handles = 0; - DeleteCriticalSection( &mscms_handle_cs ); + DeleteCriticalSection(&mscms_handle_cs); } -struct profile *grab_profile( HPROFILE handle ) +struct profile *grab_profile(HPROFILE handle) { DWORD_PTR index; - EnterCriticalSection( &mscms_handle_cs ); + EnterCriticalSection(&mscms_handle_cs); index = (DWORD_PTR)handle - 1; if (index > num_profile_handles) { - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); return NULL; } return &profiletable[index]; } -void release_profile( struct profile *profile ) +void release_profile(struct profile *profile) { - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); } -struct transform *grab_transform( HTRANSFORM handle ) +struct transform *grab_transform(HTRANSFORM handle) { DWORD_PTR index; - EnterCriticalSection( &mscms_handle_cs ); + EnterCriticalSection(&mscms_handle_cs); index = (DWORD_PTR)handle - 1; if (index > num_transform_handles) { - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); return NULL; } return &transformtable[index]; } -void release_transform( struct transform *transform ) +void release_transform(struct transform *transform) { - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); } -static HPROFILE alloc_profile_handle( void ) +static HPROFILE alloc_profile_handle(void) { DWORD_PTR index; struct profile *p; @@ -116,12 +116,12 @@ } if (!profiletable) { - p = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, count * sizeof(struct profile) ); + p = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * sizeof(struct profile)); } else { count = num_profile_handles * 2; - p = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, profiletable, count * sizeof(struct profile) ); + p = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, profiletable, count * sizeof(struct profile)); } if (!p) return NULL; @@ -131,11 +131,11 @@ return (HPROFILE)(index + 1); } -HPROFILE create_profile( struct profile *profile ) +HPROFILE create_profile(struct profile *profile) { HPROFILE handle; - EnterCriticalSection( &mscms_handle_cs ); + EnterCriticalSection(&mscms_handle_cs); if ((handle = alloc_profile_handle())) { @@ -142,21 +142,21 @@ DWORD_PTR index = (DWORD_PTR)handle - 1; profiletable[index] = *profile; } - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); return handle; } -BOOL close_profile( HPROFILE handle ) +BOOL close_profile(HPROFILE handle) { DWORD_PTR index; struct profile *profile; - EnterCriticalSection( &mscms_handle_cs ); + EnterCriticalSection(&mscms_handle_cs); index = (DWORD_PTR)handle - 1; if (index > num_profile_handles) { - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); return FALSE; } profile = &profiletable[index]; @@ -167,25 +167,25 @@ { DWORD written; - if (SetFilePointer( profile->file, 0, NULL, FILE_BEGIN ) || - !WriteFile( profile->file, profile->data, profile->size, &written, NULL ) || + if (SetFilePointer(profile->file, 0, NULL, FILE_BEGIN) || + !WriteFile(profile->file, profile->data, profile->size, &written, NULL) || written != profile->size) { - ERR( "Unable to write color profile\n" ); + ERR("Unable to write color profile\n"); } } - CloseHandle( profile->file ); + CloseHandle(profile->file); } - cmsCloseProfile( profile->cmsprofile ); - HeapFree( GetProcessHeap(), 0, profile->data ); + cmsCloseProfile(profile->cmsprofile); + HeapFree(GetProcessHeap(), 0, profile->data); - memset( profile, 0, sizeof(struct profile) ); + memset(profile, 0, sizeof(struct profile)); - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); return TRUE; } -static HTRANSFORM alloc_transform_handle( void ) +static HTRANSFORM alloc_transform_handle(void) { DWORD_PTR index; struct transform *p; @@ -197,12 +197,12 @@ } if (!transformtable) { - p = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, count * sizeof(struct transform) ); + p = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * sizeof(struct transform)); } else { count = num_transform_handles * 2; - p = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, transformtable, count * sizeof(struct transform) ); + p = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, transformtable, count * sizeof(struct transform)); } if (!p) return NULL; @@ -212,11 +212,11 @@ return (HTRANSFORM)(index + 1); } -HTRANSFORM create_transform( struct transform *transform ) +HTRANSFORM create_transform(struct transform *transform) { HTRANSFORM handle; - EnterCriticalSection( &mscms_handle_cs ); + EnterCriticalSection(&mscms_handle_cs); if ((handle = alloc_transform_handle())) { @@ -223,30 +223,30 @@ DWORD_PTR index = (DWORD_PTR)handle - 1; transformtable[index] = *transform; } - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); return handle; } -BOOL close_transform( HTRANSFORM handle ) +BOOL close_transform(HTRANSFORM handle) { DWORD_PTR index; struct transform *transform; - EnterCriticalSection( &mscms_handle_cs ); + EnterCriticalSection(&mscms_handle_cs); index = (DWORD_PTR)handle - 1; if (index > num_transform_handles) { - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); return FALSE; } transform = &transformtable[index]; - cmsDeleteTransform( transform->cmstransform ); - memset( transform, 0, sizeof(struct transform) ); + cmsDeleteTransform(transform->cmstransform); + memset(transform, 0, sizeof(struct transform)); - LeaveCriticalSection( &mscms_handle_cs ); + LeaveCriticalSection(&mscms_handle_cs); return TRUE; } -#endif /* HAVE_LCMS2 */ +#endif /* HAVE_LCMS2 */ \ No newline at end of file