winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
July 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
712 discussions
Start a n
N
ew thread
Alexandre Goujon : include/ddk: Add DVD_DESCRIPTOR_HEADER descriptor structure.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 9536e66d61ac3ac9185b6da518fe9cd26ea6539f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9536e66d61ac3ac9185b6da51…
Author: Alexandre Goujon <ale.goujon(a)gmail.com> Date: Wed Jul 11 22:26:49 2012 +0200 include/ddk: Add DVD_DESCRIPTOR_HEADER descriptor structure. --- include/ddk/ntddcdvd.h | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/include/ddk/ntddcdvd.h b/include/ddk/ntddcdvd.h index 5313496..f6ce77b 100644 --- a/include/ddk/ntddcdvd.h +++ b/include/ddk/ntddcdvd.h @@ -113,7 +113,13 @@ typedef struct DVD_READ_STRUCTURE { /* From 0 to 4 */ UCHAR LayerNumber; -}DVD_READ_STRUCTURE, * PDVD_READ_STRUCTURE; +} DVD_READ_STRUCTURE, *PDVD_READ_STRUCTURE; + +typedef struct _DVD_DESCRIPTOR_HEADER { + USHORT Length; + UCHAR Reserved[2]; +} DVD_DESCRIPTOR_HEADER, *PDVD_DESCRIPTOR_HEADER; +C_ASSERT(sizeof(DVD_DESCRIPTOR_HEADER) == 4); typedef struct _DVD_LAYER_DESCRIPTOR { @@ -154,6 +160,7 @@ typedef struct _DVD_LAYER_DESCRIPTOR /* 0 indicates no BCA data */ UCHAR BCAFlag : 1; }DVD_LAYER_DESCRIPTOR, * PDVD_LAYER_DESCRIPTOR; +C_ASSERT(sizeof(DVD_LAYER_DESCRIPTOR) == 17); typedef struct _DVD_COPYRIGHT_DESCRIPTOR {
1
0
0
0
Erich Hoover : shell32: Fix FindExecutable search path when a default directory is supplied.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 6a1d2f80b87de75cd4ed2d1280ab8e885b691857 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6a1d2f80b87de75cd4ed2d128…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Tue Jul 10 11:59:24 2012 -0600 shell32: Fix FindExecutable search path when a default directory is supplied. --- dlls/shell32/shlexec.c | 8 +++++++- dlls/shell32/tests/shlexec.c | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletions(-) diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 77212f0..e351d86 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -603,7 +603,13 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOpera { TRACE("SearchPathW returned non-zero\n"); lpFile = xlpFile; - /* Hey, isn't this value ignored? Why make this call? Shouldn't we return here? --dank*/ + /* The file was found in the application-supplied default directory (or the system search path) */ + } + else if (lpPath && SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile)/sizeof(WCHAR), xlpFile, NULL)) + { + TRACE("SearchPathW returned non-zero\n"); + lpFile = xlpFile; + /* The file was found in one of the directories in the system-wide search path */ } attribs = GetFileAttributesW(lpFile); diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 1c5fe7f..8e200aa 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -1307,6 +1307,7 @@ static void test_filename(void) static void test_find_executable(void) { + char notepad_path[MAX_PATH]; char filename[MAX_PATH]; char command[MAX_PATH]; const filename_tests_t* test; @@ -1329,6 +1330,21 @@ static void test_find_executable(void) ok(strcmp(command, "your word") != 0, "FindExecutable(NULL) returned command=[%s]\n", command); } + GetSystemDirectoryA( notepad_path, MAX_PATH ); + strcat( notepad_path, "\\notepad.exe" ); + + /* Search for something that should be in the system-wide search path (no default directory) */ + strcpy(command, "your word"); + rc=(INT_PTR)FindExecutableA("notepad.exe", NULL, command); + ok(rc > 32, "FindExecutable(%s) returned %ld\n", "notepad.exe", rc); + ok(strcasecmp(command, notepad_path) == 0, "FindExecutable(%s) returned command=[%s]\n", "notepad.exe", command); + + /* Search for something that should be in the system-wide search path (with default directory) */ + strcpy(command, "your word"); + rc=(INT_PTR)FindExecutableA("notepad.exe", tmpdir, command); + ok(rc > 32, "FindExecutable(%s) returned %ld\n", "notepad.exe", rc); + ok(strcasecmp(command, notepad_path) == 0, "FindExecutable(%s) returned command=[%s]\n", "notepad.exe", command); + strcpy(command, "your word"); rc=(INT_PTR)FindExecutableA(tmpdir, NULL, command); ok(rc == SE_ERR_NOASSOC /* >= win2000 */ || rc > 32 /* win98, nt4 */, "FindExecutable(NULL) returned %ld\n", rc);
1
0
0
0
Detlef Riekenberg : advapi32/tests: Add tests for CredIsMarshaledCredential .
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: d685894a45d98d2f507b02e8a42124aa48d86eb9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d685894a45d98d2f507b02e8a…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Sat Jul 7 00:36:28 2012 +0200 advapi32/tests: Add tests for CredIsMarshaledCredential. --- dlls/advapi32/tests/cred.c | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 64 insertions(+), 0 deletions(-) diff --git a/dlls/advapi32/tests/cred.c b/dlls/advapi32/tests/cred.c index 3aaae4c..5762f1b 100644 --- a/dlls/advapi32/tests/cred.c +++ b/dlls/advapi32/tests/cred.c @@ -37,6 +37,7 @@ static BOOL (WINAPI *pCredWriteA)(PCREDENTIALA,DWORD); static BOOL (WINAPI *pCredReadDomainCredentialsA)(PCREDENTIAL_TARGET_INFORMATIONA,DWORD,DWORD*,PCREDENTIALA**); static BOOL (WINAPI *pCredMarshalCredentialA)(CRED_MARSHAL_TYPE,PVOID,LPSTR *); static BOOL (WINAPI *pCredUnmarshalCredentialA)(LPCSTR,PCRED_MARSHAL_TYPE,PVOID); +static BOOL (WINAPI *pCredIsMarshaledCredentialA)(LPCSTR); #define TEST_TARGET_NAME "
credtest.winehq.org
" #define TEST_TARGET_NAME2 "
credtest2.winehq.org
" @@ -630,6 +631,67 @@ static void test_CredUnmarshalCredentialA(void) pCredFree( username ); } +static void test_CredIsMarshaledCredentialA(void) +{ + int i; + BOOL res; + BOOL expected = TRUE; + + const char * ptr[] = { + /* CertCredential */ + "@@BXlmblBAAAAAAAAAAAAAAAAAAAAA", /* hash for 'W','i','n','e' */ + "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAA", /* hash for all 0 */ + + /* UsernameTargetCredential */ + "@@CCAAAAA0BA", /* "t" */ + "@@CIAAAAA0BQZAMHA0BA", /* "test" */ + + /* todo: BinaryBlobCredential */ + + /* not marshaled names return always FALSE */ + "winetest", + "", + "@@", + "@@A", + "@@AA", + "@@AAA", + "@@B", + "@@BB", + "@@BBB", + + /* CertCredential */ + "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAAA", /* to long */ + "@@BAAAAAAAAAAAAAAAAAAAAAAAAAA", /* to short */ + "@@BAAAAAAAAAAAAAAAAAAAAAAAAAA+", /* bad char */ + "@@BAAAAAAAAAAAAAAAAAAAAAAAAAA:", + "@@BAAAAAAAAAAAAAAAAAAAAAAAAAA>", + "@@BAAAAAAAAAAAAAAAAAAAAAAAAAA<", + + "@@C", + "@@CC", + "@@CCC", + "@@D", + "@@DD", + "@@DDD", + NULL}; + + for (i = 0; ptr[i]; i++) + { + if (*ptr[i] != '@') + expected = FALSE; + + SetLastError(0xdeadbeef); + res = pCredIsMarshaledCredentialA(ptr[i]); + if (expected) + ok(res != FALSE, "%d: got %d and %u for %s (expected TRUE)\n", i, res, GetLastError(), ptr[i]); + else + { + /* Windows returns ERROR_INVALID_PARAMETER here, but that's not documented */ + ok(!res, "%d: got %d and %u for %s (expected FALSE)\n", i, res, GetLastError(), ptr[i]); + } + } +} + START_TEST(cred) { DWORD persists[CRED_TYPE_MAXIMUM]; @@ -644,6 +706,7 @@ START_TEST(cred) pCredReadDomainCredentialsA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredReadDomainCredentialsA"); pCredMarshalCredentialA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredMarshalCredentialA"); pCredUnmarshalCredentialA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredUnmarshalCredentialA"); + pCredIsMarshaledCredentialA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredIsMarshaledCredentialA"); if (!pCredEnumerateA || !pCredFree || !pCredWriteA || !pCredDeleteA || !pCredReadA) { @@ -690,4 +753,5 @@ START_TEST(cred) test_CredMarshalCredentialA(); test_CredUnmarshalCredentialA(); + test_CredIsMarshaledCredentialA(); }
1
0
0
0
Detlef Riekenberg : advapi32: Implement CredIsMarshaledCredentialA/W.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: d96de83089cc4af8077e6f185024134b06bab78e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d96de83089cc4af8077e6f185…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Sat Jul 7 00:36:27 2012 +0200 advapi32: Implement CredIsMarshaledCredentialA/W. --- dlls/advapi32/advapi32.spec | 4 +- dlls/advapi32/cred.c | 66 +++++++++++++++++++++++++++++++++++++++++++ include/wincred.h | 3 ++ 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index 638cba1..732bf04 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -144,8 +144,8 @@ @ stdcall CredGetSessionTypes(long ptr) # @ stub CredGetTargetInfoA # @ stub CredGetTargetInfoW -# @ stub CredIsMarshaledCredentialA -# @ stub CredIsMarshaledCredentialW +@ stdcall CredIsMarshaledCredentialA(str) +@ stdcall CredIsMarshaledCredentialW(wstr) # @ stub CredIsProtectedA # @ stub CredIsProtectedW @ stdcall CredMarshalCredentialA(long ptr ptr) diff --git a/dlls/advapi32/cred.c b/dlls/advapi32/cred.c index 432eb5c..d15feb7 100644 --- a/dlls/advapi32/cred.c +++ b/dlls/advapi32/cred.c @@ -2161,3 +2161,69 @@ BOOL WINAPI CredUnmarshalCredentialW( LPCWSTR cred, PCRED_MARSHAL_TYPE type, PVO } return TRUE; } + +/****************************************************************************** + * CredIsMarshaledCredentialW [ADVAPI32.@] + * + * Check, if the name parameter is a marshaled credential, hash or binary blob + * + * PARAMS + * name the name to check + * + * RETURNS + * TRUE: the name parameter is a marshaled credential, hash or binary blob + * FALSE: the name is a plain username + */ +BOOL WINAPI CredIsMarshaledCredentialW(LPCWSTR name) +{ + TRACE("(%s)\n", debugstr_w(name)); + + if (name && name[0] == '@' && name[1] == '@' && name[2] > 'A' && name[3]) + { + char hash[CERT_HASH_LENGTH + 2]; + int len = strlenW(name + 3 ); + DWORD size; + + if ((name[2] - 'A') == CertCredential && (len == 27) && cred_decode(name + 3, len, hash)) + return TRUE; + + if (((name[2] - 'A') == UsernameTargetCredential) && + (len >= 9) && cred_decode(name + 3, 6, (char *)&size) && size) + return TRUE; + + if ((name[2] - 'A') == BinaryBlobCredential) + FIXME("BinaryBlobCredential not checked\n"); + + if ((name[2] - 'A') > BinaryBlobCredential) + TRACE("unknown type: %d\n", (name[2] - 'A')); + } + + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; +} + +/****************************************************************************** + * CredIsMarshaledCredentialA [ADVAPI32.@] + * + * See CredIsMarshaledCredentialW + * + */ +BOOL WINAPI CredIsMarshaledCredentialA(LPCSTR name) +{ + LPWSTR nameW = NULL; + BOOL res; + int len; + + TRACE("(%s)\n", debugstr_a(name)); + + if (name) + { + len = MultiByteToWideChar(CP_ACP, 0, name, -1, NULL, 0); + nameW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, len); + } + + res = CredIsMarshaledCredentialW(nameW); + HeapFree(GetProcessHeap(), 0, nameW); + return res; +} diff --git a/include/wincred.h b/include/wincred.h index fb18a01..d0a75a7 100644 --- a/include/wincred.h +++ b/include/wincred.h @@ -248,6 +248,9 @@ WINADVAPI BOOL WINAPI CredEnumerateW(LPCWSTR,DWORD,DWORD *,PCREDENTIALW **); #define CredEnumerate WINELIB_NAME_AW(CredEnumerate) WINADVAPI VOID WINAPI CredFree(PVOID); WINADVAPI BOOL WINAPI CredGetSessionTypes(DWORD,LPDWORD); +WINADVAPI BOOL WINAPI CredIsMarshaledCredentialA(LPCSTR); +WINADVAPI BOOL WINAPI CredIsMarshaledCredentialW(LPCWSTR); +#define CredIsMarshaledCredential WINELIB_NAME_AW(CredIsMarshaledCredential) WINADVAPI BOOL WINAPI CredMarshalCredentialA(CRED_MARSHAL_TYPE,PVOID,LPSTR *); WINADVAPI BOOL WINAPI CredMarshalCredentialW(CRED_MARSHAL_TYPE,PVOID,LPWSTR *); #define CredMarshalCredential WINELIB_NAME_AW(CredMarshalCredential)
1
0
0
0
Nikolay Sivov : scrrun: Added IFileSystem3_FileExists implementation.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 1ca6cacdb348746fbc3a8b56e9285593dcc7c437 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ca6cacdb348746fbc3a8b56e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 12 02:00:42 2012 +0400 scrrun: Added IFileSystem3_FileExists implementation. --- dlls/scrrun/filesystem.c | 10 ++++++---- dlls/scrrun/tests/Makefile.in | 2 +- dlls/scrrun/tests/filesystem.c | 21 ++++++++++++++++++++- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index cd397a4..5c8fb7d 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -213,12 +213,14 @@ static HRESULT WINAPI filesys_DriveExists(IFileSystem3 *iface, BSTR DriveSpec, return E_NOTIMPL; } -static HRESULT WINAPI filesys_FileExists(IFileSystem3 *iface, BSTR FileSpec, - VARIANT_BOOL *pfExists) +static HRESULT WINAPI filesys_FileExists(IFileSystem3 *iface, BSTR path, VARIANT_BOOL *ret) { - FIXME("%p %s %p\n", iface, debugstr_w(FileSpec), pfExists); + TRACE("%p %s %p\n", iface, debugstr_w(path), ret); - return E_NOTIMPL; + if (!ret) return E_POINTER; + + *ret = GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; } static HRESULT WINAPI filesys_FolderExists(IFileSystem3 *iface, BSTR FolderSpec, diff --git a/dlls/scrrun/tests/Makefile.in b/dlls/scrrun/tests/Makefile.in index 44cef8a..326eb1a 100644 --- a/dlls/scrrun/tests/Makefile.in +++ b/dlls/scrrun/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = scrrun.dll -IMPORTS = ole32 shlwapi uuid +IMPORTS = ole32 shlwapi uuid oleaut32 C_SRCS = \ filesystem.c diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c index c48baa4..ff1856e 100644 --- a/dlls/scrrun/tests/filesystem.c +++ b/dlls/scrrun/tests/filesystem.c @@ -22,6 +22,7 @@ #include "windows.h" #include "ole2.h" +#include "oleauto.h" #include "dispex.h" #include "wine/test.h" @@ -31,11 +32,14 @@ static void test_interfaces(void) { + static const WCHAR pathW[] = {'p','a','t','h',0}; HRESULT hr; IDispatch *disp; IDispatchEx *dispex; IFileSystem3 *fs3; IObjectWithSite *site; + VARIANT_BOOL b; + BSTR path; hr = CoCreateInstance(&CLSID_FileSystemObject, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IDispatch, (void**)&disp); @@ -46,7 +50,6 @@ static void test_interfaces(void) hr = IDispatch_QueryInterface(disp, &IID_IFileSystem3, (void**)&fs3); ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK); - IFileSystem3_Release(fs3); hr = IDispatch_QueryInterface(disp, &IID_IObjectWithSite, (void**)&site); ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr, E_NOINTERFACE); @@ -54,6 +57,22 @@ static void test_interfaces(void) hr = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); ok(hr == E_NOINTERFACE, "got 0x%08x, expected 0x%08x\n", hr, E_NOINTERFACE); + b = VARIANT_TRUE; + hr = IFileSystem3_FileExists(fs3, NULL, &b); + ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK); + ok(b == VARIANT_FALSE, "got %x\n", b); + + hr = IFileSystem3_FileExists(fs3, NULL, NULL); + ok(hr == E_POINTER, "got 0x%08x, expected 0x%08x\n", hr, E_POINTER); + + path = SysAllocString(pathW); + b = VARIANT_TRUE; + hr = IFileSystem3_FileExists(fs3, path, &b); + ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK); + ok(b == VARIANT_FALSE, "got %x\n", b); + SysFreeString(path); + + IFileSystem3_Release(fs3); IDispatch_Release(disp); }
1
0
0
0
Alistair Leslie-Hughes : scrrun: Add typelib support.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 6c5588f95d2e27aa14a1cc15d4fdfda012a4bd2f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6c5588f95d2e27aa14a1cc15d…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Jun 15 15:17:42 2012 +1000 scrrun: Add typelib support. --- dlls/scrrun/Makefile.in | 2 +- dlls/scrrun/filesystem.c | 39 ++++++++++++++++++------ dlls/scrrun/scrrun.c | 68 ++++++++++++++++++++++++++++++++++++++++- dlls/scrrun/scrrun_private.h | 32 +++++++++++++++++++ 4 files changed, 128 insertions(+), 13 deletions(-) diff --git a/dlls/scrrun/Makefile.in b/dlls/scrrun/Makefile.in index d2ceb87..f6dcf62 100644 --- a/dlls/scrrun/Makefile.in +++ b/dlls/scrrun/Makefile.in @@ -1,5 +1,5 @@ MODULE = scrrun.dll -IMPORTS = uuid +IMPORTS = uuid oleaut32 C_SRCS = \ filesystem.c \ diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index a14d926..cd397a4 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -26,6 +26,7 @@ #include "ole2.h" #include "dispex.h" #include "scrrun.h" +#include "scrrun_private.h" #include "wine/debug.h" @@ -90,19 +91,26 @@ static HRESULT WINAPI filesys_GetTypeInfoCount(IFileSystem3 *iface, UINT *pctinf static HRESULT WINAPI filesys_GetTypeInfo(IFileSystem3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - FIXME("(%p)->(%u %u %p)\n", iface, iTInfo, lcid, ppTInfo); - - return E_NOTIMPL; -} + TRACE("(%p)->(%u %u %p)\n", iface, iTInfo, lcid, ppTInfo); + return get_typeinfo(IFileSystem3_tid, ppTInfo);} static HRESULT WINAPI filesys_GetIDsOfNames(IFileSystem3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { - FIXME("(%p)->(%s %p %u %u %p)\n", iface, debugstr_guid(riid), rgszNames, cNames, - lcid, rgDispId); + ITypeInfo *typeinfo; + HRESULT hr; - return E_NOTIMPL; + TRACE("(%p)->(%s %p %u %u %p)\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); + + hr = get_typeinfo(IFileSystem3_tid, &typeinfo); + if(SUCCEEDED(hr)) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); + ITypeInfo_Release(typeinfo); + } + + return hr; } static HRESULT WINAPI filesys_Invoke(IFileSystem3 *iface, DISPID dispIdMember, @@ -110,10 +118,21 @@ static HRESULT WINAPI filesys_Invoke(IFileSystem3 *iface, DISPID dispIdMember, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { - FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", iface, dispIdMember, debugstr_guid(riid), - lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + ITypeInfo *typeinfo; + HRESULT hr; - return E_NOTIMPL; + TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", iface, dispIdMember, debugstr_guid(riid), + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + + hr = get_typeinfo(IFileSystem3_tid, &typeinfo); + if(SUCCEEDED(hr)) + { + hr = ITypeInfo_Invoke(typeinfo, &iface, dispIdMember, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + ITypeInfo_Release(typeinfo); + } + + return hr; } static HRESULT WINAPI filesys_get_Drives(IFileSystem3 *iface, IDriveCollection **ppdrives) diff --git a/dlls/scrrun/scrrun.c b/dlls/scrrun/scrrun.c index d1e2de2..d5ea369 100644 --- a/dlls/scrrun/scrrun.c +++ b/dlls/scrrun/scrrun.c @@ -27,6 +27,7 @@ #include <initguid.h> #include "scrrun.h" +#include "scrrun_private.h" #include "wine/debug.h" @@ -36,8 +37,6 @@ static HINSTANCE scrrun_instance; typedef HRESULT (*fnCreateInstance)(LPVOID *ppObj); -extern HRESULT WINAPI FileSystem_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; - static HRESULT WINAPI scrruncf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppv ) { *ppv = NULL; @@ -88,6 +87,70 @@ static const struct IClassFactoryVtbl scrruncf_vtbl = static IClassFactory FileSystemFactory = { &scrruncf_vtbl }; +static ITypeLib *typelib; +static ITypeInfo *typeinfos[LAST_tid]; + +static REFIID tid_ids[] = { + &IID_NULL, + &IID_IFileSystem3, +}; + +static HRESULT load_typelib(void) +{ + HRESULT hres; + ITypeLib *tl; + + hres = LoadRegTypeLib(&LIBID_Scripting, 1, 0, LOCALE_SYSTEM_DEFAULT, &tl); + if(FAILED(hres)) { + ERR("LoadRegTypeLib failed: %08x\n", hres); + return hres; + } + + if(InterlockedCompareExchangePointer((void**)&typelib, tl, NULL)) + ITypeLib_Release(tl); + return hres; +} + +HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) +{ + HRESULT hres; + + if (!typelib) + hres = load_typelib(); + if (!typelib) + return hres; + + if(!typeinfos[tid]) { + ITypeInfo *ti; + + hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti); + if(FAILED(hres)) { + ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hres); + return hres; + } + + if(InterlockedCompareExchangePointer((void**)(typeinfos+tid), ti, NULL)) + ITypeInfo_Release(ti); + } + + *typeinfo = typeinfos[tid]; + return S_OK; +} + +static void release_typelib(void) +{ + unsigned i; + + if(!typelib) + return; + + for(i=0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++) + if(typeinfos[i]) + ITypeInfo_Release(typeinfos[i]); + + ITypeLib_Release(typelib); +} + BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { TRACE("%p, %u, %p\n", hinst, reason, reserved); @@ -101,6 +164,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) scrrun_instance = hinst; break; case DLL_PROCESS_DETACH: + release_typelib(); break; } return TRUE; diff --git a/dlls/scrrun/scrrun_private.h b/dlls/scrrun/scrrun_private.h new file mode 100644 index 0000000..fc700a6 --- /dev/null +++ b/dlls/scrrun/scrrun_private.h @@ -0,0 +1,32 @@ +/* + * Copyright 2012 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef _SCRRUN_PRIVATE_H_ +#define _SCRRUN_PRIVATE_H + +extern HRESULT WINAPI FileSystem_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; + +typedef enum tid_t +{ + NULL_tid, + IFileSystem3_tid, + LAST_tid +} tid_t; + +HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) DECLSPEC_HIDDEN; + +#endif
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for generating WICBitmapPaletteTypeFixedHalftone256 palette.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 45f240c0cbefee748ea8380357649abddf8d03f5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=45f240c0cbefee748ea838035…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jul 12 16:14:11 2012 +0900 windowscodecs: Add support for generating WICBitmapPaletteTypeFixedHalftone256 palette. --- dlls/windowscodecs/palette.c | 26 ++++++++++++++++++++++++++ dlls/windowscodecs/tests/palette.c | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/palette.c b/dlls/windowscodecs/palette.c index a024cd1..4541c7c 100644 --- a/dlls/windowscodecs/palette.c +++ b/dlls/windowscodecs/palette.c @@ -188,6 +188,27 @@ static WICColor *generate_halftone64_palette(UINT *count) return entries; } +static WICColor *generate_halftone256_palette(UINT *count) +{ + WICColor *entries; + UINT i; + + *count = 256; + entries = HeapAlloc(GetProcessHeap(), 0, 256 * sizeof(WICColor)); + if (!entries) return NULL; + + for (i = 0; i < 256; i++) + { + static const BYTE halftone_values_b[4] = { 0x00,0x55,0xaa,0xff }; + static const BYTE halftone_values_gr[8] = { 0x00,0x24,0x49,0x6d,0x92,0xb6,0xdb,0xff }; + entries[i] = 0xff000000; + entries[i] |= halftone_values_b[i%4]; + entries[i] |= halftone_values_gr[(i/4)%8] << 8; + entries[i] |= halftone_values_gr[(i/32)%8] << 16; + } + return entries; +} + static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, WICBitmapPaletteType type, BOOL add_transparent) { @@ -237,6 +258,11 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, if (!colors) return E_OUTOFMEMORY; break; + case WICBitmapPaletteTypeFixedHalftone256: + colors = generate_halftone256_palette(&count); + if (!colors) return E_OUTOFMEMORY; + break; + default: FIXME("(%p,%u,%d): stub\n", iface, type, add_transparent); return E_NOTIMPL; diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c index e97ffc6..8e320c5 100644 --- a/dlls/windowscodecs/tests/palette.c +++ b/dlls/windowscodecs/tests/palette.c @@ -223,6 +223,23 @@ static void generate_halftone64_palette(DWORD *entries, UINT count) } } +static void generate_halftone256_palette(DWORD *entries, UINT count) +{ + static const BYTE halftone_values_b[4] = { 0x00,0x55,0xaa,0xff }; + static const BYTE halftone_values_gr[8] = { 0x00,0x24,0x49,0x6d,0x92,0xb6,0xdb,0xff }; + UINT i; + + assert(count == 256); + + for (i = 0; i < 256; i++) + { + entries[i] = 0xff000000; + entries[i] |= halftone_values_b[i%4]; + entries[i] |= halftone_values_gr[(i/4)%8] << 8; + entries[i] |= halftone_values_gr[(i/32)%8] << 16; + } +} + static void test_predefined_palette(void) { static struct test_data @@ -240,6 +257,7 @@ static void test_predefined_palette(void) { WICBitmapPaletteTypeFixedGray256, 0, 1, 256, { 0 } }, { WICBitmapPaletteTypeFixedHalftone8, 0, 0, 16, { 0 } }, { WICBitmapPaletteTypeFixedHalftone64, 0, 0, 72, { 0 } }, + { WICBitmapPaletteTypeFixedHalftone256, 0, 0, 256, { 0 } }, }; IWICImagingFactory *factory; IWICPalette *palette; @@ -298,6 +316,8 @@ static void test_predefined_palette(void) generate_halftone8_palette(td[i].color, td[i].count); else if (td[i].type == WICBitmapPaletteTypeFixedHalftone64) generate_halftone64_palette(td[i].color, td[i].count); + else if (td[i].type == WICBitmapPaletteTypeFixedHalftone256) + generate_halftone256_palette(td[i].color, td[i].count); for (j = 0; j < count; j++) {
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for generating WICBitmapPaletteTypeFixedHalftone64 palette.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 011d23c535d67877e986d52810253554e616c103 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=011d23c535d67877e986d5281…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jul 12 16:11:51 2012 +0900 windowscodecs: Add support for generating WICBitmapPaletteTypeFixedHalftone64 palette. --- dlls/windowscodecs/palette.c | 33 +++++++++++++++++++++++++++++++++ dlls/windowscodecs/tests/palette.c | 27 +++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/palette.c b/dlls/windowscodecs/palette.c index 9280aa1..a024cd1 100644 --- a/dlls/windowscodecs/palette.c +++ b/dlls/windowscodecs/palette.c @@ -160,6 +160,34 @@ static WICColor *generate_halftone8_palette(UINT *count) return entries; } +static WICColor *generate_halftone64_palette(UINT *count) +{ + WICColor *entries; + UINT i; + + *count = 72; + entries = HeapAlloc(GetProcessHeap(), 0, 72 * sizeof(WICColor)); + if (!entries) return NULL; + + for (i = 0; i < 64; i++) + { + static const BYTE halftone_values[4] = { 0x00,0x55,0xaa,0xff }; + entries[i] = 0xff000000; + entries[i] |= halftone_values[i%4]; + entries[i] |= halftone_values[(i/4)%4] << 8; + entries[i] |= halftone_values[(i/16)%4] << 16; + } + + for (i = 64; i < 72; i++) + { + static const DWORD halftone[8] = { 0xc0c0c0, 0x808080, 0x800000, 0x008000, + 0x000080, 0x808000, 0x800080, 0x008080 }; + entries[i] = 0xff000000; + entries[i] |= halftone[i-64]; + } + return entries; +} + static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, WICBitmapPaletteType type, BOOL add_transparent) { @@ -204,6 +232,11 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, if (!colors) return E_OUTOFMEMORY; break; + case WICBitmapPaletteTypeFixedHalftone64: + colors = generate_halftone64_palette(&count); + if (!colors) return E_OUTOFMEMORY; + break; + default: FIXME("(%p,%u,%d): stub\n", iface, type, add_transparent); return E_NOTIMPL; diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c index e92c871..e97ffc6 100644 --- a/dlls/windowscodecs/tests/palette.c +++ b/dlls/windowscodecs/tests/palette.c @@ -199,6 +199,30 @@ static void generate_halftone8_palette(DWORD *entries, UINT count) } } +static void generate_halftone64_palette(DWORD *entries, UINT count) +{ + static const BYTE halftone_values[4] = { 0x00,0x55,0xaa,0xff }; + UINT i; + + assert(count == 72); + + for (i = 0; i < 64; i++) + { + entries[i] = 0xff000000; + entries[i] |= halftone_values[i%4]; + entries[i] |= halftone_values[(i/4)%4] << 8; + entries[i] |= halftone_values[(i/16)%4] << 16; + } + + for (i = 64; i < 72; i++) + { + static const DWORD halftone[8] = { 0xc0c0c0, 0x808080, 0x800000, 0x008000, + 0x000080, 0x808000, 0x800080, 0x008080 }; + entries[i] = 0xff000000; + entries[i] |= halftone[i-64]; + } +} + static void test_predefined_palette(void) { static struct test_data @@ -215,6 +239,7 @@ static void test_predefined_palette(void) { WICBitmapPaletteTypeFixedGray16, 0, 1, 16, { 0 } }, { WICBitmapPaletteTypeFixedGray256, 0, 1, 256, { 0 } }, { WICBitmapPaletteTypeFixedHalftone8, 0, 0, 16, { 0 } }, + { WICBitmapPaletteTypeFixedHalftone64, 0, 0, 72, { 0 } }, }; IWICImagingFactory *factory; IWICPalette *palette; @@ -271,6 +296,8 @@ static void test_predefined_palette(void) generate_gray256_palette(td[i].color, td[i].count); else if (td[i].type == WICBitmapPaletteTypeFixedHalftone8) generate_halftone8_palette(td[i].color, td[i].count); + else if (td[i].type == WICBitmapPaletteTypeFixedHalftone64) + generate_halftone64_palette(td[i].color, td[i].count); for (j = 0; j < count; j++) {
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for generating WICBitmapPaletteTypeFixedHalftone8 palette.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 63cb0cf6d2ff856bf36066c6d970a8072a444c45 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=63cb0cf6d2ff856bf36066c6d…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jul 12 16:10:27 2012 +0900 windowscodecs: Add support for generating WICBitmapPaletteTypeFixedHalftone8 palette. --- dlls/windowscodecs/palette.c | 33 +++++++++++++++++++++++++++++++++ dlls/windowscodecs/tests/palette.c | 27 +++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/palette.c b/dlls/windowscodecs/palette.c index 9d3b8ee..9280aa1 100644 --- a/dlls/windowscodecs/palette.c +++ b/dlls/windowscodecs/palette.c @@ -1,5 +1,6 @@ /* * Copyright 2009 Vincent Povirk for CodeWeavers + * Copyright 2012 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -132,6 +133,33 @@ static WICColor *generate_gray256_palette(UINT *count) return entries; } +static WICColor *generate_halftone8_palette(UINT *count) +{ + WICColor *entries; + UINT i; + + *count = 16; + entries = HeapAlloc(GetProcessHeap(), 0, 16 * sizeof(WICColor)); + if (!entries) return NULL; + + for (i = 0; i < 8; i++) + { + entries[i] = 0xff000000; + if (i & 1) entries[i] |= 0xff; + if (i & 2) entries[i] |= 0xff00; + if (i & 4) entries[i] |= 0xff0000; + } + + for (i = 8; i < 16; i++) + { + static const DWORD halftone[8] = { 0xc0c0c0, 0x808080, 0x800000, 0x008000, + 0x000080, 0x808000, 0x800080, 0x008080 }; + entries[i] = 0xff000000; + entries[i] |= halftone[i-8]; + } + return entries; +} + static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, WICBitmapPaletteType type, BOOL add_transparent) { @@ -171,6 +199,11 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, if (!colors) return E_OUTOFMEMORY; break; + case WICBitmapPaletteTypeFixedHalftone8: + colors = generate_halftone8_palette(&count); + if (!colors) return E_OUTOFMEMORY; + break; + default: FIXME("(%p,%u,%d): stub\n", iface, type, add_transparent); return E_NOTIMPL; diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c index ef21307..e92c871 100644 --- a/dlls/windowscodecs/tests/palette.c +++ b/dlls/windowscodecs/tests/palette.c @@ -1,5 +1,6 @@ /* * Copyright 2009 Vincent Povirk for CodeWeavers + * Copyright 2012 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -175,6 +176,29 @@ static void generate_gray256_palette(DWORD *entries, UINT count) } } +static void generate_halftone8_palette(DWORD *entries, UINT count) +{ + UINT i; + + assert(count == 16); + + for (i = 0; i < 8; i++) + { + entries[i] = 0xff000000; + if (i & 1) entries[i] |= 0xff; + if (i & 2) entries[i] |= 0xff00; + if (i & 4) entries[i] |= 0xff0000; + } + + for (i = 8; i < 16; i++) + { + static const DWORD halftone[8] = { 0xc0c0c0, 0x808080, 0x800000, 0x008000, + 0x000080, 0x808000, 0x800080, 0x008080 }; + entries[i] = 0xff000000; + entries[i] |= halftone[i-8]; + } +} + static void test_predefined_palette(void) { static struct test_data @@ -190,6 +214,7 @@ static void test_predefined_palette(void) { 0xff000000, 0xff555555, 0xffaaaaaa, 0xffffffff } }, { WICBitmapPaletteTypeFixedGray16, 0, 1, 16, { 0 } }, { WICBitmapPaletteTypeFixedGray256, 0, 1, 256, { 0 } }, + { WICBitmapPaletteTypeFixedHalftone8, 0, 0, 16, { 0 } }, }; IWICImagingFactory *factory; IWICPalette *palette; @@ -244,6 +269,8 @@ static void test_predefined_palette(void) generate_gray16_palette(td[i].color, td[i].count); else if (td[i].type == WICBitmapPaletteTypeFixedGray256) generate_gray256_palette(td[i].color, td[i].count); + else if (td[i].type == WICBitmapPaletteTypeFixedHalftone8) + generate_halftone8_palette(td[i].color, td[i].count); for (j = 0; j < count; j++) {
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for generating WICBitmapPaletteTypeFixedGray256 palette.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: ca126c069fcbf388acac0326d18ea3fb6343bb12 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ca126c069fcbf388acac0326d…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jul 12 16:09:26 2012 +0900 windowscodecs: Add support for generating WICBitmapPaletteTypeFixedGray256 palette. --- dlls/windowscodecs/palette.c | 22 ++++++++++++++++++++++ dlls/windowscodecs/tests/palette.c | 16 ++++++++++++++++ 2 files changed, 38 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/palette.c b/dlls/windowscodecs/palette.c index 03f5774a..9d3b8ee 100644 --- a/dlls/windowscodecs/palette.c +++ b/dlls/windowscodecs/palette.c @@ -115,6 +115,23 @@ static WICColor *generate_gray16_palette(UINT *count) return entries; } +static WICColor *generate_gray256_palette(UINT *count) +{ + WICColor *entries; + UINT i; + + *count = 256; + entries = HeapAlloc(GetProcessHeap(), 0, 256 * sizeof(WICColor)); + if (!entries) return NULL; + + for (i = 0; i < 256; i++) + { + entries[i] = 0xff000000; + entries[i] |= (i<<16) | (i<<8) | i; + } + return entries; +} + static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, WICBitmapPaletteType type, BOOL add_transparent) { @@ -149,6 +166,11 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, if (!colors) return E_OUTOFMEMORY; break; + case WICBitmapPaletteTypeFixedGray256: + colors = generate_gray256_palette(&count); + if (!colors) return E_OUTOFMEMORY; + break; + default: FIXME("(%p,%u,%d): stub\n", iface, type, add_transparent); return E_NOTIMPL; diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c index aba8168..ef21307 100644 --- a/dlls/windowscodecs/tests/palette.c +++ b/dlls/windowscodecs/tests/palette.c @@ -162,6 +162,19 @@ static void generate_gray16_palette(DWORD *entries, UINT count) } } +static void generate_gray256_palette(DWORD *entries, UINT count) +{ + UINT i; + + assert(count == 256); + + for (i = 0; i < 256; i++) + { + entries[i] = 0xff000000; + entries[i] |= (i << 16) | (i << 8) | i; + } +} + static void test_predefined_palette(void) { static struct test_data @@ -176,6 +189,7 @@ static void test_predefined_palette(void) { WICBitmapPaletteTypeFixedGray4, 0, 1, 4, { 0xff000000, 0xff555555, 0xffaaaaaa, 0xffffffff } }, { WICBitmapPaletteTypeFixedGray16, 0, 1, 16, { 0 } }, + { WICBitmapPaletteTypeFixedGray256, 0, 1, 256, { 0 } }, }; IWICImagingFactory *factory; IWICPalette *palette; @@ -228,6 +242,8 @@ static void test_predefined_palette(void) if (td[i].type == WICBitmapPaletteTypeFixedGray16) generate_gray16_palette(td[i].color, td[i].count); + else if (td[i].type == WICBitmapPaletteTypeFixedGray256) + generate_gray256_palette(td[i].color, td[i].count); for (j = 0; j < count; j++) {
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200