ReactOS.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
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
List overview
Download
Ros-diffs
November 2019
----- 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
ros-diffs@reactos.org
24 participants
322 discussions
Start a n
N
ew thread
[reactos] 01/01: [PRINTUI] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=58bd269253edeae526649…
commit 58bd269253edeae526649d7a846eefa05ad63a32 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:08:24 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:08:24 2019 +0100 [PRINTUI] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/printui/printui.c | 5 ++--- media/doc/README.WINE | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dll/win32/printui/printui.c b/dll/win32/printui/printui.c index 32e7b52e3d1..f35107fa0b2 100644 --- a/dll/win32/printui/printui.c +++ b/dll/win32/printui/printui.c @@ -31,7 +31,6 @@ #include "winnls.h" #include "shellapi.h" -#include "wine/unicode.h" #include "wine/debug.h" #include "printui_private.h" @@ -151,7 +150,7 @@ static BOOL parse_rundll(context_t * cx) while ( c ) { txtW[0] = c; - ptr = strchrW(optionsW, c); + ptr = wcschr(optionsW, c); if (ptr) { index = ptr - optionsW; cx->options[index] = get_next_wstr(cx); @@ -160,7 +159,7 @@ static BOOL parse_rundll(context_t * cx) } else { - ptr = strchrW(flagsW, c); + ptr = wcschr(flagsW, c); if (ptr) { index = ptr - flagsW; cx->flags[index] = TRUE; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index b5e19d9b2e7..b2ba781f32c 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -151,7 +151,7 @@ dll/win32/olethk32 # Synced to WineStaging-3.3 dll/win32/pdh # Synced to WineStaging-4.18 dll/win32/pidgen # Synced to WineStaging-4.18 dll/win32/powrprof # Forked at Wine-1.0rc5 -dll/win32/printui # Synced to WineStaging-3.3 +dll/win32/printui # Synced to WineStaging-4.18 dll/win32/propsys # Synced to WineStaging-4.0 dll/win32/pstorec # Synced to WineStaging-3.3 dll/win32/qmgr # Synced to WineStaging-4.0
5 years, 1 month
1
0
0
0
[reactos] 01/01: [PIDGEN] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f5d283bdc49dd4f9aa2c0…
commit f5d283bdc49dd4f9aa2c0d4e2010e1e125e6abb3 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:08:00 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:08:00 2019 +0100 [PIDGEN] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/pidgen/main.c | 1 - media/doc/README.WINE | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dll/win32/pidgen/main.c b/dll/win32/pidgen/main.c index 95f5389cc09..35af226ffd2 100644 --- a/dll/win32/pidgen/main.c +++ b/dll/win32/pidgen/main.c @@ -16,7 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" #include <stdarg.h> #include "windef.h" diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 9d89d2f819b..b5e19d9b2e7 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -149,7 +149,7 @@ dll/win32/olepro32 # Synced to WineStaging-3.3 dll/win32/olesvr32 # Synced to WineStaging-4.18 dll/win32/olethk32 # Synced to WineStaging-3.3 dll/win32/pdh # Synced to WineStaging-4.18 -dll/win32/pidgen # Synced to WineStaging-4.0 +dll/win32/pidgen # Synced to WineStaging-4.18 dll/win32/powrprof # Forked at Wine-1.0rc5 dll/win32/printui # Synced to WineStaging-3.3 dll/win32/propsys # Synced to WineStaging-4.0
5 years, 1 month
1
0
0
0
[reactos] 01/01: [PDH_WINETEST] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=943bcb0f74b9a420208c3…
commit 943bcb0f74b9a420208c3281ed0870c0b9623618 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:07:35 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:07:35 2019 +0100 [PDH_WINETEST] Sync with Wine Staging 4.18. CORE-16441 --- modules/rostests/winetests/pdh/pdh.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/rostests/winetests/pdh/pdh.c b/modules/rostests/winetests/pdh/pdh.c index 0a17906afbd..a9613e22b02 100644 --- a/modules/rostests/winetests/pdh/pdh.c +++ b/modules/rostests/winetests/pdh/pdh.c @@ -673,6 +673,13 @@ static void test_PdhLookupPerfNameByIndexA( void ) "PdhLookupPerfNameByIndexA failed, got %s expected \'%% Processor Time\'\n", buffer); ok(size == sizeof("% Processor Time"), "PdhLookupPerfNameByIndexA failed %d\n", size); + size = sizeof(buffer); + ret = PdhLookupPerfNameByIndexA( NULL, 238, buffer, &size ); + ok(ret == ERROR_SUCCESS, "PdhLookupPerfNameByIndexA failed 0x%08x\n", ret); + ok(!lstrcmpA( buffer, "Processor" ), + "PdhLookupPerfNameByIndexA failed, got %s expected \'Processor\'\n", buffer); + ok(size == sizeof("Processor"), "PdhLookupPerfNameByIndexA failed %d\n", size); + size = sizeof(buffer); ret = PdhLookupPerfNameByIndexA( NULL, 674, NULL, &size ); ok(ret == PDH_INVALID_ARGUMENT ||
5 years, 1 month
1
0
0
0
[reactos] 01/01: [PDH] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=909d7a81e15be2a8bf914…
commit 909d7a81e15be2a8bf914507c8ada40cfe33ccad Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:07:10 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:07:10 2019 +0100 [PDH] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/pdh/pdh_main.c | 64 ++++++++++++++++++++++++++---------------------- media/doc/README.WINE | 2 +- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/dll/win32/pdh/pdh_main.c b/dll/win32/pdh/pdh_main.c index bc3674a28a0..cd1aed90979 100644 --- a/dll/win32/pdh/pdh_main.c +++ b/dll/win32/pdh/pdh_main.c @@ -30,11 +30,14 @@ #include "pdh.h" #include "pdhmsg.h" #include "winperf.h" +#ifdef __REACTOS__ +#include <wchar.h> +#include <winnls.h> +#endif #include "wine/debug.h" #include "wine/heap.h" #include "wine/list.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(pdh); @@ -53,7 +56,7 @@ static inline WCHAR *pdh_strdup( const WCHAR *src ) WCHAR *dst; if (!src) return NULL; - if ((dst = heap_alloc( (strlenW( src ) + 1) * sizeof(WCHAR) ))) strcpyW( dst, src ); + if ((dst = heap_alloc( (lstrlenW( src ) + 1) * sizeof(WCHAR) ))) lstrcpyW( dst, src ); return dst; } @@ -178,6 +181,8 @@ struct source static const WCHAR path_processor_time[] = {'\\','P','r','o','c','e','s','s','o','r','(','_','T','o','t','a','l',')', '\\','%',' ','P','r','o','c','e','s','s','o','r',' ','T','i','m','e',0}; +static const WCHAR path_processor[] = + {'\\','P','r','o','c','e','s','s','o','r',0}; static const WCHAR path_uptime[] = {'\\','S','y','s','t','e','m', '\\', 'S','y','s','t','e','m',' ','U','p',' ','T','i','m','e',0}; @@ -204,6 +209,7 @@ static void CALLBACK collect_uptime( struct counter *counter ) static const struct source counter_sources[] = { { 6, path_processor_time, collect_processor_time, TYPE_PROCESSOR_TIME, -5, 10000000 }, + { 238, path_processor, NULL, 0, 0, 0 }, { 674, path_uptime, collect_uptime, TYPE_UPTIME, -3, 1000 } }; @@ -213,21 +219,21 @@ static BOOL is_local_machine( const WCHAR *name, DWORD len ) DWORD buflen = ARRAY_SIZE(buf); if (!GetComputerNameW( buf, &buflen )) return FALSE; - return len == buflen && !memicmpW( name, buf, buflen ); + return len == buflen && !_wcsnicmp( name, buf, buflen ); } static BOOL pdh_match_path( LPCWSTR fullpath, LPCWSTR path ) { const WCHAR *p; - if (path[0] == '\\' && path[1] == '\\' && (p = strchrW( path + 2, '\\' )) && + if (path[0] == '\\' && path[1] == '\\' && (p = wcschr( path + 2, '\\' )) && is_local_machine( path + 2, p - path - 2 )) { path += p - path; } - if (strchrW( path, '\\' )) p = fullpath; - else p = strrchrW( fullpath, '\\' ) + 1; - return !strcmpW( p, path ); + if (wcschr( path, '\\' )) p = fullpath; + else p = wcsrchr( fullpath, '\\' ) + 1; + return !wcscmp( p, path ); } /*********************************************************************** @@ -898,9 +904,9 @@ PDH_STATUS WINAPI PdhLookupPerfNameByIndexA( LPCSTR machine, DWORD index, LPSTR { int required = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL ); - if (size && *size < required) ret = PDH_MORE_DATA; + if (*size < required) ret = PDH_MORE_DATA; else WideCharToMultiByte( CP_ACP, 0, bufferW, -1, buffer, required, NULL, NULL ); - if (size) *size = required; + *size = required; } heap_free( machineW ); return ret; @@ -929,13 +935,13 @@ PDH_STATUS WINAPI PdhLookupPerfNameByIndexW( LPCWSTR machine, DWORD index, LPWST { if (counter_sources[i].index == index) { - WCHAR *p = strrchrW( counter_sources[i].path, '\\' ) + 1; - unsigned int required = strlenW( p ) + 1; + WCHAR *p = wcsrchr( counter_sources[i].path, '\\' ) + 1; + unsigned int required = lstrlenW( p ) + 1; if (*size < required) ret = PDH_MORE_DATA; else { - strcpyW( buffer, p ); + lstrcpyW( buffer, p ); ret = ERROR_SUCCESS; } *size = required; @@ -1061,7 +1067,7 @@ PDH_STATUS WINAPI PdhValidatePathA( LPCSTR path ) static PDH_STATUS validate_path( LPCWSTR path ) { if (!path || !*path) return PDH_INVALID_ARGUMENT; - if (*path++ != '\\' || !strchrW( path, '\\' )) return PDH_CSTATUS_BAD_COUNTERNAME; + if (*path++ != '\\' || !wcschr( path, '\\' )) return PDH_CSTATUS_BAD_COUNTERNAME; return ERROR_SUCCESS; } @@ -1202,30 +1208,30 @@ PDH_STATUS WINAPI PdhMakeCounterPathW( PDH_COUNTER_PATH_ELEMENTS_W *e, LPWSTR bu path[0] = 0; if (e->szMachineName) { - strcatW(path, bslash); - strcatW(path, bslash); - strcatW(path, e->szMachineName); + lstrcatW(path, bslash); + lstrcatW(path, bslash); + lstrcatW(path, e->szMachineName); } - strcatW(path, bslash); - strcatW(path, e->szObjectName); + lstrcatW(path, bslash); + lstrcatW(path, e->szObjectName); if (e->szInstanceName) { - strcatW(path, lparen); + lstrcatW(path, lparen); if (e->szParentInstance) { - strcatW(path, e->szParentInstance); - strcatW(path, fslash); + lstrcatW(path, e->szParentInstance); + lstrcatW(path, fslash); } - strcatW(path, e->szInstanceName); - sprintfW(instance, fmt, e->dwInstanceIndex); - strcatW(path, instance); - strcatW(path, rparen); + lstrcatW(path, e->szInstanceName); + swprintf(instance, fmt, e->dwInstanceIndex); + lstrcatW(path, instance); + lstrcatW(path, rparen); } - strcatW(path, bslash); - strcatW(path, e->szCounterName); + lstrcatW(path, bslash); + lstrcatW(path, e->szCounterName); - len = strlenW(path) + 1; - if (*buflen >= len) strcpyW(buffer, path); + len = lstrlenW(path) + 1; + if (*buflen >= len) lstrcpyW(buffer, path); else ret = PDH_MORE_DATA; *buflen = len; return ret; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 18a7ab71196..9d89d2f819b 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -148,7 +148,7 @@ dll/win32/oledlg # Synced to WineStaging-4.18 dll/win32/olepro32 # Synced to WineStaging-3.3 dll/win32/olesvr32 # Synced to WineStaging-4.18 dll/win32/olethk32 # Synced to WineStaging-3.3 -dll/win32/pdh # Synced to WineStaging-4.0 +dll/win32/pdh # Synced to WineStaging-4.18 dll/win32/pidgen # Synced to WineStaging-4.0 dll/win32/powrprof # Forked at Wine-1.0rc5 dll/win32/printui # Synced to WineStaging-3.3
5 years, 1 month
1
0
0
0
[reactos] 01/01: [OLESVR32] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=387183d6278d0aa11a2a5…
commit 387183d6278d0aa11a2a5f1d7a07b5bd530b4e33 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:06:44 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:06:44 2019 +0100 [OLESVR32] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/olesvr32/olesvr_main.c | 2 -- media/doc/README.WINE | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/dll/win32/olesvr32/olesvr_main.c b/dll/win32/olesvr32/olesvr_main.c index 57c28e1b9b2..0ca83ba86e7 100644 --- a/dll/win32/olesvr32/olesvr_main.c +++ b/dll/win32/olesvr32/olesvr_main.c @@ -21,8 +21,6 @@ /* At the moment, these are only empty stubs. */ -#include "config.h" - #include <stdarg.h> #include "windef.h" diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 879facad438..18a7ab71196 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -146,7 +146,7 @@ dll/win32/oleaut32 # Synced to WineStaging-4.18 dll/win32/olecli32 # Synced to WineStaging-4.18 dll/win32/oledlg # Synced to WineStaging-4.18 dll/win32/olepro32 # Synced to WineStaging-3.3 -dll/win32/olesvr32 # Synced to WineStaging-3.3 +dll/win32/olesvr32 # Synced to WineStaging-4.18 dll/win32/olethk32 # Synced to WineStaging-3.3 dll/win32/pdh # Synced to WineStaging-4.0 dll/win32/pidgen # Synced to WineStaging-4.0
5 years, 1 month
1
0
0
0
[reactos] 01/01: [OLEDLG] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a9efcbe85d1e391bff6bb…
commit a9efcbe85d1e391bff6bb68d0eb3621620a87cbb Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:06:18 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:06:18 2019 +0100 [OLEDLG] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/oledlg/insobjdlg.c | 1 - dll/win32/oledlg/oledlg_main.c | 1 - dll/win32/oledlg/pastespl.c | 9 ++++----- dll/win32/oledlg/precomp.h | 2 +- media/doc/README.WINE | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dll/win32/oledlg/insobjdlg.c b/dll/win32/oledlg/insobjdlg.c index f32f3814e5b..cf20150af89 100644 --- a/dll/win32/oledlg/insobjdlg.c +++ b/dll/win32/oledlg/insobjdlg.c @@ -29,7 +29,6 @@ #include "wingdi.h" #include "winuser.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "oledlg.h" #include "resource.h" diff --git a/dll/win32/oledlg/oledlg_main.c b/dll/win32/oledlg/oledlg_main.c index ba5b7c80812..df53ad709ad 100644 --- a/dll/win32/oledlg/oledlg_main.c +++ b/dll/win32/oledlg/oledlg_main.c @@ -33,7 +33,6 @@ #include "resource.h" #include "wine/debug.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); diff --git a/dll/win32/oledlg/pastespl.c b/dll/win32/oledlg/pastespl.c index 0b8c8c95a15..2593fd559d2 100644 --- a/dll/win32/oledlg/pastespl.c +++ b/dll/win32/oledlg/pastespl.c @@ -35,7 +35,6 @@ #include "resource.h" #include "wine/debug.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -432,15 +431,15 @@ static void update_result_text(HWND hdlg, const ps_struct_t *ps_struct) } LoadStringW(OLEDLG_hInstance, res_id, resource_txt, ARRAY_SIZE(resource_txt)); - if((ptr = strstrW(resource_txt, percent_s))) + if((ptr = wcsstr(resource_txt, percent_s))) { /* FIXME handle %s in ResultText. Sub appname if IDS_PS_PASTE_OBJECT{_AS_ICON}. Else sub appropriate type name */ - size_t result_txt_len = strlenW(pent->lpstrResultText); + size_t result_txt_len = lstrlenW(pent->lpstrResultText); ptrdiff_t offs = (char*)ptr - (char*)resource_txt; - result_txt = HeapAlloc(GetProcessHeap(), 0, (strlenW(resource_txt) + result_txt_len - 1) * sizeof(WCHAR)); + result_txt = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(resource_txt) + result_txt_len - 1) * sizeof(WCHAR)); memcpy(result_txt, resource_txt, offs); memcpy((char*)result_txt + offs, pent->lpstrResultText, result_txt_len * sizeof(WCHAR)); - memcpy((char*)result_txt + offs + result_txt_len * sizeof(WCHAR), ptr + 2, (strlenW(ptr + 2) + 1) * sizeof(WCHAR)); + memcpy((char*)result_txt + offs + result_txt_len * sizeof(WCHAR), ptr + 2, (lstrlenW(ptr + 2) + 1) * sizeof(WCHAR)); } else result_txt = resource_txt; diff --git a/dll/win32/oledlg/precomp.h b/dll/win32/oledlg/precomp.h index 4b6d825d236..ca6d648c0ce 100644 --- a/dll/win32/oledlg/precomp.h +++ b/dll/win32/oledlg/precomp.h @@ -16,10 +16,10 @@ #include <winbase.h> #include <wingdi.h> #include <winuser.h> +#include <winnls.h> #include <oledlg.h> #include <wine/debug.h> -#include <wine/unicode.h> #include "oledlg_private.h" #include "resource.h" diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 7d5b3b9db3e..879facad438 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -144,7 +144,7 @@ dll/win32/ole32 # Synced to WineStaging-4.18 dll/win32/oleacc # Synced to WineStaging-4.18 dll/win32/oleaut32 # Synced to WineStaging-4.18 dll/win32/olecli32 # Synced to WineStaging-4.18 -dll/win32/oledlg # Synced to WineStaging-4.0 +dll/win32/oledlg # Synced to WineStaging-4.18 dll/win32/olepro32 # Synced to WineStaging-3.3 dll/win32/olesvr32 # Synced to WineStaging-3.3 dll/win32/olethk32 # Synced to WineStaging-3.3
5 years, 1 month
1
0
0
0
[reactos] 01/01: [OLECLI32] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=79bacc9aca3d78e680355…
commit 79bacc9aca3d78e68035574f0e9c743ac8fe3d00 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:05:51 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:05:51 2019 +0100 [OLECLI32] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/olecli32/olecli_main.c | 2 -- media/doc/README.WINE | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/dll/win32/olecli32/olecli_main.c b/dll/win32/olecli32/olecli_main.c index 7abd4383727..ebffc0fda6a 100644 --- a/dll/win32/olecli32/olecli_main.c +++ b/dll/win32/olecli32/olecli_main.c @@ -21,8 +21,6 @@ /* At the moment, these are only empty stubs. */ -#include "config.h" - #include <stdarg.h> #include "windef.h" diff --git a/media/doc/README.WINE b/media/doc/README.WINE index ab5540dcdb7..7d5b3b9db3e 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -143,7 +143,7 @@ dll/win32/odbccp32 # Synced to WineStaging-4.18 dll/win32/ole32 # Synced to WineStaging-4.18 dll/win32/oleacc # Synced to WineStaging-4.18 dll/win32/oleaut32 # Synced to WineStaging-4.18 -dll/win32/olecli32 # Synced to WineStaging-3.3 +dll/win32/olecli32 # Synced to WineStaging-4.18 dll/win32/oledlg # Synced to WineStaging-4.0 dll/win32/olepro32 # Synced to WineStaging-3.3 dll/win32/olesvr32 # Synced to WineStaging-3.3
5 years, 1 month
1
0
0
0
[reactos] 01/01: [OLEAUT32_WINETEST] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d3e07ed74acf03010d1fc…
commit d3e07ed74acf03010d1fc35f66b7e2060eda0e29 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:05:27 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:05:27 2019 +0100 [OLEAUT32_WINETEST] Sync with Wine Staging 4.18. CORE-16441 --- modules/rostests/winetests/oleaut32/tmarshal.c | 132 +++++++++++++++++++---- modules/rostests/winetests/oleaut32/tmarshal.idl | 21 +++- modules/rostests/winetests/oleaut32/typelib.c | 28 ++++- modules/rostests/winetests/oleaut32/vartest.c | 31 +++--- 4 files changed, 166 insertions(+), 46 deletions(-) diff --git a/modules/rostests/winetests/oleaut32/tmarshal.c b/modules/rostests/winetests/oleaut32/tmarshal.c index 4b03d5a8906..ac0969bdfa8 100644 --- a/modules/rostests/winetests/oleaut32/tmarshal.c +++ b/modules/rostests/winetests/oleaut32/tmarshal.c @@ -410,7 +410,8 @@ static inline struct disp_obj *impl_from_ISomethingFromDispatch(ISomethingFromDi static HRESULT WINAPI disp_obj_QueryInterface(ISomethingFromDispatch *iface, REFIID iid, void **out) { if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IDispatch) - || IsEqualGUID(iid, &IID_ISomethingFromDispatch)) + || IsEqualGUID(iid, &IID_ISomethingFromDispatch) + || IsEqualGUID(iid, &DIID_ItestIF4)) { *out = iface; ISomethingFromDispatch_AddRef(iface); @@ -1440,6 +1441,28 @@ static HRESULT WINAPI Widget_rect(IWidget *iface, RECT in, RECT *out, RECT *in_p return S_OK; } +static HRESULT WINAPI Widget_complex_struct(IWidget *iface, struct complex in) +{ + HRESULT hr; + + ok(in.c == 98, "Got char %d.\n", in.c); + ok(in.i == 76543, "Got int %d.\n", in.i); + ok(*in.pi == 2, "Got int pointer %d.\n", *in.pi); + ok(**in.ppi == 10, "Got int double pointer %d.\n", **in.ppi); + hr = ISomethingFromDispatch_anotherfn(in.iface); + ok(hr == 0x01234567, "Got wrong hr %#x.\n", hr); + hr = ISomethingFromDispatch_anotherfn(*in.iface_ptr); + ok(hr == 0x01234567, "Got wrong hr %#x.\n", hr); + ok(!lstrcmpW(in.bstr, test_bstr2), "Got string %s.\n", wine_dbgstr_w(in.bstr)); + ok(V_VT(&in.var) == VT_I4, "Got wrong type %u.\n", V_VT(&in.var)); + ok(V_I4(&in.var) == 123, "Got wrong value %d.\n", V_I4(&in.var)); + ok(!memcmp(&in.mystruct, &test_mystruct1, sizeof(MYSTRUCT)), "Structs didn't match.\n"); + ok(!memcmp(in.arr, test_array1, sizeof(array_t)), "Arrays didn't match.\n"); + ok(in.myint == 456, "Got int %d.\n", in.myint); + + return S_OK; +} + static HRESULT WINAPI Widget_array(IWidget *iface, array_t in, array_t out, array_t in_out) { static const array_t empty = {0}; @@ -1458,21 +1481,21 @@ static HRESULT WINAPI Widget_variant_array(IWidget *iface, VARIANT in[2], VARIAN { ok(V_VT(&in[0]) == VT_I4, "Got wrong type %u.\n", V_VT(&in[0])); ok(V_I4(&in[0]) == 1, "Got wrong value %d.\n", V_I4(&in[0])); - ok(V_VT(&in[1]) == VT_I4, "Got wrong type %u.\n", V_VT(&in[1])); - ok(V_I4(&in[1]) == 2, "Got wrong value %d.\n", V_I4(&in[1])); + ok(V_VT(&in[1]) == (VT_BYREF|VT_I4), "Got wrong type %u.\n", V_VT(&in[1])); + ok(*V_I4REF(&in[1]) == 2, "Got wrong value %d.\n", *V_I4REF(&in[1])); ok(V_VT(&out[0]) == VT_EMPTY, "Got wrong type %u.\n", V_VT(&out[0])); ok(V_VT(&out[1]) == VT_EMPTY, "Got wrong type %u.\n", V_VT(&out[1])); ok(V_VT(&in_out[0]) == VT_I4, "Got wrong type %u.\n", V_VT(&in_out[0])); ok(V_I4(&in_out[0]) == 5, "Got wrong type %u.\n", V_VT(&in_out[0])); - ok(V_VT(&in_out[1]) == VT_I4, "Got wrong type %u.\n", V_VT(&in_out[1])); - ok(V_I4(&in_out[1]) == 6, "Got wrong type %u.\n", V_VT(&in_out[1])); + ok(V_VT(&in_out[1]) == VT_BSTR, "Got wrong type %u.\n", V_VT(&in_out[1])); + ok(!lstrcmpW(V_BSTR(&in_out[1]), test_bstr1), "Got wrong value %s.\n", wine_dbgstr_w(V_BSTR(&in[1]))); - V_VT(&in[0]) = VT_I1; V_I1(&in[0]) = 7; - V_VT(&in[1]) = VT_I1; V_I1(&in[1]) = 8; - V_VT(&out[0]) = VT_I1; V_I1(&out[0]) = 9; - V_VT(&out[1]) = VT_I1; V_I1(&out[1]) = 10; - V_VT(&in_out[0]) = VT_I1; V_I1(&in_out[0]) = 11; - V_VT(&in_out[1]) = VT_I1; V_I1(&in_out[1]) = 12; + V_VT(&in[0]) = VT_I1; V_I1(&in[0]) = 7; + V_VT(&in[1]) = VT_I1; V_I1(&in[1]) = 8; + V_VT(&out[0]) = VT_I1; V_I1(&out[0]) = 9; + V_VT(&out[1]) = VT_BSTR; V_BSTR(&out[1]) = SysAllocString(test_bstr2); + V_VT(&in_out[0]) = VT_I1; V_I1(&in_out[0]) = 11; + V_VT(&in_out[1]) = VT_UNKNOWN; V_UNKNOWN(&in_out[1]) = (IUnknown *)create_disp_obj(); return S_OK; } @@ -1599,6 +1622,7 @@ static const struct IWidgetVtbl Widget_VTable = Widget_mystruct_ptr_ptr, Widget_thin_struct, Widget_rect, + Widget_complex_struct, Widget_array, Widget_variant_array, Widget_mystruct_array, @@ -2499,6 +2523,9 @@ static void test_marshal_struct(IWidget *widget, IDispatch *disp) { MYSTRUCT out, in_ptr, in_out, *in_ptr_ptr; RECT rect_out, rect_in_ptr, rect_in_out; + ISomethingFromDispatch *sfd; + struct complex complex; + int i, i2, *pi = &i2; HRESULT hr; memcpy(&out, &test_mystruct2, sizeof(MYSTRUCT)); @@ -2530,14 +2557,35 @@ static void test_marshal_struct(IWidget *widget, IDispatch *disp) ok(EqualRect(&rect_out, &test_rect5), "Rects didn't match.\n"); ok(EqualRect(&rect_in_ptr, &test_rect3), "Rects didn't match.\n"); ok(EqualRect(&rect_in_out, &test_rect7), "Rects didn't match.\n"); + + /* Test complex structs. */ + complex.c = 98; + complex.i = 76543; + i = 2; + complex.pi = &i; + i2 = 10; + complex.ppi = π + complex.iface = create_disp_obj(); + sfd = create_disp_obj(); + complex.iface_ptr = &sfd; + complex.bstr = SysAllocString(test_bstr2); + V_VT(&complex.var) = VT_I4; + V_I4(&complex.var) = 123; + memcpy(&complex.mystruct, &test_mystruct1, sizeof(MYSTRUCT)); + memcpy(complex.arr, test_array1, sizeof(array_t)); + complex.myint = 456; + hr = IWidget_complex_struct(widget, complex); + ok(hr == S_OK, "Got hr %#x.\n", hr); } static void test_marshal_array(IWidget *widget, IDispatch *disp) { VARIANT var_in[2], var_out[2], var_in_out[2]; + ISomethingFromDispatch *proxy_sfd; array_t in, out, in_out; MYSTRUCT struct_in[2]; HRESULT hr; + int i = 2; memcpy(in, test_array1, sizeof(array_t)); memcpy(out, test_array2, sizeof(array_t)); @@ -2548,26 +2596,32 @@ static void test_marshal_array(IWidget *widget, IDispatch *disp) ok(!memcmp(&out, &test_array5, sizeof(array_t)), "Arrays didn't match.\n"); ok(!memcmp(&in_out, &test_array6, sizeof(array_t)), "Arrays didn't match.\n"); - V_VT(&var_in[0]) = VT_I4; V_I4(&var_in[0]) = 1; - V_VT(&var_in[1]) = VT_I4; V_I4(&var_in[1]) = 2; - V_VT(&var_out[0]) = VT_I4; V_I4(&var_out[0]) = 3; - V_VT(&var_out[1]) = VT_I4; V_I4(&var_out[1]) = 4; - V_VT(&var_in_out[0]) = VT_I4; V_I4(&var_in_out[0]) = 5; - V_VT(&var_in_out[1]) = VT_I4; V_I4(&var_in_out[1]) = 6; + V_VT(&var_in[0]) = VT_I4; V_I4(&var_in[0]) = 1; + V_VT(&var_in[1]) = VT_BYREF|VT_I4; V_I4REF(&var_in[1]) = &i; + V_VT(&var_out[0]) = VT_I4; V_I4(&var_out[0]) = 3; + V_VT(&var_out[1]) = VT_I4; V_I4(&var_out[1]) = 4; + V_VT(&var_in_out[0]) = VT_I4; V_I4(&var_in_out[0]) = 5; + V_VT(&var_in_out[1]) = VT_BSTR; V_BSTR(&var_in_out[1]) = SysAllocString(test_bstr1); hr = IWidget_variant_array(widget, var_in, var_out, var_in_out); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(V_VT(&var_in[0]) == VT_I4, "Got wrong type %u.\n", V_VT(&var_in[0])); ok(V_I4(&var_in[0]) == 1, "Got wrong value %d.\n", V_I4(&var_in[0])); - ok(V_VT(&var_in[1]) == VT_I4, "Got wrong type %u.\n", V_VT(&var_in[1])); - ok(V_I4(&var_in[1]) == 2, "Got wrong value %d.\n", V_I4(&var_in[1])); + ok(V_VT(&var_in[1]) == (VT_BYREF|VT_I4), "Got wrong type %u.\n", V_VT(&var_in[1])); + ok(V_I4REF(&var_in[1]) == &i, "Got wrong value %p.\n", V_I4REF(&var_in[1])); + ok(i == 2, "Got wrong value %d.\n", i); ok(V_VT(&var_out[0]) == VT_I1, "Got wrong type %u.\n", V_VT(&var_out[0])); ok(V_I1(&var_out[0]) == 9, "Got wrong value %u.\n", V_VT(&var_out[0])); - ok(V_VT(&var_out[1]) == VT_I1, "Got wrong type %u.\n", V_VT(&var_out[1])); - ok(V_I1(&var_out[1]) == 10, "Got wrong value %u.\n", V_VT(&var_out[1])); + ok(V_VT(&var_out[1]) == VT_BSTR, "Got wrong type %u.\n", V_VT(&var_out[1])); + ok(!lstrcmpW(V_BSTR(&var_out[1]), test_bstr2), "Got wrong value %s.\n", wine_dbgstr_w(V_BSTR(&var_out[1]))); ok(V_VT(&var_in_out[0]) == VT_I1, "Got wrong type %u.\n", V_VT(&var_in_out[0])); ok(V_I1(&var_in_out[0]) == 11, "Got wrong value %u.\n", V_VT(&var_in_out[0])); - ok(V_VT(&var_in_out[1]) == VT_I1, "Got wrong type %u.\n", V_VT(&var_in_out[1])); - ok(V_I1(&var_in_out[1]) == 12, "Got wrong value %u.\n", V_VT(&var_in_out[1])); + ok(V_VT(&var_in_out[1]) == VT_UNKNOWN, "Got wrong type %u.\n", V_VT(&var_in_out[1])); + hr = IUnknown_QueryInterface(V_UNKNOWN(&var_in_out[1]), &IID_ISomethingFromDispatch, (void **)&proxy_sfd); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = ISomethingFromDispatch_anotherfn(proxy_sfd); + ok(hr == 0x01234567, "Got hr %#x.\n", hr); + ISomethingFromDispatch_Release(proxy_sfd); + release_iface(V_UNKNOWN(&var_in_out[1])); memcpy(&struct_in[0], &test_mystruct1, sizeof(MYSTRUCT)); memcpy(&struct_in[1], &test_mystruct2, sizeof(MYSTRUCT)); @@ -3592,6 +3646,37 @@ static void test_external_connection(void) IStream_Release(stream); } +static void test_marshal_dispinterface(void) +{ + static const LARGE_INTEGER zero; + + ISomethingFromDispatch *disp_obj = create_disp_obj(); + ITypeInfo *typeinfo = NULL; + IDispatch *proxy_disp; + IStream *stream; + HANDLE thread; + HRESULT hr; + ULONG ref; + DWORD tid; + + CreateStreamOnHGlobal(NULL, TRUE, &stream); + tid = start_host_object(stream, &DIID_ItestIF4, (IUnknown *)disp_obj, MSHLFLAGS_NORMAL, &thread); + IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL); + hr = CoUnmarshalInterface(stream, &DIID_ItestIF4, (void **)&proxy_disp); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IDispatch_GetTypeInfo(proxy_disp, 0xdeadbeef, 0, &typeinfo); + ok(hr == 0xbeefdead, "Got hr %#x.\n", hr); + + ref = IDispatch_Release(proxy_disp); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IStream_Release(stream); + ok(!ref, "Got outstanding refcount %d.\n", ref); + end_host_object(tid, thread); + ref = ISomethingFromDispatch_Release(disp_obj); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(tmarshal) { HRESULT hr; @@ -3613,6 +3698,7 @@ START_TEST(tmarshal) test_StaticWidget(); test_libattr(); test_external_connection(); + test_marshal_dispinterface(); hr = UnRegisterTypeLib(&LIBID_TestTypelib, 2, 5, LOCALE_NEUTRAL, sizeof(void*) == 8 ? SYS_WIN64 : SYS_WIN32); diff --git a/modules/rostests/winetests/oleaut32/tmarshal.idl b/modules/rostests/winetests/oleaut32/tmarshal.idl index cdc7dc14d39..14b80c4eec4 100644 --- a/modules/rostests/winetests/oleaut32/tmarshal.idl +++ b/modules/rostests/winetests/oleaut32/tmarshal.idl @@ -65,6 +65,7 @@ enum IWidget_dispids DISPID_TM_STRUCT_PTR_PTR, DISPID_TM_THIN_STRUCT, DISPID_TM_RECT, + DISPID_TM_COMPLEX_STRUCT, DISPID_TM_ARRAY, DISPID_TM_VARIANT_ARRAY, DISPID_TM_STRUCT_ARRAY, @@ -105,6 +106,8 @@ library TestTypelib typedef [public] int myint_t; + typedef int array_t[4]; + coclass ApplicationObject2; [ @@ -335,7 +338,23 @@ library TestTypelib [id(DISPID_TM_RECT)] HRESULT rect([in] RECT in, [out] RECT *out, [in] RECT *in_ptr, [in, out] RECT *in_out); - typedef int array_t[4]; + struct complex + { + char c; + int i; + int *pi; + int **ppi; + ISomethingFromDispatch *iface; + ISomethingFromDispatch **iface_ptr; + BSTR bstr; + VARIANT var; + MYSTRUCT mystruct; + array_t arr; + myint_t myint; + }; + + [id(DISPID_TM_COMPLEX_STRUCT)] + HRESULT complex_struct([in] struct complex in); [id(DISPID_TM_ARRAY)] HRESULT array([in] array_t in, [out] array_t out, [in, out] array_t in_out); diff --git a/modules/rostests/winetests/oleaut32/typelib.c b/modules/rostests/winetests/oleaut32/typelib.c index 90f0cb256e5..a7064810420 100644 --- a/modules/rostests/winetests/oleaut32/typelib.c +++ b/modules/rostests/winetests/oleaut32/typelib.c @@ -1138,9 +1138,9 @@ static int WINAPI int_func( int a0, int a1, int a2, int a3, int a4 ) static double WINAPI double_func( double a0, float a1, double a2, int a3 ) { - ok( a0 == 1.2, "wrong arg0 %f\n", (double)a0 ); + ok( a0 == 1.2, "wrong arg0 %f\n", a0 ); ok( a1 == 3.25, "wrong arg1 %f\n", (double)a1 ); - ok( a2 == 1.2e12, "wrong arg2 %f\n", (double)a2); + ok( a2 == 1.2e12, "wrong arg2 %f\n", a2); ok( a3 == -4433.0, "wrong arg3 %f\n", (double)a3 ); return 4321; } @@ -4807,7 +4807,7 @@ static void test_dump_typelib(const char *name) for (func = 0; func < typeattr->cFuncs; func++) { - function_info *fn_info = (function_info *)&ti->funcs[func]; + const function_info *fn_info = &ti->funcs[func]; FUNCDESC *desc; BSTR namesTab[256]; UINT cNames; @@ -4963,6 +4963,7 @@ static void test_register_typelib(BOOL system_registration) HKEY hkey; REGSAM opposite = (sizeof(void*) == 8 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY); BOOL is_wow64 = FALSE; + LONG size; struct { TYPEKIND kind; @@ -5071,7 +5072,26 @@ static void test_register_typelib(BOOL system_registration) ret = RegOpenKeyExA(HKEY_CLASSES_ROOT, key_name, 0, KEY_READ, &hkey); ok(ret == expect_ret, "%d: got %d\n", i, ret); - if(ret == ERROR_SUCCESS) RegCloseKey(hkey); + if (ret == ERROR_SUCCESS) + { + size = sizeof(uuid); + ret = RegQueryValueA(hkey, "ProxyStubClsid32", uuid, &size); + ok(!ret, "Failed to get proxy GUID, error %u.\n", ret); + + if (attrs[i].kind == TKIND_INTERFACE || (attrs[i].flags & TYPEFLAG_FDUAL)) + { + ok(!strcasecmp(uuid, "{00020424-0000-0000-c000-000000000046}"), + "Got unexpected proxy CLSID %s.\n", uuid); + } + else + { + ok(!strcasecmp(uuid, "{00020420-0000-0000-c000-000000000046}"), + "Got unexpected proxy CLSID %s.\n", uuid); + } + + RegCloseKey(hkey); + } + /* 32-bit typelibs should be registered into both registry bit modes */ if (is_win64 || is_wow64) diff --git a/modules/rostests/winetests/oleaut32/vartest.c b/modules/rostests/winetests/oleaut32/vartest.c index 92e044bcd3f..0b1ac0f1cd0 100644 --- a/modules/rostests/winetests/oleaut32/vartest.c +++ b/modules/rostests/winetests/oleaut32/vartest.c @@ -2715,15 +2715,13 @@ static void test_VarSub(void) ok(hres == S_OK && V_VT(&result) == VT_CY, "VarSub: expected coerced type VT_CY, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromCy(V_CY(&result), &r); - ok(hres == S_OK && EQ_DOUBLE(r, 4702.0), - "VarSub: CY value %f, expected %f\n", r, (double)4720); + ok(hres == S_OK && EQ_DOUBLE(r, 4702.0), "VarSub: CY value %f, expected %f\n", r, 4720.0); hres = pVarSub(&left, &dec, &result); ok(hres == S_OK && V_VT(&result) == VT_DECIMAL, "VarSub: expected coerced type VT_DECIMAL, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromDec(&V_DECIMAL(&result), &r); - ok(hres == S_OK && EQ_DOUBLE(r, -6.8), - "VarSub: DECIMAL value %f, expected %f\n", r, (double)-15.2); + ok(hres == S_OK && EQ_DOUBLE(r, -6.8), "VarSub: DECIMAL value %f, expected %f\n", r, -6.8); SysFreeString(lbstr); SysFreeString(rbstr); @@ -5534,12 +5532,12 @@ static void test_VarMul(void) hres = pVarMul(&cy, &right, &result); ok(hres == S_OK && V_VT(&result) == VT_CY, "VarMul: expected coerced type VT_CY, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromCy(V_CY(&result), &r); - ok(hres == S_OK && EQ_DOUBLE(r, 42399.0), "VarMul: CY value %f, expected %f\n", r, (double)42399); + ok(hres == S_OK && EQ_DOUBLE(r, 42399.0), "VarMul: CY value %f, expected %f\n", r, 42399.0); hres = pVarMul(&left, &dec, &result); ok(hres == S_OK && V_VT(&result) == VT_DECIMAL, "VarMul: expected coerced type VT_DECIMAL, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromDec(&V_DECIMAL(&result), &r); - ok(hres == S_OK && EQ_DOUBLE(r, 46.2), "VarMul: DECIMAL value %f, expected %f\n", r, (double)46.2); + ok(hres == S_OK && EQ_DOUBLE(r, 46.2), "VarMul: DECIMAL value %f, expected %f\n", r, 46.2); SysFreeString(lbstr); SysFreeString(rbstr); @@ -5705,7 +5703,7 @@ static void test_VarAdd(void) hres = pVarAdd(&left, &right, &result); ok(hres == S_OK && V_VT(&result) == VT_BSTR, "VarAdd: expected coerced type VT_BSTR, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromStr(V_BSTR(&result), 0, 0, &r); - ok(hres == S_OK && EQ_DOUBLE(r, 1212.0), "VarAdd: BSTR value %f, expected %f\n", r, (double)1212); + ok(hres == S_OK && EQ_DOUBLE(r, 1212.0), "VarAdd: BSTR value %f, expected %f\n", r, 1212.0); VariantClear(&result); /* Manuly test some VT_CY and VT_DECIMAL variants */ @@ -5725,12 +5723,12 @@ static void test_VarAdd(void) hres = pVarAdd(&cy, &right, &result); ok(hres == S_OK && V_VT(&result) == VT_CY, "VarAdd: expected coerced type VT_CY, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromCy(V_CY(&result), &r); - ok(hres == S_OK && EQ_DOUBLE(r, 4720.0), "VarAdd: CY value %f, expected %f\n", r, (double)4720); + ok(hres == S_OK && EQ_DOUBLE(r, 4720.0), "VarAdd: CY value %f, expected %f\n", r, 4720.0); hres = pVarAdd(&left, &dec, &result); ok(hres == S_OK && V_VT(&result) == VT_DECIMAL, "VarAdd: expected coerced type VT_DECIMAL, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromDec(&V_DECIMAL(&result), &r); - ok(hres == S_OK && EQ_DOUBLE(r, -15.2), "VarAdd: DECIMAL value %f, expected %f\n", r, (double)-15.2); + ok(hres == S_OK && EQ_DOUBLE(r, -15.2), "VarAdd: DECIMAL value %f, expected %f\n", r, -15.2); VariantClear(&result); SysFreeString(lbstr); @@ -7995,40 +7993,37 @@ static void test_VarDiv(void) ok(hres == S_OK && V_VT(&result) == VT_R8, "VARDIV: expected coerced type VT_R8, got %s!\n", vtstr(V_VT(&result))); ok(hres == S_OK && EQ_DOUBLE(V_R8(&result), 1.0), - "VARDIV: CY value %f, expected %f\n", V_R8(&result), (double)1.0); + "VARDIV: CY value %f, expected %f\n", V_R8(&result), 1.0); hres = pVarDiv(&cy, &right, &result); ok(hres == S_OK && V_VT(&result) == VT_R8, "VARDIV: expected coerced type VT_R8, got %s!\n", vtstr(V_VT(&result))); ok(hres == S_OK && EQ_DOUBLE(V_R8(&result), 5000.0), - "VARDIV: CY value %f, expected %f\n", V_R8(&result), (double)5000.0); + "VARDIV: CY value %f, expected %f\n", V_R8(&result), 5000.0); hres = pVarDiv(&left, &cy, &result); ok(hres == S_OK && V_VT(&result) == VT_R8, "VARDIV: expected coerced type VT_R8, got %s!\n", vtstr(V_VT(&result))); ok(hres == S_OK && EQ_DOUBLE(V_R8(&result), 0.01), - "VARDIV: CY value %f, expected %f\n", V_R8(&result), (double)0.01); + "VARDIV: CY value %f, expected %f\n", V_R8(&result), 0.01); hres = pVarDiv(&left, &dec, &result); ok(hres == S_OK && V_VT(&result) == VT_DECIMAL, "VARDIV: expected coerced type VT_DECIMAL, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromDec(&V_DECIMAL(&result), &r); - ok(hres == S_OK && EQ_DOUBLE(r, 50.0), - "VARDIV: DECIMAL value %f, expected %f\n", r, (double)50.0); + ok(hres == S_OK && EQ_DOUBLE(r, 50.0), "VARDIV: DECIMAL value %f, expected %f\n", r, 50.0); hres = pVarDiv(&dec, &dec, &result); ok(hres == S_OK && V_VT(&result) == VT_DECIMAL, "VARDIV: expected coerced type VT_DECIMAL, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromDec(&V_DECIMAL(&result), &r); - ok(hres == S_OK && EQ_DOUBLE(r, 1.0), - "VARDIV: DECIMAL value %f, expected %f\n", r, (double)1.0); + ok(hres == S_OK && EQ_DOUBLE(r, 1.0), "VARDIV: DECIMAL value %f, expected %f\n", r, 1.0); hres = pVarDiv(&dec, &right, &result); ok(hres == S_OK && V_VT(&result) == VT_DECIMAL, "VARDIV: expected coerced type VT_DECIMAL, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromDec(&V_DECIMAL(&result), &r); - ok(hres == S_OK && EQ_DOUBLE(r, 1.0), - "VARDIV: DECIMAL value %f, expected %f\n", r, (double)1.0); + ok(hres == S_OK && EQ_DOUBLE(r, 1.0), "VARDIV: DECIMAL value %f, expected %f\n", r, 1.0); /* Check for division by zero and overflow */ V_VT(&left) = VT_R8;
5 years, 1 month
1
0
0
0
[reactos] 01/01: [OLEAUT32] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ae24453e12d84c0e48025…
commit ae24453e12d84c0e480253f3b4c258a4fdaaf261 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:05:03 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:05:03 2019 +0100 [OLEAUT32] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/oleaut32/dispatch.c | 2 - dll/win32/oleaut32/oleaut.c | 160 +++--- dll/win32/oleaut32/olefont.c | 13 +- dll/win32/oleaut32/olepicture.c | 10 +- dll/win32/oleaut32/precomp.h | 4 +- dll/win32/oleaut32/recinfo.c | 9 +- dll/win32/oleaut32/safearray.c | 18 +- dll/win32/oleaut32/typelib.c | 1131 ++++++++++++++++++++++----------------- dll/win32/oleaut32/varformat.c | 53 +- dll/win32/oleaut32/variant.c | 23 +- dll/win32/oleaut32/vartype.c | 35 +- media/doc/README.WINE | 2 +- 12 files changed, 776 insertions(+), 684 deletions(-) diff --git a/dll/win32/oleaut32/dispatch.c b/dll/win32/oleaut32/dispatch.c index a666d3dba1c..7e6398a1621 100644 --- a/dll/win32/oleaut32/dispatch.c +++ b/dll/win32/oleaut32/dispatch.c @@ -19,8 +19,6 @@ * */ -#include "config.h" - #include <stdlib.h> #include <string.h> #include <stdarg.h> diff --git a/dll/win32/oleaut32/oleaut.c b/dll/win32/oleaut32/oleaut.c index ae76d245d24..87606bbf344 100644 --- a/dll/win32/oleaut32/oleaut.c +++ b/dll/win32/oleaut32/oleaut.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <stdarg.h> #include <stdio.h> #include <string.h> @@ -41,7 +39,6 @@ #include "oleaut32_oaidl.h" #include "wine/debug.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DECLARE_DEBUG_CHANNEL(heap); @@ -877,7 +874,7 @@ static HRESULT reg_get_typelib_module(REFIID iid, WCHAR *module, DWORD len) sprintf(typelibkey, "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32); #else snprintf(typelibkey, sizeof(typelibkey), "Typelib\\%s\\%s\\0\\win%u", tlguid, ver, sizeof(void *) == 8 ? 64 : 32); -#endif // __REACTOS__ +#endif /* __REACTOS__ */ tlfnlen = sizeof(tlfn); if (RegQueryValueA(HKEY_CLASSES_ROOT, typelibkey, tlfn, &tlfnlen)) { @@ -927,7 +924,7 @@ static HRESULT get_typeinfo_for_iid(REFIID iid, ITypeInfo **typeinfo) return hr; } -static HRESULT WINAPI typelib_ps_QueryInterface(IPSFactoryBuffer *iface, REFIID iid, void **out) +static HRESULT WINAPI dispatch_typelib_ps_QueryInterface(IPSFactoryBuffer *iface, REFIID iid, void **out) { if (IsEqualIID(iid, &IID_IPSFactoryBuffer) || IsEqualIID(iid, &IID_IUnknown)) { @@ -940,135 +937,121 @@ static HRESULT WINAPI typelib_ps_QueryInterface(IPSFactoryBuffer *iface, REFIID return E_NOINTERFACE; } -static ULONG WINAPI typelib_ps_AddRef(IPSFactoryBuffer *iface) +static ULONG WINAPI dispatch_typelib_ps_AddRef(IPSFactoryBuffer *iface) { return 2; } -static ULONG WINAPI typelib_ps_Release(IPSFactoryBuffer *iface) +static ULONG WINAPI dispatch_typelib_ps_Release(IPSFactoryBuffer *iface) { return 1; } -static HRESULT WINAPI typelib_ps_CreateProxy(IPSFactoryBuffer *iface, - IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **out) +static HRESULT dispatch_create_proxy(IUnknown *outer, IRpcProxyBuffer **proxy, void **out) { - ITypeInfo *typeinfo; + IPSFactoryBuffer *factory; HRESULT hr; - hr = get_typeinfo_for_iid(iid, &typeinfo); + hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory); if (FAILED(hr)) return hr; - hr = CreateProxyFromTypeInfo(typeinfo, outer, iid, proxy, out); - if (FAILED(hr)) - ERR("Failed to create proxy, hr %#x.\n", hr); - - ITypeInfo_Release(typeinfo); + hr = IPSFactoryBuffer_CreateProxy(factory, outer, &IID_IDispatch, proxy, out); + IPSFactoryBuffer_Release(factory); return hr; } -static HRESULT WINAPI typelib_ps_CreateStub(IPSFactoryBuffer *iface, REFIID iid, - IUnknown *server, IRpcStubBuffer **stub) +static HRESULT WINAPI dispatch_typelib_ps_CreateProxy(IPSFactoryBuffer *iface, + IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **out) { ITypeInfo *typeinfo; + TYPEATTR *attr; HRESULT hr; + if (IsEqualGUID(iid, &IID_IDispatch)) + return dispatch_create_proxy(outer, proxy, out); + hr = get_typeinfo_for_iid(iid, &typeinfo); if (FAILED(hr)) return hr; - hr = CreateStubFromTypeInfo(typeinfo, iid, server, stub); + hr = ITypeInfo_GetTypeAttr(typeinfo, &attr); if (FAILED(hr)) - ERR("Failed to create stub, hr %#x.\n", hr); - - ITypeInfo_Release(typeinfo); - return hr; -} - -static const IPSFactoryBufferVtbl typelib_ps_vtbl = -{ - typelib_ps_QueryInterface, - typelib_ps_AddRef, - typelib_ps_Release, - typelib_ps_CreateProxy, - typelib_ps_CreateStub, -}; - -static IPSFactoryBuffer typelib_ps = { &typelib_ps_vtbl }; - -extern void _get_STDFONT_CF(LPVOID *); -extern void _get_STDPIC_CF(LPVOID *); - -static HRESULT WINAPI PSDispatchFacBuf_QueryInterface(IPSFactoryBuffer *iface, REFIID riid, void **ppv) -{ - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IPSFactoryBuffer)) { - IPSFactoryBuffer_AddRef(iface); - *ppv = iface; - return S_OK; + ITypeInfo_Release(typeinfo); + return hr; } - return E_NOINTERFACE; -} -static ULONG WINAPI PSDispatchFacBuf_AddRef(IPSFactoryBuffer *iface) -{ - return 2; -} + if (attr->typekind == TKIND_INTERFACE || (attr->wTypeFlags & TYPEFLAG_FDUAL)) + hr = CreateProxyFromTypeInfo(typeinfo, outer, iid, proxy, out); + else + hr = dispatch_create_proxy(outer, proxy, out); -static ULONG WINAPI PSDispatchFacBuf_Release(IPSFactoryBuffer *iface) -{ - return 1; + if (FAILED(hr)) + ERR("Failed to create proxy, hr %#x.\n", hr); + + ITypeInfo_ReleaseTypeAttr(typeinfo, attr); + ITypeInfo_Release(typeinfo); + return hr; } -static HRESULT WINAPI PSDispatchFacBuf_CreateProxy(IPSFactoryBuffer *iface, - IUnknown *outer, REFIID iid, IRpcProxyBuffer **proxy, void **obj) +static HRESULT dispatch_create_stub(IUnknown *server, IRpcStubBuffer **stub) { IPSFactoryBuffer *factory; HRESULT hr; - if (IsEqualIID(iid, &IID_IDispatch)) - { - hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory); - if (FAILED(hr)) return hr; + hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory); + if (FAILED(hr)) return hr; - hr = IPSFactoryBuffer_CreateProxy(factory, outer, iid, proxy, obj); - IPSFactoryBuffer_Release(factory); - return hr; - } - else - return IPSFactoryBuffer_CreateProxy(&typelib_ps, outer, iid, proxy, obj); + hr = IPSFactoryBuffer_CreateStub(factory, &IID_IDispatch, server, stub); + IPSFactoryBuffer_Release(factory); + return hr; } -static HRESULT WINAPI PSDispatchFacBuf_CreateStub(IPSFactoryBuffer *iface, +static HRESULT WINAPI dispatch_typelib_ps_CreateStub(IPSFactoryBuffer *iface, REFIID iid, IUnknown *server, IRpcStubBuffer **stub) { - IPSFactoryBuffer *factory; + ITypeInfo *typeinfo; + TYPEATTR *attr; HRESULT hr; - if (IsEqualIID(iid, &IID_IDispatch)) - { - hr = OLEAUTPS_DllGetClassObject(&CLSID_PSFactoryBuffer, &IID_IPSFactoryBuffer, (void **)&factory); - if (FAILED(hr)) return hr; + if (IsEqualGUID(iid, &IID_IDispatch)) + return dispatch_create_stub(server, stub); + + hr = get_typeinfo_for_iid(iid, &typeinfo); + if (FAILED(hr)) return hr; - hr = IPSFactoryBuffer_CreateStub(factory, iid, server, stub); - IPSFactoryBuffer_Release(factory); + hr = ITypeInfo_GetTypeAttr(typeinfo, &attr); + if (FAILED(hr)) + { + ITypeInfo_Release(typeinfo); return hr; } + + if (attr->typekind == TKIND_INTERFACE || (attr->wTypeFlags & TYPEFLAG_FDUAL)) + hr = CreateStubFromTypeInfo(typeinfo, iid, server, stub); else - return IPSFactoryBuffer_CreateStub(&typelib_ps, iid, server, stub); + hr = dispatch_create_stub(server, stub); + + if (FAILED(hr)) + ERR("Failed to create proxy, hr %#x.\n", hr); + + ITypeInfo_ReleaseTypeAttr(typeinfo, attr); + ITypeInfo_Release(typeinfo); + return hr; } -static const IPSFactoryBufferVtbl PSDispatchFacBuf_Vtbl = +static const IPSFactoryBufferVtbl dispatch_typelib_ps_vtbl = { - PSDispatchFacBuf_QueryInterface, - PSDispatchFacBuf_AddRef, - PSDispatchFacBuf_Release, - PSDispatchFacBuf_CreateProxy, - PSDispatchFacBuf_CreateStub + dispatch_typelib_ps_QueryInterface, + dispatch_typelib_ps_AddRef, + dispatch_typelib_ps_Release, + dispatch_typelib_ps_CreateProxy, + dispatch_typelib_ps_CreateStub, }; -/* This is the whole PSFactoryBuffer object, just the vtableptr */ -static const IPSFactoryBufferVtbl *pPSDispatchFacBuf = &PSDispatchFacBuf_Vtbl; +static IPSFactoryBuffer dispatch_typelib_ps = { &dispatch_typelib_ps_vtbl }; + +extern void _get_STDFONT_CF(LPVOID *); +extern void _get_STDPIC_CF(LPVOID *); /*********************************************************************** * DllGetClassObject (OLEAUT32.@) @@ -1090,14 +1073,9 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) return S_OK; } } - if (IsEqualCLSID(rclsid, &CLSID_PSDispatch) && IsEqualIID(iid, &IID_IPSFactoryBuffer)) { - *ppv = &pPSDispatchFacBuf; - IPSFactoryBuffer_AddRef((IPSFactoryBuffer *)*ppv); - return S_OK; - } - if (IsEqualGUID(rclsid, &CLSID_PSOAInterface)) - return IPSFactoryBuffer_QueryInterface(&typelib_ps, iid, ppv); + if (IsEqualGUID(rclsid, &CLSID_PSDispatch) || IsEqualGUID(rclsid, &CLSID_PSOAInterface)) + return IPSFactoryBuffer_QueryInterface(&dispatch_typelib_ps, iid, ppv); if (IsEqualCLSID(rclsid, &CLSID_PSTypeComp) || IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) || diff --git a/dll/win32/oleaut32/olefont.c b/dll/win32/oleaut32/olefont.c index 9628dc091e9..b82ffbf1b54 100644 --- a/dll/win32/oleaut32/olefont.c +++ b/dll/win32/oleaut32/olefont.c @@ -35,7 +35,6 @@ #include "wingdi.h" #include "winuser.h" #include "wine/list.h" -#include "wine/unicode.h" #include "objbase.h" #include "oleauto.h" /* for SysAllocString(....) */ #include "ole2.h" @@ -230,7 +229,7 @@ static HRESULT dec_ext_ref(HFONT hfont) static WCHAR *strdupW(const WCHAR* str) { WCHAR *ret; - DWORD size = (strlenW(str) + 1) * sizeof(WCHAR); + DWORD size = (lstrlenW(str) + 1) * sizeof(WCHAR); ret = HeapAlloc(GetProcessHeap(), 0, size); if(ret) @@ -1063,8 +1062,8 @@ static HRESULT WINAPI OLEFontImpl_IsEqual( return S_FALSE; /* Check from string */ - left_len = strlenW(left->description.lpstrName); - right_len = strlenW(right->description.lpstrName); + left_len = lstrlenW(left->description.lpstrName); + right_len = lstrlenW(right->description.lpstrName); ret = CompareStringW(0,0,left->description.lpstrName, left_len, right->description.lpstrName, right_len); if (ret != CSTR_EQUAL) @@ -1727,7 +1726,7 @@ static HRESULT WINAPI OLEFontImpl_Save( /* FontName */ if (this->description.lpstrName) string_size = WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, - strlenW(this->description.lpstrName), NULL, 0, NULL, NULL ); + lstrlenW(this->description.lpstrName), NULL, 0, NULL, NULL ); else string_size = 0; @@ -1738,7 +1737,7 @@ static HRESULT WINAPI OLEFontImpl_Save( { if (!(writeBuffer = HeapAlloc( GetProcessHeap(), 0, string_size ))) return E_OUTOFMEMORY; WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, - strlenW(this->description.lpstrName), + lstrlenW(this->description.lpstrName), writeBuffer, string_size, NULL, NULL ); IStream_Write(pOutStream, writeBuffer, string_size, &written); @@ -1774,7 +1773,7 @@ static HRESULT WINAPI OLEFontImpl_GetSizeMax( if (this->description.lpstrName!=0) pcbSize->u.LowPart += WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, - strlenW(this->description.lpstrName), + lstrlenW(this->description.lpstrName), NULL, 0, NULL, NULL ); return S_OK; diff --git a/dll/win32/oleaut32/olepicture.c b/dll/win32/oleaut32/olepicture.c index 702fcde86de..05dd10b13c4 100644 --- a/dll/win32/oleaut32/olepicture.c +++ b/dll/win32/oleaut32/olepicture.c @@ -36,12 +36,6 @@ * */ -#include "config.h" -#include "wine/port.h" - -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif #include <stdarg.h> #include <stdio.h> #include <string.h> @@ -62,8 +56,6 @@ #include "initguid.h" #include "wincodec.h" #include "wine/debug.h" -#include "wine/unicode.h" -#include "wine/library.h" WINE_DEFAULT_DEBUG_CHANNEL(olepicture); @@ -2522,7 +2514,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, *ppvRet = NULL; /* Convert file URLs to DOS paths. */ - if (strncmpW(szURLorPath, file, 5) == 0) { + if (wcsncmp(szURLorPath, file, 5) == 0) { DWORD size; hRes = CoInternetParseUrl(szURLorPath, PARSE_PATH_FROM_URL, 0, path_buf, ARRAY_SIZE(path_buf), &size, 0); diff --git a/dll/win32/oleaut32/precomp.h b/dll/win32/oleaut32/precomp.h index c5d3cb15e17..4e80f66694e 100644 --- a/dll/win32/oleaut32/precomp.h +++ b/dll/win32/oleaut32/precomp.h @@ -2,8 +2,6 @@ #ifndef _OLEAUT32_PCH_ #define _OLEAUT32_PCH_ -#include <config.h> - #include <stdarg.h> #include <stdio.h> @@ -18,12 +16,12 @@ #include <winbase.h> #include <wingdi.h> #include <winreg.h> +#include <winnls.h> #include <ole2.h> #include <olectl.h> #include <wine/debug.h> #include <wine/list.h> -#include <wine/unicode.h> #include "connpt.h" #include "variant.h" diff --git a/dll/win32/oleaut32/recinfo.c b/dll/win32/oleaut32/recinfo.c index ec65a523e38..44d46595e85 100644 --- a/dll/win32/oleaut32/recinfo.c +++ b/dll/win32/oleaut32/recinfo.c @@ -28,7 +28,6 @@ #include "oleauto.h" #include "variant.h" -#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -402,7 +401,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetField(IRecordInfo *iface, PVOID pvData, return E_INVALIDARG; for(i=0; i<This->n_vars; i++) - if(!strcmpW(This->fields[i].name, szFieldName)) + if(!wcscmp(This->fields[i].name, szFieldName)) break; if(i == This->n_vars) return TYPE_E_FIELDNOTFOUND; @@ -424,7 +423,7 @@ static HRESULT WINAPI IRecordInfoImpl_GetFieldNoCopy(IRecordInfo *iface, PVOID p return E_INVALIDARG; for(i=0; i<This->n_vars; i++) - if(!strcmpW(This->fields[i].name, szFieldName)) + if(!wcscmp(This->fields[i].name, szFieldName)) break; if(i == This->n_vars) return TYPE_E_FIELDNOTFOUND; @@ -455,7 +454,7 @@ static HRESULT WINAPI IRecordInfoImpl_PutField(IRecordInfo *iface, ULONG wFlags, } for(i=0; i<This->n_vars; i++) - if(!strcmpW(This->fields[i].name, szFieldName)) + if(!wcscmp(This->fields[i].name, szFieldName)) break; if(i == This->n_vars) return TYPE_E_FIELDNOTFOUND; @@ -477,7 +476,7 @@ static HRESULT WINAPI IRecordInfoImpl_PutFieldNoCopy(IRecordInfo *iface, ULONG w return E_INVALIDARG; for(i=0; i<This->n_vars; i++) - if(!strcmpW(This->fields[i].name, szFieldName)) + if(!wcscmp(This->fields[i].name, szFieldName)) break; if(i == This->n_vars) return TYPE_E_FIELDNOTFOUND; diff --git a/dll/win32/oleaut32/safearray.c b/dll/win32/oleaut32/safearray.c index 64a5ab94d5d..0b769358f65 100644 --- a/dll/win32/oleaut32/safearray.c +++ b/dll/win32/oleaut32/safearray.c @@ -31,8 +31,6 @@ * 0x10: SAFEARRAYBOUNDS[0...] */ -#include "config.h" - #include <string.h> #include <stdarg.h> #include <stdio.h> @@ -525,8 +523,8 @@ HRESULT WINAPI SafeArrayAllocDescriptorEx(VARTYPE vt, UINT cDims, SAFEARRAY **pp ULONG cbElements; HRESULT hRet; - TRACE("(%d->%s,%d,%p)\n", vt, debugstr_vt(vt), cDims, ppsaOut); - + TRACE("(%s,%u,%p)\n", debugstr_vt(vt), cDims, ppsaOut); + cbElements = SAFEARRAY_GetVTSize(vt); if (!cbElements) WARN("Creating a descriptor with an invalid VARTYPE!\n"); @@ -601,7 +599,7 @@ HRESULT WINAPI SafeArrayAllocData(SAFEARRAY *psa) */ SAFEARRAY* WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound) { - TRACE("(%d->%s,%d,%p)\n", vt, debugstr_vt(vt), cDims, rgsabound); + TRACE("(%s,%u,%p)\n", debugstr_vt(vt), cDims, rgsabound); if (vt == VT_RECORD) return NULL; @@ -633,7 +631,7 @@ SAFEARRAY* WINAPI SafeArrayCreateEx(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsa IRecordInfo* iRecInfo = pvExtra; SAFEARRAY* psa; - TRACE("(%d->%s,%d,%p,%p)\n", vt, debugstr_vt(vt), cDims, rgsabound, pvExtra); + TRACE("(%s,%u,%p,%p)\n", debugstr_vt(vt), cDims, rgsabound, pvExtra); if (vt == VT_RECORD) { @@ -678,8 +676,8 @@ SAFEARRAY* WINAPI SafeArrayCreateEx(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsa */ SAFEARRAY* WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements) { - TRACE("(%d->%s,%d,%d\n", vt, debugstr_vt(vt), lLbound, cElements); - + TRACE("(%s,%d,%u)\n", debugstr_vt(vt), lLbound, cElements); + if (vt == VT_RECORD) return NULL; @@ -710,8 +708,8 @@ SAFEARRAY* WINAPI SafeArrayCreateVectorEx(VARTYPE vt, LONG lLbound, ULONG cEleme IRecordInfo* iRecInfo = pvExtra; SAFEARRAY* psa; - TRACE("(%d->%s,%d,%d,%p\n", vt, debugstr_vt(vt), lLbound, cElements, pvExtra); - + TRACE("(%s,%d,%u,%p)\n", debugstr_vt(vt), lLbound, cElements, pvExtra); + if (vt == VT_RECORD) { if (!iRecInfo) diff --git a/dll/win32/oleaut32/typelib.c b/dll/win32/oleaut32/typelib.c index 6ed9ce9eb73..76e5e7f64db 100644 --- a/dll/win32/oleaut32/typelib.c +++ b/dll/win32/oleaut32/typelib.c @@ -47,9 +47,6 @@ * */ -#include "config.h" -#include "wine/port.h" - #include <stdlib.h> #include <string.h> #include <stdarg.h> @@ -68,11 +65,11 @@ #include "winternl.h" #include "lzexpand.h" -#include "wine/unicode.h" #include "objbase.h" #include "typelib.h" #include "wine/debug.h" #include "variant.h" +#include "wine/asm.h" #include "wine/heap.h" #include "wine/list.h" @@ -182,7 +179,7 @@ static BOOL find_typelib_key( REFGUID guid, WORD *wMaj, WORD *wMin ) HKEY hkey; memcpy( buffer, typelibW, sizeof(typelibW) ); - StringFromGUID2( guid, buffer + strlenW(buffer), 40 ); + StringFromGUID2( guid, buffer + lstrlenW(buffer), 40 ); if (RegOpenKeyExW( HKEY_CLASSES_ROOT, buffer, 0, KEY_READ, &hkey ) != ERROR_SUCCESS) return FALSE; @@ -246,8 +243,8 @@ static WCHAR *get_typelib_key( REFGUID guid, WORD wMaj, WORD wMin, WCHAR *buffer static const WCHAR VersionFormatW[] = {'\\','%','x','.','%','x',0}; memcpy( buffer, TypelibW, sizeof(TypelibW) ); - StringFromGUID2( guid, buffer + strlenW(buffer), 40 ); - sprintfW( buffer + strlenW(buffer), VersionFormatW, wMaj, wMin ); + StringFromGUID2( guid, buffer + lstrlenW(buffer), 40 ); + swprintf( buffer + lstrlenW(buffer), VersionFormatW, wMaj, wMin ); return buffer; } @@ -258,7 +255,7 @@ static WCHAR *get_interface_key( REFGUID guid, WCHAR *buffer ) static const WCHAR InterfaceW[] = {'I','n','t','e','r','f','a','c','e','\\',0}; memcpy( buffer, InterfaceW, sizeof(InterfaceW) ); - StringFromGUID2( guid, buffer + strlenW(buffer), 40 ); + StringFromGUID2( guid, buffer + lstrlenW(buffer), 40 ); return buffer; } @@ -271,12 +268,12 @@ static WCHAR *get_lcid_subkey( LCID lcid, SYSKIND syskind, WCHAR *buffer ) static const WCHAR win32W[] = {'w','i','n','3','2',0}; static const WCHAR win64W[] = {'w','i','n','6','4',0}; - sprintfW( buffer, LcidFormatW, lcid ); + swprintf( buffer, LcidFormatW, lcid ); switch(syskind) { - case SYS_WIN16: strcatW( buffer, win16W ); break; - case SYS_WIN32: strcatW( buffer, win32W ); break; - case SYS_WIN64: strcatW( buffer, win64W ); break; + case SYS_WIN16: lstrcatW( buffer, win16W ); break; + case SYS_WIN32: lstrcatW( buffer, win32W ); break; + case SYS_WIN64: lstrcatW( buffer, win64W ); break; default: TRACE("Typelib is for unsupported syskind %i\n", syskind); return NULL; @@ -588,29 +585,39 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t WCHAR keyName[60]; HKEY key, subKey; - static const WCHAR PSOA[] = {'{','0','0','0','2','0','4','2','4','-', - '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-', - '0','0','0','0','0','0','0','0','0','0','4','6','}',0}; + static const WCHAR typelib_proxy_clsid[] = {'{','0','0','0','2','0','4','2','4','-', + '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-', + '0','0','0','0','0','0','0','0','0','0','4','6','}',0}; + static const WCHAR dispatch_proxy_clsid[] = {'{','0','0','0','2','0','4','2','0','-', + '0','0','0','0','-','0','0','0','0','-','C','0','0','0','-', + '0','0','0','0','0','0','0','0','0','0','4','6','}',0}; get_interface_key( &tattr->guid, keyName ); if (RegCreateKeyExW(HKEY_CLASSES_ROOT, keyName, 0, NULL, 0, KEY_WRITE | flag, NULL, &key, NULL) == ERROR_SUCCESS) { + const WCHAR *proxy_clsid; + + if (tattr->typekind == TKIND_INTERFACE || (tattr->wTypeFlags & TYPEFLAG_FDUAL)) + proxy_clsid = typelib_proxy_clsid; + else + proxy_clsid = dispatch_proxy_clsid; + if (name) RegSetValueExW(key, NULL, 0, REG_SZ, - (BYTE *)name, (strlenW(name)+1) * sizeof(OLECHAR)); + (BYTE *)name, (lstrlenW(name)+1) * sizeof(OLECHAR)); if (RegCreateKeyExW(key, ProxyStubClsidW, 0, NULL, 0, KEY_WRITE | flag, NULL, &subKey, NULL) == ERROR_SUCCESS) { RegSetValueExW(subKey, NULL, 0, REG_SZ, - (const BYTE *)PSOA, sizeof PSOA); + (const BYTE *)proxy_clsid, sizeof(typelib_proxy_clsid)); RegCloseKey(subKey); } if (RegCreateKeyExW(key, ProxyStubClsid32W, 0, NULL, 0, KEY_WRITE | flag, NULL, &subKey, NULL) == ERROR_SUCCESS) { RegSetValueExW(subKey, NULL, 0, REG_SZ, - (const BYTE *)PSOA, sizeof PSOA); + (const BYTE *)proxy_clsid, sizeof(typelib_proxy_clsid)); RegCloseKey(subKey); } @@ -623,10 +630,10 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t StringFromGUID2(&libattr->guid, buffer, 40); RegSetValueExW(subKey, NULL, 0, REG_SZ, - (BYTE *)buffer, (strlenW(buffer)+1) * sizeof(WCHAR)); - sprintfW(buffer, fmtver, libattr->wMajorVerNum, libattr->wMinorVerNum); + (BYTE *)buffer, (lstrlenW(buffer)+1) * sizeof(WCHAR)); + swprintf(buffer, fmtver, libattr->wMajorVerNum, libattr->wMinorVerNum); RegSetValueExW(subKey, VersionW, 0, REG_SZ, - (BYTE*)buffer, (strlenW(buffer)+1) * sizeof(WCHAR)); + (BYTE*)buffer, (lstrlenW(buffer)+1) * sizeof(WCHAR)); RegCloseKey(subKey); } @@ -646,11 +653,7 @@ static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *t * Success: S_OK * Failure: Status */ -HRESULT WINAPI RegisterTypeLib( - ITypeLib * ptlib, /* [in] Pointer to the library*/ - OLECHAR * szFullPath, /* [in] full Path of the library*/ - OLECHAR * szHelpDir) /* [in] dir to the helpfile for the library, - may be NULL*/ +HRESULT WINAPI RegisterTypeLib(ITypeLib *ptlib, const WCHAR *szFullPath, const WCHAR *szHelpDir) { HRESULT res; TLIBATTR *attr; @@ -714,9 +717,9 @@ HRESULT WINAPI RegisterTypeLib( /* FIXME: is %u correct? */ static const WCHAR formatW[] = {'%','u',0}; WCHAR buf[20]; - sprintfW(buf, formatW, attr->wLibFlags); + swprintf(buf, formatW, attr->wLibFlags); if (RegSetValueExW(subKey, NULL, 0, REG_SZ, - (BYTE *)buf, (strlenW(buf) + 1)*sizeof(WCHAR) ) != ERROR_SUCCESS) + (BYTE *)buf, (lstrlenW(buf) + 1)*sizeof(WCHAR) ) != ERROR_SUCCESS) res = E_FAIL; RegCloseKey(subKey); @@ -728,19 +731,18 @@ HRESULT WINAPI RegisterTypeLib( if (res == S_OK && RegCreateKeyExW(key, HELPDIRW, 0, NULL, 0, KEY_WRITE, NULL, &subKey, &disposition) == ERROR_SUCCESS) { - BOOL freeHelpDir = FALSE; + BSTR freeHelpDir = NULL; OLECHAR* pIndexStr; /* if we created a new key, and helpDir was null, set the helpdir to the directory which contains the typelib. However, if we just opened an existing key, we leave the helpdir alone */ if ((disposition == REG_CREATED_NEW_KEY) && (szHelpDir == NULL)) { - szHelpDir = SysAllocString(szFullPath); - pIndexStr = strrchrW(szHelpDir, '\\'); + szHelpDir = freeHelpDir = SysAllocString(szFullPath); + pIndexStr = wcsrchr(szHelpDir, '\\'); if (pIndexStr) { *pIndexStr = 0; } - freeHelpDir = TRUE; } /* if we have an szHelpDir, set it! */ @@ -751,10 +753,8 @@ HRESULT WINAPI RegisterTypeLib( } } - /* tidy up */ - if (freeHelpDir) SysFreeString(szHelpDir); + SysFreeString(freeHelpDir); RegCloseKey(subKey); - } else { res = E_FAIL; } @@ -974,7 +974,7 @@ enddeleteloop: /* Now, delete the type library path subkey */ get_lcid_subkey( lcid, syskind, subKeyName ); RegDeleteKeyW(key, subKeyName); - *strrchrW( subKeyName, '\\' ) = 0; /* remove last path component */ + *wcsrchr( subKeyName, '\\' ) = 0; /* remove last path component */ RegDeleteKeyW(key, subKeyName); /* check if there is anything besides the FLAGS/HELPDIR keys. @@ -986,8 +986,8 @@ enddeleteloop: tmpLength = ARRAY_SIZE(subKeyName); /* if its not FLAGS or HELPDIR, then we must keep the rest of the key */ - if (!strcmpW(subKeyName, FLAGSW)) continue; - if (!strcmpW(subKeyName, HELPDIRW)) continue; + if (!wcscmp(subKeyName, FLAGSW)) continue; + if (!wcscmp(subKeyName, HELPDIRW)) continue; deleteOtherStuff = FALSE; break; } @@ -1000,7 +1000,7 @@ enddeleteloop: key = NULL; RegDeleteKeyW(HKEY_CLASSES_ROOT, keyName); - *strrchrW( keyName, '\\' ) = 0; /* remove last path component */ + *wcsrchr( keyName, '\\' ) = 0; /* remove last path component */ RegDeleteKeyW(HKEY_CLASSES_ROOT, keyName); } @@ -1889,7 +1889,7 @@ static TLBString *TLB_append_str(struct list *string_list, BSTR new_str) return NULL; LIST_FOR_EACH_ENTRY(str, string_list, TLBString, entry) { - if (strcmpW(str->str, new_str) == 0) + if (wcscmp(str->str, new_str) == 0) return str; } @@ -3090,7 +3090,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, if (!(typeInfo->type_id & 0x8000)) { BYTE *p = resTab + typeInfo->type_id; - if ((*p == len) && !strncasecmp( (char*)p+1, typeid, len )) goto found_type; + if ((*p == len) && !_strnicmp( (char*)p+1, typeid, len )) goto found_type; } typeInfo = (NE_TYPEINFO *)((char *)(typeInfo + 1) + typeInfo->count * sizeof(NE_NAMEINFO)); @@ -3120,7 +3120,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, { BYTE *p = resTab + nameInfo->id; if (nameInfo->id & 0x8000) continue; - if ((*p == len) && !strncasecmp( (char*)p+1, resid, len )) goto found_name; + if ((*p == len) && !_strnicmp( (char*)p+1, resid, len )) goto found_name; } } else /* numeric resource id */ @@ -3296,11 +3296,11 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath *ppTypeLib = NULL; - index_str = strrchrW(pszFileName, '\\'); + index_str = wcsrchr(pszFileName, '\\'); if(index_str && *++index_str != '\0') { LPWSTR end_ptr; - LONG idx = strtolW(index_str, &end_ptr, 10); + LONG idx = wcstol(index_str, &end_ptr, 10); if(*end_ptr == '\0') { int str_len = index_str - pszFileName - 1; @@ -3313,7 +3313,7 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath if(!SearchPathW(NULL, file, NULL, cchPath, pszPath, NULL)) { - if(strchrW(file, '\\')) + if(wcschr(file, '\\')) { lstrcpyW(pszPath, file); } @@ -3321,7 +3321,7 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath { int len = GetSystemDirectoryW(pszPath, cchPath); pszPath[len] = '\\'; - memcpy(pszPath + len + 1, file, (strlenW(file) + 1) * sizeof(WCHAR)); + memcpy(pszPath + len + 1, file, (lstrlenW(file) + 1) * sizeof(WCHAR)); } } @@ -3359,7 +3359,7 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath EnterCriticalSection(&cache_section); LIST_FOR_EACH_ENTRY(entry, &tlb_cache, ITypeLibImpl, entry) { - if (!strcmpiW(entry->path, pszPath) && entry->index == index) + if (!wcsicmp(entry->path, pszPath) && entry->index == index) { TRACE("cache hit\n"); *ppTypeLib = &entry->ITypeLib2_iface; @@ -3401,7 +3401,7 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath ITypeLibImpl *impl = impl_from_ITypeLib2(*ppTypeLib); TRACE("adding to cache\n"); - impl->path = heap_alloc((strlenW(pszPath)+1) * sizeof(WCHAR)); + impl->path = heap_alloc((lstrlenW(pszPath)+1) * sizeof(WCHAR)); lstrcpyW(impl->path, pszPath); /* We should really canonicalise the path here. */ impl->index = index; @@ -3764,8 +3764,8 @@ static const TLBString *decode_string(const BYTE *table, const char *stream, DWO while ((p = lookup_code(table, table_size, &bits))) { static const WCHAR spaceW[] = { ' ',0 }; - if (buf[0]) strcatW(buf, spaceW); - MultiByteToWideChar(CP_ACP, 0, p, -1, buf + strlenW(buf), buf_size - strlenW(buf)); + if (buf[0]) lstrcatW(buf, spaceW); + MultiByteToWideChar(CP_ACP, 0, p, -1, buf + lstrlenW(buf), buf_size - lstrlenW(buf)); } tlbstr = TLB_append_str(&lib->string_list, buf); @@ -5468,7 +5468,7 @@ static HRESULT WINAPI ITypeLibComp_fnBind( if ((pTypeInfo->typeattr.typekind == TKIND_ENUM) || (pTypeInfo->typeattr.typekind == TKIND_MODULE)) { - if (pTypeInfo->Name && !strcmpW(pTypeInfo->Name->str, szName)) + if (pTypeInfo->Name && !wcscmp(pTypeInfo->Name->str, szName)) { *pDescKind = DESCKIND_TYPECOMP; pBindPtr->lptcomp = &pTypeInfo->ITypeComp_iface; @@ -6114,7 +6114,7 @@ static HRESULT TLB_AllocAndInitVarDesc( const VARDESC *src, VARDESC **dest_ptr ) SIZE_T size = sizeof(*src); HRESULT hr; - if (src->lpstrSchema) size += (strlenW(src->lpstrSchema) + 1) * sizeof(WCHAR); + if (src->lpstrSchema) size += (lstrlenW(src->lpstrSchema) + 1) * sizeof(WCHAR); if (src->varkind == VAR_CONST) size += sizeof(VARIANT); size += TLB_SizeElemDesc(&src->elemdescVar); @@ -6128,7 +6128,7 @@ static HRESULT TLB_AllocAndInitVarDesc( const VARDESC *src, VARDESC **dest_ptr ) { int len; dest->lpstrSchema = (LPOLESTR)buffer; - len = strlenW(src->lpstrSchema); + len = lstrlenW(src->lpstrSchema); memcpy(dest->lpstrSchema, src->lpstrSchema, (len + 1) * sizeof(WCHAR)); buffer += (len + 1) * sizeof(WCHAR); } @@ -6443,20 +6443,133 @@ __ASM_GLOBAL_FUNC( call_method, __ASM_GLOBAL_FUNC( call_double_method, "jmp " __ASM_NAME("call_method") ) +HRESULT WINAPI DispCallFunc( void* pvInstance, ULONG_PTR oVft, CALLCONV cc, VARTYPE vtReturn, + UINT cActuals, VARTYPE* prgvt, VARIANTARG** prgpvarg, VARIANT* pvargResult ) +{ + int argspos = 0, stack_offset; + void *func; + UINT i; + DWORD *args; + + TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n", + pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, + pvargResult, V_VT(pvargResult)); + + if (cc != CC_STDCALL && cc != CC_CDECL) + { + FIXME("unsupported calling convention %d\n",cc); + return E_INVALIDARG; + } + + /* maximum size for an argument is sizeof(VARIANT) */ + args = heap_alloc(sizeof(VARIANT) * cActuals + sizeof(DWORD) * 2 ); + + if (pvInstance) + { + const FARPROC *vtable = *(FARPROC **)pvInstance; + func = vtable[oVft/sizeof(void *)]; + args[argspos++] = (DWORD)pvInstance; /* the This pointer is always the first parameter */ + } + else func = (void *)oVft; + + switch (vtReturn) + { + case VT_DECIMAL: + case VT_VARIANT: + args[argspos++] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */ + break; + case VT_HRESULT: + WARN("invalid return type %u\n", vtReturn); + heap_free( args ); + return E_INVALIDARG; + default: + break; + } + + for (i = 0; i < cActuals; i++) + { + VARIANT *arg = prgpvarg[i]; + + switch (prgvt[i]) + { + case VT_EMPTY: + break; + case VT_I8: + case VT_UI8: + case VT_R8: + case VT_DATE: + case VT_CY: + memcpy( &args[argspos], &V_I8(arg), sizeof(V_I8(arg)) ); + argspos += sizeof(V_I8(arg)) / sizeof(DWORD); + break; + case VT_DECIMAL: + case VT_VARIANT: + memcpy( &args[argspos], arg, sizeof(*arg) ); + argspos += sizeof(*arg) / sizeof(DWORD); + break; + case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */ + args[argspos++] = V_BOOL(arg); + break; + default: + args[argspos++] = V_UI4(arg); + break; + } + TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg)); + } + + switch (vtReturn) + { + case VT_EMPTY: + case VT_DECIMAL: + case VT_VARIANT: + call_method( func, argspos, args, &stack_offset ); + break; + case VT_R4: + V_R4(pvargResult) = call_double_method( func, argspos, args, &stack_offset ); + break; + case VT_R8: + case VT_DATE: + V_R8(pvargResult) = call_double_method( func, argspos, args, &stack_offset ); + break; + case VT_I8: + case VT_UI8: + case VT_CY: + V_UI8(pvargResult) = call_method( func, argspos, args, &stack_offset ); + break; + default: + V_UI4(pvargResult) = call_method( func, argspos, args, &stack_offset ); + break; + } + heap_free( args ); + if (stack_offset && cc == CC_STDCALL) + { + WARN( "stack pointer off by %d\n", stack_offset ); + return DISP_E_BADCALLEE; + } + if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn; + TRACE("retval: %s\n", debugstr_variant(pvargResult)); + return S_OK; +} + #elif defined(__x86_64__) extern DWORD_PTR CDECL call_method( void *func, int nb_args, const DWORD_PTR *args ); extern double CDECL call_double_method( void *func, int nb_args, const DWORD_PTR *args ); __ASM_GLOBAL_FUNC( call_method, "pushq %rbp\n\t" + __ASM_SEH(".seh_pushreg %rbp\n\t") __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") __ASM_CFI(".cfi_rel_offset %rbp,0\n\t") "movq %rsp,%rbp\n\t" + __ASM_SEH(".seh_setframe %rbp,0\n\t") __ASM_CFI(".cfi_def_cfa_register %rbp\n\t") "pushq %rsi\n\t" + __ASM_SEH(".seh_pushreg %rsi\n\t") __ASM_CFI(".cfi_rel_offset %rsi,-8\n\t") "pushq %rdi\n\t" + __ASM_SEH(".seh_pushreg %rdi\n\t") __ASM_CFI(".cfi_rel_offset %rdi,-16\n\t") + __ASM_SEH(".seh_endprologue\n\t") "movq %rcx,%rax\n\t" "movq $4,%rcx\n\t" "cmp %rcx,%rdx\n\t" @@ -6489,6 +6602,92 @@ __ASM_GLOBAL_FUNC( call_method, __ASM_GLOBAL_FUNC( call_double_method, "jmp " __ASM_NAME("call_method") ) +HRESULT WINAPI DispCallFunc( void* pvInstance, ULONG_PTR oVft, CALLCONV cc, VARTYPE vtReturn, + UINT cActuals, VARTYPE* prgvt, VARIANTARG** prgpvarg, VARIANT* pvargResult ) +{ + int argspos = 0; + UINT i; + DWORD_PTR *args; + void *func; + + TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n", + pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, + pvargResult, V_VT(pvargResult)); + + if (cc != CC_STDCALL && cc != CC_CDECL) + { + FIXME("unsupported calling convention %d\n",cc); + return E_INVALIDARG; + } + + /* maximum size for an argument is sizeof(DWORD_PTR) */ + args = heap_alloc( sizeof(DWORD_PTR) * (cActuals + 2) ); + + if (pvInstance) + { + const FARPROC *vtable = *(FARPROC **)pvInstance; + func = vtable[oVft/sizeof(void *)]; + args[argspos++] = (DWORD_PTR)pvInstance; /* the This pointer is always the first parameter */ + } + else func = (void *)oVft; + + switch (vtReturn) + { + case VT_DECIMAL: + case VT_VARIANT: + args[argspos++] = (DWORD_PTR)pvargResult; /* arg 0 is a pointer to the result */ + break; + case VT_HRESULT: + WARN("invalid return type %u\n", vtReturn); + heap_free( args ); + return E_INVALIDARG; + default: + break; + } + + for (i = 0; i < cActuals; i++) + { + VARIANT *arg = prgpvarg[i]; + + switch (prgvt[i]) + { + case VT_DECIMAL: + case VT_VARIANT: + args[argspos++] = (ULONG_PTR)arg; + break; + case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */ + args[argspos++] = V_BOOL(arg); + break; + default: + args[argspos++] = V_UI8(arg); + break; + } + TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg)); + } + + switch (vtReturn) + { + case VT_R4: + V_R4(pvargResult) = call_double_method( func, argspos, args ); + break; + case VT_R8: + case VT_DATE: + V_R8(pvargResult) = call_double_method( func, argspos, args ); + break; + case VT_DECIMAL: + case VT_VARIANT: + call_method( func, argspos, args ); + break; + default: + V_UI8(pvargResult) = call_method( func, argspos, args ); + break; + } + heap_free( args ); + if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn; + TRACE("retval: %s\n", debugstr_variant(pvargResult)); + return S_OK; +} + #elif defined(__arm__) extern LONGLONG CDECL call_method( void *func, int nb_stk_args, const DWORD *stk_args, const DWORD *reg_args ); @@ -6529,36 +6728,384 @@ __ASM_GLOBAL_FUNC( call_float_method, __ASM_GLOBAL_FUNC( call_double_method, "b " __ASM_NAME("call_method") ) -#endif /* __arm__ */ - -static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt) +HRESULT WINAPI DispCallFunc( void* pvInstance, ULONG_PTR oVft, CALLCONV cc, VARTYPE vtReturn, + UINT cActuals, VARTYPE* prgvt, VARIANTARG** prgpvarg, VARIANT* pvargResult ) { - HRESULT hr = S_OK; - ITypeInfo *tinfo2 = NULL; - TYPEATTR *tattr = NULL; + int argspos; + void *func; + UINT i; + DWORD *args; + struct { +#ifndef __SOFTFP__ + union { + float s[16]; + double d[8]; + } sd; +#endif + DWORD r[4]; + } regs; + int rcount; /* 32-bit register index count */ +#ifndef __SOFTFP__ + int scount = 0; /* single-precision float register index count */ + int dcount = 0; /* double-precision float register index count */ +#endif - hr = ITypeInfo_GetRefTypeInfo(tinfo, tdesc->u.hreftype, &tinfo2); - if (hr) + TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n", + pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult)); + + if (cc != CC_STDCALL && cc != CC_CDECL) { - ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED, " - "hr = 0x%08x\n", - tdesc->u.hreftype, hr); - return hr; + FIXME("unsupported calling convention %d\n",cc); + return E_INVALIDARG; } - hr = ITypeInfo_GetTypeAttr(tinfo2, &tattr); - if (hr) + + argspos = 0; + rcount = 0; + + if (pvInstance) { - ERR("ITypeInfo_GetTypeAttr failed, hr = 0x%08x\n", hr); - ITypeInfo_Release(tinfo2); - return hr; + const FARPROC *vtable = *(FARPROC **)pvInstance; + func = vtable[oVft/sizeof(void *)]; + regs.r[rcount++] = (DWORD)pvInstance; /* the This pointer is always the first parameter */ } + else func = (void *)oVft; - switch (tattr->typekind) + /* Determine if we need to pass a pointer for the return value as arg 0. If so, do that */ + /* first as it will need to be in the 'r' registers: */ + switch (vtReturn) { - case TKIND_ENUM: - *vt |= VT_I4; - break; - + case VT_DECIMAL: + case VT_VARIANT: + regs.r[rcount++] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */ + break; + case VT_HRESULT: + WARN("invalid return type %u\n", vtReturn); + return E_INVALIDARG; + default: /* And all others are in 'r', 's', or 'd' registers or have no return value */ + break; + } + + /* maximum size for an argument is sizeof(VARIANT). Also allow for return pointer and stack alignment. */ + args = heap_alloc( sizeof(VARIANT) * cActuals + sizeof(DWORD) * 4 ); + + for (i = 0; i < cActuals; i++) + { + VARIANT *arg = prgpvarg[i]; + DWORD *pdwarg = (DWORD *)(arg); /* a reinterpret_cast of the variant, used for copying structures when they are split between registers and stack */ + int ntemp; /* Used for counting words split between registers and stack */ + + switch (prgvt[i]) + { + case VT_EMPTY: + break; + case VT_R8: /* these must be 8-byte aligned, and put in 'd' regs or stack, as they are double-floats */ + case VT_DATE: +#ifndef __SOFTFP__ + dcount = max( (scount + 1) / 2, dcount ); + if (dcount < 8) + { + regs.sd.d[dcount++] = V_R8(arg); + } + else + { + argspos += (argspos % 2); /* align argspos to 8-bytes */ + memcpy( &args[argspos], &V_R8(arg), sizeof(V_R8(arg)) ); + argspos += sizeof(V_R8(arg)) / sizeof(DWORD); + } + break; +#endif + case VT_I8: /* these must be 8-byte aligned, and put in 'r' regs or stack, as they are long-longs */ + case VT_UI8: + case VT_CY: + if (rcount < 3) + { + rcount += (rcount % 2); /* align rcount to 8-byte register pair */ + memcpy( ®s.r[rcount], &V_UI8(arg), sizeof(V_UI8(arg)) ); + rcount += sizeof(V_UI8(arg)) / sizeof(DWORD); + } + else + { + rcount = 4; /* Make sure we flag that all 'r' regs are full */ + argspos += (argspos % 2); /* align argspos to 8-bytes */ + memcpy( &args[argspos], &V_UI8(arg), sizeof(V_UI8(arg)) ); + argspos += sizeof(V_UI8(arg)) / sizeof(DWORD); + } + break; + case VT_DECIMAL: /* these structures are 8-byte aligned, and put in 'r' regs or stack, can be split between the two */ + case VT_VARIANT: + /* 8-byte align 'r' and/or stack: */ + if (rcount < 3) + rcount += (rcount % 2); + else + { + rcount = 4; + argspos += (argspos % 2); + } + ntemp = sizeof(*arg) / sizeof(DWORD); + while (ntemp > 0) + { + if (rcount < 4) + regs.r[rcount++] = *pdwarg++; + else + args[argspos++] = *pdwarg++; + --ntemp; + } + break; + case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */ + if (rcount < 4) + regs.r[rcount++] = V_BOOL(arg); + else + args[argspos++] = V_BOOL(arg); + break; + case VT_R4: /* these must be 4-byte aligned, and put in 's' regs or stack, as they are single-floats */ +#ifndef __SOFTFP__ + if (!(scount % 2)) scount = max( scount, dcount * 2 ); + if (scount < 16) + regs.sd.s[scount++] = V_R4(arg); + else + args[argspos++] = V_UI4(arg); + break; +#endif + default: + if (rcount < 4) + regs.r[rcount++] = V_UI4(arg); + else + args[argspos++] = V_UI4(arg); + break; + } + TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg)); + } + + argspos += (argspos % 2); /* Make sure stack function alignment is 8-byte */ + + switch (vtReturn) + { + case VT_EMPTY: /* EMPTY = no return value */ + case VT_DECIMAL: /* DECIMAL and VARIANT already have a pointer argument passed (see above) */ + case VT_VARIANT: + call_method( func, argspos, args, (DWORD*)®s ); + break; + case VT_R4: + V_R4(pvargResult) = call_float_method( func, argspos, args, (DWORD*)®s ); + break; + case VT_R8: + case VT_DATE: + V_R8(pvargResult) = call_double_method( func, argspos, args, (DWORD*)®s ); + break; + case VT_I8: + case VT_UI8: + case VT_CY: + V_UI8(pvargResult) = call_method( func, argspos, args, (DWORD*)®s ); + break; + default: + V_UI4(pvargResult) = call_method( func, argspos, args, (DWORD*)®s ); + break; + } + heap_free( args ); + if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn; + TRACE("retval: %s\n", debugstr_variant(pvargResult)); + return S_OK; +} + +#elif defined(__aarch64__) + +extern DWORD_PTR CDECL call_method( void *func, int nb_stk_args, const DWORD_PTR *stk_args, const DWORD_PTR *reg_args ); +extern float CDECL call_float_method( void *func, int nb_stk_args, const DWORD_PTR *stk_args, const DWORD_PTR *reg_args ); +extern double CDECL call_double_method( void *func, int nb_stk_args, const DWORD_PTR *stk_args, const DWORD_PTR *reg_args ); +__ASM_GLOBAL_FUNC( call_method, + "stp x29, x30, [sp, #-16]!\n\t" + "mov x29, sp\n\t" + "sub sp, sp, x1, lsl #3\n\t" + "cbz x1, 2f\n" + "1:\tsub x1, x1, #1\n\t" + "ldr x4, [x2, x1, lsl #3]\n\t" + "str x4, [sp, x1, lsl #3]\n\t" + "cbnz x1, 1b\n" + "2:\tmov x16, x0\n\t" + "mov x9, x3\n\t" + "ldp d0, d1, [x9]\n\t" + "ldp d2, d3, [x9, #0x10]\n\t" + "ldp d4, d5, [x9, #0x20]\n\t" + "ldp d6, d7, [x9, #0x30]\n\t" + "ldp x0, x1, [x9, #0x40]\n\t" + "ldp x2, x3, [x9, #0x50]\n\t" + "ldp x4, x5, [x9, #0x60]\n\t" + "ldp x6, x7, [x9, #0x70]\n\t" + "ldr x8, [x9, #0x80]\n\t" + "blr x16\n\t" + "mov sp, x29\n\t" + "ldp x29, x30, [sp], #16\n\t" + "ret" ) +__ASM_GLOBAL_FUNC( call_float_method, + "b " __ASM_NAME("call_method") ) +__ASM_GLOBAL_FUNC( call_double_method, + "b " __ASM_NAME("call_method") ) + +HRESULT WINAPI DispCallFunc( void *instance, ULONG_PTR offset, CALLCONV cc, VARTYPE ret_type, UINT count, + VARTYPE *types, VARIANTARG **vargs, VARIANT *result ) +{ + int argspos; + void *func; + UINT i; + DWORD_PTR *args; + struct + { + union + { + float f; + double d; + } fp[8]; + DWORD_PTR x[9]; + } regs; + int rcount; /* 64-bit register index count */ + int fpcount = 0; /* float register index count */ + + TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n", + instance, offset, cc, ret_type, count, types, vargs, result, V_VT(result)); + + if (cc != CC_STDCALL && cc != CC_CDECL) + { + FIXME("unsupported calling convention %d\n",cc); + return E_INVALIDARG; + } + + argspos = 0; + rcount = 0; + + if (instance) + { + const FARPROC *vtable = *(FARPROC **)instance; + func = vtable[offset/sizeof(void *)]; + regs.x[rcount++] = (DWORD_PTR)instance; /* the This pointer is always the first parameter */ + } + else func = (void *)offset; + + /* Determine if we need to pass a pointer for the return value as arg 0. If so, do that */ + /* first as it will need to be in the 'x' registers: */ + switch (ret_type) + { + case VT_DECIMAL: + case VT_VARIANT: + regs.x[8] = (DWORD_PTR)result; /* x8 is a pointer to the result */ + break; + case VT_HRESULT: + WARN("invalid return type %u\n", ret_type); + return E_INVALIDARG; + default: + break; + } + + /* maximum size for an argument is sizeof(VARIANT). Also allow for return pointer and stack alignment. */ + args = heap_alloc( sizeof(VARIANT) * count + sizeof(DWORD_PTR) * 4 ); + + for (i = 0; i < count; i++) + { + VARIANT *arg = vargs[i]; + + switch (types[i]) + { + case VT_EMPTY: + break; + case VT_R4: + if (fpcount < 8) regs.fp[fpcount++].f = V_R4(arg); + else *(float *)&args[argspos++] = V_R4(arg); + break; + case VT_R8: + case VT_DATE: + if (fpcount < 8) regs.fp[fpcount++].d = V_R8(arg); + else *(double *)&args[argspos++] = V_R8(arg); + break; + case VT_DECIMAL: + case VT_VARIANT: + if (rcount < 7) + { + memcpy( ®s.x[rcount], arg, sizeof(*arg) ); + rcount += 2; + } + else + { + memcpy( &args[argspos], arg, sizeof(*arg) ); + argspos += 2; + } + break; + case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */ + if (rcount < 8) regs.x[rcount++] = V_BOOL(arg); + else args[argspos++] = V_BOOL(arg); + break; + default: + if (rcount < 8) regs.x[rcount++] = V_UI8(arg); + else args[argspos++] = V_UI8(arg); + break; + } + TRACE("arg %u: type %s %s\n", i, debugstr_vt(types[i]), debugstr_variant(arg)); + } + + argspos += (argspos % 2); /* Make sure stack function alignment is 16-byte */ + + switch (ret_type) + { + case VT_EMPTY: /* EMPTY = no return value */ + case VT_DECIMAL: /* DECIMAL and VARIANT already have a pointer argument passed (see above) */ + case VT_VARIANT: + call_method( func, argspos, args, (DWORD_PTR *)®s ); + break; + case VT_R4: + V_R4(result) = call_float_method( func, argspos, args, (DWORD_PTR *)®s ); + break; + case VT_R8: + case VT_DATE: + V_R8(result) = call_double_method( func, argspos, args, (DWORD_PTR *)®s ); + break; + default: + V_UI8(result) = call_method( func, argspos, args, (DWORD_PTR *)®s ); + break; + } + heap_free( args ); + if (ret_type != VT_VARIANT) V_VT(result) = ret_type; + TRACE("retval: %s\n", debugstr_variant(result)); + return S_OK; +} + +#else /* __aarch64__ */ + +HRESULT WINAPI DispCallFunc( void* pvInstance, ULONG_PTR oVft, CALLCONV cc, VARTYPE vtReturn, + UINT cActuals, VARTYPE* prgvt, VARIANTARG** prgpvarg, VARIANT* pvargResult ) +{ + FIXME( "(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d)): not implemented for this CPU\n", + pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult)); + return E_NOTIMPL; +} + +#endif + +static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt) +{ + HRESULT hr = S_OK; + ITypeInfo *tinfo2 = NULL; + TYPEATTR *tattr = NULL; + + hr = ITypeInfo_GetRefTypeInfo(tinfo, tdesc->u.hreftype, &tinfo2); + if (hr) + { + ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED, " + "hr = 0x%08x\n", + tdesc->u.hreftype, hr); + return hr; + } + hr = ITypeInfo_GetTypeAttr(tinfo2, &tattr); + if (hr) + { + ERR("ITypeInfo_GetTypeAttr failed, hr = 0x%08x\n", hr); + ITypeInfo_Release(tinfo2); + return hr; + } + + switch (tattr->typekind) + { + case TKIND_ENUM: + *vt |= VT_I4; + break; + case TKIND_ALIAS: hr = typedescvt_to_variantvt(tinfo2, &tattr->tdescAlias, vt); break; @@ -6718,420 +7265,6 @@ static HRESULT get_iface_guid(ITypeInfo *tinfo, HREFTYPE href, GUID *guid) return hres; } -/*********************************************************************** - * DispCallFunc (OLEAUT32.@) - * - * Invokes a function of the specified calling convention, passing the - * specified arguments and returns the result. - * - * PARAMS - * pvInstance [I] Optional pointer to the instance whose function to invoke. - * oVft [I] The offset in the vtable. See notes. - * cc [I] Calling convention of the function to call. - * vtReturn [I] The return type of the function. - * cActuals [I] Number of parameters. - * prgvt [I] The types of the parameters to pass. This is used for sizing only. - * prgpvarg [I] The arguments to pass. - * pvargResult [O] The return value of the function. Can be NULL. - * - * RETURNS - * Success: S_OK. - * Failure: HRESULT code. - * - * NOTES - * The HRESULT return value of this function is not affected by the return - * value of the user supplied function, which is returned in pvargResult. - * - * If pvInstance is NULL then a non-object function is to be called and oVft - * is the address of the function to call. - * - * The cc parameter can be one of the following values: - *|CC_FASTCALL - *|CC_CDECL - *|CC_PASCAL - *|CC_STDCALL - *|CC_FPFASTCALL - *|CC_SYSCALL - *|CC_MPWCDECL - *|CC_MPWPASCAL - * - */ -HRESULT WINAPI -DispCallFunc( - void* pvInstance, ULONG_PTR oVft, CALLCONV cc, VARTYPE vtReturn, UINT cActuals, - VARTYPE* prgvt, VARIANTARG** prgpvarg, VARIANT* pvargResult) -{ -#ifdef __i386__ - int argspos = 0, stack_offset; - void *func; - UINT i; - DWORD *args; - - TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n", - pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, - pvargResult, V_VT(pvargResult)); - - if (cc != CC_STDCALL && cc != CC_CDECL) - { - FIXME("unsupported calling convention %d\n",cc); - return E_INVALIDARG; - } - - /* maximum size for an argument is sizeof(VARIANT) */ - args = heap_alloc(sizeof(VARIANT) * cActuals + sizeof(DWORD) * 2 ); - - if (pvInstance) - { - const FARPROC *vtable = *(FARPROC **)pvInstance; - func = vtable[oVft/sizeof(void *)]; - args[argspos++] = (DWORD)pvInstance; /* the This pointer is always the first parameter */ - } - else func = (void *)oVft; - - switch (vtReturn) - { - case VT_DECIMAL: - case VT_VARIANT: - args[argspos++] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */ - break; - case VT_HRESULT: - WARN("invalid return type %u\n", vtReturn); - heap_free( args ); - return E_INVALIDARG; - default: - break; - } - - for (i = 0; i < cActuals; i++) - { - VARIANT *arg = prgpvarg[i]; - - switch (prgvt[i]) - { - case VT_EMPTY: - break; - case VT_I8: - case VT_UI8: - case VT_R8: - case VT_DATE: - case VT_CY: - memcpy( &args[argspos], &V_I8(arg), sizeof(V_I8(arg)) ); - argspos += sizeof(V_I8(arg)) / sizeof(DWORD); - break; - case VT_DECIMAL: - case VT_VARIANT: - memcpy( &args[argspos], arg, sizeof(*arg) ); - argspos += sizeof(*arg) / sizeof(DWORD); - break; - case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */ - args[argspos++] = V_BOOL(arg); - break; - default: - args[argspos++] = V_UI4(arg); - break; - } - TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg)); - } - - switch (vtReturn) - { - case VT_EMPTY: - case VT_DECIMAL: - case VT_VARIANT: - call_method( func, argspos, args, &stack_offset ); - break; - case VT_R4: - V_R4(pvargResult) = call_double_method( func, argspos, args, &stack_offset ); - break; - case VT_R8: - case VT_DATE: - V_R8(pvargResult) = call_double_method( func, argspos, args, &stack_offset ); - break; - case VT_I8: - case VT_UI8: - case VT_CY: - V_UI8(pvargResult) = call_method( func, argspos, args, &stack_offset ); - break; - default: - V_UI4(pvargResult) = call_method( func, argspos, args, &stack_offset ); - break; - } - heap_free( args ); - if (stack_offset && cc == CC_STDCALL) - { - WARN( "stack pointer off by %d\n", stack_offset ); - return DISP_E_BADCALLEE; - } - if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn; - TRACE("retval: %s\n", debugstr_variant(pvargResult)); - return S_OK; - -#elif defined(__x86_64__) - int argspos = 0; - UINT i; - DWORD_PTR *args; - void *func; - - TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n", - pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, - pvargResult, V_VT(pvargResult)); - - if (cc != CC_STDCALL && cc != CC_CDECL) - { - FIXME("unsupported calling convention %d\n",cc); - return E_INVALIDARG; - } - - /* maximum size for an argument is sizeof(DWORD_PTR) */ - args = heap_alloc( sizeof(DWORD_PTR) * (cActuals + 2) ); - - if (pvInstance) - { - const FARPROC *vtable = *(FARPROC **)pvInstance; - func = vtable[oVft/sizeof(void *)]; - args[argspos++] = (DWORD_PTR)pvInstance; /* the This pointer is always the first parameter */ - } - else func = (void *)oVft; - - switch (vtReturn) - { - case VT_DECIMAL: - case VT_VARIANT: - args[argspos++] = (DWORD_PTR)pvargResult; /* arg 0 is a pointer to the result */ - break; - case VT_HRESULT: - WARN("invalid return type %u\n", vtReturn); - heap_free( args ); - return E_INVALIDARG; - default: - break; - } - - for (i = 0; i < cActuals; i++) - { - VARIANT *arg = prgpvarg[i]; - - switch (prgvt[i]) - { - case VT_DECIMAL: - case VT_VARIANT: - args[argspos++] = (ULONG_PTR)arg; - break; - case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */ - args[argspos++] = V_BOOL(arg); - break; - default: - args[argspos++] = V_UI8(arg); - break; - } - TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg)); - } - - switch (vtReturn) - { - case VT_R4: - V_R4(pvargResult) = call_double_method( func, argspos, args ); - break; - case VT_R8: - case VT_DATE: - V_R8(pvargResult) = call_double_method( func, argspos, args ); - break; - case VT_DECIMAL: - case VT_VARIANT: - call_method( func, argspos, args ); - break; - default: - V_UI8(pvargResult) = call_method( func, argspos, args ); - break; - } - heap_free( args ); - if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn; - TRACE("retval: %s\n", debugstr_variant(pvargResult)); - return S_OK; - -#elif defined(__arm__) - int argspos; - void *func; - UINT i; - DWORD *args; - struct { -#ifndef __SOFTFP__ - union { - float s[16]; - double d[8]; - } sd; -#endif - DWORD r[4]; - } regs; - int rcount; /* 32-bit register index count */ -#ifndef __SOFTFP__ - int scount = 0; /* single-precision float register index count */ - int dcount = 0; /* double-precision float register index count */ -#endif - - TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n", - pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult)); - - if (cc != CC_STDCALL && cc != CC_CDECL) - { - FIXME("unsupported calling convention %d\n",cc); - return E_INVALIDARG; - } - - argspos = 0; - rcount = 0; - - if (pvInstance) - { - const FARPROC *vtable = *(FARPROC **)pvInstance; - func = vtable[oVft/sizeof(void *)]; - regs.r[rcount++] = (DWORD)pvInstance; /* the This pointer is always the first parameter */ - } - else func = (void *)oVft; - - /* Determine if we need to pass a pointer for the return value as arg 0. If so, do that */ - /* first as it will need to be in the 'r' registers: */ - switch (vtReturn) - { - case VT_DECIMAL: - case VT_VARIANT: - regs.r[rcount++] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */ - break; - case VT_HRESULT: - WARN("invalid return type %u\n", vtReturn); - return E_INVALIDARG; - default: /* And all others are in 'r', 's', or 'd' registers or have no return value */ - break; - } - - /* maximum size for an argument is sizeof(VARIANT). Also allow for return pointer and stack alignment. */ - args = heap_alloc( sizeof(VARIANT) * cActuals + sizeof(DWORD) * 4 ); - - for (i = 0; i < cActuals; i++) - { - VARIANT *arg = prgpvarg[i]; - DWORD *pdwarg = (DWORD *)(arg); /* a reinterpret_cast of the variant, used for copying structures when they are split between registers and stack */ - int ntemp; /* Used for counting words split between registers and stack */ - - switch (prgvt[i]) - { - case VT_EMPTY: - break; - case VT_R8: /* these must be 8-byte aligned, and put in 'd' regs or stack, as they are double-floats */ - case VT_DATE: -#ifndef __SOFTFP__ - dcount = max( (scount + 1) / 2, dcount ); - if (dcount < 8) - { - regs.sd.d[dcount++] = V_R8(arg); - } - else - { - argspos += (argspos % 2); /* align argspos to 8-bytes */ - memcpy( &args[argspos], &V_R8(arg), sizeof(V_R8(arg)) ); - argspos += sizeof(V_R8(arg)) / sizeof(DWORD); - } - break; -#endif - case VT_I8: /* these must be 8-byte aligned, and put in 'r' regs or stack, as they are long-longs */ - case VT_UI8: - case VT_CY: - if (rcount < 3) - { - rcount += (rcount % 2); /* align rcount to 8-byte register pair */ - memcpy( ®s.r[rcount], &V_UI8(arg), sizeof(V_UI8(arg)) ); - rcount += sizeof(V_UI8(arg)) / sizeof(DWORD); - } - else - { - rcount = 4; /* Make sure we flag that all 'r' regs are full */ - argspos += (argspos % 2); /* align argspos to 8-bytes */ - memcpy( &args[argspos], &V_UI8(arg), sizeof(V_UI8(arg)) ); - argspos += sizeof(V_UI8(arg)) / sizeof(DWORD); - } - break; - case VT_DECIMAL: /* these structures are 8-byte aligned, and put in 'r' regs or stack, can be split between the two */ - case VT_VARIANT: - /* 8-byte align 'r' and/or stack: */ - if (rcount < 3) - rcount += (rcount % 2); - else - { - rcount = 4; - argspos += (argspos % 2); - } - ntemp = sizeof(*arg) / sizeof(DWORD); - while (ntemp > 0) - { - if (rcount < 4) - regs.r[rcount++] = *pdwarg++; - else - args[argspos++] = *pdwarg++; - --ntemp; - } - break; - case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */ - if (rcount < 4) - regs.r[rcount++] = V_BOOL(arg); - else - args[argspos++] = V_BOOL(arg); - break; - case VT_R4: /* these must be 4-byte aligned, and put in 's' regs or stack, as they are single-floats */ -#ifndef __SOFTFP__ - if (!(scount % 2)) scount = max( scount, dcount * 2 ); - if (scount < 16) - regs.sd.s[scount++] = V_R4(arg); - else - args[argspos++] = V_UI4(arg); - break; -#endif - default: - if (rcount < 4) - regs.r[rcount++] = V_UI4(arg); - else - args[argspos++] = V_UI4(arg); - break; - } - TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg)); - } - - argspos += (argspos % 2); /* Make sure stack function alignment is 8-byte */ - - switch (vtReturn) - { - case VT_EMPTY: /* EMPTY = no return value */ - case VT_DECIMAL: /* DECIMAL and VARIANT already have a pointer argument passed (see above) */ - case VT_VARIANT: - call_method( func, argspos, args, (DWORD*)®s ); - break; - case VT_R4: - V_R4(pvargResult) = call_float_method( func, argspos, args, (DWORD*)®s ); - break; - case VT_R8: - case VT_DATE: - V_R8(pvargResult) = call_double_method( func, argspos, args, (DWORD*)®s ); - break; - case VT_I8: - case VT_UI8: - case VT_CY: - V_UI8(pvargResult) = call_method( func, argspos, args, (DWORD*)®s ); - break; - default: - V_UI4(pvargResult) = call_method( func, argspos, args, (DWORD*)®s ); - break; - } - heap_free( args ); - if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn; - TRACE("retval: %s\n", debugstr_variant(pvargResult)); - return S_OK; - -#else - FIXME( "(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d)): not implemented for this CPU\n", - pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult)); - return E_NOTIMPL; -#endif -} - static inline BOOL func_restricted( const FUNCDESC *desc ) { return (desc->wFuncFlags & FUNCFLAG_FRESTRICTED) && (desc->memid >= 0); @@ -7850,7 +7983,7 @@ static BOOL CALLBACK search_res_tlb(HMODULE hModule, LPCWSTR lpszType, LPWSTR lp if (!(len = GetModuleFileNameW(hModule, szPath, MAX_PATH))) return TRUE; - if (snprintfW(szPath + len, ARRAY_SIZE(szPath) - len, formatW, LOWORD(lpszName)) < 0) + if (swprintf(szPath + len, formatW, LOWORD(lpszName)) < 0) return TRUE; ret = LoadTypeLibEx(szPath, REGKIND_NONE, &pTLib); @@ -9167,7 +9300,7 @@ static HRESULT WMSFT_compile_strings(ITypeLibImpl *This, LIST_FOR_EACH_ENTRY(str, &This->string_list, TLBString, entry) { int size; - size = WideCharToMultiByte(CP_ACP, 0, str->str, strlenW(str->str), NULL, 0, NULL, NULL); + size = WideCharToMultiByte(CP_ACP, 0, str->str, lstrlenW(str->str), NULL, 0, NULL, NULL); if (size == 0) return E_UNEXPECTED; @@ -9190,7 +9323,7 @@ static HRESULT WMSFT_compile_strings(ITypeLibImpl *This, LIST_FOR_EACH_ENTRY(str, &This->string_list, TLBString, entry) { int size; - size = WideCharToMultiByte(CP_ACP, 0, str->str, strlenW(str->str), + size = WideCharToMultiByte(CP_ACP, 0, str->str, lstrlenW(str->str), data + sizeof(INT16), file->string_seg.len - last_offs - sizeof(INT16), NULL, NULL); if (size == 0) { heap_free(file->string_seg.data); @@ -9225,7 +9358,7 @@ static HRESULT WMSFT_compile_names(ITypeLibImpl *This, LIST_FOR_EACH_ENTRY(str, &This->name_list, TLBString, entry) { int size; - size = strlenW(str->str); + size = lstrlenW(str->str); file->header.nametablechars += size; file->header.nametablecount++; @@ -9254,7 +9387,7 @@ static HRESULT WMSFT_compile_names(ITypeLibImpl *This, int size, hash; MSFT_NameIntro *intro = (MSFT_NameIntro*)data; - size = WideCharToMultiByte(CP_ACP, 0, str->str, strlenW(str->str), + size = WideCharToMultiByte(CP_ACP, 0, str->str, lstrlenW(str->str), data + sizeof(MSFT_NameIntro), file->name_seg.len - last_offs - sizeof(MSFT_NameIntro), NULL, NULL); if (size == 0) { @@ -10019,12 +10152,12 @@ static void WMSFT_compile_impfile(ITypeLibImpl *This, WMSFT_TLBFile *file) int size = 0; if(implib->name){ - WCHAR *path = strrchrW(implib->name, '\\'); + WCHAR *path = wcsrchr(implib->name, '\\'); if(path) ++path; else path = implib->name; - size = WideCharToMultiByte(CP_ACP, 0, path, strlenW(path), NULL, 0, NULL, NULL); + size = WideCharToMultiByte(CP_ACP, 0, path, lstrlenW(path), NULL, 0, NULL, NULL); if (size == 0) ERR("failed to convert wide string: %s\n", debugstr_w(path)); } @@ -10051,12 +10184,12 @@ static void WMSFT_compile_impfile(ITypeLibImpl *This, WMSFT_TLBFile *file) data += sizeof(WMSFT_ImpFile); if(implib->name){ - WCHAR *path= strrchrW(implib->name, '\\'); + WCHAR *path= wcsrchr(implib->name, '\\'); if(path) ++path; else path = implib->name; - strlen = WideCharToMultiByte(CP_ACP, 0, path, strlenW(path), + strlen = WideCharToMultiByte(CP_ACP, 0, path, lstrlenW(path), data + sizeof(INT16), file->impfile_seg.len - last_offs - sizeof(INT16), NULL, NULL); if (strlen == 0) ERR("failed to convert wide string: %s\n", debugstr_w(path)); @@ -10999,7 +11132,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncAndParamNames(ICreateTypeInfo2 * for(i = 0; i < This->typeattr.cFuncs; ++i) { TLBFuncDesc *iter = &This->funcdescs[i]; - if (iter->Name && !strcmpW(TLB_get_bstr(iter->Name), *names)) { + if (iter->Name && !wcscmp(TLB_get_bstr(iter->Name), *names)) { if (iter->funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF | INVOKE_PROPERTYGET) && func_desc->funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF | INVOKE_PROPERTYGET) && func_desc->funcdesc.invkind != iter->funcdesc.invkind) diff --git a/dll/win32/oleaut32/varformat.c b/dll/win32/oleaut32/varformat.c index 470ea4e01b7..591093dbc52 100644 --- a/dll/win32/oleaut32/varformat.c +++ b/dll/win32/oleaut32/varformat.c @@ -25,8 +25,6 @@ * Please submit a test case if you find a difference. */ -#include "config.h" - #include <string.h> #include <stdlib.h> #include <stdarg.h> @@ -34,7 +32,6 @@ #include "windef.h" #include "winbase.h" -#include "wine/unicode.h" #include "winerror.h" #include "variant.h" #include "wine/debug.h" @@ -438,9 +435,9 @@ static const NAMED_FORMAT VARIANT_NamedFormats[] = }; typedef const NAMED_FORMAT *LPCNAMED_FORMAT; -static int FormatCompareFn(const void *l, const void *r) +static int __cdecl FormatCompareFn(const void *l, const void *r) { - return strcmpiW(((LPCNAMED_FORMAT)l)->name, ((LPCNAMED_FORMAT)r)->name); + return wcsicmp(((LPCNAMED_FORMAT)l)->name, ((LPCNAMED_FORMAT)r)->name); } static inline const BYTE *VARIANT_GetNamedFormat(LPCWSTR lpszFormat) @@ -763,7 +760,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok, TRACE("time sep\n"); } else if ((*pFormat == 'a' || *pFormat == 'A') && - !strncmpiW(pFormat, szAMPM, ARRAY_SIZE(szAMPM))) + !_wcsnicmp(pFormat, szAMPM, ARRAY_SIZE(szAMPM))) { /* Date formats: System AM/PM designation * Other formats: Literal @@ -772,7 +769,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok, header->type = FMT_TYPE_DATE; NEED_SPACE(sizeof(BYTE)); pFormat += ARRAY_SIZE(szAMPM); - if (!strncmpW(pFormat, szampm, ARRAY_SIZE(szampm))) + if (!wcsncmp(pFormat, szampm, ARRAY_SIZE(szampm))) *pOut++ = FMT_DATE_AMPM_SYS2; else *pOut++ = FMT_DATE_AMPM_SYS1; @@ -810,7 +807,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok, *pLastHours = *pLastHours + 2; TRACE("A/P\n"); } - else if (*pFormat == 'a' && !strncmpW(pFormat, szamSlashpm, ARRAY_SIZE(szamSlashpm))) + else if (*pFormat == 'a' && !wcsncmp(pFormat, szamSlashpm, ARRAY_SIZE(szamSlashpm))) { /* Date formats: lowercase AM or PM designation * Other formats: Literal @@ -824,7 +821,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok, *pLastHours = *pLastHours + 2; TRACE("AM/PM\n"); } - else if (*pFormat == 'A' && !strncmpW(pFormat, szAMSlashPM, ARRAY_SIZE(szAMSlashPM))) + else if (*pFormat == 'A' && !wcsncmp(pFormat, szAMSlashPM, ARRAY_SIZE(szAMSlashPM))) { /* Date formats: Uppercase AM or PM designation * Other formats: Literal @@ -986,7 +983,7 @@ HRESULT WINAPI VarTokenizeFormatString(LPOLESTR lpszFormat, LPBYTE rgbTok, fmt_state &= ~FMT_STATE_OPEN_COPY; } else if ((*pFormat == 't' || *pFormat == 'T') && - !strncmpiW(pFormat, szTTTTT, ARRAY_SIZE(szTTTTT))) + !_wcsnicmp(pFormat, szTTTTT, ARRAY_SIZE(szTTTTT))) { /* Date formats: System time specifier * Other formats: Literal @@ -1376,7 +1373,7 @@ VARIANT_FormatNumber_Bool: hRes = VarBstrFromBool(V_BOOL(&vBool), lcid, boolFlag, &boolStr); if (SUCCEEDED(hRes)) { - strcpyW(pBuff, boolStr); + lstrcpyW(pBuff, boolStr); SysFreeString(boolStr); while (*pBuff) pBuff++; @@ -1418,13 +1415,13 @@ VARIANT_FormatNumber_Bool: if (exponent < 0) { *pBuff++ = '-'; - sprintfW(pBuff, szPercentZeroStar_d, pToken[1], -exponent); + swprintf(pBuff, szPercentZeroStar_d, pToken[1], -exponent); } else { if (*pToken == FMT_NUM_EXP_POS_L || *pToken == FMT_NUM_EXP_POS_U) *pBuff++ = '+'; - sprintfW(pBuff, szPercentZeroStar_d, pToken[1], exponent); + swprintf(pBuff, szPercentZeroStar_d, pToken[1], exponent); } while (*pBuff) pBuff++; @@ -1897,7 +1894,7 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat, } else if (szPrintFmt) { - sprintfW(pBuff, szPrintFmt, dwVal); + swprintf(pBuff, szPrintFmt, dwVal); while (*pBuff) pBuff++; } @@ -1956,7 +1953,7 @@ static HRESULT VARIANT_FormatString(LPVARIANT pVarIn, LPOLESTR lpszFormat, pSrc = V_BSTR(&vStr); if ((strHeader->flags & (FMT_FLAG_LT|FMT_FLAG_GT)) == FMT_FLAG_GT) bUpper = TRUE; - blanks_first = strHeader->copy_chars - strlenW(pSrc); + blanks_first = strHeader->copy_chars - lstrlenW(pSrc); pToken = (const BYTE*)strHeader + sizeof(FMT_DATE_HEADER); while (*pToken != FMT_GEN_END) @@ -1997,9 +1994,9 @@ static HRESULT VARIANT_FormatString(LPVARIANT pVarIn, LPOLESTR lpszFormat, while (dwCount > 0 && *pSrc) { if (bUpper) - *pBuff++ = toupperW(*pSrc); + *pBuff++ = towupper(*pSrc); else - *pBuff++ = tolowerW(*pSrc); + *pBuff++ = towlower(*pSrc); dwCount--; pSrc++; } @@ -2025,9 +2022,9 @@ VARIANT_FormatString_Exit: while (*pSrc) { if (bUpper) - *pBuff++ = toupperW(*pSrc); + *pBuff++ = towupper(*pSrc); else - *pBuff++ = tolowerW(*pSrc); + *pBuff++ = towlower(*pSrc); pSrc++; } VariantClear(&vStr); @@ -2284,9 +2281,9 @@ HRESULT WINAPI VarFormatNumber(LPVARIANT pVarIn, INT nDigits, INT nLeading, INT if (nGrouping == -2) { - WCHAR grouping[16]; + WCHAR grouping[10]; grouping[2] = '\0'; - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping, ARRAY_SIZE(grouping)); + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SGROUPING, grouping, ARRAY_SIZE(grouping)); numfmt.Grouping = grouping[2] == '2' ? 32 : grouping[0] - '0'; } else if (nGrouping == -1) @@ -2380,12 +2377,12 @@ HRESULT WINAPI VarFormatPercent(LPVARIANT pVarIn, INT nDigits, INT nLeading, INT if (SUCCEEDED(hRet)) { - DWORD dwLen = strlenW(*pbstrOut); + DWORD dwLen = lstrlenW(*pbstrOut); BOOL bBracket = (*pbstrOut)[dwLen] == ')'; dwLen -= bBracket; memcpy(buff, *pbstrOut, dwLen * sizeof(WCHAR)); - strcpyW(buff + dwLen, bBracket ? szPercentBracket : szPercent); + lstrcpyW(buff + dwLen, bBracket ? szPercentBracket : szPercent); SysFreeString(*pbstrOut); *pbstrOut = SysAllocString(buff); if (!*pbstrOut) @@ -2443,7 +2440,7 @@ HRESULT WINAPI VarFormatCurrency(LPVARIANT pVarIn, INT nDigits, INT nLeading, if (SUCCEEDED(hRet)) { - WCHAR buff[256], decimal[8], thousands[8], currency[8]; + WCHAR buff[256], decimal[8], thousands[4], currency[13]; CURRENCYFMTW numfmt; if (nDigits < 0) @@ -2460,9 +2457,9 @@ HRESULT WINAPI VarFormatCurrency(LPVARIANT pVarIn, INT nDigits, INT nLeading, if (nGrouping == -2) { - WCHAR grouping[16]; + WCHAR grouping[10]; grouping[2] = '\0'; - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, grouping, ARRAY_SIZE(grouping)); + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SGROUPING, grouping, ARRAY_SIZE(grouping)); numfmt.Grouping = grouping[2] == '2' ? 32 : grouping[0] - '0'; } else if (nGrouping == -1) @@ -2482,9 +2479,9 @@ HRESULT WINAPI VarFormatCurrency(LPVARIANT pVarIn, INT nDigits, INT nLeading, numfmt.lpDecimalSep = decimal; GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, decimal, ARRAY_SIZE(decimal)); numfmt.lpThousandSep = thousands; - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, thousands, ARRAY_SIZE(thousands)); + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, thousands, ARRAY_SIZE(thousands)); numfmt.lpCurrencySymbol = currency; - GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, currency, ARRAY_SIZE(currency)); + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SCURRENCY, currency, ARRAY_SIZE(currency)); /* use NLS as per VarFormatNumber() */ if (GetCurrencyFormatW(LOCALE_USER_DEFAULT, 0, V_BSTR(&vStr), &numfmt, buff, ARRAY_SIZE(buff))) diff --git a/dll/win32/oleaut32/variant.c b/dll/win32/oleaut32/variant.c index fcbef5317fd..ce96ba14565 100644 --- a/dll/win32/oleaut32/variant.c +++ b/dll/win32/oleaut32/variant.c @@ -25,8 +25,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <string.h> #include <stdlib.h> #include <stdarg.h> @@ -37,7 +35,6 @@ #include "windef.h" #include "winbase.h" -#include "wine/unicode.h" #include "winerror.h" #include "variant.h" #include "resource.h" @@ -1635,14 +1632,14 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, /* First consume all the leading symbols and space from the string */ while (1) { - if (pNumprs->dwInFlags & NUMPRS_LEADING_WHITE && isspaceW(*lpszStr)) + if (pNumprs->dwInFlags & NUMPRS_LEADING_WHITE && iswspace(*lpszStr)) { pNumprs->dwOutFlags |= NUMPRS_LEADING_WHITE; do { cchUsed++; lpszStr++; - } while (isspaceW(*lpszStr)); + } while (iswspace(*lpszStr)); } else if (pNumprs->dwInFlags & NUMPRS_LEADING_PLUS && *lpszStr == chars.cPositiveSymbol && @@ -1717,14 +1714,14 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, while (*lpszStr) { - if (isdigitW(*lpszStr)) + if (iswdigit(*lpszStr)) { if (dwState & B_PROCESSING_EXPONENT) { int exponentSize = 0; if (dwState & B_EXPONENT_START) { - if (!isdigitW(*lpszStr)) + if (!iswdigit(*lpszStr)) break; /* No exponent digits - invalid */ while (*lpszStr == '0') { @@ -1734,7 +1731,7 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, } } - while (isdigitW(*lpszStr)) + while (iswdigit(*lpszStr)) { exponentSize *= 10; exponentSize += *lpszStr - '0'; @@ -1906,14 +1903,14 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, /* Consume any trailing symbols and space */ while (1) { - if ((pNumprs->dwInFlags & NUMPRS_TRAILING_WHITE) && isspaceW(*lpszStr)) + if ((pNumprs->dwInFlags & NUMPRS_TRAILING_WHITE) && iswspace(*lpszStr)) { pNumprs->dwOutFlags |= NUMPRS_TRAILING_WHITE; do { cchUsed++; lpszStr++; - } while (isspaceW(*lpszStr)); + } while (iswspace(*lpszStr)); } else if (pNumprs->dwInFlags & NUMPRS_TRAILING_PLUS && !(pNumprs->dwOutFlags & NUMPRS_LEADING_PLUS) && @@ -5138,7 +5135,9 @@ HRESULT WINAPI VarRound(LPVARIANT pVarIn, int deci, LPVARIANT pVarOut) { double dbl; - VarR8FromDec(&V_DECIMAL(pVarIn), &dbl); + hRet = VarR8FromDec(&V_DECIMAL(pVarIn), &dbl); + if (FAILED(hRet)) + break; if (dbl>0.0f) dbl = floor(dbl*pow(10,deci)+0.5); @@ -5146,7 +5145,7 @@ HRESULT WINAPI VarRound(LPVARIANT pVarIn, int deci, LPVARIANT pVarOut) dbl = ceil(dbl*pow(10,deci)-0.5); V_VT(pVarOut)=VT_DECIMAL; - VarDecFromR8(dbl, &V_DECIMAL(pVarOut)); + hRet = VarDecFromR8(dbl, &V_DECIMAL(pVarOut)); break; } /* cases we don't know yet */ diff --git a/dll/win32/oleaut32/vartype.c b/dll/win32/oleaut32/vartype.c index 067d515e34c..cf18d7db2e9 100644 --- a/dll/win32/oleaut32/vartype.c +++ b/dll/win32/oleaut32/vartype.c @@ -22,8 +22,9 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT +#include <wchar.h> + #include "wine/debug.h" -#include "wine/unicode.h" #include "winbase.h" #include "winuser.h" #include "winnt.h" @@ -6150,13 +6151,13 @@ VarBoolFromStr_CheckLocalised: if (VARIANT_GetLocalisedText(langId, IDS_TRUE, szBuff)) { /* Compare against localised strings, ignoring case */ - if (!strcmpiW(strIn, szBuff)) + if (!wcsicmp(strIn, szBuff)) { *pBoolOut = VARIANT_TRUE; /* Matched localised 'true' text */ return hRes; } VARIANT_GetLocalisedText(langId, IDS_FALSE, szBuff); - if (!strcmpiW(strIn, szBuff)) + if (!wcsicmp(strIn, szBuff)) { *pBoolOut = VARIANT_FALSE; /* Matched localised 'false' text */ return hRes; @@ -6171,9 +6172,9 @@ VarBoolFromStr_CheckLocalised: } /* All checks against localised text have failed, try #TRUE#/#FALSE# */ - if (!strcmpW(strIn, szFalse)) + if (!wcscmp(strIn, szFalse)) *pBoolOut = VARIANT_FALSE; - else if (!strcmpW(strIn, szTrue)) + else if (!wcscmp(strIn, szTrue)) *pBoolOut = VARIANT_TRUE; else { @@ -6356,7 +6357,7 @@ static BSTR VARIANT_MakeBstr(LCID lcid, DWORD dwFlags, WCHAR *szOut) szOut, NULL, szConverted, ARRAY_SIZE(szConverted)); szOut = szConverted; } - return SysAllocStringByteLen((LPCSTR)szOut, strlenW(szOut) * sizeof(WCHAR)); + return SysAllocStringByteLen((LPCSTR)szOut, lstrlenW(szOut) * sizeof(WCHAR)); } /* Create a (possibly localised) BSTR from a UI8 and sign */ @@ -6487,8 +6488,8 @@ static BSTR VARIANT_BstrReplaceDecimal(const WCHAR * buff, LCID lcid, ULONG dwFl minFormat.NegativeOrder = 1; /* NLS_NEG_LEFT */ /* count number of decimal digits in string */ - p = strchrW( buff, '.' ); - if (p) minFormat.NumDigits = strlenW(p + 1); + p = wcschr( buff, '.' ); + if (p) minFormat.NumDigits = lstrlenW(p + 1); numbuff[0] = '\0'; if (!GetNumberFormatW(lcid, 0, buff, &minFormat, numbuff, ARRAY_SIZE(numbuff))) @@ -6513,7 +6514,7 @@ static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags, if (!pbstrOut) return E_INVALIDARG; - sprintfW( buff, lpszFormat, dblIn ); + swprintf( buff, lpszFormat, dblIn ); /* Negative zeroes are disallowed (some applications depend on this). If buff starts with a minus, and then nothing follows but zeroes @@ -6523,7 +6524,7 @@ static HRESULT VARIANT_BstrFromReal(DOUBLE dblIn, LCID lcid, ULONG dwFlags, if (buff[0] == '-') { static const WCHAR szAccept[] = {'0', '.', '\0'}; - if (strlenW(buff + 1) == strspnW(buff + 1, szAccept)) + if (lstrlenW(buff + 1) == wcsspn(buff + 1, szAccept)) { buff[0] = '0'; buff[1] = '\0'; } } @@ -6814,7 +6815,7 @@ HRESULT WINAPI VarBstrFromDate(DATE dateIn, LCID lcid, ULONG dwFlags, BSTR* pbst if (!(dwFlags & VAR_DATEVALUEONLY)) { - time = date + strlenW(date); + time = date + lstrlenW(date); if (time != date) *time++ = ' '; if (!GetTimeFormatW(lcid, dwFormatFlags, &st, NULL, time, ARRAY_SIZE(date)-(time-date))) @@ -7658,25 +7659,25 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd /* Parse the string into our structure */ while (*strIn) { - if (isdigitW(*strIn)) + if (iswdigit(*strIn)) { if (dp.dwCount >= 6) { hRet = DISP_E_TYPEMISMATCH; break; } - dp.dwValues[dp.dwCount] = strtoulW(strIn, &strIn, 10); + dp.dwValues[dp.dwCount] = wcstoul(strIn, &strIn, 10); dp.dwCount++; strIn--; } - else if (isalphaW(*strIn)) + else if (iswalpha(*strIn)) { BOOL bFound = FALSE; for (i = 0; i < ARRAY_SIZE(tokens); i++) { - DWORD dwLen = strlenW(tokens[i]); - if (dwLen && !strncmpiW(strIn, tokens[i], dwLen)) + DWORD dwLen = lstrlenW(tokens[i]); + if (dwLen && !_wcsnicmp(strIn, tokens[i], dwLen)) { if (i <= 25) { @@ -7755,7 +7756,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd else dp.dwFlags[dp.dwCount - 1] |= DP_DATESEP; } - else if (*strIn == ',' || isspaceW(*strIn)) + else if (*strIn == ',' || iswspace(*strIn)) { if (*strIn == ',' && !strIn[1]) hRet = DISP_E_TYPEMISMATCH; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 2d0c7cc1278..ab5540dcdb7 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -142,7 +142,7 @@ dll/win32/odbc32 # Synced to WineStaging-4.18. Depends on port of L dll/win32/odbccp32 # Synced to WineStaging-4.18 dll/win32/ole32 # Synced to WineStaging-4.18 dll/win32/oleacc # Synced to WineStaging-4.18 -dll/win32/oleaut32 # Synced to WineStaging-4.0 +dll/win32/oleaut32 # Synced to WineStaging-4.18 dll/win32/olecli32 # Synced to WineStaging-3.3 dll/win32/oledlg # Synced to WineStaging-4.0 dll/win32/olepro32 # Synced to WineStaging-3.3
5 years, 1 month
1
0
0
0
[reactos] 01/01: [PSDK] Update oleauto.h. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1431ca4c7595b1d889a76…
commit 1431ca4c7595b1d889a76a26dbe361c6f5562c33 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sat Nov 23 12:04:39 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sat Nov 23 12:04:39 2019 +0100 [PSDK] Update oleauto.h. CORE-16441 --- sdk/include/psdk/oleauto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/include/psdk/oleauto.h b/sdk/include/psdk/oleauto.h index 82211297277..9df62cd76ec 100644 --- a/sdk/include/psdk/oleauto.h +++ b/sdk/include/psdk/oleauto.h @@ -1047,8 +1047,8 @@ HRESULT WINAPI RegisterTypeLib( ITypeLib*, - _In_ OLECHAR*, - _In_opt_ OLECHAR*); + _In_ LPCOLESTR, + _In_opt_ LPCOLESTR); _Check_return_ HRESULT
5 years, 1 month
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
33
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
Results per page:
10
25
50
100
200