Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
May 2022
- 77 participants
- 705 discussions
[PATCH 3/5] mscms/tests: Get rid of workarounds for old Windows versions.
by Hans Leidekker 30 May '22
by Hans Leidekker 30 May '22
30 May '22
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/mscms/tests/Makefile.in | 2 +-
dlls/mscms/tests/profile.c | 546 +++++++++++++----------------------
2 files changed, 195 insertions(+), 353 deletions(-)
diff --git a/dlls/mscms/tests/Makefile.in b/dlls/mscms/tests/Makefile.in
index 2d229c049ab..5dd9975434a 100644
--- a/dlls/mscms/tests/Makefile.in
+++ b/dlls/mscms/tests/Makefile.in
@@ -1,5 +1,5 @@
TESTDLL = mscms.dll
-IMPORTS = advapi32
+IMPORTS = mscms user32 advapi32
C_SRCS = \
profile.c
diff --git a/dlls/mscms/tests/profile.c b/dlls/mscms/tests/profile.c
index e5f924fb2da..c579dc86540 100644
--- a/dlls/mscms/tests/profile.c
+++ b/dlls/mscms/tests/profile.c
@@ -30,79 +30,6 @@
#include "wine/test.h"
-static HMODULE hmscms;
-static HMODULE huser32;
-
-static BOOL (WINAPI *pAssociateColorProfileWithDeviceA)(PCSTR,PCSTR,PCSTR);
-static BOOL (WINAPI *pCloseColorProfile)(HPROFILE);
-static HTRANSFORM (WINAPI *pCreateMultiProfileTransform)(PHPROFILE,DWORD,PDWORD,DWORD,DWORD,DWORD);
-static BOOL (WINAPI *pDeleteColorTransform)(HTRANSFORM);
-static BOOL (WINAPI *pDisassociateColorProfileFromDeviceA)(PCSTR,PCSTR,PCSTR);
-static BOOL (WINAPI *pGetColorDirectoryA)(PCHAR,PCHAR,PDWORD);
-static BOOL (WINAPI *pGetColorDirectoryW)(PWCHAR,PWCHAR,PDWORD);
-static BOOL (WINAPI *pGetColorProfileElement)(HPROFILE,TAGTYPE,DWORD,PDWORD,PVOID,PBOOL);
-static BOOL (WINAPI *pGetColorProfileElementTag)(HPROFILE,DWORD,PTAGTYPE);
-static BOOL (WINAPI *pGetColorProfileFromHandle)(HPROFILE,PBYTE,PDWORD);
-static BOOL (WINAPI *pGetColorProfileHeader)(HPROFILE,PPROFILEHEADER);
-static BOOL (WINAPI *pGetCountColorProfileElements)(HPROFILE,PDWORD);
-static BOOL (WINAPI *pGetStandardColorSpaceProfileA)(PCSTR,DWORD,PSTR,PDWORD);
-static BOOL (WINAPI *pGetStandardColorSpaceProfileW)(PCWSTR,DWORD,PWSTR,PDWORD);
-static BOOL (WINAPI *pEnumColorProfilesA)(PCSTR,PENUMTYPEA,PBYTE,PDWORD,PDWORD);
-static BOOL (WINAPI *pEnumColorProfilesW)(PCWSTR,PENUMTYPEW,PBYTE,PDWORD,PDWORD);
-static BOOL (WINAPI *pInstallColorProfileA)(PCSTR,PCSTR);
-static BOOL (WINAPI *pInstallColorProfileW)(PCWSTR,PCWSTR);
-static BOOL (WINAPI *pIsColorProfileTagPresent)(HPROFILE,TAGTYPE,PBOOL);
-static HPROFILE (WINAPI *pOpenColorProfileA)(PPROFILE,DWORD,DWORD,DWORD);
-static HPROFILE (WINAPI *pOpenColorProfileW)(PPROFILE,DWORD,DWORD,DWORD);
-static BOOL (WINAPI *pSetColorProfileElement)(HPROFILE,TAGTYPE,DWORD,PDWORD,PVOID);
-static BOOL (WINAPI *pSetColorProfileHeader)(HPROFILE,PPROFILEHEADER);
-static BOOL (WINAPI *pSetStandardColorSpaceProfileA)(PCSTR,DWORD,PSTR);
-static BOOL (WINAPI *pSetStandardColorSpaceProfileW)(PCWSTR,DWORD,PWSTR);
-static BOOL (WINAPI *pTranslateBitmapBits)(HTRANSFORM,PVOID,BMFORMAT,DWORD,DWORD,DWORD,PVOID,BMFORMAT,DWORD,PBMCALLBACKFN,ULONG);
-static BOOL (WINAPI *pUninstallColorProfileA)(PCSTR,PCSTR,BOOL);
-static BOOL (WINAPI *pUninstallColorProfileW)(PCWSTR,PCWSTR,BOOL);
-
-static BOOL (WINAPI *pEnumDisplayDevicesA)(LPCSTR,DWORD,PDISPLAY_DEVICEA,DWORD);
-
-#define GETFUNCPTR(func) p##func = (void *)GetProcAddress( hmscms, #func ); \
- if (!p##func) return FALSE;
-
-static BOOL init_function_ptrs( void )
-{
- GETFUNCPTR( AssociateColorProfileWithDeviceA )
- GETFUNCPTR( CloseColorProfile )
- GETFUNCPTR( CreateMultiProfileTransform )
- GETFUNCPTR( DeleteColorTransform )
- GETFUNCPTR( DisassociateColorProfileFromDeviceA )
- GETFUNCPTR( GetColorDirectoryA )
- GETFUNCPTR( GetColorDirectoryW )
- GETFUNCPTR( GetColorProfileElement )
- GETFUNCPTR( GetColorProfileElementTag )
- GETFUNCPTR( GetColorProfileFromHandle )
- GETFUNCPTR( GetColorProfileHeader )
- GETFUNCPTR( GetCountColorProfileElements )
- GETFUNCPTR( GetStandardColorSpaceProfileA )
- GETFUNCPTR( GetStandardColorSpaceProfileW )
- GETFUNCPTR( EnumColorProfilesA )
- GETFUNCPTR( EnumColorProfilesW )
- GETFUNCPTR( InstallColorProfileA )
- GETFUNCPTR( InstallColorProfileW )
- GETFUNCPTR( IsColorProfileTagPresent )
- GETFUNCPTR( OpenColorProfileA )
- GETFUNCPTR( OpenColorProfileW )
- GETFUNCPTR( SetColorProfileElement )
- GETFUNCPTR( SetColorProfileHeader )
- GETFUNCPTR( SetStandardColorSpaceProfileA )
- GETFUNCPTR( SetStandardColorSpaceProfileW )
- GETFUNCPTR( UninstallColorProfileA )
- GETFUNCPTR( UninstallColorProfileW )
- GETFUNCPTR( TranslateBitmapBits )
-
- pEnumDisplayDevicesA = (void *)GetProcAddress( huser32, "EnumDisplayDevicesA" );
-
- return TRUE;
-}
-
static const char machine[] = "dummy";
static const WCHAR machineW[] = L"dummy";
@@ -161,26 +88,24 @@ static void test_GetColorDirectoryA(void)
char buffer[MAX_PATH];
/* Parameter checks */
-
- ret = pGetColorDirectoryA( NULL, NULL, NULL );
+ ret = GetColorDirectoryA( NULL, NULL, NULL );
ok( !ret, "GetColorDirectoryA() succeeded (%lu)\n", GetLastError() );
size = 0;
- ret = pGetColorDirectoryA( NULL, NULL, &size );
+ ret = GetColorDirectoryA( NULL, NULL, &size );
ok( !ret && size > 0, "GetColorDirectoryA() succeeded (%lu)\n", GetLastError() );
size = 0;
- ret = pGetColorDirectoryA( NULL, buffer, &size );
+ ret = GetColorDirectoryA( NULL, buffer, &size );
ok( !ret && size > 0, "GetColorDirectoryA() succeeded (%lu)\n", GetLastError() );
size = 1;
- ret = pGetColorDirectoryA( NULL, buffer, &size );
+ ret = GetColorDirectoryA( NULL, buffer, &size );
ok( !ret && size > 0, "GetColorDirectoryA() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
size = sizeof(buffer);
- ret = pGetColorDirectoryA( NULL, buffer, &size );
+ ret = GetColorDirectoryA( NULL, buffer, &size );
ok( ret && size > 0, "GetColorDirectoryA() failed (%lu)\n", GetLastError() );
}
@@ -191,28 +116,24 @@ static void test_GetColorDirectoryW(void)
WCHAR buffer[MAX_PATH];
/* Parameter checks */
-
- /* This one crashes win2k
- ret = pGetColorDirectoryW( NULL, NULL, NULL );
+ ret = GetColorDirectoryW( NULL, NULL, NULL );
ok( !ret, "GetColorDirectoryW() succeeded (%lu)\n", GetLastError() );
- */
size = 0;
- ret = pGetColorDirectoryW( NULL, NULL, &size );
+ ret = GetColorDirectoryW( NULL, NULL, &size );
ok( !ret && size > 0, "GetColorDirectoryW() succeeded (%lu)\n", GetLastError() );
size = 0;
- ret = pGetColorDirectoryW( NULL, buffer, &size );
+ ret = GetColorDirectoryW( NULL, buffer, &size );
ok( !ret && size > 0, "GetColorDirectoryW() succeeded (%lu)\n", GetLastError() );
size = 1;
- ret = pGetColorDirectoryW( NULL, buffer, &size );
+ ret = GetColorDirectoryW( NULL, buffer, &size );
ok( !ret && size > 0, "GetColorDirectoryW() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
size = sizeof(buffer);
- ret = pGetColorDirectoryW( NULL, buffer, &size );
+ ret = GetColorDirectoryW( NULL, buffer, &size );
ok( ret && size > 0, "GetColorDirectoryW() failed (%lu)\n", GetLastError() );
}
@@ -232,31 +153,29 @@ static void test_GetColorProfileElement( char *standardprofile )
profile.pProfileData = standardprofile;
profile.cbDataSize = strlen(standardprofile);
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
/* Parameter checks */
-
- ret = pGetColorProfileElement( handle, tag, 0, NULL, NULL, &ref );
+ ret = GetColorProfileElement( handle, tag, 0, NULL, NULL, &ref );
ok( !ret, "GetColorProfileElement() succeeded (%lu)\n", GetLastError() );
- ret = pGetColorProfileElement( handle, tag, 0, &size, NULL, NULL );
+ ret = GetColorProfileElement( handle, tag, 0, &size, NULL, NULL );
ok( !ret, "GetColorProfileElement() succeeded (%lu)\n", GetLastError() );
size = 0;
- ret = pGetColorProfileElement( handle, tag, 0, &size, NULL, &ref );
+ ret = GetColorProfileElement( handle, tag, 0, &size, NULL, &ref );
ok( !ret, "GetColorProfileElement() succeeded\n" );
ok( size > 0, "wrong size\n" );
/* Functional checks */
-
size = sizeof(buffer);
- ret = pGetColorProfileElement( handle, tag, 0, &size, buffer, &ref );
+ ret = GetColorProfileElement( handle, tag, 0, &size, buffer, &ref );
ok( ret, "GetColorProfileElement() failed %lu\n", GetLastError() );
ok( size > 0, "wrong size\n" );
ok( !memcmp( buffer, expect, sizeof(expect)-1 ), "Unexpected tag data\n" );
- pCloseColorProfile( handle );
+ CloseColorProfile( handle );
}
}
@@ -274,29 +193,27 @@ static void test_GetColorProfileElementTag( char *standardprofile )
profile.pProfileData = standardprofile;
profile.cbDataSize = strlen(standardprofile);
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
/* Parameter checks */
-
- ret = pGetColorProfileElementTag( NULL, index, &tag );
+ ret = GetColorProfileElementTag( NULL, index, &tag );
ok( !ret, "GetColorProfileElementTag() succeeded (%lu)\n", GetLastError() );
- ret = pGetColorProfileElementTag( handle, 0, &tag );
+ ret = GetColorProfileElementTag( handle, 0, &tag );
ok( !ret, "GetColorProfileElementTag() succeeded (%lu)\n", GetLastError() );
- ret = pGetColorProfileElementTag( handle, index, NULL );
+ ret = GetColorProfileElementTag( handle, index, NULL );
ok( !ret, "GetColorProfileElementTag() succeeded (%lu)\n", GetLastError() );
- ret = pGetColorProfileElementTag( handle, 18, NULL );
+ ret = GetColorProfileElementTag( handle, 18, NULL );
ok( !ret, "GetColorProfileElementTag() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
- while ((ret = pGetColorProfileElementTag( handle, index, &tag )) && tag != expect) index++;
+ while ((ret = GetColorProfileElementTag( handle, index, &tag )) && tag != expect) index++;
ok( ret && tag == expect, "GetColorProfileElementTag() failed (%lu)\n", GetLastError() );
- pCloseColorProfile( handle );
+ CloseColorProfile( handle );
}
}
@@ -315,29 +232,25 @@ static void test_GetColorProfileFromHandle( char *testprofile )
profile.pProfileData = testprofile;
profile.cbDataSize = strlen(testprofile);
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
/* Parameter checks */
-
size = 0;
-
- ret = pGetColorProfileFromHandle( handle, NULL, &size );
+ ret = GetColorProfileFromHandle( handle, NULL, &size );
ok( !ret && size > 0, "GetColorProfileFromHandle() failed (%lu)\n", GetLastError() );
buffer = HeapAlloc( GetProcessHeap(), 0, size );
-
if (buffer)
{
- ret = pGetColorProfileFromHandle( NULL, buffer, &size );
+ ret = GetColorProfileFromHandle( NULL, buffer, &size );
ok( !ret, "GetColorProfileFromHandle() succeeded (%lu)\n", GetLastError() );
- ret = pGetColorProfileFromHandle( handle, buffer, NULL );
+ ret = GetColorProfileFromHandle( handle, buffer, NULL );
ok( !ret, "GetColorProfileFromHandle() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
- ret = pGetColorProfileFromHandle( handle, buffer, &size );
+ ret = GetColorProfileFromHandle( handle, buffer, &size );
ok( ret && size > 0, "GetColorProfileFromHandle() failed (%lu)\n", GetLastError() );
header = (PROFILEHEADER *)buffer;
@@ -350,11 +263,10 @@ static void test_GetColorProfileFromHandle( char *testprofile )
ok( header->phIlluminant.ciexyzX == 0xd6f60000, "wrong phIlluminant.ciexyzX %lx\n", header->phIlluminant.ciexyzX );
ok( header->phIlluminant.ciexyzY == 0x00000100, "wrong phIlluminant.ciexyzY %lx\n", header->phIlluminant.ciexyzY );
ok( header->phIlluminant.ciexyzZ == 0x2dd30000, "wrong phIlluminant.ciexyzZ %lx\n", header->phIlluminant.ciexyzZ );
-
HeapFree( GetProcessHeap(), 0, buffer );
}
- pCloseColorProfile( handle );
+ CloseColorProfile( handle );
}
}
@@ -371,26 +283,24 @@ static void test_GetColorProfileHeader( char *testprofile )
profile.pProfileData = testprofile;
profile.cbDataSize = strlen(testprofile);
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
/* Parameter checks */
-
- ret = pGetColorProfileHeader( NULL, NULL );
+ ret = GetColorProfileHeader( NULL, NULL );
ok( !ret, "GetColorProfileHeader() succeeded (%lu)\n", GetLastError() );
- ret = pGetColorProfileHeader( NULL, &header );
+ ret = GetColorProfileHeader( NULL, &header );
ok( !ret, "GetColorProfileHeader() succeeded (%lu)\n", GetLastError() );
if (0) /* Crashes on Vista */
{
- ret = pGetColorProfileHeader( handle, NULL );
- ok( !ret, "GetColorProfileHeader() succeeded (%lu)\n", GetLastError() );
+ ret = GetColorProfileHeader( handle, NULL );
+ ok( !ret, "GetColorProfileHeader() succeeded (%lu)\n", GetLastError() );
}
/* Functional checks */
-
- ret = pGetColorProfileHeader( handle, &header );
+ ret = GetColorProfileHeader( handle, &header );
ok( ret, "GetColorProfileHeader() failed (%lu)\n", GetLastError() );
ok( header.phClass == 0x6d6e7472, "wrong phClass %#lx\n", header.phClass );
@@ -403,7 +313,7 @@ static void test_GetColorProfileHeader( char *testprofile )
ok( header.phIlluminant.ciexyzY == 0x00010000, "wrong phIlluminant.ciexyzY %#lx\n", header.phIlluminant.ciexyzY );
ok( header.phIlluminant.ciexyzZ == 0x0000d32d, "wrong phIlluminant.ciexyzZ %#lx\n", header.phIlluminant.ciexyzZ );
- pCloseColorProfile( handle );
+ CloseColorProfile( handle );
}
}
@@ -420,24 +330,22 @@ static void test_GetCountColorProfileElements( char *standardprofile )
profile.pProfileData = standardprofile;
profile.cbDataSize = strlen(standardprofile);
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
/* Parameter checks */
-
- ret = pGetCountColorProfileElements( NULL, &count );
+ ret = GetCountColorProfileElements( NULL, &count );
ok( !ret, "GetCountColorProfileElements() succeeded (%lu)\n", GetLastError() );
- ret = pGetCountColorProfileElements( handle, NULL );
+ ret = GetCountColorProfileElements( handle, NULL );
ok( !ret, "GetCountColorProfileElements() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
- ret = pGetCountColorProfileElements( handle, &count );
+ ret = GetCountColorProfileElements( handle, &count );
ok( ret && count > 15 && count < 20,
"GetCountColorProfileElements() failed (%lu) %lu\n", GetLastError(), count );
- pCloseColorProfile( handle );
+ CloseColorProfile( handle );
}
}
@@ -448,75 +356,70 @@ static void test_GetStandardColorSpaceProfileA( char *standardprofile )
CHAR oldprofile[MAX_PATH];
CHAR newprofile[MAX_PATH];
- /* Parameter checks */
-
/* Single invalid parameter checks: */
-
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* 1st param, */
- ret = pGetStandardColorSpaceProfileA(machine, LCS_sRGB, newprofile, &size);
+ ret = GetStandardColorSpaceProfileA(machine, LCS_sRGB, newprofile, &size);
ok( !ret && GetLastError() == ERROR_NOT_SUPPORTED, "GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n",
ret, GetLastError() );
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* 2nd param, */
- ret = pGetStandardColorSpaceProfileA(NULL, (DWORD)-1, newprofile, &size);
+ ret = GetStandardColorSpaceProfileA(NULL, (DWORD)-1, newprofile, &size);
ok( !ret && GetLastError() == ERROR_FILE_NOT_FOUND, "GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n",
ret, GetLastError() );
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* 4th param, */
- ret = pGetStandardColorSpaceProfileA(NULL, LCS_sRGB, newprofile, NULL);
+ ret = GetStandardColorSpaceProfileA(NULL, LCS_sRGB, newprofile, NULL);
ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, "GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n",
ret, GetLastError() );
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* 3rd param, */
- ret = pGetStandardColorSpaceProfileA(NULL, LCS_sRGB, NULL, &size);
+ ret = GetStandardColorSpaceProfileA(NULL, LCS_sRGB, NULL, &size);
ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n",
ret, GetLastError() );
size = 0;
SetLastError(0xfaceabee); /* dereferenced 4th param, */
- ret = pGetStandardColorSpaceProfileA(NULL, LCS_sRGB, newprofile, &size);
+ ret = GetStandardColorSpaceProfileA(NULL, LCS_sRGB, newprofile, &size);
ok( !ret && (GetLastError() == ERROR_MORE_DATA || GetLastError() == ERROR_INSUFFICIENT_BUFFER),
"GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n", ret, GetLastError() );
/* Several invalid parameter checks: */
-
size = 0;
SetLastError(0xfaceabee); /* 1st, maybe 2nd and then dereferenced 4th param, */
- ret = pGetStandardColorSpaceProfileA(machine, 0, newprofile, &size);
+ ret = GetStandardColorSpaceProfileA(machine, 0, newprofile, &size);
ok( !ret && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_NOT_SUPPORTED),
"GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n", ret, GetLastError() );
SetLastError(0xfaceabee); /* maybe 2nd and then 4th param, */
- ret = pGetStandardColorSpaceProfileA(NULL, 0, newprofile, NULL);
+ ret = GetStandardColorSpaceProfileA(NULL, 0, newprofile, NULL);
ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, "GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n",
ret, GetLastError() );
size = 0;
SetLastError(0xfaceabee); /* maybe 2nd, then 3rd and dereferenced 4th param, */
- ret = pGetStandardColorSpaceProfileA(NULL, 0, NULL, &size);
+ ret = GetStandardColorSpaceProfileA(NULL, 0, NULL, &size);
ok( !ret && (GetLastError() == ERROR_INSUFFICIENT_BUFFER || GetLastError() == ERROR_FILE_NOT_FOUND),
"GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n", ret, GetLastError() );
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* maybe 2nd param. */
- ret = pGetStandardColorSpaceProfileA(NULL, 0, newprofile, &size);
+ ret = GetStandardColorSpaceProfileA(NULL, 0, newprofile, &size);
if (!ret) ok( GetLastError() == ERROR_FILE_NOT_FOUND, "GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n",
ret, GetLastError() );
else ok( !lstrcmpiA( newprofile, "" ) && GetLastError() == 0xfaceabee,
"GetStandardColorSpaceProfileA() returns %d (GLE=%lu)\n", ret, GetLastError() );
/* Functional checks */
-
size = sizeof(oldprofile);
- ret = pGetStandardColorSpaceProfileA( NULL, LCS_sRGB, oldprofile, &size );
+ ret = GetStandardColorSpaceProfileA( NULL, LCS_sRGB, oldprofile, &size );
ok( ret, "GetStandardColorSpaceProfileA() failed (%lu)\n", GetLastError() );
SetLastError(0xdeadbeef);
- ret = pSetStandardColorSpaceProfileA( NULL, LCS_sRGB, standardprofile );
+ ret = SetStandardColorSpaceProfileA( NULL, LCS_sRGB, standardprofile );
if (!ret && (GetLastError() == ERROR_ACCESS_DENIED))
{
skip("Not enough rights for SetStandardColorSpaceProfileA\n");
@@ -525,10 +428,10 @@ static void test_GetStandardColorSpaceProfileA( char *standardprofile )
ok( ret, "SetStandardColorSpaceProfileA() failed (%lu)\n", GetLastError() );
size = sizeof(newprofile);
- ret = pGetStandardColorSpaceProfileA( NULL, LCS_sRGB, newprofile, &size );
+ ret = GetStandardColorSpaceProfileA( NULL, LCS_sRGB, newprofile, &size );
ok( ret, "GetStandardColorSpaceProfileA() failed (%lu)\n", GetLastError() );
- ret = pSetStandardColorSpaceProfileA( NULL, LCS_sRGB, oldprofile );
+ ret = SetStandardColorSpaceProfileA( NULL, LCS_sRGB, oldprofile );
ok( ret, "SetStandardColorSpaceProfileA() failed (%lu)\n", GetLastError() );
}
@@ -540,77 +443,69 @@ static void test_GetStandardColorSpaceProfileW( WCHAR *standardprofileW )
WCHAR newprofile[MAX_PATH];
CHAR newprofileA[MAX_PATH];
- /* Parameter checks */
-
/* Single invalid parameter checks: */
-
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* 1st param, */
- ret = pGetStandardColorSpaceProfileW(machineW, LCS_sRGB, newprofile, &size);
+ ret = GetStandardColorSpaceProfileW(machineW, LCS_sRGB, newprofile, &size);
ok( !ret && GetLastError() == ERROR_NOT_SUPPORTED, "GetStandardColorSpaceProfileW() returns %d (GLE=%lu)\n",
ret, GetLastError() );
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* 2nd param, */
- ret = pGetStandardColorSpaceProfileW(NULL, (DWORD)-1, newprofile, &size);
+ ret = GetStandardColorSpaceProfileW(NULL, (DWORD)-1, newprofile, &size);
ok( !ret && GetLastError() == ERROR_FILE_NOT_FOUND, "GetStandardColorSpaceProfileW() returns %d (GLE=%lu)\n",
ret, GetLastError() );
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* 2nd param, */
- ret = pGetStandardColorSpaceProfileW(NULL, 0, newprofile, &size);
- ok( (!ret && GetLastError() == ERROR_FILE_NOT_FOUND) ||
- broken(ret), /* Win98 and WinME */
+ ret = GetStandardColorSpaceProfileW(NULL, 0, newprofile, &size);
+ ok( !ret && GetLastError() == ERROR_FILE_NOT_FOUND,
"GetStandardColorSpaceProfileW() returns %d (GLE=%lu)\n", ret, GetLastError() );
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* 3rd param, */
- ret = pGetStandardColorSpaceProfileW(NULL, LCS_sRGB, NULL, &size);
- ok( !ret || broken(ret) /* win98 */, "GetStandardColorSpaceProfileW succeeded\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
- broken(GetLastError() == 0xfaceabee) /* win98 */,
+ ret = GetStandardColorSpaceProfileW(NULL, LCS_sRGB, NULL, &size);
+ ok( !ret, "GetStandardColorSpaceProfileW succeeded\n" );
+ ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"GetStandardColorSpaceProfileW() returns GLE=%lu\n", GetLastError() );
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* 4th param, */
- ret = pGetStandardColorSpaceProfileW(NULL, LCS_sRGB, newprofile, NULL);
+ ret = GetStandardColorSpaceProfileW(NULL, LCS_sRGB, newprofile, NULL);
ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, "GetStandardColorSpaceProfileW() returns %d (GLE=%lu)\n",
ret, GetLastError() );
size = 0;
SetLastError(0xfaceabee); /* dereferenced 4th param. */
- ret = pGetStandardColorSpaceProfileW(NULL, LCS_sRGB, newprofile, &size);
- ok( !ret || broken(ret) /* win98 */, "GetStandardColorSpaceProfileW succeeded\n" );
+ ret = GetStandardColorSpaceProfileW(NULL, LCS_sRGB, newprofile, &size);
+ ok( !ret, "GetStandardColorSpaceProfileW succeeded\n" );
ok( GetLastError() == ERROR_MORE_DATA ||
- GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
- broken(GetLastError() == 0xfaceabee) /* win98 */,
+ GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"GetStandardColorSpaceProfileW() returns GLE=%lu\n", GetLastError() );
/* Several invalid parameter checks: */
-
size = 0;
SetLastError(0xfaceabee); /* 1st, maybe 2nd and then dereferenced 4th param, */
- ret = pGetStandardColorSpaceProfileW(machineW, 0, newprofile, &size);
+ ret = GetStandardColorSpaceProfileW(machineW, 0, newprofile, &size);
ok( !ret && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_NOT_SUPPORTED),
"GetStandardColorSpaceProfileW() returns %d (GLE=%lu)\n", ret, GetLastError() );
SetLastError(0xfaceabee); /* maybe 2nd and then 4th param, */
- ret = pGetStandardColorSpaceProfileW(NULL, 0, newprofile, NULL);
+ ret = GetStandardColorSpaceProfileW(NULL, 0, newprofile, NULL);
ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, "GetStandardColorSpaceProfileW() returns %d (GLE=%lu)\n",
ret, GetLastError() );
size = 0;
SetLastError(0xfaceabee); /* maybe 2nd, then 3rd and dereferenced 4th param, */
- ret = pGetStandardColorSpaceProfileW(NULL, 0, NULL, &size);
- ok( !ret || broken(ret) /* win98 */, "GetStandardColorSpaceProfileW succeeded\n" );
+ ret = GetStandardColorSpaceProfileW(NULL, 0, NULL, &size);
+ ok( !ret, "GetStandardColorSpaceProfileW succeeded\n" );
ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
- GetLastError() == ERROR_FILE_NOT_FOUND ||
- broken(GetLastError() == 0xfaceabee) /* win98 */,
+ GetLastError() == ERROR_FILE_NOT_FOUND,
"GetStandardColorSpaceProfileW() returns GLE=%lu\n", GetLastError() );
size = sizeof(newprofile);
SetLastError(0xfaceabee); /* maybe 2nd param. */
- ret = pGetStandardColorSpaceProfileW(NULL, 0, newprofile, &size);
+ ret = GetStandardColorSpaceProfileW(NULL, 0, newprofile, &size);
if (!ret) ok( GetLastError() == ERROR_FILE_NOT_FOUND, "GetStandardColorSpaceProfileW() returns %d (GLE=%lu)\n",
ret, GetLastError() );
else
@@ -621,13 +516,12 @@ static void test_GetStandardColorSpaceProfileW( WCHAR *standardprofileW )
}
/* Functional checks */
-
size = sizeof(oldprofile);
- ret = pGetStandardColorSpaceProfileW( NULL, LCS_sRGB, oldprofile, &size );
+ ret = GetStandardColorSpaceProfileW( NULL, LCS_sRGB, oldprofile, &size );
ok( ret, "GetStandardColorSpaceProfileW() failed (%lu)\n", GetLastError() );
SetLastError(0xdeadbeef);
- ret = pSetStandardColorSpaceProfileW( NULL, LCS_sRGB, standardprofileW );
+ ret = SetStandardColorSpaceProfileW( NULL, LCS_sRGB, standardprofileW );
if (!ret && (GetLastError() == ERROR_ACCESS_DENIED))
{
skip("Not enough rights for SetStandardColorSpaceProfileW\n");
@@ -636,10 +530,10 @@ static void test_GetStandardColorSpaceProfileW( WCHAR *standardprofileW )
ok( ret, "SetStandardColorSpaceProfileW() failed (%lu)\n", GetLastError() );
size = sizeof(newprofile);
- ret = pGetStandardColorSpaceProfileW( NULL, LCS_sRGB, newprofile, &size );
+ ret = GetStandardColorSpaceProfileW( NULL, LCS_sRGB, newprofile, &size );
ok( ret, "GetStandardColorSpaceProfileW() failed (%lu)\n", GetLastError() );
- ret = pSetStandardColorSpaceProfileW( NULL, LCS_sRGB, oldprofile );
+ ret = SetStandardColorSpaceProfileW( NULL, LCS_sRGB, oldprofile );
ok( ret, "SetStandardColorSpaceProfileW() failed (%lu)\n", GetLastError() );
}
@@ -651,9 +545,7 @@ static void test_EnumColorProfilesA( char *standardprofile )
BYTE *buffer;
/* Parameter checks */
-
memset( &record, 0, sizeof(ENUMTYPEA) );
-
record.dwSize = sizeof(ENUMTYPEA);
record.dwVersion = ENUM_TYPE_VERSION;
record.dwFields |= ET_DATACOLORSPACE;
@@ -661,33 +553,32 @@ static void test_EnumColorProfilesA( char *standardprofile )
total = 0;
SetLastError( 0xdeadbeef );
- ret = pEnumColorProfilesA( NULL, &record, NULL, &total, &number );
+ ret = EnumColorProfilesA( NULL, &record, NULL, &total, &number );
ok( !ret, "EnumColorProfilesA succeeded\n" );
if (have_color_profile) ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", GetLastError() );
buffer = HeapAlloc( GetProcessHeap(), 0, total );
size = total;
- ret = pEnumColorProfilesA( machine, &record, buffer, &size, &number );
+ ret = EnumColorProfilesA( machine, &record, buffer, &size, &number );
ok( !ret, "EnumColorProfilesA succeeded\n" );
- ret = pEnumColorProfilesA( NULL, NULL, buffer, &size, &number );
+ ret = EnumColorProfilesA( NULL, NULL, buffer, &size, &number );
ok( !ret, "EnumColorProfilesA succeeded\n" );
- ret = pEnumColorProfilesA( NULL, &record, buffer, NULL, &number );
+ ret = EnumColorProfilesA( NULL, &record, buffer, NULL, &number );
ok( !ret, "EnumColorProfilesA succeeded\n" );
- ret = pEnumColorProfilesA( NULL, &record, buffer, &size, &number );
+ ret = EnumColorProfilesA( NULL, &record, buffer, &size, &number );
todo_wine_if (!have_color_profile)
ok( ret, "EnumColorProfilesA failed %lu\n", GetLastError() );
size = 0;
- ret = pEnumColorProfilesA( NULL, &record, buffer, &size, &number );
+ ret = EnumColorProfilesA( NULL, &record, buffer, &size, &number );
ok( !ret, "EnumColorProfilesA succeeded\n" );
/* Functional checks */
-
size = total;
- ret = pEnumColorProfilesA( NULL, &record, buffer, &size, &number );
+ ret = EnumColorProfilesA( NULL, &record, buffer, &size, &number );
todo_wine_if (!have_color_profile)
ok( ret, "EnumColorProfilesA failed %lu\n", GetLastError() );
@@ -702,9 +593,7 @@ static void test_EnumColorProfilesW( WCHAR *standardprofileW )
BYTE *buffer;
/* Parameter checks */
-
memset( &record, 0, sizeof(ENUMTYPEW) );
-
record.dwSize = sizeof(ENUMTYPEW);
record.dwVersion = ENUM_TYPE_VERSION;
record.dwFields |= ET_DATACOLORSPACE;
@@ -712,33 +601,32 @@ static void test_EnumColorProfilesW( WCHAR *standardprofileW )
total = 0;
SetLastError( 0xdeadbeef );
- ret = pEnumColorProfilesW( NULL, &record, NULL, &total, &number );
+ ret = EnumColorProfilesW( NULL, &record, NULL, &total, &number );
ok( !ret, "EnumColorProfilesW succeeded\n" );
if (have_color_profile) ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", GetLastError() );
buffer = HeapAlloc( GetProcessHeap(), 0, total * sizeof(WCHAR) );
size = total;
- ret = pEnumColorProfilesW( machineW, &record, buffer, &size, &number );
+ ret = EnumColorProfilesW( machineW, &record, buffer, &size, &number );
ok( !ret, "EnumColorProfilesW succeeded\n" );
- ret = pEnumColorProfilesW( NULL, NULL, buffer, &size, &number );
+ ret = EnumColorProfilesW( NULL, NULL, buffer, &size, &number );
ok( !ret, "EnumColorProfilesW succeeded\n" );
- ret = pEnumColorProfilesW( NULL, &record, buffer, NULL, &number );
+ ret = EnumColorProfilesW( NULL, &record, buffer, NULL, &number );
ok( !ret, "EnumColorProfilesW succeeded\n" );
- ret = pEnumColorProfilesW( NULL, &record, buffer, &size, &number );
+ ret = EnumColorProfilesW( NULL, &record, buffer, &size, &number );
todo_wine_if (!have_color_profile)
ok( ret, "EnumColorProfilesW failed %lu\n", GetLastError() );
size = 0;
- ret = pEnumColorProfilesW( NULL, &record, buffer, &size, &number );
+ ret = EnumColorProfilesW( NULL, &record, buffer, &size, &number );
ok( !ret, "EnumColorProfilesW succeeded\n" );
/* Functional checks */
-
size = total;
- ret = pEnumColorProfilesW( NULL, &record, buffer, &size, &number );
+ ret = EnumColorProfilesW( NULL, &record, buffer, &size, &number );
todo_wine_if (!have_color_profile)
ok( ret, "EnumColorProfilesW failed %lu\n", GetLastError() );
@@ -750,24 +638,22 @@ static void test_InstallColorProfileA( char *standardprofile, char *testprofile
BOOL ret;
/* Parameter checks */
-
- ret = pInstallColorProfileA( NULL, NULL );
+ ret = InstallColorProfileA( NULL, NULL );
ok( !ret, "InstallColorProfileA() succeeded (%lu)\n", GetLastError() );
- ret = pInstallColorProfileA( machine, NULL );
+ ret = InstallColorProfileA( machine, NULL );
ok( !ret, "InstallColorProfileA() succeeded (%lu)\n", GetLastError() );
- ret = pInstallColorProfileA( NULL, machine );
+ ret = InstallColorProfileA( NULL, machine );
ok( !ret, "InstallColorProfileA() succeeded (%lu)\n", GetLastError() );
if (standardprofile)
{
- ret = pInstallColorProfileA( NULL, standardprofile );
+ ret = InstallColorProfileA( NULL, standardprofile );
ok( ret, "InstallColorProfileA() failed (%lu)\n", GetLastError() );
}
/* Functional checks */
-
if (testprofile)
{
CHAR dest[MAX_PATH], base[MAX_PATH];
@@ -775,7 +661,7 @@ static void test_InstallColorProfileA( char *standardprofile, char *testprofile
HANDLE handle;
SetLastError(0xdeadbeef);
- ret = pInstallColorProfileA( NULL, testprofile );
+ ret = InstallColorProfileA( NULL, testprofile );
if (!ret && (GetLastError() == ERROR_ACCESS_DENIED))
{
skip("Not enough rights for InstallColorProfileA\n");
@@ -783,7 +669,7 @@ static void test_InstallColorProfileA( char *standardprofile, char *testprofile
}
ok( ret, "InstallColorProfileA() failed (%lu)\n", GetLastError() );
- ret = pGetColorDirectoryA( NULL, dest, &size );
+ ret = GetColorDirectoryA( NULL, dest, &size );
ok( ret, "GetColorDirectoryA() failed (%lu)\n", GetLastError() );
MSCMS_basenameA( testprofile, base );
@@ -795,8 +681,8 @@ static void test_InstallColorProfileA( char *standardprofile, char *testprofile
handle = CreateFileA( dest, 0 , 0, NULL, OPEN_EXISTING, 0, NULL );
ok( handle != INVALID_HANDLE_VALUE, "Couldn't find the profile (%lu)\n", GetLastError() );
CloseHandle( handle );
-
- ret = pUninstallColorProfileA( NULL, dest, TRUE );
+
+ ret = UninstallColorProfileA( NULL, dest, TRUE );
ok( ret, "UninstallColorProfileA() failed (%lu)\n", GetLastError() );
}
}
@@ -806,24 +692,22 @@ static void test_InstallColorProfileW( WCHAR *standardprofileW, WCHAR *testprofi
BOOL ret;
/* Parameter checks */
-
- ret = pInstallColorProfileW( NULL, NULL );
+ ret = InstallColorProfileW( NULL, NULL );
ok( !ret, "InstallColorProfileW() succeeded (%lu)\n", GetLastError() );
- ret = pInstallColorProfileW( machineW, NULL );
+ ret = InstallColorProfileW( machineW, NULL );
ok( !ret, "InstallColorProfileW() succeeded (%lu)\n", GetLastError() );
- ret = pInstallColorProfileW( NULL, machineW );
+ ret = InstallColorProfileW( NULL, machineW );
ok( !ret, "InstallColorProfileW() failed (%lu)\n", GetLastError() );
if (standardprofileW)
{
- ret = pInstallColorProfileW( NULL, standardprofileW );
+ ret = InstallColorProfileW( NULL, standardprofileW );
ok( ret, "InstallColorProfileW() failed (%lu)\n", GetLastError() );
}
/* Functional checks */
-
if (testprofileW)
{
WCHAR dest[MAX_PATH], base[MAX_PATH];
@@ -831,7 +715,7 @@ static void test_InstallColorProfileW( WCHAR *standardprofileW, WCHAR *testprofi
HANDLE handle;
SetLastError(0xdeadbeef);
- ret = pInstallColorProfileW( NULL, testprofileW );
+ ret = InstallColorProfileW( NULL, testprofileW );
if (!ret && (GetLastError() == ERROR_ACCESS_DENIED))
{
skip("Not enough rights for InstallColorProfileW\n");
@@ -839,11 +723,10 @@ static void test_InstallColorProfileW( WCHAR *standardprofileW, WCHAR *testprofi
}
ok( ret, "InstallColorProfileW() failed (%lu)\n", GetLastError() );
- ret = pGetColorDirectoryW( NULL, dest, &size );
+ ret = GetColorDirectoryW( NULL, dest, &size );
ok( ret, "GetColorDirectoryW() failed (%lu)\n", GetLastError() );
MSCMS_basenameW( testprofileW, base );
-
lstrcatW( dest, L"\\" );
lstrcatW( dest, base );
@@ -852,7 +735,7 @@ static void test_InstallColorProfileW( WCHAR *standardprofileW, WCHAR *testprofi
ok( handle != INVALID_HANDLE_VALUE, "Couldn't find the profile (%lu)\n", GetLastError() );
CloseHandle( handle );
- ret = pUninstallColorProfileW( NULL, dest, TRUE );
+ ret = UninstallColorProfileW( NULL, dest, TRUE );
ok( ret, "UninstallColorProfileW() failed (%lu)\n", GetLastError() );
}
}
@@ -870,30 +753,26 @@ static void test_IsColorProfileTagPresent( char *standardprofile )
profile.pProfileData = standardprofile;
profile.cbDataSize = strlen(standardprofile);
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
/* Parameter checks */
-
tag = 0;
-
- ret = pIsColorProfileTagPresent( handle, tag, &present );
+ ret = IsColorProfileTagPresent( handle, tag, &present );
ok( !(ret && present), "IsColorProfileTagPresent() succeeded (%lu)\n", GetLastError() );
tag = 0x63707274; /* 'cprt' */
-
- ret = pIsColorProfileTagPresent( NULL, tag, &present );
+ ret = IsColorProfileTagPresent( NULL, tag, &present );
ok( !ret, "IsColorProfileTagPresent() succeeded (%lu)\n", GetLastError() );
- ret = pIsColorProfileTagPresent( handle, tag, NULL );
+ ret = IsColorProfileTagPresent( handle, tag, NULL );
ok( !ret, "IsColorProfileTagPresent() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
- ret = pIsColorProfileTagPresent( handle, tag, &present );
+ ret = IsColorProfileTagPresent( handle, tag, &present );
ok( ret && present, "IsColorProfileTagPresent() failed (%lu)\n", GetLastError() );
- pCloseColorProfile( handle );
+ CloseColorProfile( handle );
}
}
@@ -908,51 +787,49 @@ static void test_OpenColorProfileA( char *standardprofile )
profile.cbDataSize = 0;
/* Parameter checks */
-
- handle = pOpenColorProfileA( NULL, 0, 0, 0 );
+ handle = OpenColorProfileA( NULL, 0, 0, 0 );
ok( handle == NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileA( &profile, 0, 0, 0 );
+ handle = OpenColorProfileA( &profile, 0, 0, 0 );
ok( handle == NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, 0 );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, 0 );
ok( handle == NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileA( &profile, PROFILE_READWRITE, 0, 0 );
+ handle = OpenColorProfileA( &profile, PROFILE_READWRITE, 0, 0 );
ok( handle == NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- ok ( !pCloseColorProfile( NULL ), "CloseColorProfile() succeeded\n" );
+ ok( !CloseColorProfile( NULL ), "CloseColorProfile() succeeded\n" );
if (standardprofile)
{
profile.pProfileData = standardprofile;
profile.cbDataSize = strlen(standardprofile);
- handle = pOpenColorProfileA( &profile, 0, 0, 0 );
+ handle = OpenColorProfileA( &profile, 0, 0, 0 );
ok( handle == NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, 0 );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, 0 );
ok( handle == NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileA( &profile, PROFILE_READ|PROFILE_READWRITE, 0, 0 );
+ handle = OpenColorProfileA( &profile, PROFILE_READ|PROFILE_READWRITE, 0, 0 );
ok( handle == NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
/* Functional checks */
-
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- ret = pCloseColorProfile( handle );
+ ret = CloseColorProfile( handle );
ok( ret, "CloseColorProfile() failed (%lu)\n", GetLastError() );
profile.dwType = PROFILE_FILENAME;
profile.pProfileData = (void *)"sRGB Color Space Profile.icm";
profile.cbDataSize = sizeof("sRGB Color Space Profile.icm");
- handle = pOpenColorProfileA( &profile, PROFILE_READ, FILE_SHARE_READ, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, FILE_SHARE_READ, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- ret = pCloseColorProfile( handle );
+ ret = CloseColorProfile( handle );
ok( ret, "CloseColorProfile() failed (%lu)\n", GetLastError() );
}
}
@@ -968,41 +845,39 @@ static void test_OpenColorProfileW( WCHAR *standardprofileW )
profile.cbDataSize = 0;
/* Parameter checks */
-
- handle = pOpenColorProfileW( NULL, 0, 0, 0 );
+ handle = OpenColorProfileW( NULL, 0, 0, 0 );
ok( handle == NULL, "OpenColorProfileW() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileW( &profile, 0, 0, 0 );
+ handle = OpenColorProfileW( &profile, 0, 0, 0 );
ok( handle == NULL, "OpenColorProfileW() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileW( &profile, PROFILE_READ, 0, 0 );
+ handle = OpenColorProfileW( &profile, PROFILE_READ, 0, 0 );
ok( handle == NULL, "OpenColorProfileW() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileW( &profile, PROFILE_READWRITE, 0, 0 );
+ handle = OpenColorProfileW( &profile, PROFILE_READWRITE, 0, 0 );
ok( handle == NULL, "OpenColorProfileW() failed (%lu)\n", GetLastError() );
- ok ( !pCloseColorProfile( NULL ), "CloseColorProfile() succeeded\n" );
+ ok( !CloseColorProfile( NULL ), "CloseColorProfile() succeeded\n" );
if (standardprofileW)
{
profile.pProfileData = standardprofileW;
profile.cbDataSize = lstrlenW(standardprofileW) * sizeof(WCHAR);
- handle = pOpenColorProfileW( &profile, 0, 0, 0 );
+ handle = OpenColorProfileW( &profile, 0, 0, 0 );
ok( handle == NULL, "OpenColorProfileW() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileW( &profile, PROFILE_READ, 0, 0 );
+ handle = OpenColorProfileW( &profile, PROFILE_READ, 0, 0 );
ok( handle == NULL, "OpenColorProfileW() failed (%lu)\n", GetLastError() );
- handle = pOpenColorProfileW( &profile, PROFILE_READ|PROFILE_READWRITE, 0, 0 );
+ handle = OpenColorProfileW( &profile, PROFILE_READ|PROFILE_READWRITE, 0, 0 );
ok( handle == NULL, "OpenColorProfileW() failed (%lu)\n", GetLastError() );
/* Functional checks */
-
- handle = pOpenColorProfileW( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileW( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileW() failed (%lu)\n", GetLastError() );
- ret = pCloseColorProfile( handle );
+ ret = CloseColorProfile( handle );
ok( ret, "CloseColorProfile() failed (%lu)\n", GetLastError() );
}
}
@@ -1025,45 +900,42 @@ static void test_SetColorProfileElement( char *testprofile )
profile.cbDataSize = strlen(testprofile);
/* Parameter checks */
-
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- ret = pSetColorProfileElement( handle, tag, 0, &size, data );
+ ret = SetColorProfileElement( handle, tag, 0, &size, data );
ok( !ret, "SetColorProfileElement() succeeded (%lu)\n", GetLastError() );
+ CloseColorProfile( handle );
- pCloseColorProfile( handle );
-
- handle = pOpenColorProfileA( &profile, PROFILE_READWRITE, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READWRITE, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- ret = pSetColorProfileElement( NULL, 0, 0, NULL, NULL );
+ ret = SetColorProfileElement( NULL, 0, 0, NULL, NULL );
ok( !ret, "SetColorProfileElement() succeeded (%lu)\n", GetLastError() );
- ret = pSetColorProfileElement( handle, 0, 0, NULL, NULL );
+ ret = SetColorProfileElement( handle, 0, 0, NULL, NULL );
ok( !ret, "SetColorProfileElement() succeeded (%lu)\n", GetLastError() );
- ret = pSetColorProfileElement( handle, tag, 0, NULL, NULL );
+ ret = SetColorProfileElement( handle, tag, 0, NULL, NULL );
ok( !ret, "SetColorProfileElement() succeeded (%lu)\n", GetLastError() );
- ret = pSetColorProfileElement( handle, tag, 0, &size, NULL );
+ ret = SetColorProfileElement( handle, tag, 0, &size, NULL );
ok( !ret, "SetColorProfileElement() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
size = sizeof(data);
- ret = pSetColorProfileElement( handle, tag, 0, &size, data );
+ ret = SetColorProfileElement( handle, tag, 0, &size, data );
ok( ret, "SetColorProfileElement() failed %lu\n", GetLastError() );
size = sizeof(buffer);
- ret = pGetColorProfileElement( handle, tag, 0, &size, buffer, &ref );
+ ret = GetColorProfileElement( handle, tag, 0, &size, buffer, &ref );
ok( ret, "GetColorProfileElement() failed %lu\n", GetLastError() );
ok( size > 0, "wrong size\n" );
ok( !memcmp( data, buffer, sizeof(data) ),
"Unexpected tag data, expected %s, got %s (%lu)\n", data, buffer, GetLastError() );
- pCloseColorProfile( handle );
+ CloseColorProfile( handle );
}
}
@@ -1103,38 +975,33 @@ static void test_SetColorProfileHeader( char *testprofile )
header.phCreator = 0x48502020;
/* Parameter checks */
-
- handle = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- ret = pSetColorProfileHeader( handle, &header );
+ ret = SetColorProfileHeader( handle, &header );
ok( !ret, "SetColorProfileHeader() succeeded (%lu)\n", GetLastError() );
+ CloseColorProfile( handle );
- pCloseColorProfile( handle );
-
- handle = pOpenColorProfileA( &profile, PROFILE_READWRITE, 0, OPEN_EXISTING );
+ handle = OpenColorProfileA( &profile, PROFILE_READWRITE, 0, OPEN_EXISTING );
ok( handle != NULL, "OpenColorProfileA() failed (%lu)\n", GetLastError() );
- ret = pSetColorProfileHeader( NULL, NULL );
+ ret = SetColorProfileHeader( NULL, NULL );
ok( !ret, "SetColorProfileHeader() succeeded (%lu)\n", GetLastError() );
- ret = pSetColorProfileHeader( handle, NULL );
+ ret = SetColorProfileHeader( handle, NULL );
ok( !ret, "SetColorProfileHeader() succeeded (%lu)\n", GetLastError() );
- ret = pSetColorProfileHeader( NULL, &header );
+ ret = SetColorProfileHeader( NULL, &header );
ok( !ret, "SetColorProfileHeader() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
- ret = pSetColorProfileHeader( handle, &header );
+ ret = SetColorProfileHeader( handle, &header );
ok( ret, "SetColorProfileHeader() failed (%lu)\n", GetLastError() );
- ret = pGetColorProfileHeader( handle, &header );
+ ret = GetColorProfileHeader( handle, &header );
ok( ret, "GetColorProfileHeader() failed (%lu)\n", GetLastError() );
-
ok( !memcmp( &header, rgbheader, sizeof(rgbheader) ), "Unexpected header data\n" );
-
- pCloseColorProfile( handle );
+ CloseColorProfile( handle );
}
}
@@ -1143,15 +1010,13 @@ static void test_UninstallColorProfileA( char *testprofile )
BOOL ret;
/* Parameter checks */
-
- ret = pUninstallColorProfileA( NULL, NULL, FALSE );
+ ret = UninstallColorProfileA( NULL, NULL, FALSE );
ok( !ret, "UninstallColorProfileA() succeeded (%lu)\n", GetLastError() );
- ret = pUninstallColorProfileA( machine, NULL, FALSE );
+ ret = UninstallColorProfileA( machine, NULL, FALSE );
ok( !ret, "UninstallColorProfileA() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
if (testprofile)
{
CHAR dest[MAX_PATH], base[MAX_PATH];
@@ -1159,7 +1024,7 @@ static void test_UninstallColorProfileA( char *testprofile )
HANDLE handle;
SetLastError(0xdeadbeef);
- ret = pInstallColorProfileA( NULL, testprofile );
+ ret = InstallColorProfileA( NULL, testprofile );
if (!ret && (GetLastError() == ERROR_ACCESS_DENIED))
{
skip("Not enough rights for InstallColorProfileA\n");
@@ -1167,15 +1032,14 @@ static void test_UninstallColorProfileA( char *testprofile )
}
ok( ret, "InstallColorProfileA() failed (%lu)\n", GetLastError() );
- ret = pGetColorDirectoryA( NULL, dest, &size );
+ ret = GetColorDirectoryA( NULL, dest, &size );
ok( ret, "GetColorDirectoryA() failed (%lu)\n", GetLastError() );
MSCMS_basenameA( testprofile, base );
-
lstrcatA( dest, "\\" );
lstrcatA( dest, base );
- ret = pUninstallColorProfileA( NULL, dest, TRUE );
+ ret = UninstallColorProfileA( NULL, dest, TRUE );
ok( ret, "UninstallColorProfileA() failed (%lu)\n", GetLastError() );
/* Check if the profile is really gone */
@@ -1190,15 +1054,13 @@ static void test_UninstallColorProfileW( WCHAR *testprofileW )
BOOL ret;
/* Parameter checks */
-
- ret = pUninstallColorProfileW( NULL, NULL, FALSE );
+ ret = UninstallColorProfileW( NULL, NULL, FALSE );
ok( !ret, "UninstallColorProfileW() succeeded (%lu)\n", GetLastError() );
- ret = pUninstallColorProfileW( machineW, NULL, FALSE );
+ ret = UninstallColorProfileW( machineW, NULL, FALSE );
ok( !ret, "UninstallColorProfileW() succeeded (%lu)\n", GetLastError() );
/* Functional checks */
-
if (testprofileW)
{
WCHAR dest[MAX_PATH], base[MAX_PATH];
@@ -1208,7 +1070,7 @@ static void test_UninstallColorProfileW( WCHAR *testprofileW )
int bytes_copied;
SetLastError(0xdeadbeef);
- ret = pInstallColorProfileW( NULL, testprofileW );
+ ret = InstallColorProfileW( NULL, testprofileW );
if (!ret && (GetLastError() == ERROR_ACCESS_DENIED))
{
skip("Not enough rights for InstallColorProfileW\n");
@@ -1216,15 +1078,14 @@ static void test_UninstallColorProfileW( WCHAR *testprofileW )
}
ok( ret, "InstallColorProfileW() failed (%lu)\n", GetLastError() );
- ret = pGetColorDirectoryW( NULL, dest, &size );
+ ret = GetColorDirectoryW( NULL, dest, &size );
ok( ret, "GetColorDirectoryW() failed (%lu)\n", GetLastError() );
MSCMS_basenameW( testprofileW, base );
-
lstrcatW( dest, L"\\" );
lstrcatW( dest, base );
- ret = pUninstallColorProfileW( NULL, dest, TRUE );
+ ret = UninstallColorProfileW( NULL, dest, TRUE );
ok( ret, "UninstallColorProfileW() failed (%lu)\n", GetLastError() );
bytes_copied = WideCharToMultiByte(CP_ACP, 0, dest, -1, destA, MAX_PATH, NULL, NULL);
@@ -1244,69 +1105,69 @@ static void test_AssociateColorProfileWithDeviceA( char *testprofile )
DISPLAY_DEVICEA display, monitor;
BOOL res;
- if (testprofile && pEnumDisplayDevicesA)
+ if (testprofile)
{
display.cb = sizeof( DISPLAY_DEVICEA );
- res = pEnumDisplayDevicesA( NULL, 0, &display, 0 );
+ res = EnumDisplayDevicesA( NULL, 0, &display, 0 );
ok( res, "Can't get display info\n" );
monitor.cb = sizeof( DISPLAY_DEVICEA );
- res = pEnumDisplayDevicesA( display.DeviceName, 0, &monitor, 0 );
+ res = EnumDisplayDevicesA( display.DeviceName, 0, &monitor, 0 );
if (res)
{
SetLastError(0xdeadbeef);
- ret = pAssociateColorProfileWithDeviceA( "machine", testprofile, NULL );
+ ret = AssociateColorProfileWithDeviceA( "machine", testprofile, NULL );
error = GetLastError();
ok( !ret, "AssociateColorProfileWithDevice() succeeded\n" );
ok( error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error );
SetLastError(0xdeadbeef);
- ret = pAssociateColorProfileWithDeviceA( "machine", NULL, monitor.DeviceID );
+ ret = AssociateColorProfileWithDeviceA( "machine", NULL, monitor.DeviceID );
error = GetLastError();
ok( !ret, "AssociateColorProfileWithDevice() succeeded\n" );
ok( error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error );
SetLastError(0xdeadbeef);
- ret = pAssociateColorProfileWithDeviceA( "machine", testprofile, monitor.DeviceID );
+ ret = AssociateColorProfileWithDeviceA( "machine", testprofile, monitor.DeviceID );
error = GetLastError();
ok( !ret, "AssociateColorProfileWithDevice() succeeded\n" );
ok( error == ERROR_NOT_SUPPORTED, "expected ERROR_NOT_SUPPORTED, got %lu\n", error );
- ret = pInstallColorProfileA( NULL, testprofile );
+ ret = InstallColorProfileA( NULL, testprofile );
ok( ret, "InstallColorProfileA() failed (%lu)\n", GetLastError() );
- ret = pGetColorDirectoryA( NULL, profile, &size );
+ ret = GetColorDirectoryA( NULL, profile, &size );
ok( ret, "GetColorDirectoryA() failed (%lu)\n", GetLastError() );
MSCMS_basenameA( testprofile, basename );
lstrcatA( profile, "\\" );
lstrcatA( profile, basename );
- ret = pAssociateColorProfileWithDeviceA( NULL, profile, monitor.DeviceID );
+ ret = AssociateColorProfileWithDeviceA( NULL, profile, monitor.DeviceID );
ok( ret, "AssociateColorProfileWithDevice() failed (%lu)\n", GetLastError() );
SetLastError(0xdeadbeef);
- ret = pDisassociateColorProfileFromDeviceA( "machine", profile, NULL );
+ ret = DisassociateColorProfileFromDeviceA( "machine", profile, NULL );
error = GetLastError();
ok( !ret, "DisassociateColorProfileFromDeviceA() succeeded\n" );
ok( error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error );
SetLastError(0xdeadbeef);
- ret = pDisassociateColorProfileFromDeviceA( "machine", NULL, monitor.DeviceID );
+ ret = DisassociateColorProfileFromDeviceA( "machine", NULL, monitor.DeviceID );
error = GetLastError();
ok( !ret, "DisassociateColorProfileFromDeviceA() succeeded\n" );
ok( error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error );
SetLastError(0xdeadbeef);
- ret = pDisassociateColorProfileFromDeviceA( "machine", profile, monitor.DeviceID );
+ ret = DisassociateColorProfileFromDeviceA( "machine", profile, monitor.DeviceID );
error = GetLastError();
ok( !ret, "DisassociateColorProfileFromDeviceA() succeeded\n" );
ok( error == ERROR_NOT_SUPPORTED, "expected ERROR_NOT_SUPPORTED, got %lu\n", error );
- ret = pDisassociateColorProfileFromDeviceA( NULL, profile, monitor.DeviceID );
+ ret = DisassociateColorProfileFromDeviceA( NULL, profile, monitor.DeviceID );
ok( ret, "DisassociateColorProfileFromDeviceA() failed (%lu)\n", GetLastError() );
- ret = pUninstallColorProfileA( NULL, profile, TRUE );
+ ret = UninstallColorProfileA( NULL, profile, TRUE );
ok( ret, "UninstallColorProfileA() failed (%lu)\n", GetLastError() );
}
else
@@ -1321,7 +1182,7 @@ static BOOL have_profile(void)
HANDLE handle;
WIN32_FIND_DATAA data;
- if (!pGetColorDirectoryA( NULL, glob, &size )) return FALSE;
+ if (!GetColorDirectoryA( NULL, glob, &size )) return FALSE;
lstrcatA( glob, "\\*.icm" );
handle = FindFirstFileA( glob, &data );
if (handle == INVALID_HANDLE_VALUE) return FALSE;
@@ -1342,22 +1203,22 @@ static void test_CreateMultiProfileTransform( char *standardprofile, char *testp
profile.pProfileData = standardprofile;
profile.cbDataSize = strlen(standardprofile);
- handle[0] = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle[0] = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle[0] != NULL, "got %lu\n", GetLastError() );
profile.dwType = PROFILE_FILENAME;
profile.pProfileData = testprofile;
profile.cbDataSize = strlen(testprofile);
- handle[1] = pOpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
+ handle[1] = OpenColorProfileA( &profile, PROFILE_READ, 0, OPEN_EXISTING );
ok( handle[1] != NULL, "got %lu\n", GetLastError() );
- transform = pCreateMultiProfileTransform( handle, 2, intents, 2, 0, 0 );
+ transform = CreateMultiProfileTransform( handle, 2, intents, 2, 0, 0 );
ok( transform != NULL, "got %lu\n", GetLastError() );
- pDeleteColorTransform( transform );
- pCloseColorProfile( handle[0] );
- pCloseColorProfile( handle[1] );
+ DeleteColorTransform( transform );
+ CloseColorProfile( handle[0] );
+ CloseColorProfile( handle[1] );
}
}
@@ -1380,42 +1241,42 @@ static void test_TranslateBitmapBits( char *standardprofile, char *testprofile )
profile.pProfileData = standardprofile;
profile.cbDataSize = strlen(standardprofile);
- handle[0] = pOpenColorProfileA( &profile, PROFILE_READ, 1, OPEN_EXISTING );
+ handle[0] = OpenColorProfileA( &profile, PROFILE_READ, 1, OPEN_EXISTING );
ok( handle[0] != NULL, "got %lu\n", GetLastError() );
profile.dwType = PROFILE_FILENAME;
profile.pProfileData = testprofile;
profile.cbDataSize = strlen(testprofile);
- handle[1] = pOpenColorProfileA( &profile, PROFILE_READ, 1, OPEN_EXISTING );
+ handle[1] = OpenColorProfileA( &profile, PROFILE_READ, 1, OPEN_EXISTING );
ok( handle[1] != NULL, "got %lu\n", GetLastError() );
- transform = pCreateMultiProfileTransform( handle, 2, &intent, 1, 0, 0 );
+ transform = CreateMultiProfileTransform( handle, 2, &intent, 1, 0, 0 );
ok( transform != NULL, "got %lu\n", GetLastError() );
memset( destbits, 0, sizeof(destbits) );
- ret = pTranslateBitmapBits( transform, srcbits, BM_RGBTRIPLETS, 1, 1, 3, destbits, BM_xBGRQUADS, 4, NULL, 0 );
+ ret = TranslateBitmapBits( transform, srcbits, BM_RGBTRIPLETS, 1, 1, 3, destbits, BM_xBGRQUADS, 4, NULL, 0 );
ok( ret, "got %lu\n", GetLastError() );
ok( !memcmp(expect_destbits, destbits, sizeof(expect_destbits)), "unexpected destbits\n" );
memset( destbits, 0, sizeof(destbits) );
- ret = pTranslateBitmapBits( transform, srcbits, BM_RGBTRIPLETS, 1, 1, 3, destbits, BM_xRGBQUADS, 4, NULL, 0 );
+ ret = TranslateBitmapBits( transform, srcbits, BM_RGBTRIPLETS, 1, 1, 3, destbits, BM_xRGBQUADS, 4, NULL, 0 );
ok( ret, "got %lu\n", GetLastError() );
ok( !memcmp(expect_destbits2, destbits, sizeof(expect_destbits2)), "unexpected destbits\n" );
memset( destbits, 0, sizeof(destbits) );
- ret = pTranslateBitmapBits( transform, srcbits2, BM_xRGBQUADS, 1, 1, 4, destbits, BM_RGBTRIPLETS, 3, NULL, 0 );
+ ret = TranslateBitmapBits( transform, srcbits2, BM_xRGBQUADS, 1, 1, 4, destbits, BM_RGBTRIPLETS, 3, NULL, 0 );
ok( ret, "got %lu\n", GetLastError() );
ok( !memcmp(expect_destbits3, destbits, sizeof(expect_destbits3)), "unexpected destbits\n" );
memset( destbits, 0, sizeof(destbits) );
- ret = pTranslateBitmapBits( transform, srcbits2, BM_xRGBQUADS, 1, 1, 4, destbits, BM_BGRTRIPLETS, 3, NULL, 0 );
+ ret = TranslateBitmapBits( transform, srcbits2, BM_xRGBQUADS, 1, 1, 4, destbits, BM_BGRTRIPLETS, 3, NULL, 0 );
ok( ret, "got %lu\n", GetLastError() );
ok( !memcmp(expect_destbits4, destbits, sizeof(expect_destbits4)), "unexpected destbits\n" );
- pDeleteColorTransform( transform );
- pCloseColorProfile( handle[0] );
- pCloseColorProfile( handle[1] );
+ DeleteColorTransform( transform );
+ CloseColorProfile( handle[0] );
+ CloseColorProfile( handle[1] );
}
START_TEST(profile)
@@ -1428,23 +1289,6 @@ START_TEST(profile)
WCHAR *standardprofileW = NULL, *testprofileW = NULL;
UINT ret;
- hmscms = LoadLibraryA( "mscms.dll" );
- if (!hmscms) return;
-
- huser32 = LoadLibraryA( "user32.dll" );
- if (!huser32)
- {
- FreeLibrary( hmscms );
- return;
- }
-
- if (!init_function_ptrs())
- {
- FreeLibrary( huser32 );
- FreeLibrary( hmscms );
- return;
- }
-
/* See if we can find the standard color profile */
ret = GetSystemDirectoryA( profilefile1, sizeof(profilefile1) );
ok( ret > 0, "GetSystemDirectoryA() returns %d, LastError = %lu\n", ret, GetLastError());
@@ -1531,6 +1375,4 @@ START_TEST(profile)
test_TranslateBitmapBits( standardprofile, testprofile );
if (testprofile) DeleteFileA( testprofile );
- FreeLibrary( huser32 );
- FreeLibrary( hmscms );
}
--
2.30.2
1
0
From: Zhao Yi <zhaoyi(a)uniontech.com>
Signed-off-by: Zhao Yi <zhaoyi(a)uniontech.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/mscms/tests/profile.c | 8 ++++----
dlls/mscms/transform.c | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/mscms/tests/profile.c b/dlls/mscms/tests/profile.c
index 025b1531796..e5f924fb2da 100644
--- a/dlls/mscms/tests/profile.c
+++ b/dlls/mscms/tests/profile.c
@@ -1396,22 +1396,22 @@ static void test_TranslateBitmapBits( char *standardprofile, char *testprofile )
memset( destbits, 0, sizeof(destbits) );
ret = pTranslateBitmapBits( transform, srcbits, BM_RGBTRIPLETS, 1, 1, 3, destbits, BM_xBGRQUADS, 4, NULL, 0 );
ok( ret, "got %lu\n", GetLastError() );
- todo_wine ok( !memcmp(expect_destbits, destbits, sizeof(expect_destbits)), "unexpected destbits\n" );
+ ok( !memcmp(expect_destbits, destbits, sizeof(expect_destbits)), "unexpected destbits\n" );
memset( destbits, 0, sizeof(destbits) );
ret = pTranslateBitmapBits( transform, srcbits, BM_RGBTRIPLETS, 1, 1, 3, destbits, BM_xRGBQUADS, 4, NULL, 0 );
ok( ret, "got %lu\n", GetLastError() );
- todo_wine ok( !memcmp(expect_destbits2, destbits, sizeof(expect_destbits2)), "unexpected destbits\n" );
+ ok( !memcmp(expect_destbits2, destbits, sizeof(expect_destbits2)), "unexpected destbits\n" );
memset( destbits, 0, sizeof(destbits) );
ret = pTranslateBitmapBits( transform, srcbits2, BM_xRGBQUADS, 1, 1, 4, destbits, BM_RGBTRIPLETS, 3, NULL, 0 );
ok( ret, "got %lu\n", GetLastError() );
- todo_wine ok( !memcmp(expect_destbits3, destbits, sizeof(expect_destbits3)), "unexpected destbits\n" );
+ ok( !memcmp(expect_destbits3, destbits, sizeof(expect_destbits3)), "unexpected destbits\n" );
memset( destbits, 0, sizeof(destbits) );
ret = pTranslateBitmapBits( transform, srcbits2, BM_xRGBQUADS, 1, 1, 4, destbits, BM_BGRTRIPLETS, 3, NULL, 0 );
ok( ret, "got %lu\n", GetLastError() );
- todo_wine ok( !memcmp(expect_destbits4, destbits, sizeof(expect_destbits4)), "unexpected destbits\n" );
+ ok( !memcmp(expect_destbits4, destbits, sizeof(expect_destbits4)), "unexpected destbits\n" );
pDeleteColorTransform( transform );
pCloseColorProfile( handle[0] );
diff --git a/dlls/mscms/transform.c b/dlls/mscms/transform.c
index 0d48e217d66..22901ad721c 100644
--- a/dlls/mscms/transform.c
+++ b/dlls/mscms/transform.c
@@ -39,12 +39,12 @@ static DWORD from_bmformat( BMFORMAT format )
switch (format)
{
- case BM_RGBTRIPLETS: ret = TYPE_RGB_8; break;
- case BM_BGRTRIPLETS: ret = TYPE_BGR_8; break;
+ case BM_RGBTRIPLETS: ret = TYPE_BGR_8; break;
+ case BM_BGRTRIPLETS: ret = TYPE_RGB_8; break;
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;
+ case BM_xRGBQUADS: ret = TYPE_BGRA_8; break;
+ case BM_xBGRQUADS: ret = TYPE_RGBA_8; break;
+ case BM_KYMCQUADS: ret = TYPE_CMYK_8; break;
default:
if (!quietfixme)
{
--
2.30.2
1
0
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/mscms/tests/profile.c | 60 ++++++++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/dlls/mscms/tests/profile.c b/dlls/mscms/tests/profile.c
index e0bfbd70e10..025b1531796 100644
--- a/dlls/mscms/tests/profile.c
+++ b/dlls/mscms/tests/profile.c
@@ -58,6 +58,7 @@ static BOOL (WINAPI *pSetColorProfileElement)(HPROFILE,TAGTYPE,DWORD,PDWORD,
static BOOL (WINAPI *pSetColorProfileHeader)(HPROFILE,PPROFILEHEADER);
static BOOL (WINAPI *pSetStandardColorSpaceProfileA)(PCSTR,DWORD,PSTR);
static BOOL (WINAPI *pSetStandardColorSpaceProfileW)(PCWSTR,DWORD,PWSTR);
+static BOOL (WINAPI *pTranslateBitmapBits)(HTRANSFORM,PVOID,BMFORMAT,DWORD,DWORD,DWORD,PVOID,BMFORMAT,DWORD,PBMCALLBACKFN,ULONG);
static BOOL (WINAPI *pUninstallColorProfileA)(PCSTR,PCSTR,BOOL);
static BOOL (WINAPI *pUninstallColorProfileW)(PCWSTR,PCWSTR,BOOL);
@@ -95,6 +96,7 @@ static BOOL init_function_ptrs( void )
GETFUNCPTR( SetStandardColorSpaceProfileW )
GETFUNCPTR( UninstallColorProfileA )
GETFUNCPTR( UninstallColorProfileW )
+ GETFUNCPTR( TranslateBitmapBits )
pEnumDisplayDevicesA = (void *)GetProcAddress( huser32, "EnumDisplayDevicesA" );
@@ -1359,6 +1361,63 @@ static void test_CreateMultiProfileTransform( char *standardprofile, char *testp
}
}
+static void test_TranslateBitmapBits( char *standardprofile, char *testprofile )
+{
+ PROFILE profile;
+ HPROFILE handle[2];
+ HTRANSFORM transform;
+ DWORD intent = INTENT_PERCEPTUAL;
+ BYTE srcbits[] = {0x00, 0x00, 0xff}, srcbits2[] = {0xcc, 0x00, 0x00, 0xff}, destbits[4];
+ const BYTE expect_destbits[] = {0xff, 0x00, 0x00, 0x00};
+ const BYTE expect_destbits2[] = {0x00, 0x00, 0xff, 0x00};
+ const BYTE expect_destbits3[] = {0xcc, 0x00, 0x00};
+ const BYTE expect_destbits4[] = {0x00, 0x00, 0xcc};
+ BOOL ret;
+
+ if (!standardprofile) return;
+
+ profile.dwType = PROFILE_FILENAME;
+ profile.pProfileData = standardprofile;
+ profile.cbDataSize = strlen(standardprofile);
+
+ handle[0] = pOpenColorProfileA( &profile, PROFILE_READ, 1, OPEN_EXISTING );
+ ok( handle[0] != NULL, "got %lu\n", GetLastError() );
+
+ profile.dwType = PROFILE_FILENAME;
+ profile.pProfileData = testprofile;
+ profile.cbDataSize = strlen(testprofile);
+
+ handle[1] = pOpenColorProfileA( &profile, PROFILE_READ, 1, OPEN_EXISTING );
+ ok( handle[1] != NULL, "got %lu\n", GetLastError() );
+
+ transform = pCreateMultiProfileTransform( handle, 2, &intent, 1, 0, 0 );
+ ok( transform != NULL, "got %lu\n", GetLastError() );
+
+ memset( destbits, 0, sizeof(destbits) );
+ ret = pTranslateBitmapBits( transform, srcbits, BM_RGBTRIPLETS, 1, 1, 3, destbits, BM_xBGRQUADS, 4, NULL, 0 );
+ ok( ret, "got %lu\n", GetLastError() );
+ todo_wine ok( !memcmp(expect_destbits, destbits, sizeof(expect_destbits)), "unexpected destbits\n" );
+
+ memset( destbits, 0, sizeof(destbits) );
+ ret = pTranslateBitmapBits( transform, srcbits, BM_RGBTRIPLETS, 1, 1, 3, destbits, BM_xRGBQUADS, 4, NULL, 0 );
+ ok( ret, "got %lu\n", GetLastError() );
+ todo_wine ok( !memcmp(expect_destbits2, destbits, sizeof(expect_destbits2)), "unexpected destbits\n" );
+
+ memset( destbits, 0, sizeof(destbits) );
+ ret = pTranslateBitmapBits( transform, srcbits2, BM_xRGBQUADS, 1, 1, 4, destbits, BM_RGBTRIPLETS, 3, NULL, 0 );
+ ok( ret, "got %lu\n", GetLastError() );
+ todo_wine ok( !memcmp(expect_destbits3, destbits, sizeof(expect_destbits3)), "unexpected destbits\n" );
+
+ memset( destbits, 0, sizeof(destbits) );
+ ret = pTranslateBitmapBits( transform, srcbits2, BM_xRGBQUADS, 1, 1, 4, destbits, BM_BGRTRIPLETS, 3, NULL, 0 );
+ ok( ret, "got %lu\n", GetLastError() );
+ todo_wine ok( !memcmp(expect_destbits4, destbits, sizeof(expect_destbits4)), "unexpected destbits\n" );
+
+ pDeleteColorTransform( transform );
+ pCloseColorProfile( handle[0] );
+ pCloseColorProfile( handle[1] );
+}
+
START_TEST(profile)
{
UINT len;
@@ -1469,6 +1528,7 @@ START_TEST(profile)
test_AssociateColorProfileWithDeviceA( testprofile );
test_CreateMultiProfileTransform( standardprofile, testprofile );
+ test_TranslateBitmapBits( standardprofile, testprofile );
if (testprofile) DeleteFileA( testprofile );
FreeLibrary( huser32 );
--
2.30.2
1
0
[PATCH 1/3] conhost: Save console settings as global defaults on first run
by Hugh McMaster 30 May '22
by Hugh McMaster 30 May '22
30 May '22
On Windows, HKCU\Console holds global default settings, while subkeys
hold any app-specific settings that differ from the defaults.
Wine's conhost.exe implementation currently saves all console settings
to an app-specific subkey on the first run, while global defaults are
only saved to HKCU\Console if the user selects 'Set Defaults' from the
pop-up menu and saves new settings. This is the opposite of console
behaviour on Windows.
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
---
programs/conhost/window.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/programs/conhost/window.c b/programs/conhost/window.c
index 5e8c3e15a4f..019925789fd 100644
--- a/programs/conhost/window.c
+++ b/programs/conhost/window.c
@@ -850,7 +850,7 @@ static void set_first_font( struct console *console, struct console_config *conf
if (fc.pass > 5)
ERR("Unable to find a valid console font\n");
- /* Save font configuration to the registry */
+ /* Update active configuration */
config->cell_width = console->active->font.width;
config->cell_height = console->active->font.height;
config->font_pitch_family = console->active->font.pitch_family;
@@ -858,7 +858,8 @@ static void set_first_font( struct console *console, struct console_config *conf
console->active->font.face_len * sizeof(WCHAR) );
config->face_name[console->active->font.face_len] = 0;
- save_config( console->window->config_key, config );
+ /* Save default console configuration to the registry */
+ save_config( NULL, config );
}
/* Sets the font specified in the LOGFONT as the new console font */
--
2.36.1
2
5
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/mshtml/tests/misc.c | 190 +++++++++++++++++++++++++++++++++++++++
1 file changed, 190 insertions(+)
diff --git a/dlls/mshtml/tests/misc.c b/dlls/mshtml/tests/misc.c
index 1702a24c804..410d24884ee 100644
--- a/dlls/mshtml/tests/misc.c
+++ b/dlls/mshtml/tests/misc.c
@@ -24,6 +24,7 @@
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
+#include "mshtml.h"
#include "initguid.h"
#include "optary.h"
@@ -106,11 +107,200 @@ static void test_HTMLLoadOptions(void)
IHtmlLoadOptions_Release(loadopts);
}
+static IHTMLDocument2 *create_doc_from_url(const WCHAR *start_url)
+{
+ BSTR url;
+ IBindCtx *bc;
+ IMoniker *url_mon;
+ IPersistMoniker *persist_mon;
+ IHTMLDocument2 *doc;
+ HRESULT hres;
+
+ hres = CreateBindCtx(0, &bc);
+ ok(hres == S_OK, "CreateBindCtx failed: 0x%08lx\n", hres);
+
+ url = SysAllocString(start_url);
+ hres = CreateURLMoniker(NULL, url, &url_mon);
+ ok(hres == S_OK, "CreateURLMoniker failed: 0x%08lx\n", hres);
+
+ hres = CoCreateInstance(&CLSID_HTMLDocument, NULL,
+ CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, &IID_IHTMLDocument2,
+ (void**)&doc);
+ ok(hres == S_OK, "CoCreateInstance failed: 0x%08lx\n", hres);
+
+ hres = IHTMLDocument2_QueryInterface(doc, &IID_IPersistMoniker,
+ (void**)&persist_mon);
+ ok(hres == S_OK, "IHTMLDocument2_QueryInterface failed: 0x%08lx\n", hres);
+
+ hres = IPersistMoniker_Load(persist_mon, FALSE, url_mon, bc,
+ STGM_SHARE_EXCLUSIVE | STGM_READWRITE);
+ ok(hres == S_OK, "IPersistMoniker_Load failed: 0x%08lx\n", hres);
+
+ IPersistMoniker_Release(persist_mon);
+ IMoniker_Release(url_mon);
+ IBindCtx_Release(bc);
+ SysFreeString(url);
+ return doc;
+}
+
+static HRESULT get_localstorage(IHTMLDocument2 *doc, IHTMLStorage **storage)
+{
+ IHTMLWindow2 *window;
+ IHTMLWindow6 *window6;
+ HRESULT hres;
+
+ hres = IHTMLDocument2_get_parentWindow(doc, &window);
+ ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres);
+ ok(window != NULL, "window == NULL\n");
+
+ hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLWindow6, (void**)&window6);
+ IHTMLWindow2_Release(window);
+ if(FAILED(hres)) {
+ win_skip("IHTMLWindow6 not supported\n");
+ return hres;
+ }
+
+ hres = IHTMLWindow6_get_localStorage(window6, storage);
+ ok(hres == S_OK, "get_localStorage failed: %08lx\n", hres);
+ ok(*storage != NULL, "*storage == NULL\n");
+
+ IHTMLWindow6_Release(window6);
+ return hres;
+}
+
+static void test_HTMLStorage(void)
+{
+ IHTMLDocument2 *doc, *doc2;
+ IHTMLStorage *storage, *storage2;
+ VARIANT var;
+ BSTR key, value;
+ HRESULT hres;
+
+ doc = create_doc_from_url(L"http://www.codeweavers.com/");
+ doc2 = create_doc_from_url(L"http://www.codeweavers.com/");
+
+ hres = get_localstorage(doc, &storage);
+ ok(hres == S_OK, "got %08lx\n", hres);
+
+ hres = get_localstorage(doc2, &storage2);
+ ok(hres == S_OK, "got %08lx\n", hres);
+
+ key = SysAllocString(L"");
+ V_VT(&var) = 0xdead;
+ hres = IHTMLStorage_getItem(storage, key, &var);
+ ok(hres == S_OK, "getItem failed: %08lx\n", hres);
+ ok(V_VT(&var) == VT_NULL, "got %d\n", V_VT(&var));
+
+ key = SysAllocString(L"undefined");
+ hres = IHTMLStorage_removeItem(storage, key);
+ ok(hres == S_OK, "removeItem failed: %08lx\n", hres);
+
+ value = SysAllocString(L"null");
+ hres = IHTMLStorage_setItem(storage, key, value);
+ ok(hres == S_OK, "setItem failed: %08lx\n", hres);
+
+ V_VT(&var) = 0xdead;
+ hres = IHTMLStorage_getItem(storage, key, &var);
+ ok(hres == S_OK, "getItem failed: %08lx\n", hres);
+ ok(V_VT(&var) == VT_BSTR, "got %d\n", V_VT(&var));
+ if (V_VT(&var) == VT_BSTR) ok(!wcscmp(V_BSTR(&var), L"null"), "got %s\n", wine_dbgstr_w(V_BSTR(&var)));
+ hres = IHTMLStorage_removeItem(storage, key);
+ ok(hres == S_OK, "removeItem failed: %08lx\n", hres);
+ SysFreeString(key);
+ SysFreeString(value);
+
+ key = SysAllocString(L"winetest");
+ value = SysAllocString(L"winetest");
+ hres = IHTMLStorage_setItem(storage, key, value);
+ ok(hres == S_OK, "setItem failed: %08lx\n", hres);
+
+ /* retrieve value from different storage instance */
+ V_VT(&var) = 0xdead;
+ hres = IHTMLStorage_getItem(storage2, key, &var);
+ ok(hres == S_OK, "getItem failed: %08lx\n", hres);
+ ok(V_VT(&var) == VT_BSTR, "got %d\n", V_VT(&var));
+ if (V_VT(&var) == VT_BSTR) ok(!wcscmp(V_BSTR(&var), L"winetest"), "got %s\n", wine_dbgstr_w(V_BSTR(&var)));
+
+ hres = IHTMLStorage_removeItem(storage, key);
+ ok(hres == S_OK, "removeItem failed: %08lx\n", hres);
+
+ V_VT(&var) = 0xdead;
+ hres = IHTMLStorage_getItem(storage2, key, &var);
+ ok(hres == S_OK, "getItem failed: %08lx\n", hres);
+ ok(V_VT(&var) == VT_NULL, "got %d\n", V_VT(&var));
+ SysFreeString(key);
+ SysFreeString(value);
+
+ /* item doesn't exist */
+ key = SysAllocString(L"nosuch");
+ hres = IHTMLStorage_removeItem(storage, key);
+ ok(hres == S_OK, "removeItem failed: %08lx\n", hres);
+
+ V_VT(&var) = 0xdead;
+ hres = IHTMLStorage_getItem(storage, key, &var);
+ ok(hres == S_OK, "getItem failed: %08lx\n", hres);
+ ok(V_VT(&var) == VT_NULL, "got %d\n", V_VT(&var));
+ SysFreeString(key);
+
+ hres = IHTMLStorage_getItem(storage, NULL, NULL);
+ ok(hres == E_POINTER, "getItem returned: %08lx\n", hres);
+
+ hres = IHTMLStorage_getItem(storage, key, NULL);
+ ok(hres == E_POINTER, "getItem failed: %08lx\n", hres);
+
+ V_VT(&var) = 0xdead;
+ hres = IHTMLStorage_getItem(storage, NULL, &var);
+ ok(hres == S_OK, "getItem returned: %08lx\n", hres);
+ ok(V_VT(&var) == VT_NULL, "got %d\n", V_VT(&var));
+
+ hres = IHTMLStorage_setItem(storage, NULL, NULL);
+ ok(hres == S_OK, "setItem failed: %08lx\n", hres);
+
+ key = SysAllocString(L"winetest2");
+ hres = IHTMLStorage_setItem(storage, key, NULL);
+ ok(hres == S_OK, "setItem failed: %08lx\n", hres);
+
+ hres = IHTMLStorage_setItem(storage, NULL, key);
+ ok(hres == S_OK, "setItem failed: %08lx\n", hres);
+
+ hres = IHTMLStorage_removeItem(storage, key);
+ ok(hres == S_OK, "removeItem failed: %08lx\n", hres);
+ SysFreeString(key);
+
+ hres = IHTMLStorage_removeItem(storage, NULL);
+ ok(hres == S_OK, "removeItem failed: %08lx\n", hres);
+
+ /* Unicode characters */
+ key = SysAllocString(L"winetest");
+ value = SysAllocString(L"\x20ac");
+ hres = IHTMLStorage_setItem(storage, key, value);
+ ok(hres == S_OK, "setItem failed: %08lx\n", hres);
+ hres = IHTMLStorage_removeItem(storage, key);
+ ok(hres == S_OK, "removeItem failed: %08lx\n", hres);
+ SysFreeString(value);
+ SysFreeString(key);
+
+ key = SysAllocString(L"\x20ac");
+ value = SysAllocString(L"winetest");
+ hres = IHTMLStorage_setItem(storage, key, value);
+ ok(hres == S_OK, "setItem failed: %08lx\n", hres);
+ hres = IHTMLStorage_removeItem(storage, key);
+ ok(hres == S_OK, "removeItem failed: %08lx\n", hres);
+ SysFreeString(value);
+ SysFreeString(key);
+
+ IHTMLStorage_Release(storage);
+ IHTMLStorage_Release(storage2);
+ IHTMLDocument2_Release(doc);
+ IHTMLDocument2_Release(doc2);
+}
+
START_TEST(misc)
{
CoInitialize(NULL);
test_HTMLLoadOptions();
+ test_HTMLStorage();
CoUninitialize();
}
--
2.30.2
2
1
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/mshtml/htmlstorage.c | 56 +++++++++++++++++++++++++++++++++++++--
1 file changed, 54 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c
index f7b92114622..1983d87a296 100644
--- a/dlls/mshtml/htmlstorage.c
+++ b/dlls/mshtml/htmlstorage.c
@@ -454,11 +454,63 @@ static HRESULT WINAPI HTMLStorage_setItem(IHTMLStorage *iface, BSTR bstrKey, BST
return hres;
}
+static HRESULT remove_item(const WCHAR *filename, BSTR key)
+{
+ IXMLDOMDocument *doc;
+ IXMLDOMNode *root = NULL, *node = NULL;
+ BSTR query = NULL;
+ HRESULT hres;
+
+ hres = open_document(filename, &doc);
+ if(hres != S_OK)
+ return hres;
+
+ hres = get_root_node(doc, &root);
+ if(hres != S_OK)
+ goto done;
+
+ query = build_query(key);
+ if(!query) {
+ hres = E_OUTOFMEMORY;
+ goto done;
+ }
+
+ hres = IXMLDOMNode_selectSingleNode(root, query, &node);
+ if(hres == S_OK) {
+ hres = IXMLDOMNode_removeChild(root, node, NULL);
+ if(hres != S_OK)
+ goto done;
+ }
+
+ hres = save_document(doc, filename);
+
+done:
+ SysFreeString(query);
+ if(root)
+ IXMLDOMNode_Release(root);
+ if(node)
+ IXMLDOMNode_Release(node);
+ IXMLDOMDocument_Release(doc);
+ return hres;
+}
+
static HRESULT WINAPI HTMLStorage_removeItem(IHTMLStorage *iface, BSTR bstrKey)
{
HTMLStorage *This = impl_from_IHTMLStorage(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(bstrKey));
- return E_NOTIMPL;
+ HRESULT hres;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(bstrKey));
+
+ if(!This->filename) {
+ FIXME("session storage not supported\n");
+ return E_NOTIMPL;
+ }
+
+ WaitForSingleObject(This->mutex, INFINITE);
+ hres = remove_item(This->filename, bstrKey);
+ ReleaseMutex(This->mutex);
+
+ return hres;
}
static HRESULT WINAPI HTMLStorage_clear(IHTMLStorage *iface)
--
2.30.2
2
1
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/mshtml/htmlstorage.c | 113 +++++++++++++++++++++++++++++++++++++-
1 file changed, 111 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c
index 8ef92453b95..f7b92114622 100644
--- a/dlls/mshtml/htmlstorage.c
+++ b/dlls/mshtml/htmlstorage.c
@@ -338,11 +338,120 @@ static HRESULT WINAPI HTMLStorage_getItem(IHTMLStorage *iface, BSTR bstrKey, VAR
return hres;
}
+static HRESULT set_attribute(IXMLDOMElement *elem, const WCHAR *name, BSTR value)
+{
+ BSTR str;
+ VARIANT var;
+ HRESULT hres;
+
+ str = SysAllocString(name);
+ if(!str)
+ return E_OUTOFMEMORY;
+ V_VT(&var) = VT_BSTR;
+ V_BSTR(&var) = value;
+
+ hres = IXMLDOMElement_setAttribute(elem, str, var);
+ SysFreeString(str);
+ return hres;
+}
+
+static HRESULT save_document(IXMLDOMDocument *doc, const WCHAR *filename)
+{
+ VARIANT var;
+ HRESULT hres;
+
+ V_VT(&var) = VT_BSTR;
+ V_BSTR(&var) = SysAllocString(filename);
+ if(!V_BSTR(&var))
+ return E_OUTOFMEMORY;
+
+ hres = IXMLDOMDocument_save(doc, var);
+ SysFreeString(V_BSTR(&var));
+ return hres;
+}
+
+static HRESULT set_item(const WCHAR *filename, BSTR key, BSTR value)
+{
+ IXMLDOMDocument *doc;
+ IXMLDOMNode *root = NULL, *node = NULL;
+ IXMLDOMElement *elem = NULL;
+ BSTR query = NULL;
+ HRESULT hres;
+
+ hres = open_document(filename, &doc);
+ if(hres != S_OK)
+ return hres;
+
+ hres = get_root_node(doc, &root);
+ if(hres != S_OK)
+ goto done;
+
+ query = build_query(key);
+ if(!query) {
+ hres = E_OUTOFMEMORY;
+ goto done;
+ }
+
+ hres = IXMLDOMNode_selectSingleNode(root, query, &node);
+ if(hres == S_OK) {
+ hres = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMElement, (void**)&elem);
+ if(hres != S_OK)
+ goto done;
+
+ hres = set_attribute(elem, L"value", value);
+ if(hres != S_OK)
+ goto done;
+ }else {
+ BSTR str = SysAllocString(L"item");
+ hres = IXMLDOMDocument_createElement(doc, str, &elem);
+ SysFreeString(str);
+ if(hres != S_OK)
+ goto done;
+
+ hres = set_attribute(elem, L"name", key);
+ if(hres != S_OK)
+ goto done;
+
+ hres = set_attribute(elem, L"value", value);
+ if(hres != S_OK)
+ goto done;
+
+ hres = IXMLDOMNode_appendChild(root, (IXMLDOMNode*)elem, NULL);
+ if(hres != S_OK)
+ goto done;
+ }
+
+ hres = save_document(doc, filename);
+
+done:
+ SysFreeString(query);
+ if(root)
+ IXMLDOMNode_Release(root);
+ if(node)
+ IXMLDOMNode_Release(node);
+ if(elem)
+ IXMLDOMElement_Release(elem);
+ IXMLDOMDocument_Release(doc);
+ return hres;
+}
+
static HRESULT WINAPI HTMLStorage_setItem(IHTMLStorage *iface, BSTR bstrKey, BSTR bstrValue)
{
HTMLStorage *This = impl_from_IHTMLStorage(iface);
- FIXME("(%p)->(%s %s)\n", This, debugstr_w(bstrKey), debugstr_w(bstrValue));
- return E_NOTIMPL;
+ HRESULT hres;
+
+ TRACE("(%p)->(%s %s)\n", This, debugstr_w(bstrKey), debugstr_w(bstrValue));
+
+ if(!This->filename) {
+ FIXME("session storage not supported\n");
+ return E_NOTIMPL;
+ }
+
+ WaitForSingleObject(This->mutex, INFINITE);
+ hres = set_item(This->filename, bstrKey, bstrValue);
+ ReleaseMutex(This->mutex);
+
+ return hres;
}
static HRESULT WINAPI HTMLStorage_removeItem(IHTMLStorage *iface, BSTR bstrKey)
--
2.30.2
3
2
v2: Store filename.
v3: Store mutex.
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/mshtml/htmlstorage.c | 269 ++++++++++++++++++++++++++++++++++-
dlls/mshtml/htmlwindow.c | 4 +-
dlls/mshtml/mshtml_private.h | 2 +-
3 files changed, 267 insertions(+), 8 deletions(-)
diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c
index 95f7ae5cd16..8ef92453b95 100644
--- a/dlls/mshtml/htmlstorage.c
+++ b/dlls/mshtml/htmlstorage.c
@@ -24,6 +24,7 @@
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
+#include "shlobj.h"
#include "wine/debug.h"
@@ -35,6 +36,8 @@ typedef struct {
DispatchEx dispex;
IHTMLStorage IHTMLStorage_iface;
LONG ref;
+ WCHAR *filename;
+ HANDLE mutex;
} HTMLStorage;
static inline HTMLStorage *impl_from_IHTMLStorage(IHTMLStorage *iface)
@@ -83,6 +86,8 @@ static ULONG WINAPI HTMLStorage_Release(IHTMLStorage *iface)
if(!ref) {
release_dispex(&This->dispex);
+ heap_free(This->filename);
+ CloseHandle(This->mutex);
heap_free(This);
}
@@ -121,6 +126,103 @@ static HRESULT WINAPI HTMLStorage_Invoke(IHTMLStorage *iface, DISPID dispIdMembe
pDispParams, pVarResult, pExcepInfo, puArgErr);
}
+static BOOL create_path(const WCHAR *path)
+{
+ BOOL ret = TRUE;
+ WCHAR *new_path;
+ int len;
+
+ new_path = heap_alloc((wcslen(path) + 1) * sizeof(WCHAR));
+ if(!new_path)
+ return FALSE;
+ wcscpy(new_path, path);
+
+ while((len = wcslen(new_path)) && new_path[len - 1] == '\\')
+ new_path[len - 1] = 0;
+
+ while(!CreateDirectoryW(new_path, NULL)) {
+ WCHAR *slash;
+ DWORD error = GetLastError();
+ if(error == ERROR_ALREADY_EXISTS) break;
+ if(error != ERROR_PATH_NOT_FOUND) {
+ ret = FALSE;
+ break;
+ }
+ slash = wcsrchr(new_path, '\\');
+ if(!slash) {
+ ret = FALSE;
+ break;
+ }
+ len = slash - new_path;
+ new_path[len] = 0;
+ if(!create_path(new_path)) {
+ ret = FALSE;
+ break;
+ }
+ new_path[len] = '\\';
+ }
+ heap_free(new_path);
+ return ret;
+}
+
+static HRESULT open_document(const WCHAR *filename, IXMLDOMDocument **ret)
+{
+ IXMLDOMDocument *doc = NULL;
+ HRESULT hres = E_OUTOFMEMORY;
+ WCHAR *ptr, *path;
+ VARIANT var;
+ VARIANT_BOOL success;
+
+ path = heap_strdupW(filename);
+ if(!path)
+ return E_OUTOFMEMORY;
+
+ *(ptr = wcsrchr(path, '\\')) = 0;
+ if(!create_path(path))
+ goto done;
+
+ if(GetFileAttributesW(filename) == INVALID_FILE_ATTRIBUTES) {
+ DWORD count;
+ HANDLE file = CreateFileW(filename, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL);
+ if(file == INVALID_HANDLE_VALUE) {
+ hres = HRESULT_FROM_WIN32(GetLastError());
+ goto done;
+ }
+ if(!WriteFile(file, "<root/>", sizeof("<root/>") - 1, &count, NULL)) {
+ CloseHandle(file);
+ hres = HRESULT_FROM_WIN32(GetLastError());
+ goto done;
+ }
+ CloseHandle(file);
+ }
+
+ hres = CoCreateInstance(&CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (void**)&doc);
+ if(hres != S_OK)
+ goto done;
+
+ V_VT(&var) = VT_BSTR;
+ V_BSTR(&var) = SysAllocString(filename);
+ if(!V_BSTR(&var)) {
+ hres = E_OUTOFMEMORY;
+ goto done;
+ }
+
+ hres = IXMLDOMDocument_load(doc, var, &success);
+ if(hres == S_FALSE || success == VARIANT_FALSE)
+ hres = E_FAIL;
+
+ SysFreeString(V_BSTR(&var));
+
+done:
+ heap_free(path);
+ if(hres == S_OK)
+ *ret = doc;
+ else if(doc)
+ IXMLDOMDocument_Release(doc);
+
+ return hres;
+}
+
static HRESULT WINAPI HTMLStorage_get_length(IHTMLStorage *iface, LONG *p)
{
HTMLStorage *This = impl_from_IHTMLStorage(iface);
@@ -142,14 +244,98 @@ static HRESULT WINAPI HTMLStorage_key(IHTMLStorage *iface, LONG lIndex, BSTR *p)
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLStorage_getItem(IHTMLStorage *iface, BSTR bstrKey, VARIANT *p)
+static BSTR build_query(const WCHAR *key)
+{
+ static const WCHAR fmt[] = L"item[@name='%s']";
+ const WCHAR *str = key ? key : L"";
+ UINT len = ARRAY_SIZE(fmt) + wcslen(str);
+ BSTR ret = SysAllocStringLen(NULL, len);
+
+ if(ret) swprintf(ret, len, fmt, str);
+ return ret;
+}
+
+static HRESULT get_root_node(IXMLDOMDocument *doc, IXMLDOMNode **root)
+{
+ HRESULT hres;
+ BSTR str;
+
+ str = SysAllocString(L"root");
+ if(!str)
+ return E_OUTOFMEMORY;
+
+ hres = IXMLDOMDocument_selectSingleNode(doc, str, root);
+ SysFreeString(str);
+ return hres;
+}
+
+static HRESULT get_item(const WCHAR *filename, BSTR key, VARIANT *value)
+{
+ IXMLDOMDocument *doc;
+ BSTR query = NULL;
+ IXMLDOMNode *root = NULL, *node = NULL;
+ IXMLDOMElement *elem = NULL;
+ HRESULT hres;
+
+ hres = open_document(filename, &doc);
+ if(hres != S_OK)
+ return hres;
+
+ hres = get_root_node(doc, &root);
+ if(hres != S_OK)
+ goto done;
+
+ query = build_query(key);
+ if(!query) {
+ hres = E_OUTOFMEMORY;
+ goto done;
+ }
+
+ hres = IXMLDOMNode_selectSingleNode(root, query, &node);
+ if(hres == S_OK) {
+ hres = IXMLDOMNode_QueryInterface(node, &IID_IXMLDOMElement, (void**)&elem);
+ if(hres != S_OK)
+ goto done;
+
+ hres = IXMLDOMElement_getAttribute(elem, (BSTR)L"value", value);
+ }else {
+ V_VT(value) = VT_NULL;
+ hres = S_OK;
+ }
+
+done:
+ SysFreeString(query);
+ if(root)
+ IXMLDOMNode_Release(root);
+ if(node)
+ IXMLDOMNode_Release(node);
+ if(elem)
+ IXMLDOMElement_Release(elem);
+ IXMLDOMDocument_Release(doc);
+ return hres;
+}
+
+static HRESULT WINAPI HTMLStorage_getItem(IHTMLStorage *iface, BSTR bstrKey, VARIANT *value)
{
HTMLStorage *This = impl_from_IHTMLStorage(iface);
+ HRESULT hres;
- FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrKey), p);
+ TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrKey), value);
- V_VT(p) = VT_NULL;
- return S_OK;
+ if(!value)
+ return E_POINTER;
+
+ if(!This->filename) {
+ FIXME("session storage not supported\n");
+ V_VT(value) = VT_NULL;
+ return S_OK;
+ }
+
+ WaitForSingleObject(This->mutex, INFINITE);
+ hres = get_item(This->filename, bstrKey, value);
+ ReleaseMutex(This->mutex);
+
+ return hres;
}
static HRESULT WINAPI HTMLStorage_setItem(IHTMLStorage *iface, BSTR bstrKey, BSTR bstrValue)
@@ -201,7 +387,59 @@ static dispex_static_data_t HTMLStorage_dispex = {
HTMLStorage_iface_tids
};
-HRESULT create_html_storage(compat_mode_t compat_mode, IHTMLStorage **p)
+static WCHAR *build_filename(IUri *uri)
+{
+ static const WCHAR store[] = L"\\Microsoft\\Internet Explorer\\DOMStore\\";
+ WCHAR path[MAX_PATH], *ret;
+ BSTR hostname;
+ HRESULT hres;
+ int len;
+
+ hres = IUri_GetHost(uri, &hostname);
+ if(hres != S_OK)
+ return NULL;
+
+ if(!SHGetSpecialFolderPathW(NULL, path, CSIDL_LOCAL_APPDATA, TRUE)) {
+ ERR("Can't get folder path %lu\n", GetLastError());
+ SysFreeString(hostname);
+ return NULL;
+ }
+
+ len = wcslen(path);
+ if(len + ARRAY_SIZE(store) > ARRAY_SIZE(path)) {
+ ERR("Path too long\n");
+ SysFreeString(hostname);
+ return NULL;
+ }
+ memcpy(path + len, store, sizeof(store));
+
+ len += ARRAY_SIZE(store);
+ ret = heap_alloc((len + wcslen(hostname) + ARRAY_SIZE(L".xml")) * sizeof(WCHAR));
+ if(!ret) {
+ SysFreeString(hostname);
+ return NULL;
+ }
+
+ wcscpy(ret, path);
+ wcscat(ret, hostname);
+ wcscat(ret, L".xml");
+
+ SysFreeString(hostname);
+ return ret;
+}
+
+static WCHAR *build_mutexname(const WCHAR *filename)
+{
+ WCHAR *ret, *ptr;
+ ret = heap_strdupW(filename);
+ if(!ret)
+ return NULL;
+ for(ptr = ret; *ptr; ptr++)
+ if(*ptr == '\\') *ptr = '_';
+ return ret;
+}
+
+HRESULT create_html_storage(compat_mode_t compat_mode, IUri *uri, IHTMLStorage **p)
{
HTMLStorage *storage;
@@ -209,6 +447,27 @@ HRESULT create_html_storage(compat_mode_t compat_mode, IHTMLStorage **p)
if(!storage)
return E_OUTOFMEMORY;
+ if(uri) {
+ WCHAR *mutexname;
+ if(!(storage->filename = build_filename(uri))) {
+ heap_free(storage);
+ return E_OUTOFMEMORY;
+ }
+ mutexname = build_mutexname(storage->filename);
+ if(!mutexname) {
+ heap_free(storage->filename);
+ heap_free(storage);
+ return E_OUTOFMEMORY;
+ }
+ storage->mutex = CreateMutexW(NULL, FALSE, mutexname);
+ heap_free(mutexname);
+ if(!storage->mutex) {
+ heap_free(storage->filename);
+ heap_free(storage);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+ }
+
storage->IHTMLStorage_iface.lpVtbl = &HTMLStorageVtbl;
storage->ref = 1;
init_dispatch(&storage->dispex, (IUnknown*)&storage->IHTMLStorage_iface, &HTMLStorage_dispex, compat_mode);
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index 235e29a3070..ef5d80ff512 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -2143,7 +2143,7 @@ static HRESULT WINAPI HTMLWindow6_get_sessionStorage(IHTMLWindow6 *iface, IHTMLS
HRESULT hres;
hres = create_html_storage(dispex_compat_mode(&This->inner_window->event_target.dispex),
- &This->inner_window->session_storage);
+ NULL, &This->inner_window->session_storage);
if(FAILED(hres))
return hres;
}
@@ -2163,7 +2163,7 @@ static HRESULT WINAPI HTMLWindow6_get_localStorage(IHTMLWindow6 *iface, IHTMLSto
HRESULT hres;
hres = create_html_storage(dispex_compat_mode(&This->inner_window->event_target.dispex),
- &This->inner_window->local_storage);
+ This->inner_window->base.outer_window->uri, &This->inner_window->local_storage);
if(FAILED(hres))
return hres;
}
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 0a7c3a2556e..ca637e5efd0 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -944,7 +944,7 @@ HRESULT create_namespace_collection(compat_mode_t,IHTMLNamespaceCollection**) DE
HRESULT create_dom_implementation(HTMLDocumentNode*,IHTMLDOMImplementation**) DECLSPEC_HIDDEN;
void detach_dom_implementation(IHTMLDOMImplementation*) DECLSPEC_HIDDEN;
-HRESULT create_html_storage(compat_mode_t,IHTMLStorage**) DECLSPEC_HIDDEN;
+HRESULT create_html_storage(compat_mode_t,IUri*,IHTMLStorage**) DECLSPEC_HIDDEN;
void HTMLDocument_Persist_Init(HTMLDocument*) DECLSPEC_HIDDEN;
void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN;
--
2.30.2
2
1
[PATCH 0/1] MR153: include: Mark IPersistFolder3::InitializeEx's optional parameters as [unique].
by Jinoh Kang (@iamahuman) 30 May '22
by Jinoh Kang (@iamahuman) 30 May '22
30 May '22
The Windows SDK headers makes it clear that the IBindCtx and ppfti
parameters of InitializeEx are optional. Bring Wine's definition in
sync with those.
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/153
3
2
[PATCH v2 0/1] MR152: include: Make IShellItem::BindToHandler's pbc parameter as [unique].
by Jinoh Kang (@iamahuman) 30 May '22
by Jinoh Kang (@iamahuman) 30 May '22
30 May '22
The Windows SDK headers makes it clear that the IBindCtx parameter of
BindToHandler is optional. Bring Wine's definition in sync with those.
Thanks @nsivov for pointing this out.
--
v2: include: Mark IShellItem::BindToHandler's pbc parameter as [unique].
https://gitlab.winehq.org/wine/wine/-/merge_requests/152
3
2