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
September 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
828 discussions
Start a n
N
ew thread
Piotr Caban : wininet: Call FreeUrlCacheSpaceW when cache is full.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: ed71ed596fcd2a613d982462c6b435b7eb808a98 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ed71ed596fcd2a613d982462c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Sep 21 14:53:33 2012 +0200 wininet: Call FreeUrlCacheSpaceW when cache is full. --- dlls/wininet/internet.c | 8 ++++++-- dlls/wininet/internet.h | 4 ++-- dlls/wininet/urlcache.c | 38 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 9091ce8..a6dbaa1 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -292,7 +292,11 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES) return FALSE; - URLCacheContainers_CreateDefaults(); + if(!init_urlcache()) + { + TlsFree(g_dwTlsErrIndex); + return FALSE; + } WININET_hModule = hinstDLL; break; @@ -310,7 +314,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) case DLL_PROCESS_DETACH: collect_connections(COLLECT_CLEANUP); NETCON_unload(); - URLCacheContainers_DeleteAll(); + free_urlcache(); if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES) { diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index e3fb530..a4fcdaa 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -551,8 +551,8 @@ int sock_get_error(int) DECLSPEC_HIDDEN; server_t *get_server(const WCHAR*,INTERNET_PORT,BOOL); -extern void URLCacheContainers_CreateDefaults(void) DECLSPEC_HIDDEN; -extern void URLCacheContainers_DeleteAll(void) DECLSPEC_HIDDEN; +BOOL init_urlcache(void) DECLSPEC_HIDDEN; +void free_urlcache(void) DECLSPEC_HIDDEN; #define MAX_REPLY_LEN 0x5B4 diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c index 379288a..81ef5b6 100644 --- a/dlls/wininet/urlcache.c +++ b/dlls/wininet/urlcache.c @@ -2326,6 +2326,22 @@ static BOOL DeleteUrlCacheEntryInternal(const URLCACHECONTAINER * pContainer, return TRUE; } +static HANDLE free_cache_running; +static DWORD WINAPI handle_full_cache_worker(void *param) +{ + FreeUrlCacheSpaceW(NULL, 20, 0); + ReleaseSemaphore(free_cache_running, 1, NULL); + return 0; +} + +static void handle_full_cache(void) +{ + if(WaitForSingleObject(free_cache_running, 0) == WAIT_OBJECT_0) { + if(!QueueUserWorkItem(handle_full_cache_worker, NULL, 0)) + ReleaseSemaphore(free_cache_running, 1, NULL); + } +} + /*********************************************************************** * UnlockUrlCacheEntryFileA (WININET.@) * @@ -2712,7 +2728,6 @@ BOOL WINAPI CreateUrlCacheEntryW( return FALSE; } - /*********************************************************************** * CommitUrlCacheEntryInternal (Compensates for an MS bug) * @@ -2969,7 +2984,7 @@ static BOOL CommitUrlCacheEntryInternal( pHeader->CacheUsage.QuadPart += file_size.QuadPart; if (pHeader->CacheUsage.QuadPart + pHeader->ExemptUsage.QuadPart > pHeader->CacheLimit.QuadPart) - FIXME("file of size %s bytes fills cache\n", wine_dbgstr_longlong(file_size.QuadPart)); + handle_full_cache(); } cleanup: @@ -4114,3 +4129,22 @@ DWORD WINAPI RunOnceUrlCache(HWND hwnd, HINSTANCE hinst, LPSTR cmd, int cmdshow) FIXME("(%p, %p, %s, %d): stub\n", hwnd, hinst, debugstr_a(cmd), cmdshow); return 0; } + +BOOL init_urlcache(void) +{ + free_cache_running = CreateSemaphoreW(NULL, 1, 1, NULL); + if(!free_cache_running) + return FALSE; + + URLCacheContainers_CreateDefaults(); + return TRUE; +} + +void free_urlcache(void) +{ + WaitForSingleObject(free_cache_running, INFINITE); + ReleaseSemaphore(free_cache_running, 1, NULL); + CloseHandle(free_cache_running); + + URLCacheContainers_DeleteAll(); +}
1
0
0
0
Alexandre Julliard : include: Fix the CDSIZEOF_STRUCT definition to avoid warnings on 64-bit.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: b037bd7bffb22d79ccdacbe2314b000d65e4dc33 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b037bd7bffb22d79ccdacbe23…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 21 18:29:09 2012 +0200 include: Fix the CDSIZEOF_STRUCT definition to avoid warnings on 64-bit. --- include/commdlg.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/commdlg.h b/include/commdlg.h index 3ab7078..1a6e1d9 100644 --- a/include/commdlg.h +++ b/include/commdlg.h @@ -130,7 +130,7 @@ DECL_WINELIB_TYPE_AW(OPENFILENAME) DECL_WINELIB_TYPE_AW(LPOPENFILENAME) #ifndef CDSIZEOF_STRUCT -#define CDSIZEOF_STRUCT(type,field) ((int)&(((type *)0)->field) + sizeof(((type*)0)->field)) +#define CDSIZEOF_STRUCT(type,field) ((INT_PTR)&(((type *)0)->field) + sizeof(((type*)0)->field)) #endif #define OPENFILENAME_SIZE_VERSION_400A CDSIZEOF_STRUCT(OPENFILENAMEA,lpTemplateName)
1
0
0
0
Huw Davies : comdlg32: Add structure size checks.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 4c47385ea57ddcd35262590d6ee8d2a7bc2a3e63 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4c47385ea57ddcd35262590d6…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Sep 21 13:22:51 2012 +0100 comdlg32: Add structure size checks. --- dlls/comdlg32/filedlg.c | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 3df67df..9ccd25c 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -4024,6 +4024,12 @@ static void MemFree(void *mem) HeapFree(GetProcessHeap(),0,mem); } +static inline BOOL valid_struct_size( DWORD size ) +{ + return (size == OPENFILENAME_SIZE_VERSION_400W) || + (size == sizeof( OPENFILENAMEW )); +} + static inline BOOL is_win16_looks(DWORD flags) { return (flags & (OFN_ALLOWMULTISELECT|OFN_ENABLEHOOK|OFN_ENABLETEMPLATE) && @@ -4047,6 +4053,12 @@ BOOL WINAPI GetOpenFileNameA( { TRACE("flags %08x\n", ofn->Flags); + if (!valid_struct_size( ofn->lStructSize )) + { + COMDLG32_SetCommDlgExtendedError( CDERR_STRUCTSIZE ); + return FALSE; + } + /* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */ if (ofn->Flags & OFN_FILEMUSTEXIST) ofn->Flags |= OFN_PATHMUSTEXIST; @@ -4072,6 +4084,12 @@ BOOL WINAPI GetOpenFileNameW( { TRACE("flags %08x\n", ofn->Flags); + if (!valid_struct_size( ofn->lStructSize )) + { + COMDLG32_SetCommDlgExtendedError( CDERR_STRUCTSIZE ); + return FALSE; + } + /* OFN_FILEMUSTEXIST implies OFN_PATHMUSTEXIST */ if (ofn->Flags & OFN_FILEMUSTEXIST) ofn->Flags |= OFN_PATHMUSTEXIST; @@ -4096,6 +4114,12 @@ BOOL WINAPI GetOpenFileNameW( BOOL WINAPI GetSaveFileNameA( LPOPENFILENAMEA ofn) /* [in/out] address of init structure */ { + if (!valid_struct_size( ofn->lStructSize )) + { + COMDLG32_SetCommDlgExtendedError( CDERR_STRUCTSIZE ); + return FALSE; + } + if (is_win16_looks(ofn->Flags)) return GetFileName31A(ofn, SAVE_DIALOG); else @@ -4115,6 +4139,12 @@ BOOL WINAPI GetSaveFileNameA( BOOL WINAPI GetSaveFileNameW( LPOPENFILENAMEW ofn) /* [in/out] address of init structure */ { + if (!valid_struct_size( ofn->lStructSize )) + { + COMDLG32_SetCommDlgExtendedError( CDERR_STRUCTSIZE ); + return FALSE; + } + if (is_win16_looks(ofn->Flags)) return GetFileName31W(ofn, SAVE_DIALOG); else
1
0
0
0
Huw Davies : comdlg32: Copy additional structure members if present.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 9db8e593bf098e7d669b2f96aebddabc702bcd52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9db8e593bf098e7d669b2f96a…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Sep 21 13:22:50 2012 +0100 comdlg32: Copy additional structure members if present. --- dlls/comdlg32/filedlg31.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/comdlg32/filedlg31.c b/dlls/comdlg32/filedlg31.c index dcef99e..b52b23e 100644 --- a/dlls/comdlg32/filedlg31.c +++ b/dlls/comdlg32/filedlg31.c @@ -804,6 +804,12 @@ static void FD31_MapOfnStructA(const OPENFILENAMEA *ofnA, LPOPENFILENAMEW ofnW, else /* numbered resource */ ofnW->lpTemplateName = (LPCWSTR) ofnA->lpTemplateName; } + if (ofnW->lStructSize > OPENFILENAME_SIZE_VERSION_400W) + { + ofnW->pvReserved = ofnA->pvReserved; + ofnW->dwReserved = ofnA->dwReserved; + ofnW->FlagsEx = ofnA->FlagsEx; + } }
1
0
0
0
Huw Davies : include: Add missing structure members.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 16c7653c2d9cd75c59800a42f7ea41785dd4fd55 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=16c7653c2d9cd75c59800a42f…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Sep 21 13:22:49 2012 +0100 include: Add missing structure members. --- include/commdlg.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/commdlg.h b/include/commdlg.h index c404050..3ab7078 100644 --- a/include/commdlg.h +++ b/include/commdlg.h @@ -95,6 +95,9 @@ typedef struct tagOFNA { LPARAM lCustData; LPOFNHOOKPROC lpfnHook; LPCSTR lpTemplateName; + void *pvReserved; + DWORD dwReserved; + DWORD FlagsEx; } OPENFILENAMEA,*LPOPENFILENAMEA; typedef struct tagOFNW { @@ -118,6 +121,9 @@ typedef struct tagOFNW { LPARAM lCustData; LPOFNHOOKPROC lpfnHook; LPCWSTR lpTemplateName; + void *pvReserved; + DWORD dwReserved; + DWORD FlagsEx; } OPENFILENAMEW,*LPOPENFILENAMEW; DECL_WINELIB_TYPE_AW(OPENFILENAME)
1
0
0
0
Huw Davies : commdlg: Set the nt40 version size.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: ac347c7e40d75217439ef43f381666a6658d7017 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ac347c7e40d75217439ef43f3…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Sep 21 13:22:48 2012 +0100 commdlg: Set the nt40 version size. --- dlls/commdlg.dll16/filedlg.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/commdlg.dll16/filedlg.c b/dlls/commdlg.dll16/filedlg.c index 3de8b90..7e2fda7 100644 --- a/dlls/commdlg.dll16/filedlg.c +++ b/dlls/commdlg.dll16/filedlg.c @@ -73,7 +73,7 @@ BOOL16 WINAPI GetOpenFileName16( SEGPTR ofn ) /* [in/out] address of structure w if (!lpofn) return FALSE; - ofn32.lStructSize = sizeof(ofn32); + ofn32.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn32.hwndOwner = HWND_32( lpofn->hwndOwner ); ofn32.lpstrFilter = MapSL( lpofn->lpstrFilter ); ofn32.lpstrCustomFilter = MapSL( lpofn->lpstrCustomFilter ); @@ -126,7 +126,7 @@ BOOL16 WINAPI GetSaveFileName16( SEGPTR ofn ) /* [in/out] address of structure w if (!lpofn) return FALSE; - ofn32.lStructSize = sizeof(ofn32); + ofn32.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn32.hwndOwner = HWND_32( lpofn->hwndOwner ); ofn32.lpstrFilter = MapSL( lpofn->lpstrFilter ); ofn32.lpstrCustomFilter = MapSL( lpofn->lpstrCustomFilter );
1
0
0
0
Huw Davies : comdlg32/tests: Explicitly set the structure size to the nt40 version size.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 37975ba776de3d45c5a73d7ba4476881e0d9f1ee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=37975ba776de3d45c5a73d7ba…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Sep 21 13:22:47 2012 +0100 comdlg32/tests: Explicitly set the structure size to the nt40 version size. --- dlls/comdlg32/tests/filedlg.c | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index c9bf52a..b701956 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -93,7 +93,7 @@ static void test_DialogCancel(void) ZeroMemory(&ofn, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn.hwndOwner = NULL; ofn.lpstrFilter = "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0"; ofn.lpstrFile = szFileName; @@ -266,7 +266,7 @@ static void test_create_view_window2(void) char filename[1024] = {0}; DWORD ret; - ofn.lStructSize = sizeof(ofn); + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn.lpstrFile = filename; ofn.nMaxFile = 1024; ofn.lpfnHook = create_view_window2_hook; @@ -283,7 +283,7 @@ static void test_create_view_template(void) char filename[1024] = {0}; DWORD ret; - ofn.lStructSize = sizeof(ofn); + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn.lpstrFile = filename; ofn.nMaxFile = 1024; ofn.lpfnHook = (LPOFNHOOKPROC)template_hook; @@ -531,7 +531,7 @@ todo_wine static void test_resize(void) { - OPENFILENAME ofn = { sizeof(OPENFILENAME)}; + OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; char filename[1024] = {0}; DWORD ret; int i; @@ -633,7 +633,7 @@ static LONG_PTR WINAPI ok_template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARA static void test_ok(void) { - OPENFILENAME ofn = { sizeof(OPENFILENAME)}; + OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; char filename[1024] = {0}; char tmpfilename[ MAX_PATH]; char curdir[MAX_PATH]; @@ -843,7 +843,7 @@ static void test_arrange(void) return; } - ofn.lStructSize = sizeof(ofn); + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn.lpstrFile = filename; ofn.nMaxFile = 1024; ofn.lpfnHook = (LPOFNHOOKPROC)template_hook_arrange; @@ -916,7 +916,7 @@ static void test_getfolderpath(void) ZeroMemory(&ofn, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn.hwndOwner = NULL; ofn.lpstrFilter = "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0"; ofn.lpstrFile = szFileName; @@ -948,7 +948,7 @@ static void test_resizable2(void) skip( "some interactive resizable dialog tests (set WINETEST_INTERACTIVE=1)\n"); return; } - ofn.lStructSize = sizeof(ofn); + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofn.lpstrFile = filename; ofn.nMaxFile = 1024; ofn.lpfnHook = NULL; @@ -983,7 +983,7 @@ static void test_resizable2(void) static void test_mru(void) { ok_wndproc_testcase testcase = {0}; - OPENFILENAME ofn = {sizeof(OPENFILENAME)}; + OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; const char *test_dir_name = "C:\\mru_test"; const char *test_file_name = "test.txt"; const char *test_full_path = "C:\\mru_test\\test.txt"; @@ -1069,7 +1069,7 @@ static void test_extension_helper(OPENFILENAME* ofn, const char *filter, static void test_extension(void) { - OPENFILENAME ofn = { sizeof(OPENFILENAME)}; + OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; char filename[1024] = {0}; char curdir[MAX_PATH]; unsigned int i; @@ -1093,7 +1093,6 @@ static void test_extension(void) boolret = GetCurrentDirectoryA(sizeof(curdir), curdir); ok(boolret, "Failed to get current dir err %d\n", GetLastError()); - ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = NULL; ofn.lpstrFile = filename; ofn.nMaxFile = MAX_PATH; @@ -1176,7 +1175,7 @@ static void test_null_filename(void) 'A','l','l','\0','*','\0','\0'}; DWORD ret; - ofnA.lStructSize = sizeof(ofnA); + ofnA.lStructSize = OPENFILENAME_SIZE_VERSION_400A; ofnA.lpstrFile = NULL; ofnA.nMaxFile = 0; ofnA.nFileOffset = 0xdead; @@ -1207,7 +1206,7 @@ static void test_null_filename(void) ok(ofnA.nFileExtension == 0, "ofnA.nFileExtension is 0x%x, should be 0\n", ofnA.nFileExtension); /* unicode tests */ - ofnW.lStructSize = sizeof(ofnW); + ofnW.lStructSize = OPENFILENAME_SIZE_VERSION_400W; ofnW.lpstrFile = NULL; ofnW.nMaxFile = 0; ofnW.nFileOffset = 0xdead;
1
0
0
0
Huw Davies : comdlg32: Make the unicode copy the same size as the ansi version.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 914353d3dcf2f554e5cc5294d81499efa81a13d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=914353d3dcf2f554e5cc5294d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Sep 21 13:22:46 2012 +0100 comdlg32: Make the unicode copy the same size as the ansi version. --- dlls/comdlg32/filedlg31.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/comdlg32/filedlg31.c b/dlls/comdlg32/filedlg31.c index f0763c5..dcef99e 100644 --- a/dlls/comdlg32/filedlg31.c +++ b/dlls/comdlg32/filedlg31.c @@ -758,7 +758,6 @@ static void FD31_MapOfnStructA(const OPENFILENAMEA *ofnA, LPOPENFILENAMEW ofnW, { UNICODE_STRING usBuffer; - ofnW->lStructSize = sizeof(OPENFILENAMEW); ofnW->hwndOwner = ofnA->hwndOwner; ofnW->hInstance = ofnA->hInstance; if (ofnA->lpstrFilter) @@ -935,7 +934,8 @@ static PFD31_DATA FD31_AllocPrivate(LPARAM lParam, UINT dlgType, BOOL IsUnicode) if (lfs->ofnA->Flags & OFN_ENABLEHOOK) if (lfs->ofnA->lpfnHook) lfs->hook = TRUE; - lfs->ofnW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*lfs->ofnW)); + lfs->ofnW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, lfs->ofnA->lStructSize); + lfs->ofnW->lStructSize = lfs->ofnA->lStructSize; FD31_MapOfnStructA(lfs->ofnA, lfs->ofnW, lfs->open); }
1
0
0
0
Huw Davies : comdlg32: Only copy the valid portion of the structure.
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: bdbc45fddd583c9273511419e49ff815c516d8c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bdbc45fddd583c9273511419e…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Sep 21 13:22:45 2012 +0100 comdlg32: Only copy the valid portion of the structure. --- dlls/comdlg32/filedlg31.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/comdlg32/filedlg31.c b/dlls/comdlg32/filedlg31.c index 4a78958..f0763c5 100644 --- a/dlls/comdlg32/filedlg31.c +++ b/dlls/comdlg32/filedlg31.c @@ -556,8 +556,9 @@ static LRESULT FD31_Validate( const FD31_DATA *lfs, LPCWSTR path, UINT control, OPENFILENAMEW ofnsav; LPOPENFILENAMEW ofnW = lfs->ofnW; WCHAR filename[BUFFILE]; + int copied_size = min( ofnW->lStructSize, sizeof(ofnsav) ); - ofnsav = *ofnW; /* for later restoring */ + memcpy( &ofnsav, ofnW, copied_size ); /* for later restoring */ /* get current file name */ if (path) @@ -591,7 +592,7 @@ static LRESULT FD31_Validate( const FD31_DATA *lfs, LPCWSTR path, UINT control, 0, lfs->lParam ); if (lRet) { - *ofnW = ofnsav; /* restore old state */ + memcpy( ofnW, &ofnsav, copied_size ); /* restore old state */ return FALSE; } }
1
0
0
0
Dmitry Timoshkov : gdiplus: Add an ability to cache bitmap properties and use distinct metadata loaders for different image formats .
by Alexandre Julliard
21 Sep '12
21 Sep '12
Module: wine Branch: master Commit: 915df87aa5048734046c9889dba4f2fdf6298c1b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=915df87aa5048734046c9889d…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Sep 21 19:58:20 2012 +0900 gdiplus: Add an ability to cache bitmap properties and use distinct metadata loaders for different image formats. --- dlls/gdiplus/gdiplus_private.h | 2 + dlls/gdiplus/image.c | 115 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 109 insertions(+), 8 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index d44c969..53f978c 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -311,6 +311,8 @@ struct GpBitmap{ BYTE *own_bits; /* image bits that need to be freed with this object */ INT lockx, locky; /* X and Y coordinates of the rect when a bitmap is locked for writing. */ IWICMetadataReader *metadata_reader; /* NULL if there is no metadata */ + UINT prop_count; + PropertyItem *prop_item; /* cached image properties */ }; struct GpCachedBitmap{ diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index b657969..c6018ab 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1911,6 +1911,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, (*bitmap)->stride = stride; (*bitmap)->own_bits = own_bits; (*bitmap)->metadata_reader = NULL; + (*bitmap)->prop_count = 0; + (*bitmap)->prop_item = NULL; /* set format-related flags */ if (format & (PixelFormatAlpha|PixelFormatPAlpha|PixelFormatIndexed)) @@ -2123,6 +2125,9 @@ static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette) if (dst->metadata_reader) IWICMetadataReader_Release(dst->metadata_reader); dst->metadata_reader = src->metadata_reader; + GdipFree(dst->prop_item); + dst->prop_item = src->prop_item; + dst->prop_count = src->prop_count; if (dst->image.stream) IStream_Release(dst->image.stream); dst->image.stream = src->image.stream; @@ -2147,6 +2152,7 @@ static GpStatus free_image_data(GpImage *image) DeleteObject(((GpBitmap*)image)->hbitmap); if (((GpBitmap*)image)->metadata_reader) IWICMetadataReader_Release(((GpBitmap*)image)->metadata_reader); + GdipFree(((GpBitmap*)image)->prop_item); } else if (image->type == ImageTypeMetafile) { @@ -2509,6 +2515,12 @@ GpStatus WINGDIPAPI GdipGetPropertyCount(GpImage *image, UINT *num) if (image->type == ImageTypeBitmap) { + if (((GpBitmap *)image)->prop_item) + { + *num = ((GpBitmap *)image)->prop_count; + return Ok; + } + if (((GpBitmap *)image)->metadata_reader) IWICMetadataReader_GetCount(((GpBitmap *)image)->metadata_reader, num); } @@ -2533,6 +2545,18 @@ GpStatus WINGDIPAPI GdipGetPropertyIdList(GpImage *image, UINT num, PROPID *list return NotImplemented; } + if (((GpBitmap *)image)->prop_item) + { + if (num != ((GpBitmap *)image)->prop_count) return InvalidParameter; + + for (i = 0; i < num; i++) + { + list[i] = ((GpBitmap *)image)->prop_item[i].id; + } + + return Ok; + } + reader = ((GpBitmap *)image)->metadata_reader; if (!reader) { @@ -2621,6 +2645,22 @@ GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID propid, UINT return NotImplemented; } + if (((GpBitmap *)image)->prop_item) + { + UINT i; + + for (i = 0; i < ((GpBitmap *)image)->prop_count; i++) + { + if (propid == ((GpBitmap *)image)->prop_item[i].id) + { + *size = sizeof(PropertyItem) + ((GpBitmap *)image)->prop_item[i].length; + return Ok; + } + } + + return PropertyNotFound; + } + reader = ((GpBitmap *)image)->metadata_reader; if (!reader) return PropertyNotFound; @@ -2753,6 +2793,27 @@ GpStatus WINGDIPAPI GdipGetPropertyItem(GpImage *image, PROPID propid, UINT size return NotImplemented; } + if (((GpBitmap *)image)->prop_item) + { + UINT i; + + for (i = 0; i < ((GpBitmap *)image)->prop_count; i++) + { + if (propid == ((GpBitmap *)image)->prop_item[i].id) + { + if (size != sizeof(PropertyItem) + ((GpBitmap *)image)->prop_item[i].length) + return InvalidParameter; + + *buffer = ((GpBitmap *)image)->prop_item[i]; + buffer->value = buffer + 1; + memcpy(buffer->value, ((GpBitmap *)image)->prop_item[i].value, buffer->length); + return Ok; + } + } + + return PropertyNotFound; + } + reader = ((GpBitmap *)image)->metadata_reader; if (!reader) return PropertyNotFound; @@ -2785,6 +2846,19 @@ GpStatus WINGDIPAPI GdipGetPropertySize(GpImage *image, UINT *size, UINT *count) return NotImplemented; } + if (((GpBitmap *)image)->prop_item) + { + *count = ((GpBitmap *)image)->prop_count; + *size = 0; + + for (i = 0; i < ((GpBitmap *)image)->prop_count; i++) + { + *size += sizeof(PropertyItem) + ((GpBitmap *)image)->prop_item[i].length; + } + + return Ok; + } + reader = ((GpBitmap *)image)->metadata_reader; if (!reader) return PropertyNotFound; @@ -2850,6 +2924,21 @@ GpStatus WINGDIPAPI GdipGetAllPropertyItems(GpImage *image, UINT size, if (prop_count != count || prop_size != size) return InvalidParameter; + if (((GpBitmap *)image)->prop_item) + { + memcpy(buf, ((GpBitmap *)image)->prop_item, prop_size); + + item_value = (char *)(buf + prop_count); + + for (i = 0; i < prop_count; i++) + { + buf[i].value = item_value; + item_value += buf[i].length; + } + + return Ok; + } + reader = ((GpBitmap *)image)->metadata_reader; if (!reader) return PropertyNotFound; @@ -3011,7 +3100,14 @@ GpStatus WINGDIPAPI GdipLoadImageFromFileICM(GDIPCONST WCHAR* filename,GpImage * return GdipLoadImageFromFile(filename, image); } -static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, UINT active_frame, GpImage **image) +static void gif_metadata_reader(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UINT frame) +{ +} + +typedef void (*metadata_reader_func)(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UINT frame); + +static GpStatus decode_image_wic(IStream *stream, GDIPCONST CLSID *clsid, + UINT active_frame, metadata_reader_func metadata_reader, GpImage **image) { GpStatus status=Ok; GpBitmap *bitmap; @@ -3126,7 +3222,10 @@ static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, UINT active_fr if (SUCCEEDED(hr)) { bitmap->metadata_reader = NULL; - if (IWICBitmapFrameDecode_QueryInterface(frame, &IID_IWICMetadataBlockReader, (void **)&block_reader) == S_OK) + + if (metadata_reader) + metadata_reader(bitmap, decoder, active_frame); + else if (IWICBitmapFrameDecode_QueryInterface(frame, &IID_IWICMetadataBlockReader, (void **)&block_reader) == S_OK) { UINT block_count = 0; if (IWICMetadataBlockReader_GetCount(block_reader, &block_count) == S_OK && block_count) @@ -3172,7 +3271,7 @@ end: static GpStatus decode_image_icon(IStream* stream, REFCLSID clsid, UINT active_frame, GpImage **image) { - return decode_image_wic(stream, &CLSID_WICIcoDecoder, active_frame, image); + return decode_image_wic(stream, &CLSID_WICIcoDecoder, active_frame, NULL, image); } static GpStatus decode_image_bmp(IStream* stream, REFCLSID clsid, UINT active_frame, GpImage **image) @@ -3180,7 +3279,7 @@ static GpStatus decode_image_bmp(IStream* stream, REFCLSID clsid, UINT active_fr GpStatus status; GpBitmap* bitmap; - status = decode_image_wic(stream, &CLSID_WICBmpDecoder, active_frame, image); + status = decode_image_wic(stream, &CLSID_WICBmpDecoder, active_frame, NULL, image); bitmap = (GpBitmap*)*image; @@ -3195,22 +3294,22 @@ static GpStatus decode_image_bmp(IStream* stream, REFCLSID clsid, UINT active_fr static GpStatus decode_image_jpeg(IStream* stream, REFCLSID clsid, UINT active_frame, GpImage **image) { - return decode_image_wic(stream, &CLSID_WICJpegDecoder, active_frame, image); + return decode_image_wic(stream, &CLSID_WICJpegDecoder, active_frame, NULL, image); } static GpStatus decode_image_png(IStream* stream, REFCLSID clsid, UINT active_frame, GpImage **image) { - return decode_image_wic(stream, &CLSID_WICPngDecoder, active_frame, image); + return decode_image_wic(stream, &CLSID_WICPngDecoder, active_frame, NULL, image); } static GpStatus decode_image_gif(IStream* stream, REFCLSID clsid, UINT active_frame, GpImage **image) { - return decode_image_wic(stream, &CLSID_WICGifDecoder, active_frame, image); + return decode_image_wic(stream, &CLSID_WICGifDecoder, active_frame, gif_metadata_reader, image); } static GpStatus decode_image_tiff(IStream* stream, REFCLSID clsid, UINT active_frame, GpImage **image) { - return decode_image_wic(stream, &CLSID_WICTiffDecoder, active_frame, image); + return decode_image_wic(stream, &CLSID_WICTiffDecoder, active_frame, NULL, image); } static GpStatus decode_image_olepicture_metafile(IStream* stream, REFCLSID clsid, UINT active_frame, GpImage **image)
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
83
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
73
74
75
76
77
78
79
80
81
82
83
Results per page:
10
25
50
100
200