https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eb856c3564362c5f11247…
commit eb856c3564362c5f1124711a2a4f6ec3e17b227f
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sat Nov 9 21:58:56 2019 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sat Nov 9 21:58:56 2019 +0100
[MSCMS] Sync with Wine Staging 4.18. CORE-16441
---
dll/win32/mscms/mscms.spec | 4 +--
dll/win32/mscms/profile.c | 83 +++++++++++++++++++++++++++++++++------------
dll/win32/mscms/transform.c | 1 +
media/doc/README.WINE | 2 +-
4 files changed, 66 insertions(+), 24 deletions(-)
diff --git a/dll/win32/mscms/mscms.spec b/dll/win32/mscms/mscms.spec
index f521ac69698..fec0af571d7 100644
--- a/dll/win32/mscms/mscms.spec
+++ b/dll/win32/mscms/mscms.spec
@@ -96,8 +96,8 @@
@ stub WcsGetDefaultRenderingIntent
@ stdcall WcsGetUsePerUserProfiles(wstr long ptr)
@ stub WcsGpCanInstallOrUninstallProfiles
-@ stub WcsOpenColorProfileA
-@ stub WcsOpenColorProfileW
+@ stdcall WcsOpenColorProfileA(ptr ptr ptr long long long long)
+@ stdcall WcsOpenColorProfileW(ptr ptr ptr long long long long)
@ stub WcsSetCalibrationManagementState
@ stub WcsSetDefaultColorProfile
@ stub WcsSetDefaultRenderingIntent
diff --git a/dll/win32/mscms/profile.c b/dll/win32/mscms/profile.c
index a0b9d4133d7..d45ac4af128 100644
--- a/dll/win32/mscms/profile.c
+++ b/dll/win32/mscms/profile.c
@@ -918,7 +918,11 @@ BOOL WINAPI EnumColorProfilesA( PCSTR machine, PENUMTYPEA record,
PBYTE buffer,
*p = 0;
ret = TRUE;
}
- else ret = FALSE;
+ else
+ {
+ SetLastError( ERROR_INSUFFICIENT_BUFFER );
+ ret = FALSE;
+ }
*size = totalsize;
if (number) *number = count;
@@ -1044,7 +1048,11 @@ BOOL WINAPI EnumColorProfilesW( PCWSTR machine, PENUMTYPEW record,
PBYTE buffer,
*p = 0;
ret = TRUE;
}
- else ret = FALSE;
+ else
+ {
+ SetLastError( ERROR_INSUFFICIENT_BUFFER );
+ ret = FALSE;
+ }
*size = totalsize;
if (number) *number = count;
@@ -1327,6 +1335,18 @@ BOOL WINAPI UninstallColorProfileW( PCWSTR machine, PCWSTR profile,
BOOL delete
return TRUE;
}
+static BOOL profile_AtoW( const PROFILE *in, PROFILE *out )
+{
+ int len;
+ if (!in->pProfileData) return FALSE;
+ len = MultiByteToWideChar( CP_ACP, 0, in->pProfileData, -1, NULL, 0 );
+ if (!(out->pProfileData = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
return FALSE;
+ out->cbDataSize = len * sizeof(WCHAR);
+ MultiByteToWideChar( CP_ACP, 0, in->pProfileData, -1, out->pProfileData, len
);
+ out->dwType = in->dwType;
+ return TRUE;
+}
+
/******************************************************************************
* OpenColorProfileA [MSCMS.@]
*
@@ -1335,6 +1355,7 @@ BOOL WINAPI UninstallColorProfileW( PCWSTR machine, PCWSTR profile,
BOOL delete
HPROFILE WINAPI OpenColorProfileA( PPROFILE profile, DWORD access, DWORD sharing, DWORD
creation )
{
HPROFILE handle = NULL;
+ PROFILE profileW;
TRACE( "( %p, 0x%08x, 0x%08x, 0x%08x )\n", profile, access, sharing,
creation );
@@ -1344,25 +1365,9 @@ HPROFILE WINAPI OpenColorProfileA( PPROFILE profile, DWORD access,
DWORD sharing
if (profile->dwType & PROFILE_MEMBUFFER)
return OpenColorProfileW( profile, access, sharing, creation );
- if (profile->dwType & PROFILE_FILENAME)
- {
- UINT len;
- PROFILE profileW;
-
- profileW.dwType = profile->dwType;
-
- len = MultiByteToWideChar( CP_ACP, 0, profile->pProfileData, -1, NULL, 0 );
- profileW.pProfileData = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
-
- if (profileW.pProfileData)
- {
- profileW.cbDataSize = len * sizeof(WCHAR);
- MultiByteToWideChar( CP_ACP, 0, profile->pProfileData, -1,
profileW.pProfileData, len );
-
- handle = OpenColorProfileW( &profileW, access, sharing, creation );
- HeapFree( GetProcessHeap(), 0, profileW.pProfileData );
- }
- }
+ if (!profile_AtoW( profile, &profileW )) return FALSE;
+ handle = OpenColorProfileW( &profileW, access, sharing, creation );
+ HeapFree( GetProcessHeap(), 0, profileW.pProfileData );
return handle;
}
@@ -1546,3 +1551,39 @@ BOOL WINAPI WcsEnumColorProfilesSize( WCS_PROFILE_MANAGEMENT_SCOPE
scope, ENUMTY
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return FALSE;
}
+
+/******************************************************************************
+ * WcsOpenColorProfileA [MSCMS.@]
+ */
+HPROFILE WINAPI WcsOpenColorProfileA( PROFILE *cdm, PROFILE *camp, PROFILE *gmmp, DWORD
access, DWORD sharing,
+ DWORD creation, DWORD flags )
+{
+ PROFILE cdmW, campW = {0}, gmmpW = {0};
+ HPROFILE ret = NULL;
+
+ TRACE( "%p, %p, %p, %08x, %08x, %08x, %08x\n", cdm, camp, gmmp, access,
sharing, creation, flags );
+
+ if (!cdm || !profile_AtoW( cdm, &cdmW )) return NULL;
+ if (camp && !profile_AtoW( camp, &campW )) goto done;
+ if (gmmp && !profile_AtoW( gmmp, &gmmpW )) goto done;
+
+ ret = WcsOpenColorProfileW( &cdmW, &campW, &gmmpW, access, sharing,
creation, flags );
+
+done:
+ HeapFree( GetProcessHeap(), 0, cdmW.pProfileData );
+ HeapFree( GetProcessHeap(), 0, campW.pProfileData );
+ HeapFree( GetProcessHeap(), 0, gmmpW.pProfileData );
+ return ret;
+}
+
+/******************************************************************************
+ * WcsOpenColorProfileW [MSCMS.@]
+ */
+HPROFILE WINAPI WcsOpenColorProfileW( PROFILE *cdm, PROFILE *camp, PROFILE *gmmp, DWORD
access, DWORD sharing,
+ DWORD creation, DWORD flags )
+{
+ TRACE( "%p, %p, %p, %08x, %08x, %08x, %08x\n", cdm, camp, gmmp, access,
sharing, creation, flags );
+ FIXME("no support for WCS profiles\n" );
+
+ return OpenColorProfileW( cdm, access, sharing, creation );
+}
diff --git a/dll/win32/mscms/transform.c b/dll/win32/mscms/transform.c
index cada3329ace..d4eb40b2c8a 100644
--- a/dll/win32/mscms/transform.c
+++ b/dll/win32/mscms/transform.c
@@ -48,6 +48,7 @@ static DWORD from_bmformat( BMFORMAT format )
case BM_GRAY: ret = TYPE_GRAY_8; break;
case BM_xRGBQUADS: ret = TYPE_ARGB_8; break;
case BM_xBGRQUADS: ret = TYPE_ABGR_8; break;
+ case BM_KYMCQUADS: ret = TYPE_KYMC_8; break;
default:
if (!quietfixme)
{
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index cb3d4f5b742..3c7b0a15c26 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -105,7 +105,7 @@ dll/win32/msacm32 # Synced to WineStaging-4.18
dll/win32/msacm32.drv # Synced to WineStaging-3.3
dll/win32/msadp32.acm # Synced to WineStaging-4.0
dll/win32/mscat32 # Synced to WineStaging-4.18
-dll/win32/mscms # Synced to WineStaging-4.0
+dll/win32/mscms # Synced to WineStaging-4.18
dll/win32/mscoree # Synced to Wine-1.5.4
dll/win32/msctf # Synced to WineStaging-4.0
dll/win32/msftedit # Synced to WineStaging-3.3