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
September 2017
----- 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
17 participants
284 discussions
Start a n
N
ew thread
[akhaldi] 75900: [SXS] Sync with Wine Staging 2.16. CORE-13762 3c4f6ed sxs: Use standard wine_dbgstr_longlong.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:57:49 2017 New Revision: 75900 URL:
http://svn.reactos.org/svn/reactos?rev=75900&view=rev
Log: [SXS] Sync with Wine Staging 2.16. CORE-13762 3c4f6ed sxs: Use standard wine_dbgstr_longlong. Modified: trunk/reactos/dll/win32/sxs/name.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/sxs/name.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sxs/name.c?rev=7…
============================================================================== --- trunk/reactos/dll/win32/sxs/name.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/sxs/name.c [iso-8859-1] Sun Sep 17 22:57:49 2017 @@ -160,9 +160,9 @@ DWORD cbReserved, LPVOID *ppReserved ) { - FIXME("%p, %s, %p, %p, %s, %x%08x, %p, %d, %p\n", iface, + FIXME("%p, %s, %p, %p, %s, %s, %p, %d, %p\n", iface, debugstr_guid(riid), pUnkReserved1, pUnkReserved2, - debugstr_w(szReserved), (DWORD)(llReserved >> 32), (DWORD)llReserved, + debugstr_w(szReserved), wine_dbgstr_longlong(llReserved), pvReserved, cbReserved, ppReserved); return E_NOTIMPL; } Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Sep 17 22:57:49 2017 @@ -181,7 +181,7 @@ reactos/dll/win32/stdole2.tlb # Synced to WineStaging-2.9 reactos/dll/win32/stdole32.tlb # Synced to WineStaging-2.9 reactos/dll/win32/sti # Synced to WineStaging-2.9 -reactos/dll/win32/sxs # Synced to WineStaging-2.9 +reactos/dll/win32/sxs # Synced to WineStaging-2.16 reactos/dll/win32/t2embed # Synced to WineStaging-2.9 reactos/dll/win32/tapi32 # Synced to WineStaging-2.9 reactos/dll/win32/traffic # Synced to WineStaging-2.9
7 years, 3 months
1
0
0
0
[akhaldi] 75899: [RPCRT4_WINETEST] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:57:43 2017 New Revision: 75899 URL:
http://svn.reactos.org/svn/reactos?rev=75899&view=rev
Log: [RPCRT4_WINETEST] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/rostests/winetests/rpcrt4/CMakeLists.txt trunk/rostests/winetests/rpcrt4/server.c Modified: trunk/rostests/winetests/rpcrt4/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/CMakeLis…
============================================================================== --- trunk/rostests/winetests/rpcrt4/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/CMakeLists.txt [iso-8859-1] Sun Sep 17 22:57:43 2017 @@ -1,7 +1,10 @@ remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) -add_definitions(-DUSE_WINE_TODOS) +add_definitions( + -DUSE_WINE_TODOS + -DWINETEST_USE_DBGSTR_LONGLONG) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(IDL_FLAGS ${IDL_FLAGS} --prefix-server=s_) add_rpc_files(client server.idl) Modified: trunk/rostests/winetests/rpcrt4/server.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/rpcrt4/server.c…
============================================================================== --- trunk/rostests/winetests/rpcrt4/server.c [iso-8859-1] (original) +++ trunk/rostests/winetests/rpcrt4/server.c [iso-8859-1] Sun Sep 17 22:57:43 2017 @@ -41,7 +41,7 @@ static const char *progname; static BOOL old_windows_version; -static HANDLE stop_event; +static HANDLE stop_event, stop_wait_event; static void (WINAPI *pNDRSContextMarshall2)(RPC_BINDING_HANDLE, NDR_SCONTEXT, void*, NDR_RUNDOWN, void*, ULONG); static NDR_SCONTEXT (WINAPI *pNDRSContextUnmarshall2)(RPC_BINDING_HANDLE, void*, ULONG, void*, ULONG); @@ -830,9 +830,18 @@ void __cdecl s_stop(void) { - ok(RPC_S_OK == RpcMgmtStopServerListening(NULL), "RpcMgmtStopServerListening\n"); - ok(RPC_S_OK == RpcServerUnregisterIf(NULL, NULL, FALSE), "RpcServerUnregisterIf\n"); + if (!stop_wait_event) + { + ok(RPC_S_OK == RpcMgmtStopServerListening(NULL), "RpcMgmtStopServerListening\n"); + ok(RPC_S_OK == RpcServerUnregisterIf(NULL, NULL, FALSE), "RpcServerUnregisterIf\n"); + } ok(SetEvent(stop_event), "SetEvent\n"); + if (stop_wait_event) + { + DWORD ret; + ret = WaitForSingleObject(stop_wait_event, 10000); + ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n"); + } } static void @@ -903,7 +912,7 @@ x = sum_double_int(-78, 148.46); ok(x == 70, "RPC sum_double_int got %d\n", x); y = sum_hyper((hyper)0x12345678 << 16, (hyper)0x33557799 << 16); - ok(y == (hyper)0x4589ce11 << 16, "RPC hyper got %x%08x\n", (DWORD)(y >> 32), (DWORD)y); + ok(y == (hyper)0x4589ce11 << 16, "RPC hyper got %s\n", wine_dbgstr_longlong(y)); x = sum_hyper_int((hyper)0x24242424 << 16, -((hyper)0x24241212 << 16)); ok(x == 0x12120000, "RPC hyper_int got 0x%x\n", x); x = sum_char_hyper( 12, ((hyper)0x42424242 << 32) | 0x33334444 ); @@ -1759,10 +1768,87 @@ stop_event = NULL; } +static DWORD WINAPI listen_test_client_thread(void *binding) +{ + RPC_STATUS status; + + status = RpcBindingFromStringBindingA(binding, &IServer_IfHandle); + ok(status == RPC_S_OK, "RpcBindingFromStringBinding\n"); + + test_is_server_listening(IServer_IfHandle, RPC_S_OK); + stop(); + trace("stopped\n"); + + status = RpcBindingFree(&IServer_IfHandle); + ok(status == RPC_S_OK, "RpcBindingFree\n"); + return 0; +} + +static DWORD WINAPI wait_listen_proc(void *arg) +{ + RPC_STATUS status; + + trace("waiting\n"); + status = RpcMgmtWaitServerListen(); + ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %d\n", status); + trace("done\n"); + + return 0; +} + +static void test_stop_wait_for_call(unsigned char *binding) +{ + HANDLE client_thread, wait_listen_thread; + RPC_STATUS status; + DWORD ret; + + status = RpcServerListen(1, 20, TRUE); + ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status); + test_is_server_listening(NULL, RPC_S_OK); + + stop_wait_event = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(stop_wait_event != NULL, "CreateEvent failed with error %d\n", GetLastError()); + stop_event = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError()); + + wait_listen_thread = CreateThread(NULL, 0, wait_listen_proc, 0, 0, NULL); + ok(wait_listen_thread != NULL, "CreateThread failed\n"); + + client_thread = CreateThread(NULL, 0, listen_test_client_thread, binding, 0, NULL); + ok(client_thread != NULL, "CreateThread failed\n"); + CloseHandle(client_thread); + + ret = WaitForSingleObject(stop_event, 10000); + ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject\n"); + + status = RpcMgmtStopServerListening(NULL); + ok(status == RPC_S_OK, "RpcMgmtStopServerListening\n"); + test_is_server_listening(NULL, RPC_S_NOT_LISTENING); + + ret = WaitForSingleObject(wait_listen_thread, 500); + ok(WAIT_TIMEOUT == ret, "WaitForSingleObject\n"); + + SetEvent(stop_wait_event); + + ret = WaitForSingleObject(wait_listen_thread, 10000); + ok(WAIT_OBJECT_0 == ret, "WaitForSingleObject returned %u\n", ret); + + CloseHandle(wait_listen_thread); + + CloseHandle(stop_wait_event); + stop_wait_event = NULL; + CloseHandle(stop_event); + stop_event = NULL; +} + static void test_server_listening(void) { static unsigned char np[] = "ncacn_np"; + static unsigned char address_np[] = "\\\\."; static unsigned char pipe[] = PIPE "listen_test"; + static unsigned char ncalrpc[] = "ncalrpc"; + static unsigned char guid[] = "00000000-4114-0704-2302-000000000000"; + unsigned char *binding; RPC_STATUS status; status = RpcServerUseProtseqEpA(np, 0, pipe, NULL); @@ -1788,6 +1874,27 @@ status = RpcMgmtWaitServerListen(); ok(status == RPC_S_NOT_LISTENING, "RpcMgmtWaitServerListening failed with status %d\n", status); + + /* test that server stop waits for a call in progress */ + status = RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding); + ok(status == RPC_S_OK, "RpcStringBindingCompose\n"); + + test_stop_wait_for_call(binding); + + status = RpcStringFreeA(&binding); + ok(status == RPC_S_OK, "RpcStringFree\n"); + + /* repeat the test using ncalrpc */ + status = RpcServerUseProtseqEpA(ncalrpc, 0, guid, NULL); + ok(status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", status); + + status = RpcStringBindingComposeA(NULL, ncalrpc, NULL, guid, NULL, &binding); + ok(status == RPC_S_OK, "RpcStringBindingCompose\n"); + + test_stop_wait_for_call(binding); + + status = RpcStringFreeA(&binding); + ok(status == RPC_S_OK, "RpcStringFree\n"); } static BOOL is_process_elevated(void)
7 years, 3 months
1
0
0
0
[akhaldi] 75898: [RPCRT4] Sync with Wine Staging 2.16. CORE-13762 2d9e894 rpcrt4: Always protect ref access for connections associated with protseq in RPCRT4_ReleaseConnection. aea6d23 rpcrt4: Mark...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:57:32 2017 New Revision: 75898 URL:
http://svn.reactos.org/svn/reactos?rev=75898&view=rev
Log: [RPCRT4] Sync with Wine Staging 2.16. CORE-13762 2d9e894 rpcrt4: Always protect ref access for connections associated with protseq in RPCRT4_ReleaseConnection. aea6d23 rpcrt4: Mark function that are only called from assembly as hidden. bea5c0c rpcrt4: Spelling fixes in comments. 2cb32b2 rpcrt4: Change RPCRT4_ReleaseConnection return type to void. e889b02 rpcrt4: Fix a race when server grabs a connection from the list of active connections. 09e98be rpcrt4: Wait for server threads to finish in RpcMgmtWaitServerListen. e98c7a5 rpcrt4: Wait for all active connections to be released before quiting server thread. 10a6b33 rpcrt4: Recreate listening pipe in rpcrt4_protseq_np_get_wait_array if needed. 5c2083f rpcrt4: Store listening pipe name in RpcConnection_np. 5c81f82 rpcrt4: Store server thread handle in RpcServerProtseq. Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c trunk/reactos/dll/win32/rpcrt4/rpc_binding.c trunk/reactos/dll/win32/rpcrt4/rpc_binding.h trunk/reactos/dll/win32/rpcrt4/rpc_server.c trunk/reactos/dll/win32/rpcrt4/rpc_server.h trunk/reactos/dll/win32/rpcrt4/rpc_transport.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_marsh…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c [iso-8859-1] Sun Sep 17 22:57:32 2017 @@ -2929,7 +2929,7 @@ { /* for some reason interface pointers aren't generated as * RPC_FC_POINTER, but instead as RPC_FC_EMBEDDED_COMPLEX, yet - * they still need the derefencing treatment that pointers are + * they still need the dereferencing treatment that pointers are * given */ if (*desc == RPC_FC_IP) m(pStubMsg, *(unsigned char **)pMemory, desc); @@ -3105,7 +3105,7 @@ { /* for some reason interface pointers aren't generated as * RPC_FC_POINTER, but instead as RPC_FC_EMBEDDED_COMPLEX, yet - * they still need the derefencing treatment that pointers are + * they still need the dereferencing treatment that pointers are * given */ if (*desc == RPC_FC_IP) m(pStubMsg, (unsigned char **)pMemory, desc, FALSE); @@ -3229,7 +3229,7 @@ { /* for some reason interface pointers aren't generated as * RPC_FC_POINTER, but instead as RPC_FC_EMBEDDED_COMPLEX, yet - * they still need the derefencing treatment that pointers are + * they still need the dereferencing treatment that pointers are * given */ if (*desc == RPC_FC_IP) m(pStubMsg, *(unsigned char **)pMemory, desc); @@ -3330,7 +3330,7 @@ { /* for some reason interface pointers aren't generated as * RPC_FC_POINTER, but instead as RPC_FC_EMBEDDED_COMPLEX, yet - * they still need the derefencing treatment that pointers are + * they still need the dereferencing treatment that pointers are * given */ if (*desc == RPC_FC_IP) m(pStubMsg, *(unsigned char **)pMemory, desc); Modified: trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_stubl…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_stubless.c [iso-8859-1] Sun Sep 17 22:57:32 2017 @@ -581,8 +581,8 @@ return (PFORMAT_STRING)args; } -LONG_PTR CDECL ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, - void **stack_top, void **fpu_stack ) +LONG_PTR CDECL DECLSPEC_HIDDEN ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, + void **stack_top, void **fpu_stack ) { /* pointer to start of stack where arguments start */ RPC_MESSAGE rpcMsg; @@ -1511,7 +1511,8 @@ ULONG_PTR NdrCorrCache[256]; }; -LONG_PTR CDECL ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, void **stack_top ) +LONG_PTR CDECL DECLSPEC_HIDDEN ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, + void **stack_top ) { /* pointer to start of stack where arguments start */ PRPC_MESSAGE pRpcMsg; Modified: trunk/reactos/dll/win32/rpcrt4/rpc_binding.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_bindi…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_binding.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_binding.c [iso-8859-1] Sun Sep 17 22:57:32 2017 @@ -279,14 +279,13 @@ if (!Connection) return RPC_S_OK; if (Binding->server) { /* don't destroy a connection that is cached in the binding */ - if (Binding->FromConn == Connection) - return RPC_S_OK; - return RPCRT4_ReleaseConnection(Connection); + if (Binding->FromConn != Connection) + RPCRT4_ReleaseConnection(Connection); } else { RpcAssoc_ReleaseIdleConnection(Binding->Assoc, Connection); - return RPC_S_OK; - } + } + return RPC_S_OK; } static LPSTR RPCRT4_strconcatA(LPSTR dst, LPCSTR src) Modified: trunk/reactos/dll/win32/rpcrt4/rpc_binding.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_bindi…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_binding.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_binding.h [iso-8859-1] Sun Sep 17 22:57:32 2017 @@ -59,6 +59,7 @@ { LONG ref; BOOL server; + HANDLE wait_release; LPSTR NetworkAddr; LPSTR Endpoint; LPWSTR NetworkOptions; @@ -158,7 +159,7 @@ LPCSTR NetworkAddr, LPCSTR Endpoint, LPCWSTR NetworkOptions, RpcAuthInfo* AuthInfo, RpcQualityOfService *QOS, LPCWSTR CookieAuth) DECLSPEC_HIDDEN; RpcConnection *RPCRT4_GrabConnection( RpcConnection *conn ) DECLSPEC_HIDDEN; -RPC_STATUS RPCRT4_ReleaseConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; +void RPCRT4_ReleaseConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint) DECLSPEC_HIDDEN; @@ -172,6 +173,8 @@ const RPC_SYNTAX_IDENTIFIER *TransferSyntax, const RPC_SYNTAX_IDENTIFIER *InterfaceId) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_CloseBinding(RpcBinding* Binding, RpcConnection* Connection) DECLSPEC_HIDDEN; +void rpcrt4_conn_release_and_wait(RpcConnection *connection) DECLSPEC_HIDDEN; + static inline const char *rpcrt4_conn_get_name(const RpcConnection *Connection) { return Connection->ops->name; Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_serve…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_server.c [iso-8859-1] Sun Sep 17 22:57:32 2017 @@ -647,21 +647,44 @@ { /* cleanup */ cps->ops->free_wait_array(cps, objs); - - EnterCriticalSection(&cps->cs); - LIST_FOR_EACH_ENTRY(conn, &cps->listeners, RpcConnection, protseq_entry) - RPCRT4_CloseConnection(conn); - LIST_FOR_EACH_ENTRY(conn, &cps->connections, RpcConnection, protseq_entry) - rpcrt4_conn_close_read(conn); - LeaveCriticalSection(&cps->cs); - - if (res == 0 && !std_listen) - SetEvent(cps->server_ready_event); break; } else if (res == 0) set_ready_event = TRUE; } + + TRACE("closing connections\n"); + + EnterCriticalSection(&cps->cs); + LIST_FOR_EACH_ENTRY(conn, &cps->listeners, RpcConnection, protseq_entry) + RPCRT4_CloseConnection(conn); + LIST_FOR_EACH_ENTRY(conn, &cps->connections, RpcConnection, protseq_entry) + { + RPCRT4_GrabConnection(conn); + rpcrt4_conn_close_read(conn); + } + LeaveCriticalSection(&cps->cs); + + if (res == 0 && !std_listen) + SetEvent(cps->server_ready_event); + + TRACE("waiting for active connections to close\n"); + + EnterCriticalSection(&cps->cs); + while (!list_empty(&cps->connections)) + { + conn = LIST_ENTRY(list_head(&cps->connections), RpcConnection, protseq_entry); + LeaveCriticalSection(&cps->cs); + rpcrt4_conn_release_and_wait(conn); + EnterCriticalSection(&cps->cs); + } + LeaveCriticalSection(&cps->cs); + + EnterCriticalSection(&listen_cs); + CloseHandle(cps->server_thread); + cps->server_thread = NULL; + LeaveCriticalSection(&listen_cs); + TRACE("done\n"); return 0; } @@ -685,21 +708,15 @@ static RPC_STATUS RPCRT4_start_listen_protseq(RpcServerProtseq *ps, BOOL auto_listen) { RPC_STATUS status = RPC_S_OK; - HANDLE server_thread; EnterCriticalSection(&listen_cs); - if (ps->is_listening) goto done; + if (ps->server_thread) goto done; if (!ps->mgr_mutex) ps->mgr_mutex = CreateMutexW(NULL, FALSE, NULL); if (!ps->server_ready_event) ps->server_ready_event = CreateEventW(NULL, FALSE, FALSE, NULL); - server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, ps, 0, NULL); - if (!server_thread) - { + ps->server_thread = CreateThread(NULL, 0, RPCRT4_server_thread, ps, 0, NULL); + if (!ps->server_thread) status = RPC_S_OUT_OF_RESOURCES; - goto done; - } - ps->is_listening = TRUE; - CloseHandle(server_thread); done: LeaveCriticalSection(&listen_cs); @@ -767,8 +784,10 @@ if (stop_listen) { RpcServerProtseq *cps; + EnterCriticalSection(&server_cs); LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry) RPCRT4_sync_with_server_thread(cps); + LeaveCriticalSection(&server_cs); } if (!auto_listen) @@ -1503,7 +1522,8 @@ */ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) { - HANDLE event; + RpcServerProtseq *protseq; + HANDLE event, wait_thread; TRACE("()\n"); @@ -1519,6 +1539,28 @@ TRACE( "done waiting\n" ); EnterCriticalSection(&listen_cs); + /* wait for server threads to finish */ + while(1) + { + if (listen_count) + break; + + wait_thread = NULL; + EnterCriticalSection(&server_cs); + LIST_FOR_EACH_ENTRY(protseq, &protseqs, RpcServerProtseq, entry) + { + if ((wait_thread = protseq->server_thread)) + break; + } + LeaveCriticalSection(&server_cs); + if (!wait_thread) + break; + + TRACE("waiting for thread %u\n", GetThreadId(wait_thread)); + LeaveCriticalSection(&listen_cs); + WaitForSingleObject(wait_thread, INFINITE); + EnterCriticalSection(&listen_cs); + } if (listen_done_event == event) { listen_done_event = NULL; Modified: trunk/reactos/dll/win32/rpcrt4/rpc_server.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_serve…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_server.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_server.h [iso-8859-1] Sun Sep 17 22:57:32 2017 @@ -36,8 +36,8 @@ struct list connections; /* CS cs */ CRITICAL_SECTION cs; - /* is the server currently listening? */ - BOOL is_listening; /* CS ::listen_cs */ + /* handle to listening thread */ + HANDLE server_thread; /* CS ::listen_cs */ /* mutex for ensuring only one thread can change state at a time */ HANDLE mgr_mutex; /* set when server thread has finished opening connections */ Modified: trunk/reactos/dll/win32/rpcrt4/rpc_transport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_trans…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] Sun Sep 17 22:57:32 2017 @@ -65,6 +65,7 @@ RpcConnection common; HANDLE pipe; HANDLE listen_event; + char *listen_pipe; IO_STATUS_BLOCK io_status; HANDLE event_cache; BOOL read_closed; @@ -89,26 +90,26 @@ CloseHandle(event); } -static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *Connection, LPCSTR pname) -{ - RpcConnection_np *npc = (RpcConnection_np *) Connection; - TRACE("listening on %s\n", pname); - - npc->pipe = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, - PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, - PIPE_UNLIMITED_INSTANCES, - RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL); - if (npc->pipe == INVALID_HANDLE_VALUE) { - WARN("CreateNamedPipe failed with error %d\n", GetLastError()); - if (GetLastError() == ERROR_FILE_EXISTS) - return RPC_S_DUPLICATE_ENDPOINT; - else - return RPC_S_CANT_CREATE_ENDPOINT; - } - - /* Note: we don't call ConnectNamedPipe here because it must be done in the - * server thread as the thread must be alertable */ - return RPC_S_OK; +static RPC_STATUS rpcrt4_conn_create_pipe(RpcConnection *conn) +{ + RpcConnection_np *connection = (RpcConnection_np *) conn; + + TRACE("listening on %s\n", connection->listen_pipe); + + connection->pipe = CreateNamedPipeA(connection->listen_pipe, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, + PIPE_UNLIMITED_INSTANCES, + RPC_MAX_PACKET_SIZE, RPC_MAX_PACKET_SIZE, 5000, NULL); + if (connection->pipe == INVALID_HANDLE_VALUE) + { + WARN("CreateNamedPipe failed with error %d\n", GetLastError()); + if (GetLastError() == ERROR_FILE_EXISTS) + return RPC_S_DUPLICATE_ENDPOINT; + else + return RPC_S_CANT_CREATE_ENDPOINT; + } + + return RPC_S_OK; } static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection *Connection, LPCSTR pname, BOOL wait) @@ -201,7 +202,6 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq, const char *endpoint) { RPC_STATUS r; - LPSTR pname; RpcConnection *Connection; char generated_endpoint[22]; @@ -220,9 +220,8 @@ if (r != RPC_S_OK) return r; - pname = ncalrpc_pipe_name(Connection->Endpoint); - r = rpcrt4_conn_create_pipe(Connection, pname); - I_RpcFree(pname); + ((RpcConnection_np*)Connection)->listen_pipe = ncalrpc_pipe_name(Connection->Endpoint); + r = rpcrt4_conn_create_pipe(Connection); EnterCriticalSection(&protseq->cs); list_add_head(&protseq->listeners, &Connection->protseq_entry); @@ -263,7 +262,6 @@ static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, const char *endpoint) { RPC_STATUS r; - LPSTR pname; RpcConnection *Connection; char generated_endpoint[26]; @@ -282,9 +280,8 @@ if (r != RPC_S_OK) return r; - pname = ncacn_pipe_name(Connection->Endpoint); - r = rpcrt4_conn_create_pipe(Connection, pname); - I_RpcFree(pname); + ((RpcConnection_np*)Connection)->listen_pipe = ncacn_pipe_name(Connection->Endpoint); + r = rpcrt4_conn_create_pipe(Connection); EnterCriticalSection(&protseq->cs); list_add_head(&protseq->listeners, &Connection->protseq_entry); @@ -308,13 +305,9 @@ { DWORD len = MAX_COMPUTERNAME_LENGTH + 1; RPC_STATUS status; - LPSTR pname; rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - - pname = ncacn_pipe_name(old_conn->Endpoint); - status = rpcrt4_conn_create_pipe(old_conn, pname); - I_RpcFree(pname); + status = rpcrt4_conn_create_pipe(old_conn); /* Store the local computer name as the NetworkAddr for ncacn_np as long as * we don't support named pipes over the network. */ @@ -359,15 +352,11 @@ { DWORD len = MAX_COMPUTERNAME_LENGTH + 1; RPC_STATUS status; - LPSTR pname; TRACE("%s\n", old_conn->Endpoint); rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - - pname = ncalrpc_pipe_name(old_conn->Endpoint); - status = rpcrt4_conn_create_pipe(old_conn, pname); - I_RpcFree(pname); + status = rpcrt4_conn_create_pipe(old_conn); /* Store the local computer name as the NetworkAddr for ncalrpc. */ new_conn->NetworkAddr = HeapAlloc(GetProcessHeap(), 0, len); @@ -672,6 +661,8 @@ *count = 1; LIST_FOR_EACH_ENTRY(conn, &protseq->listeners, RpcConnection_np, common.protseq_entry) { + if (!conn->pipe && rpcrt4_conn_create_pipe(&conn->common) != RPC_S_OK) + continue; if (!conn->listen_event) { NTSTATUS status; @@ -3372,38 +3363,69 @@ return connection; } -RpcConnection *RPCRT4_GrabConnection( RpcConnection *conn ) -{ - InterlockedIncrement( &conn->ref ); - return conn; -} - -RPC_STATUS RPCRT4_ReleaseConnection(RpcConnection* Connection) -{ - if (InterlockedDecrement( &Connection->ref ) > 0) return RPC_S_OK; - - TRACE("destroying connection %p\n", Connection); - - RPCRT4_CloseConnection(Connection); - RPCRT4_strfree(Connection->Endpoint); - RPCRT4_strfree(Connection->NetworkAddr); - HeapFree(GetProcessHeap(), 0, Connection->NetworkOptions); - HeapFree(GetProcessHeap(), 0, Connection->CookieAuth); - if (Connection->AuthInfo) RpcAuthInfo_Release(Connection->AuthInfo); - if (Connection->QOS) RpcQualityOfService_Release(Connection->QOS); - - /* server-only */ - if (Connection->server_binding) RPCRT4_ReleaseBinding(Connection->server_binding); - - if (Connection->protseq) - { - EnterCriticalSection(&Connection->protseq->cs); - list_remove(&Connection->protseq_entry); - LeaveCriticalSection(&Connection->protseq->cs); - } - - HeapFree(GetProcessHeap(), 0, Connection); - return RPC_S_OK; +void rpcrt4_conn_release_and_wait(RpcConnection *connection) +{ + HANDLE event = NULL; + + if (connection->ref > 1) + event = connection->wait_release = CreateEventW(NULL, TRUE, FALSE, NULL); + + RPCRT4_ReleaseConnection(connection); + + if(event) + { + WaitForSingleObject(event, INFINITE); + CloseHandle(event); + } +} + +RpcConnection *RPCRT4_GrabConnection(RpcConnection *connection) +{ + LONG ref = InterlockedIncrement(&connection->ref); + TRACE("%p ref=%u\n", connection, ref); + return connection; +} + +void RPCRT4_ReleaseConnection(RpcConnection *connection) +{ + LONG ref; + + /* protseq stores a list of active connections, but does not own references to them. + * It may need to grab a connection from the list, which could lead to a race if + * connection is being released, but not yet removed from the list. We handle that + * by synchronizing on CS here. */ + if (connection->protseq) + { + EnterCriticalSection(&connection->protseq->cs); + ref = InterlockedDecrement(&connection->ref); + if (!ref) + list_remove(&connection->protseq_entry); + LeaveCriticalSection(&connection->protseq->cs); + } + else + { + ref = InterlockedDecrement(&connection->ref); + } + + TRACE("%p ref=%u\n", connection, ref); + + if (!ref) + { + RPCRT4_CloseConnection(connection); + RPCRT4_strfree(connection->Endpoint); + RPCRT4_strfree(connection->NetworkAddr); + HeapFree(GetProcessHeap(), 0, connection->NetworkOptions); + HeapFree(GetProcessHeap(), 0, connection->CookieAuth); + if (connection->AuthInfo) RpcAuthInfo_Release(connection->AuthInfo); + if (connection->QOS) RpcQualityOfService_Release(connection->QOS); + + /* server-only */ + if (connection->server_binding) RPCRT4_ReleaseBinding(connection->server_binding); + + if (connection->wait_release) SetEvent(connection->wait_release); + + HeapFree(GetProcessHeap(), 0, connection); + } } RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Sep 17 22:57:32 2017 @@ -160,7 +160,7 @@ reactos/dll/win32/resutils # Synced to WineStaging-2.9 reactos/dll/win32/riched20 # Synced to WineStaging-2.16 reactos/dll/win32/riched32 # Synced to WineStaging-2.9 -reactos/dll/win32/rpcrt4 # Synced to WineStaging-2.9 +reactos/dll/win32/rpcrt4 # Synced to WineStaging-2.16 reactos/dll/win32/rsabase # Synced to WineStaging-2.9 reactos/dll/win32/rsaenh # Synced to WineStaging-2.9 reactos/dll/win32/sccbase # Synced to WineStaging-2.9
7 years, 3 months
1
0
0
0
[akhaldi] 75897: [RICHED20_WINETEST] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:57:24 2017 New Revision: 75897 URL:
http://svn.reactos.org/svn/reactos?rev=75897&view=rev
Log: [RICHED20_WINETEST] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/rostests/winetests/riched20/editor.c Modified: trunk/rostests/winetests/riched20/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/editor…
============================================================================== --- trunk/rostests/winetests/riched20/editor.c [iso-8859-1] (original) +++ trunk/rostests/winetests/riched20/editor.c [iso-8859-1] Sun Sep 17 22:57:24 2017 @@ -8537,19 +8537,23 @@ DestroyWindow(hwndRichEdit); } -static void test_rtf_specials(void) +static void test_rtf(void) { const char *specials = "{\\rtf1\\emspace\\enspace\\bullet\\lquote" "\\rquote\\ldblquote\\rdblquote\\ltrmark\\rtlmark\\zwj\\zwnj}"; const WCHAR expect_specials[] = {' ',' ',0x2022,0x2018,0x2019,0x201c, 0x201d,0x200e,0x200f,0x200d,0x200c}; const char *pard = "{\\rtf1 ABC\\rtlpar\\par DEF\\par HIJ\\pard\\par}"; + const char *highlight = "{\\rtf1{\\colortbl;\\red0\\green0\\blue0;\\red128\\green128\\blue128;\\red192\\green192\\blue192;}\\cf2\\highlight3 foo\\par}"; + HWND edit = new_richeditW( NULL ); EDITSTREAM es; WCHAR buf[80]; LRESULT result; PARAFORMAT2 fmt; - + CHARFORMAT2W cf; + + /* Test rtf specials */ es.dwCookie = (DWORD_PTR)&specials; es.dwError = 0; es.pfnCallback = test_EM_STREAMIN_esCallback; @@ -8579,6 +8583,18 @@ SendMessageW( edit, EM_GETPARAFORMAT, 0, (LPARAM)&fmt ); ok( fmt.dwMask & PFM_RTLPARA, "rtl para mask not set\n" ); ok( !(fmt.wEffects & PFE_RTLPARA), "rtl para set\n" ); + + /* Test \highlight */ + es.dwCookie = (DWORD_PTR)&highlight; + result = SendMessageA( edit, EM_STREAMIN, SF_RTF, (LPARAM)&es ); + ok( result == 3, "got %ld\n", result ); + SendMessageW( edit, EM_SETSEL, 1, 1 ); + memset( &cf, 0, sizeof(cf) ); + cf.cbSize = sizeof(cf); + SendMessageW( edit, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf ); + ok( (cf.dwEffects & (CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR)) == 0, "got %08x\n", cf.dwEffects ); + ok( cf.crTextColor == RGB(128,128,128), "got %08x\n", cf.crTextColor ); + ok( cf.crBackColor == RGB(192,192,192), "got %08x\n", cf.crBackColor ); DestroyWindow( edit ); } @@ -8802,7 +8818,7 @@ test_EM_SETREADONLY(); test_EM_SETFONTSIZE(); test_alignment_style(); - test_rtf_specials(); + test_rtf(); test_background(); test_eop_char_fmt(); test_para_numbering();
7 years, 3 months
1
0
0
0
[akhaldi] 75896: [RICHED20] Sync with Wine Staging 2.16. CORE-13762 58cac9c riched20: Remove the separate implementation of IOleWindow as IOleInPlaceSite inherits from IOleWindow. adf53a9 riched20:...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:57:18 2017 New Revision: 75896 URL:
http://svn.reactos.org/svn/reactos?rev=75896&view=rev
Log: [RICHED20] Sync with Wine Staging 2.16. CORE-13762 58cac9c riched20: Remove the separate implementation of IOleWindow as IOleInPlaceSite inherits from IOleWindow. adf53a9 riched20: Add support for pasting EMFs. bbf34a4 riched20: Use the implementation of EM_PASTESPECIAL for EM_CANPASTE. 46fef3d riched20: Use the implementation of EM_PASTESPECIAL for WM_PASTE. 9bec53f riched20: Add support for EM_PASTESPECIAL. 417c80d riched20: Don't create a special richedit ole instance for the RTF parser. 1bc48be riched20: Initialize ME_TextEditor members in ME_MakeEditor(). 5cc8c9f riched20: Retrieve the default paragraph alignment from the text host. 4cb7578 riched20: Move the editor initialization out of CreateTextHost(). 2d91663 riched20: New high resolution cursor generated from SVG. 17b7cde riched20: The background colour is set using \highlight. Modified: trunk/reactos/dll/win32/riched20/editor.c trunk/reactos/dll/win32/riched20/editor.h trunk/reactos/dll/win32/riched20/editstr.h trunk/reactos/dll/win32/riched20/ocr_reverse.cur trunk/reactos/dll/win32/riched20/para.c trunk/reactos/dll/win32/riched20/reader.c trunk/reactos/dll/win32/riched20/richole.c trunk/reactos/dll/win32/riched20/rtf.h trunk/reactos/dll/win32/riched20/txthost.c trunk/reactos/dll/win32/riched20/txtsrv.c trunk/reactos/dll/win32/riched20/writer.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/riched20/editor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.…
============================================================================== --- trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -1119,8 +1119,8 @@ } } -static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbmp, - const SIZEL* sz) +static HRESULT insert_static_object(ME_TextEditor *editor, HENHMETAFILE hemf, HBITMAP hbmp, + const SIZEL* sz) { LPOLEOBJECT lpObject = NULL; LPSTORAGE lpStorage = NULL; @@ -1130,7 +1130,7 @@ STGMEDIUM stgm; FORMATETC fm; CLSID clsid; - BOOL ret = FALSE; + HRESULT hr = E_FAIL; DWORD conn; if (hemf) @@ -1152,13 +1152,14 @@ fm.lindex = -1; fm.tymed = stgm.tymed; - if (!info->lpRichEditOle) - { - CreateIRichEditOle(NULL, info->editor, (VOID**)&info->lpRichEditOle); + if (!editor->reOle) + { + if (!CreateIRichEditOle(NULL, editor, (LPVOID *)&editor->reOle)) + return hr; } if (OleCreateDefaultHandler(&CLSID_NULL, NULL, &IID_IOleObject, (void**)&lpObject) == S_OK && - IRichEditOle_GetClientSite(info->lpRichEditOle, &lpClientSite) == S_OK && + IRichEditOle_GetClientSite(editor->reOle, &lpClientSite) == S_OK && IOleObject_SetClientSite(lpObject, lpClientSite) == S_OK && IOleObject_GetUserClassID(lpObject, &clsid) == S_OK && IOleObject_QueryInterface(lpObject, &IID_IOleCache, (void**)&lpOleCache) == S_OK && @@ -1181,8 +1182,8 @@ reobject.dwFlags = 0; /* FIXME */ reobject.dwUser = 0; - ME_InsertOLEFromCursor(info->editor, &reobject, 0); - ret = TRUE; + ME_InsertOLEFromCursor(editor, &reobject, 0); + hr = S_OK; } if (lpObject) IOleObject_Release(lpObject); @@ -1191,7 +1192,7 @@ if (lpDataObject) IDataObject_Release(lpDataObject); if (lpOleCache) IOleCache_Release(lpOleCache); - return ret; + return hr; } static void ME_RTFReadShpPictGroup( RTF_Info *info ) @@ -1350,11 +1351,11 @@ { case gfx_enhmetafile: if ((hemf = SetEnhMetaFileBits( size, buffer ))) - ME_RTFInsertOleObject( info, hemf, NULL, &sz ); + insert_static_object( info->editor, hemf, NULL, &sz ); break; case gfx_metafile: if ((hemf = SetWinMetaFileBits( size, buffer, NULL, &mfp ))) - ME_RTFInsertOleObject( info, hemf, NULL, &sz ); + insert_static_object( info->editor, hemf, NULL, &sz ); break; case gfx_dib: { @@ -1368,7 +1369,7 @@ if ((hbmp = CreateDIBitmap( hdc, &bi->bmiHeader, CBM_INIT, (char*)(bi + 1) + nc * sizeof(RGBQUAD), bi, DIB_RGB_COLORS)) ) - ME_RTFInsertOleObject( info, NULL, hbmp, &sz ); + insert_static_object( info->editor, NULL, hbmp, &sz ); ReleaseDC( 0, hdc ); break; } @@ -1724,8 +1725,6 @@ } ME_CheckTablesForCorruption(editor); RTFDestroy(&parser); - if (parser.lpRichEditOle) - IRichEditOle_Release(parser.lpRichEditOle); if (parser.stackTop > 0) { @@ -2207,31 +2206,122 @@ return 0; } -static BOOL ME_Paste(ME_TextEditor *editor) -{ - DWORD dwFormat = 0; - EDITSTREAM es; - ME_GlobalDestStruct gds; - UINT nRTFFormat = RegisterClipboardFormatA("Rich Text Format"); - UINT cf = 0; - - if (IsClipboardFormatAvailable(nRTFFormat)) - cf = nRTFFormat, dwFormat = SF_RTF; - else if (IsClipboardFormatAvailable(CF_UNICODETEXT)) - cf = CF_UNICODETEXT, dwFormat = SF_TEXT|SF_UNICODE; - else - return FALSE; - - if (!OpenClipboard(editor->hWnd)) - return FALSE; - gds.hData = GetClipboardData(cf); - gds.nLength = 0; - es.dwCookie = (DWORD_PTR)&gds; - es.pfnCallback = dwFormat == SF_RTF ? ME_ReadFromHGLOBALRTF : ME_ReadFromHGLOBALUnicode; - ME_StreamIn(editor, dwFormat|SFF_SELECTION, &es, FALSE); - - CloseClipboard(); - return TRUE; +static const WCHAR rtfW[] = {'R','i','c','h',' ','T','e','x','t',' ','F','o','r','m','a','t',0}; + +static HRESULT paste_rtf(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med) +{ + EDITSTREAM es; + ME_GlobalDestStruct gds; + HRESULT hr; + + gds.hData = med->u.hGlobal; + gds.nLength = 0; + es.dwCookie = (DWORD_PTR)&gds; + es.pfnCallback = ME_ReadFromHGLOBALRTF; + hr = ME_StreamIn( editor, SF_RTF | SFF_SELECTION, &es, FALSE ) == 0 ? E_FAIL : S_OK; + ReleaseStgMedium( med ); + return hr; +} + +static HRESULT paste_text(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med) +{ + EDITSTREAM es; + ME_GlobalDestStruct gds; + HRESULT hr; + + gds.hData = med->u.hGlobal; + gds.nLength = 0; + es.dwCookie = (DWORD_PTR)&gds; + es.pfnCallback = ME_ReadFromHGLOBALUnicode; + hr = ME_StreamIn( editor, SF_TEXT | SF_UNICODE | SFF_SELECTION, &es, FALSE ) == 0 ? E_FAIL : S_OK; + ReleaseStgMedium( med ); + return hr; +} + +static HRESULT paste_emf(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med) +{ + HRESULT hr; + SIZEL sz = {0, 0}; + + hr = insert_static_object( editor, med->u.hEnhMetaFile, NULL, &sz ); + if (SUCCEEDED(hr)) + { + ME_CommitUndo( editor ); + ME_UpdateRepaint( editor, FALSE ); + } + else + ReleaseStgMedium( med ); + + return hr; +} + +static struct paste_format +{ + FORMATETC fmt; + HRESULT (*paste)(ME_TextEditor *, FORMATETC *, STGMEDIUM *); + const WCHAR *name; +} paste_formats[] = +{ + {{ -1, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, paste_rtf, rtfW }, + {{ CF_UNICODETEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, paste_text }, + {{ CF_ENHMETAFILE, NULL, DVASPECT_CONTENT, -1, TYMED_ENHMF }, paste_emf }, + {{ 0 }} +}; + +static void init_paste_formats(void) +{ + struct paste_format *format; + static int done; + + if (!done) + { + for (format = paste_formats; format->fmt.cfFormat; format++) + { + if (format->name) + format->fmt.cfFormat = RegisterClipboardFormatW( format->name ); + } + done = 1; + } +} + +static BOOL paste_special(ME_TextEditor *editor, UINT cf, REPASTESPECIAL *ps, BOOL check_only) +{ + HRESULT hr; + STGMEDIUM med; + struct paste_format *format; + IDataObject *data; + + init_paste_formats(); + + if (ps && ps->dwAspect != DVASPECT_CONTENT) + FIXME("Ignoring aspect %x\n", ps->dwAspect); + + hr = OleGetClipboard( &data ); + if (hr != S_OK) return FALSE; + + if (cf == CF_TEXT) cf = CF_UNICODETEXT; + + hr = S_FALSE; + for (format = paste_formats; format->fmt.cfFormat; format++) + { + if (cf && cf != format->fmt.cfFormat) continue; + hr = IDataObject_QueryGetData( data, &format->fmt ); + if (hr == S_OK) + { + if (!check_only) + { + hr = IDataObject_GetData( data, &format->fmt, &med ); + if (hr != S_OK) goto done; + hr = format->paste( editor, &format->fmt, &med ); + } + break; + } + } + +done: + IDataObject_Release( data ); + + return hr == S_OK; } static BOOL ME_Copy(ME_TextEditor *editor, const ME_Cursor *start, int nChars) @@ -2547,7 +2637,7 @@ break; case 'V': if (ctrl_is_down) - return ME_Paste(editor); + return paste_special( editor, 0, NULL, FALSE ); break; case 'C': case 'X': @@ -2881,7 +2971,7 @@ return TRUE; } -ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10, DWORD csStyle) +ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) { ME_TextEditor *ed = ALLOC_OBJ(ME_TextEditor); int i; @@ -2895,11 +2985,7 @@ ed->reOle = NULL; ed->bEmulateVersion10 = bEmulateVersion10; ed->styleFlags = 0; - ed->alignStyle = PFA_LEFT; - if (csStyle & ES_RIGHT) - ed->alignStyle = PFA_RIGHT; - if (csStyle & ES_CENTER) - ed->alignStyle = PFA_CENTER; + ed->exStyleFlags = 0; ITextHost_TxGetPropertyBits(texthost, (TXTBIT_RICHTEXT|TXTBIT_MULTILINE| TXTBIT_READONLY|TXTBIT_USEPASSWORD| @@ -2960,6 +3046,7 @@ } ME_CheckCharOffsets(ed); + SetRectEmpty(&ed->rcFormat); ed->bDefaultFormatRect = TRUE; ITextHost_TxGetSelectionBarWidth(ed->texthost, &selbarwidth); if (selbarwidth) { @@ -3411,7 +3498,6 @@ UNSUPPORTED_MSG(EM_GETTYPOGRAPHYOPTIONS) UNSUPPORTED_MSG(EM_GETUNDONAME) UNSUPPORTED_MSG(EM_GETWORDBREAKPROCEX) - UNSUPPORTED_MSG(EM_PASTESPECIAL) UNSUPPORTED_MSG(EM_SELECTIONTYPE) UNSUPPORTED_MSG(EM_SETBIDIOPTIONS) UNSUPPORTED_MSG(EM_SETEDITSTYLE) @@ -3968,17 +4054,14 @@ return 1; } case EM_CANPASTE: - { - UINT nRTFFormat = RegisterClipboardFormatA("Rich Text Format"); - if (IsClipboardFormatAvailable(nRTFFormat)) - return TRUE; - if (IsClipboardFormatAvailable(CF_UNICODETEXT)) - return TRUE; - return FALSE; - } + return paste_special( editor, 0, NULL, TRUE ); case WM_PASTE: case WM_MBUTTONDOWN: - ME_Paste(editor); + wParam = 0; + lParam = 0; + /* fall through */ + case EM_PASTESPECIAL: + paste_special( editor, wParam, (REPASTESPECIAL *)lParam, FALSE ); return 0; case WM_CUT: case WM_COPY: @@ -4789,6 +4872,30 @@ return 0L; } +static BOOL create_windowed_editor(HWND hwnd, CREATESTRUCTW *create, BOOL emulate_10) +{ + ITextHost *host = ME_CreateTextHost( hwnd, create, emulate_10 ); + ME_TextEditor *editor; + + if (!host) return FALSE; + + editor = ME_MakeEditor( host, emulate_10 ); + if (!editor) + { + ITextHost_Release( host ); + return FALSE; + } + + editor->exStyleFlags = GetWindowLongW( hwnd, GWL_EXSTYLE ); + editor->styleFlags |= GetWindowLongW( hwnd, GWL_STYLE ) & ES_WANTRETURN; + editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */ + editor->hwndParent = create->hwndParent; + + SetWindowLongPtrW( hwnd, 0, (LONG_PTR)editor ); + + return TRUE; +} + static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode) { @@ -4805,11 +4912,9 @@ if (msg == WM_NCCREATE) { CREATESTRUCTW *pcs = (CREATESTRUCTW *)lParam; - ITextHost *texthost; TRACE("WM_NCCREATE: hWnd %p style 0x%08x\n", hWnd, pcs->style); - texthost = ME_CreateTextHost(hWnd, pcs, FALSE); - return texthost != NULL; + return create_windowed_editor( hWnd, pcs, FALSE ); } else { @@ -4935,12 +5040,10 @@ { if (msg == WM_NCCREATE && !GetWindowLongPtrW(hWnd, 0)) { - ITextHost *texthost; CREATESTRUCTW *pcs = (CREATESTRUCTW *)lParam; TRACE("WM_NCCREATE: hWnd %p style 0x%08x\n", hWnd, pcs->style); - texthost = ME_CreateTextHost(hWnd, pcs, TRUE); - return texthost != NULL; + return create_windowed_editor( hWnd, pcs, TRUE ); } return RichEditANSIWndProc(hWnd, msg, wParam, lParam); } Modified: trunk/reactos/dll/win32/riched20/editor.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.…
============================================================================== --- trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -290,7 +290,7 @@ void ME_GetITextDocumentInterface(IRichEditOle *iface, LPVOID *ppvObj) DECLSPEC_HIDDEN; /* editor.c */ -ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10, DWORD csStyle) DECLSPEC_HIDDEN; +ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) DECLSPEC_HIDDEN; void ME_DestroyEditor(ME_TextEditor *editor) DECLSPEC_HIDDEN; LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode, HRESULT* phresult) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/riched20/editstr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editstr…
============================================================================== --- trunk/reactos/dll/win32/riched20/editstr.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editstr.h [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -353,7 +353,6 @@ ME_TextBuffer *pBuffer; ME_Cursor *pCursors; DWORD styleFlags; - DWORD alignStyle; DWORD exStyleFlags; int nCursors; SIZE sizeWindow; Modified: trunk/reactos/dll/win32/riched20/ocr_reverse.cur URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/ocr_rev…
============================================================================== Binary files - no diff available. Modified: trunk/reactos/dll/win32/riched20/para.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/para.c?…
============================================================================== --- trunk/reactos/dll/win32/riched20/para.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/para.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -863,10 +863,22 @@ void ME_SetDefaultParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) { + const PARAFORMAT2 *host_fmt; + HRESULT hr; + ZeroMemory(pFmt, sizeof(PARAFORMAT2)); pFmt->cbSize = sizeof(PARAFORMAT2); pFmt->dwMask = PFM_ALL2; - pFmt->wAlignment = editor->alignStyle; + pFmt->wAlignment = PFA_LEFT; pFmt->sStyle = -1; pFmt->bOutlineLevel = TRUE; -} + + hr = ITextHost_TxGetParaFormat( editor->texthost, (const PARAFORMAT **)&host_fmt ); + if (SUCCEEDED(hr)) + { + /* Just use the alignment for now */ + if (host_fmt->dwMask & PFM_ALIGNMENT) + pFmt->wAlignment = host_fmt->wAlignment; + ITextHost_OnTxParaFormatChange( editor->texthost, (PARAFORMAT *)pFmt ); + } +} Modified: trunk/reactos/dll/win32/riched20/reader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/reader.…
============================================================================== --- trunk/reactos/dll/win32/riched20/reader.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/reader.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -1366,7 +1366,7 @@ { rtfCharAttr, rtfSuperScrShrink, "super", 0 }, { rtfCharAttr, rtfInvisible, "v", 0 }, { rtfCharAttr, rtfForeColor, "cf", 0 }, - { rtfCharAttr, rtfBackColor, "cb", 0 }, + { rtfCharAttr, rtfBackColor, "highlight", 0 }, { rtfCharAttr, rtfRTLChar, "rtlch", 0 }, { rtfCharAttr, rtfLTRChar, "ltrch", 0 }, { rtfCharAttr, rtfCharStyleNum, "cs", 0 }, Modified: trunk/reactos/dll/win32/riched20/richole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/richole…
============================================================================== --- trunk/reactos/dll/win32/riched20/richole.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/richole.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -244,7 +244,6 @@ struct IOleClientSiteImpl { struct reole_child child; IOleClientSite IOleClientSite_iface; - IOleWindow IOleWindow_iface; IOleInPlaceSite IOleInPlaceSite_iface; LONG ref; }; @@ -262,11 +261,6 @@ static inline IRichEditOleImpl *impl_from_IUnknown(IUnknown *iface) { return CONTAINING_RECORD(iface, IRichEditOleImpl, IUnknown_inner); -} - -static inline IOleClientSiteImpl *impl_from_IOleWindow(IOleWindow *iface) -{ - return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleWindow_iface); } static inline IOleClientSiteImpl *impl_from_IOleInPlaceSite(IOleInPlaceSite *iface) @@ -1062,9 +1056,8 @@ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IOleClientSite)) *ppvObj = me; - else if (IsEqualGUID(riid, &IID_IOleWindow)) - *ppvObj = &This->IOleWindow_iface; - else if (IsEqualGUID(riid, &IID_IOleInPlaceSite)) + else if (IsEqualGUID(riid, &IID_IOleWindow) || + IsEqualGUID(riid, &IID_IOleInPlaceSite)) *ppvObj = &This->IOleInPlaceSite_iface; if (*ppvObj) { @@ -1175,35 +1168,28 @@ IOleClientSite_fnRequestNewObjectLayout }; -/* IOleWindow interface */ -static HRESULT WINAPI IOleWindow_fnQueryInterface(IOleWindow *iface, REFIID riid, void **ppvObj) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); +/* IOleInPlaceSite interface */ +static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnQueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppvObj) +{ + IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj); } -static ULONG WINAPI IOleWindow_fnAddRef(IOleWindow *iface) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); +static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnAddRef(IOleInPlaceSite *iface) +{ + IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); return IOleClientSite_AddRef(&This->IOleClientSite_iface); } -static ULONG WINAPI IOleWindow_fnRelease(IOleWindow *iface) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); +static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnRelease(IOleInPlaceSite *iface) +{ + IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); return IOleClientSite_Release(&This->IOleClientSite_iface); } -static HRESULT WINAPI IOleWindow_fnContextSensitiveHelp(IOleWindow *iface, BOOL fEnterMode) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); - FIXME("not implemented: (%p)->(%d)\n", This, fEnterMode); - return E_NOTIMPL; -} - -static HRESULT WINAPI IOleWindow_fnGetWindow(IOleWindow *iface, HWND *phwnd) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); +static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindow(IOleInPlaceSite *iface, HWND *phwnd) +{ + IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); TRACE("(%p)->(%p)\n", This, phwnd); @@ -1217,43 +1203,11 @@ return S_OK; } -static const IOleWindowVtbl olewinvt = { - IOleWindow_fnQueryInterface, - IOleWindow_fnAddRef, - IOleWindow_fnRelease, - IOleWindow_fnGetWindow, - IOleWindow_fnContextSensitiveHelp -}; - -/* IOleInPlaceSite interface */ -static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnQueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppvObj) +static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode) { IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj); -} - -static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnAddRef(IOleInPlaceSite *iface) -{ - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleClientSite_AddRef(&This->IOleClientSite_iface); -} - -static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnRelease(IOleInPlaceSite *iface) -{ - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleClientSite_Release(&This->IOleClientSite_iface); -} - -static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindow(IOleInPlaceSite *iface, HWND *phwnd) -{ - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleWindow_GetWindow(&This->IOleWindow_iface, phwnd); -} - -static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode) -{ - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleWindow_ContextSensitiveHelp(&This->IOleWindow_iface, fEnterMode); + FIXME("not implemented: (%p)->(%d)\n", This, fEnterMode); + return E_NOTIMPL; } static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnCanInPlaceActivate(IOleInPlaceSite *iface) @@ -1355,7 +1309,6 @@ return E_OUTOFMEMORY; clientSite->IOleClientSite_iface.lpVtbl = &ocst; - clientSite->IOleWindow_iface.lpVtbl = &olewinvt; clientSite->IOleInPlaceSite_iface.lpVtbl = &olestvt; clientSite->ref = 1; clientSite->child.reole = reOle; Modified: trunk/reactos/dll/win32/riched20/rtf.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/rtf.h?r…
============================================================================== --- trunk/reactos/dll/win32/riched20/rtf.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/rtf.h [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -1165,7 +1165,6 @@ RTFState stack[maxStack]; int stackTop; BOOL styleChanged; - LPRICHEDITOLE lpRichEditOle; RTFTable *tableDef; int nestingLevel; Modified: trunk/reactos/dll/win32/riched20/txthost.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/txthost…
============================================================================== --- trunk/reactos/dll/win32/riched20/txthost.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/txthost.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -27,6 +27,7 @@ LONG ref; HWND hWnd; BOOL bEmulateVersion10; + PARAFORMAT2 para_fmt; } ITextHostImpl; static const ITextHostVtbl textHostVtbl; @@ -34,23 +35,22 @@ ITextHost *ME_CreateTextHost(HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10) { ITextHostImpl *texthost; + texthost = CoTaskMemAlloc(sizeof(*texthost)); - if (texthost) - { - ME_TextEditor *editor; - - texthost->ITextHost_iface.lpVtbl = &textHostVtbl; - texthost->ref = 1; - texthost->hWnd = hwnd; - texthost->bEmulateVersion10 = bEmulateVersion10; - - editor = ME_MakeEditor(&texthost->ITextHost_iface, bEmulateVersion10, cs->style); - editor->exStyleFlags = GetWindowLongW(hwnd, GWL_EXSTYLE); - editor->styleFlags |= GetWindowLongW(hwnd, GWL_STYLE) & ES_WANTRETURN; - editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */ - editor->hwndParent = cs->hwndParent; - SetWindowLongPtrW(hwnd, 0, (LONG_PTR)editor); - } + if (!texthost) return NULL; + + texthost->ITextHost_iface.lpVtbl = &textHostVtbl; + texthost->ref = 1; + texthost->hWnd = hwnd; + texthost->bEmulateVersion10 = bEmulateVersion10; + memset( &texthost->para_fmt, 0, sizeof(texthost->para_fmt) ); + texthost->para_fmt.cbSize = sizeof(texthost->para_fmt); + texthost->para_fmt.dwMask = PFM_ALIGNMENT; + texthost->para_fmt.wAlignment = PFA_LEFT; + if (cs->style & ES_RIGHT) + texthost->para_fmt.wAlignment = PFA_RIGHT; + if (cs->style & ES_CENTER) + texthost->para_fmt.wAlignment = PFA_CENTER; return &texthost->ITextHost_iface; } @@ -258,9 +258,11 @@ } DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetParaFormat(ITextHost *iface, - const PARAFORMAT **ppPF) -{ - return E_NOTIMPL; + const PARAFORMAT **fmt) +{ + ITextHostImpl *This = impl_from_ITextHost(iface); + *fmt = (const PARAFORMAT *)&This->para_fmt; + return S_OK; } DECLSPEC_HIDDEN COLORREF WINAPI ITextHostImpl_TxGetSysColor(ITextHost *iface, Modified: trunk/reactos/dll/win32/riched20/txtsrv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/txtsrv.…
============================================================================== --- trunk/reactos/dll/win32/riched20/txtsrv.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/txtsrv.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -401,9 +401,7 @@ ITextImpl->pMyHost = pITextHost; ITextImpl->IUnknown_inner.lpVtbl = &textservices_inner_vtbl; ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl; - ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE, ES_LEFT); - ITextImpl->editor->exStyleFlags = 0; - SetRectEmpty(&ITextImpl->editor->rcFormat); + ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE); if (pUnkOuter) ITextImpl->outer_unk = pUnkOuter; Modified: trunk/reactos/dll/win32/riched20/writer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/writer.…
============================================================================== --- trunk/reactos/dll/win32/riched20/writer.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/writer.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -770,7 +770,7 @@ { if (fmt->dwEffects & CFE_AUTOBACKCOLOR) i = 0; else find_color_in_colortbl( pStream, fmt->crBackColor, &i ); - sprintf(props + strlen(props), "\\cb%u", i); + sprintf(props + strlen(props), "\\highlight%u", i); } if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOCOLOR || (!(fmt->dwEffects & CFE_AUTOCOLOR) && old_fmt->crTextColor != fmt->crTextColor)) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -158,7 +158,7 @@ reactos/dll/win32/query # Synced to WineStaging-2.9 reactos/dll/win32/rasapi32 # Synced to WineStaging-2.9 reactos/dll/win32/resutils # Synced to WineStaging-2.9 -reactos/dll/win32/riched20 # Synced to WineStaging-2.9 +reactos/dll/win32/riched20 # Synced to WineStaging-2.16 reactos/dll/win32/riched32 # Synced to WineStaging-2.9 reactos/dll/win32/rpcrt4 # Synced to WineStaging-2.9 reactos/dll/win32/rsabase # Synced to WineStaging-2.9
7 years, 3 months
1
0
0
0
[akhaldi] 75895: [PROPSYS_WINETEST] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:57:07 2017 New Revision: 75895 URL:
http://svn.reactos.org/svn/reactos?rev=75895&view=rev
Log: [PROPSYS_WINETEST] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/rostests/winetests/propsys/CMakeLists.txt trunk/rostests/winetests/propsys/propsys.c Modified: trunk/rostests/winetests/propsys/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/propsys/CMakeLi…
============================================================================== --- trunk/rostests/winetests/propsys/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/propsys/CMakeLists.txt [iso-8859-1] Sun Sep 17 22:57:07 2017 @@ -1,5 +1,5 @@ -add_definitions(-DUSE_WINE_TODOS) +add_definitions(-DUSE_WINE_TODOS -DWINETEST_USE_DBGSTR_LONGLONG) add_executable(propsys_winetest propstore.c propsys.c testlist.c) set_module_type(propsys_winetest win32cui) add_importlibs(propsys_winetest propsys ole32 oleaut32 msvcrt kernel32) Modified: trunk/rostests/winetests/propsys/propsys.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/propsys/propsys…
============================================================================== --- trunk/rostests/winetests/propsys/propsys.c [iso-8859-1] (original) +++ trunk/rostests/winetests/propsys/propsys.c [iso-8859-1] Sun Sep 17 22:57:07 2017 @@ -770,16 +770,6 @@ SysFreeString(str_b.u.bstrVal); } -static inline const char* debugstr_longlong(ULONGLONG ll) -{ - static char string[17]; - if (sizeof(ll) > sizeof(unsigned long) && ll >> 32) - sprintf(string, "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll); - else - sprintf(string, "%lx", (unsigned long)ll); - return string; -} - static void test_intconversions(void) { PROPVARIANT propvar; @@ -803,7 +793,7 @@ hr = PropVariantToInt64(&propvar, &llval); ok(hr == S_OK, "hr=%x\n", hr); - ok(llval == (ULONGLONG)1 << 63, "got wrong value %s\n", debugstr_longlong(llval)); + ok(llval == (ULONGLONG)1 << 63, "got wrong value %s\n", wine_dbgstr_longlong(llval)); hr = PropVariantToUInt64(&propvar, &ullval); ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); @@ -825,11 +815,11 @@ hr = PropVariantToInt64(&propvar, &llval); ok(hr == S_OK, "hr=%x\n", hr); - ok(llval == 5, "got wrong value %s\n", debugstr_longlong(llval)); + ok(llval == 5, "got wrong value %s\n", wine_dbgstr_longlong(llval)); hr = PropVariantToUInt64(&propvar, &ullval); ok(hr == S_OK, "hr=%x\n", hr); - ok(ullval == 5, "got wrong value %s\n", debugstr_longlong(ullval)); + ok(ullval == 5, "got wrong value %s\n", wine_dbgstr_longlong(ullval)); hr = PropVariantToInt32(&propvar, &lval); ok(hr == S_OK, "hr=%x\n", hr); @@ -852,7 +842,7 @@ hr = PropVariantToInt64(&propvar, &llval); ok(hr == S_OK, "hr=%x\n", hr); - ok(llval == -5, "got wrong value %s\n", debugstr_longlong(llval)); + ok(llval == -5, "got wrong value %s\n", wine_dbgstr_longlong(llval)); hr = PropVariantToUInt64(&propvar, &ullval); ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); @@ -876,28 +866,28 @@ hr = PropVariantToInt64(&propvar, &llval); ok(hr == S_OK, "hr=%x\n", hr); - ok(llval == 6, "got wrong value %s\n", debugstr_longlong(llval)); + ok(llval == 6, "got wrong value %s\n", wine_dbgstr_longlong(llval)); propvar.vt = VT_I4; propvar.u.lVal = -6; hr = PropVariantToInt64(&propvar, &llval); ok(hr == S_OK, "hr=%x\n", hr); - ok(llval == -6, "got wrong value %s\n", debugstr_longlong(llval)); + ok(llval == -6, "got wrong value %s\n", wine_dbgstr_longlong(llval)); propvar.vt = VT_UI2; propvar.u.uiVal = 7; hr = PropVariantToInt64(&propvar, &llval); ok(hr == S_OK, "hr=%x\n", hr); - ok(llval == 7, "got wrong value %s\n", debugstr_longlong(llval)); + ok(llval == 7, "got wrong value %s\n", wine_dbgstr_longlong(llval)); propvar.vt = VT_I2; propvar.u.iVal = -7; hr = PropVariantToInt64(&propvar, &llval); ok(hr == S_OK, "hr=%x\n", hr); - ok(llval == -7, "got wrong value %s\n", debugstr_longlong(llval)); + ok(llval == -7, "got wrong value %s\n", wine_dbgstr_longlong(llval)); } static void test_PropVariantChangeType_LPWSTR(void)
7 years, 3 months
1
0
0
0
[akhaldi] 75894: [PROPSYS] Sync with Wine Staging 2.16. CORE-13762 7960ed9 propsys: Don't use the format string size as buffer size.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:56:55 2017 New Revision: 75894 URL:
http://svn.reactos.org/svn/reactos?rev=75894&view=rev
Log: [PROPSYS] Sync with Wine Staging 2.16. CORE-13762 7960ed9 propsys: Don't use the format string size as buffer size. Modified: trunk/reactos/dll/win32/propsys/propvar.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/propsys/propvar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/propsys/propvar.…
============================================================================== --- trunk/reactos/dll/win32/propsys/propvar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/propsys/propvar.c [iso-8859-1] Sun Sep 17 22:56:55 2017 @@ -34,22 +34,16 @@ switch (vt) { case VT_LPSTR: - { - static const char format[] = "%04d/%02d/%02d:%02d:%02d:%02d.%03d"; - - ppropvarDest->u.pszVal = HeapAlloc(GetProcessHeap(), 0, - sizeof(format)); + ppropvarDest->u.pszVal = HeapAlloc(GetProcessHeap(), 0, 64); if (!ppropvarDest->u.pszVal) return E_OUTOFMEMORY; - snprintf( ppropvarDest->u.pszVal, sizeof(format), - format, + sprintf( ppropvarDest->u.pszVal, "%04d/%02d/%02d:%02d:%02d:%02d.%03d", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond, time.wMilliseconds ); return S_OK; - } default: FIXME("Unhandled target type: %d\n", vt); @@ -102,14 +96,24 @@ *res = 0; break; case VT_LPSTR: - *res = _strtoi64(pv->u.pszVal, NULL, 0); + { + char *end; + *res = _strtoi64(pv->u.pszVal, &end, 0); + if (pv->u.pszVal == end) + return DISP_E_TYPEMISMATCH; src_signed = *res < 0; break; + } case VT_LPWSTR: case VT_BSTR: - *res = strtolW(pv->u.pwszVal, NULL, 0); + { + WCHAR *end; + *res = strtolW(pv->u.pwszVal, &end, 0); + if (pv->u.pwszVal == end) + return DISP_E_TYPEMISMATCH; src_signed = *res < 0; break; + } default: FIXME("unhandled vt %d\n", pv->vt); return E_NOTIMPL; @@ -240,7 +244,7 @@ case VT_BSTR: if (propvarIn->u.pwszVal) { - DWORD size = (strlenW(propvarIn->u.pwszVal) + 1) * sizeof(WCHAR); + DWORD size = (lstrlenW(propvarIn->u.pwszVal) + 1) * sizeof(WCHAR); res = CoTaskMemAlloc(size); if(!res) return E_OUTOFMEMORY; memcpy(res, propvarIn->u.pwszVal, size); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Sep 17 22:56:55 2017 @@ -151,7 +151,7 @@ reactos/dll/win32/pidgen # Synced to WineStaging-2.9 reactos/dll/win32/powrprof # Forked at Wine-1.0rc5 reactos/dll/win32/printui # Synced to WineStaging-2.9 -reactos/dll/win32/propsys # Synced to WineStaging-2.9 +reactos/dll/win32/propsys # Synced to WineStaging-2.16 reactos/dll/win32/pstorec # Synced to WineStaging-2.2 reactos/dll/win32/qmgr # Synced to WineStaging-2.9 reactos/dll/win32/qmgrprxy # Synced to WineStaging-2.9
7 years, 3 months
1
0
0
0
[akhaldi] 75893: [OLEAUT32_WINETEST] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:56:47 2017 New Revision: 75893 URL:
http://svn.reactos.org/svn/reactos?rev=75893&view=rev
Log: [OLEAUT32_WINETEST] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/rostests/winetests/oleaut32/typelib.c trunk/rostests/winetests/oleaut32/vartest.c trunk/rostests/winetests/oleaut32/vartype.c Modified: trunk/rostests/winetests/oleaut32/typelib.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/typeli…
============================================================================== --- trunk/rostests/winetests/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/typelib.c [iso-8859-1] Sun Sep 17 22:56:47 2017 @@ -5053,6 +5053,22 @@ hres = LoadTypeLib(kernel32_dllW, &tl); ok(hres == TYPE_E_CANTLOADLIBRARY, "LoadTypeLib returned: %08x, expected TYPE_E_CANTLOADLIBRARY\n", hres); + + hres = LoadTypeLib(NULL, NULL); + ok(hres == E_INVALIDARG, "Got %#x.\n", hres); + + tl = (void *)0xdeadbeef; + hres = LoadTypeLib(NULL, &tl); + ok(hres == E_INVALIDARG, "Got %#x.\n", hres); + ok(tl == (void *)0xdeadbeef, "Got %p.\n", tl); + + hres = LoadTypeLibEx(NULL, REGKIND_NONE, NULL); + ok(hres == E_INVALIDARG, "Got %#x.\n", hres); + + tl = (void *)0xdeadbeef; + hres = LoadTypeLibEx(NULL, REGKIND_NONE, &tl); + ok(hres == E_INVALIDARG, "Got %#x.\n", hres); + ok(tl == (void *)0xdeadbeef, "Got %p.\n", tl); } static void test_SetVarHelpContext(void) Modified: trunk/rostests/winetests/oleaut32/vartest.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartes…
============================================================================== --- trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] Sun Sep 17 22:56:47 2017 @@ -6097,7 +6097,7 @@ SET_EXPECT(dispatch_invoke); hres = VarCat(&left, &right, &result); - todo_wine ok(hres == S_OK, "got 0x%08x\n", hres); + ok(hres == S_OK, "got 0x%08x\n", hres); ok(V_VT(&result) == VT_BSTR, "got %d\n", V_VT(&result)); ok(SysStringLen(V_BSTR(&result)) == 0, "got %d\n", SysStringLen(V_BSTR(&result))); CHECK_CALLED(dispatch_invoke); @@ -6112,7 +6112,7 @@ SET_EXPECT(dispatch_invoke); hres = VarCat(&left, &right, &result); - todo_wine ok(hres == S_OK, "got 0x%08x\n", hres); + ok(hres == S_OK, "got 0x%08x\n", hres); ok(V_VT(&result) == VT_BSTR, "got %d\n", V_VT(&result)); ok(SysStringLen(V_BSTR(&result)) == 0, "got %d\n", SysStringLen(V_BSTR(&result))); CHECK_CALLED(dispatch_invoke); @@ -6144,7 +6144,21 @@ SET_EXPECT(dispatch_invoke); hres = VarCat(&left, &right, &result); - todo_wine ok(hres == E_OUTOFMEMORY, "got 0x%08x\n", hres); + ok(hres == E_OUTOFMEMORY, "got 0x%08x\n", hres); + CHECK_CALLED(dispatch_invoke); + + VariantClear(&left); + VariantClear(&right); + VariantClear(&result); + + init_test_dispatch(VT_NULL, &dispatch); + dispatch.result = DISP_E_TYPEMISMATCH; + V_VT(&right) = VT_DISPATCH; + V_DISPATCH(&right) = &dispatch.IDispatch_iface; + + SET_EXPECT(dispatch_invoke); + hres = VarCat(&left, &right, &result); + ok(hres == DISP_E_TYPEMISMATCH, "got 0x%08x\n", hres); CHECK_CALLED(dispatch_invoke); VariantClear(&left); Modified: trunk/rostests/winetests/oleaut32/vartype.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartyp…
============================================================================== --- trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] Sun Sep 17 22:56:47 2017 @@ -57,11 +57,6 @@ static HMODULE hOleaut32; -/* Get a conversion function ptr, return if function not available */ -#define CHECKPTR(func) p##func = (void*)GetProcAddress(hOleaut32, #func); \ - if (!p##func) { \ - win_skip("function " # func " not available, not testing it\n"); return; } - /* Has I8/UI8 data type? */ static BOOL has_i8; /* Has proper locale conversions? */ @@ -89,7 +84,7 @@ #define EXPECT_DBL(x) \ ok(hres == S_OK && fabs(out-(x))<=1e-14*(x), "expected %16.16g, got %16.16g; hres=0x%08x\n", (x), out, hres) -#define CONVERT(func, val) in = val; hres = p##func(in, &out) +#define CONVERT(func, val) in = val; hres = func(in, &out) #define CONVERTRANGE(func,start,end) for (i = start; i < end; i+=1) { CONVERT(func, i); EXPECT(i); }; #define OVERFLOWRANGE(func,start,end) for (i = start; i < end; i+=1) { CONVERT(func, i); EXPECT_OVERFLOW; }; @@ -98,11 +93,11 @@ #define DATE_MIN -657434 #define DATE_MAX 2958465 -#define CONVERT_I8(func,hi,lo) in = hi; in = (in << 32) | lo; hres = p##func(in, &out) - -#define CONVERT_CY(func,val) in.int64 = (LONGLONG)(val * CY_MULTIPLIER); hres = p##func(in, &out) - -#define CONVERT_CY64(func,hi,lo) S(in).Hi = hi; S(in).Lo = lo; in.int64 *= CY_MULTIPLIER; hres = p##func(in, &out) +#define CONVERT_I8(func,hi,lo) in = hi; in = (in << 32) | lo; hres = func(in, &out) + +#define CONVERT_CY(func,val) in.int64 = (LONGLONG)(val * CY_MULTIPLIER); hres = func(in, &out) + +#define CONVERT_CY64(func,hi,lo) S(in).Hi = hi; S(in).Lo = lo; in.int64 *= CY_MULTIPLIER; hres = func(in, &out) #define SETDEC(dec, scl, sgn, hi, lo) S(U(dec)).scale = (BYTE)scl; S(U(dec)).sign = (BYTE)sgn; \ dec.Hi32 = (ULONG)hi; U1(dec).Lo64 = (ULONG64)lo @@ -110,9 +105,9 @@ #define SETDEC64(dec, scl, sgn, hi, mid, lo) S(U(dec)).scale = (BYTE)scl; S(U(dec)).sign = (BYTE)sgn; \ dec.Hi32 = (ULONG)hi; S1(U1(dec)).Mid32 = mid; S1(U1(dec)).Lo32 = lo; -#define CONVERT_DEC(func,scl,sgn,hi,lo) SETDEC(in,scl,sgn,hi,lo); hres = p##func(&in, &out) - -#define CONVERT_DEC64(func,scl,sgn,hi,mid,lo) SETDEC64(in,scl,sgn,hi,mid,lo); hres = p##func(&in, &out) +#define CONVERT_DEC(func,scl,sgn,hi,lo) SETDEC(in,scl,sgn,hi,lo); hres = func(&in, &out) + +#define CONVERT_DEC64(func,scl,sgn,hi,mid,lo) SETDEC64(in,scl,sgn,hi,mid,lo); hres = func(&in, &out) #define CONVERT_BADDEC(func) \ CONVERT_DEC(func,29,0,0,0); EXPECT_INVALID; \ @@ -123,7 +118,7 @@ #define CONVERT_STR(func,str,flags) \ SetLastError(0); \ if (str) MultiByteToWideChar(CP_ACP,0,str,-1,buff,sizeof(buff)/sizeof(WCHAR)); \ - hres = p##func(str ? buff : NULL,in,flags,&out) + hres = func(str ? buff : NULL,in,flags,&out) #define COPYTEST(val, vt, srcval, dstval, srcref, dstref, fs) do { \ HRESULT hres; VARIANTARG vSrc, vDst; CONV_TYPE in = val; \ @@ -283,243 +278,6 @@ DEFINE_EXPECT(dispatch_invoke); -/* Early versions of oleaut32 are missing many functions */ -static HRESULT (WINAPI *pVarI1FromUI1)(BYTE,signed char*); -static HRESULT (WINAPI *pVarI1FromI2)(SHORT,signed char*); -static HRESULT (WINAPI *pVarI1FromI4)(LONG,signed char*); -static HRESULT (WINAPI *pVarI1FromR4)(FLOAT,signed char*); -static HRESULT (WINAPI *pVarI1FromR8)(double,signed char*); -static HRESULT (WINAPI *pVarI1FromDate)(DATE,signed char*); -static HRESULT (WINAPI *pVarI1FromCy)(CY,signed char*); -static HRESULT (WINAPI *pVarI1FromStr)(OLECHAR*,LCID,ULONG,signed char*); -static HRESULT (WINAPI *pVarI1FromBool)(VARIANT_BOOL,signed char*); -static HRESULT (WINAPI *pVarI1FromUI2)(USHORT,signed char*); -static HRESULT (WINAPI *pVarI1FromUI4)(ULONG,signed char*); -static HRESULT (WINAPI *pVarI1FromDec)(DECIMAL*,signed char*); -static HRESULT (WINAPI *pVarI1FromI8)(LONG64,signed char*); -static HRESULT (WINAPI *pVarI1FromUI8)(ULONG64,signed char*); -static HRESULT (WINAPI *pVarUI1FromI2)(SHORT,BYTE*); -static HRESULT (WINAPI *pVarUI1FromI4)(LONG,BYTE*); -static HRESULT (WINAPI *pVarUI1FromR4)(FLOAT,BYTE*); -static HRESULT (WINAPI *pVarUI1FromR8)(double,BYTE*); -static HRESULT (WINAPI *pVarUI1FromCy)(CY,BYTE*); -static HRESULT (WINAPI *pVarUI1FromDate)(DATE,BYTE*); -static HRESULT (WINAPI *pVarUI1FromStr)(OLECHAR*,LCID,ULONG,BYTE*); -static HRESULT (WINAPI *pVarUI1FromBool)(VARIANT_BOOL,BYTE*); -static HRESULT (WINAPI *pVarUI1FromI1)(signed char,BYTE*); -static HRESULT (WINAPI *pVarUI1FromUI2)(USHORT,BYTE*); -static HRESULT (WINAPI *pVarUI1FromUI4)(ULONG,BYTE*); -static HRESULT (WINAPI *pVarUI1FromDec)(DECIMAL*,BYTE*); -static HRESULT (WINAPI *pVarUI1FromI8)(LONG64,BYTE*); -static HRESULT (WINAPI *pVarUI1FromUI8)(ULONG64,BYTE*); -static HRESULT (WINAPI *pVarUI1FromDisp)(IDispatch*,LCID,BYTE*); - -static HRESULT (WINAPI *pVarI2FromUI1)(BYTE,SHORT*); -static HRESULT (WINAPI *pVarI2FromI4)(LONG,SHORT*); -static HRESULT (WINAPI *pVarI2FromR4)(FLOAT,SHORT*); -static HRESULT (WINAPI *pVarI2FromR8)(double,SHORT*); -static HRESULT (WINAPI *pVarI2FromCy)(CY,SHORT*); -static HRESULT (WINAPI *pVarI2FromDate)(DATE,SHORT*); -static HRESULT (WINAPI *pVarI2FromStr)(OLECHAR*,LCID,ULONG,SHORT*); -static HRESULT (WINAPI *pVarI2FromBool)(VARIANT_BOOL,SHORT*); -static HRESULT (WINAPI *pVarI2FromI1)(signed char,SHORT*); -static HRESULT (WINAPI *pVarI2FromUI2)(USHORT,SHORT*); -static HRESULT (WINAPI *pVarI2FromUI4)(ULONG,SHORT*); -static HRESULT (WINAPI *pVarI2FromDec)(DECIMAL*,SHORT*); -static HRESULT (WINAPI *pVarI2FromI8)(LONG64,SHORT*); -static HRESULT (WINAPI *pVarI2FromUI8)(ULONG64,SHORT*); -static HRESULT (WINAPI *pVarUI2FromUI1)(BYTE,USHORT*); -static HRESULT (WINAPI *pVarUI2FromI2)(SHORT,USHORT*); -static HRESULT (WINAPI *pVarUI2FromI4)(LONG,USHORT*); -static HRESULT (WINAPI *pVarUI2FromR4)(FLOAT,USHORT*); -static HRESULT (WINAPI *pVarUI2FromR8)(double,USHORT*); -static HRESULT (WINAPI *pVarUI2FromDate)(DATE,USHORT*); -static HRESULT (WINAPI *pVarUI2FromCy)(CY,USHORT*); -static HRESULT (WINAPI *pVarUI2FromStr)(OLECHAR*,LCID,ULONG,USHORT*); -static HRESULT (WINAPI *pVarUI2FromBool)(VARIANT_BOOL,USHORT*); -static HRESULT (WINAPI *pVarUI2FromI1)(signed char,USHORT*); -static HRESULT (WINAPI *pVarUI2FromUI4)(ULONG,USHORT*); -static HRESULT (WINAPI *pVarUI2FromDec)(DECIMAL*,USHORT*); -static HRESULT (WINAPI *pVarUI2FromI8)(LONG64,USHORT*); -static HRESULT (WINAPI *pVarUI2FromUI8)(ULONG64,USHORT*); - -static HRESULT (WINAPI *pVarI4FromUI1)(BYTE,LONG*); -static HRESULT (WINAPI *pVarI4FromI2)(SHORT,LONG*); -static HRESULT (WINAPI *pVarI4FromR4)(FLOAT,LONG*); -static HRESULT (WINAPI *pVarI4FromR8)(DOUBLE,LONG*); -static HRESULT (WINAPI *pVarI4FromCy)(CY,LONG*); -static HRESULT (WINAPI *pVarI4FromDate)(DATE,LONG*); -static HRESULT (WINAPI *pVarI4FromStr)(OLECHAR*,LCID,ULONG,LONG*); -static HRESULT (WINAPI *pVarI4FromBool)(VARIANT_BOOL,LONG*); -static HRESULT (WINAPI *pVarI4FromI1)(signed char,LONG*); -static HRESULT (WINAPI *pVarI4FromUI2)(USHORT,LONG*); -static HRESULT (WINAPI *pVarI4FromUI4)(ULONG,LONG*); -static HRESULT (WINAPI *pVarI4FromDec)(DECIMAL*,LONG*); -static HRESULT (WINAPI *pVarI4FromI8)(LONG64,LONG*); -static HRESULT (WINAPI *pVarI4FromUI8)(ULONG64,LONG*); -static HRESULT (WINAPI *pVarUI4FromUI1)(BYTE,ULONG*); -static HRESULT (WINAPI *pVarUI4FromI2)(SHORT,ULONG*); -static HRESULT (WINAPI *pVarUI4FromI4)(LONG,ULONG*); -static HRESULT (WINAPI *pVarUI4FromR4)(FLOAT,ULONG*); -static HRESULT (WINAPI *pVarUI4FromR8)(DOUBLE,ULONG*); -static HRESULT (WINAPI *pVarUI4FromDate)(DATE,ULONG*); -static HRESULT (WINAPI *pVarUI4FromCy)(CY,ULONG*); -static HRESULT (WINAPI *pVarUI4FromStr)(OLECHAR*,LCID,ULONG,ULONG*); -static HRESULT (WINAPI *pVarUI4FromBool)(VARIANT_BOOL,ULONG*); -static HRESULT (WINAPI *pVarUI4FromI1)(signed char,ULONG*); -static HRESULT (WINAPI *pVarUI4FromUI2)(USHORT,ULONG*); -static HRESULT (WINAPI *pVarUI4FromDec)(DECIMAL*,ULONG*); -static HRESULT (WINAPI *pVarUI4FromI8)(LONG64,ULONG*); -static HRESULT (WINAPI *pVarUI4FromUI8)(ULONG64,ULONG*); - -static HRESULT (WINAPI *pVarI8FromUI1)(BYTE,LONG64*); -static HRESULT (WINAPI *pVarI8FromI2)(SHORT,LONG64*); -static HRESULT (WINAPI *pVarI8FromR4)(FLOAT,LONG64*); -static HRESULT (WINAPI *pVarI8FromR8)(double,LONG64*); -static HRESULT (WINAPI *pVarI8FromCy)(CY,LONG64*); -static HRESULT (WINAPI *pVarI8FromDate)(DATE,LONG64*); -static HRESULT (WINAPI *pVarI8FromStr)(OLECHAR*,LCID,ULONG,LONG64*); -static HRESULT (WINAPI *pVarI8FromBool)(VARIANT_BOOL,LONG64*); -static HRESULT (WINAPI *pVarI8FromI1)(signed char,LONG64*); -static HRESULT (WINAPI *pVarI8FromUI2)(USHORT,LONG64*); -static HRESULT (WINAPI *pVarI8FromUI4)(ULONG,LONG64*); -static HRESULT (WINAPI *pVarI8FromDec)(DECIMAL*,LONG64*); -static HRESULT (WINAPI *pVarI8FromUI8)(ULONG64,LONG64*); -static HRESULT (WINAPI *pVarUI8FromI8)(LONG64,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromUI1)(BYTE,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromI2)(SHORT,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromR4)(FLOAT,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromR8)(double,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromCy)(CY,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromDate)(DATE,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromStr)(OLECHAR*,LCID,ULONG,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromBool)(VARIANT_BOOL,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromI1)(signed char,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromUI2)(USHORT,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromUI4)(ULONG,ULONG64*); -static HRESULT (WINAPI *pVarUI8FromDec)(DECIMAL*,ULONG64*); - -static HRESULT (WINAPI *pVarR4FromUI1)(BYTE,float*); -static HRESULT (WINAPI *pVarR4FromI2)(SHORT,float*); -static HRESULT (WINAPI *pVarR4FromI4)(LONG,float*); -static HRESULT (WINAPI *pVarR4FromR8)(double,float*); -static HRESULT (WINAPI *pVarR4FromCy)(CY,float*); -static HRESULT (WINAPI *pVarR4FromDate)(DATE,float*); -static HRESULT (WINAPI *pVarR4FromStr)(OLECHAR*,LCID,ULONG,float*); -static HRESULT (WINAPI *pVarR4FromBool)(VARIANT_BOOL,float*); -static HRESULT (WINAPI *pVarR4FromI1)(signed char,float*); -static HRESULT (WINAPI *pVarR4FromUI2)(USHORT,float*); -static HRESULT (WINAPI *pVarR4FromUI4)(ULONG,float*); -static HRESULT (WINAPI *pVarR4FromDec)(DECIMAL*,float*); -static HRESULT (WINAPI *pVarR4FromI8)(LONG64,float*); -static HRESULT (WINAPI *pVarR4FromUI8)(ULONG64,float*); - -static HRESULT (WINAPI *pVarR8FromUI1)(BYTE,double*); -static HRESULT (WINAPI *pVarR8FromI2)(SHORT,double*); -static HRESULT (WINAPI *pVarR8FromI4)(LONG,double*); -static HRESULT (WINAPI *pVarR8FromR4)(FLOAT,double*); -static HRESULT (WINAPI *pVarR8FromCy)(CY,double*); -static HRESULT (WINAPI *pVarR8FromDate)(DATE,double*); -static HRESULT (WINAPI *pVarR8FromStr)(OLECHAR*,LCID,ULONG,double*); -static HRESULT (WINAPI *pVarR8FromBool)(VARIANT_BOOL,double*); -static HRESULT (WINAPI *pVarR8FromI1)(signed char,double*); -static HRESULT (WINAPI *pVarR8FromUI2)(USHORT,double*); -static HRESULT (WINAPI *pVarR8FromUI4)(ULONG,double*); -static HRESULT (WINAPI *pVarR8FromDec)(DECIMAL*,double*); -static HRESULT (WINAPI *pVarR8FromI8)(LONG64,double*); -static HRESULT (WINAPI *pVarR8FromUI8)(ULONG64,double*); -static HRESULT (WINAPI *pVarR8Round)(double,int,double*); - -static HRESULT (WINAPI *pVarDateFromUI1)(BYTE,DATE*); -static HRESULT (WINAPI *pVarDateFromI2)(SHORT,DATE*); -static HRESULT (WINAPI *pVarDateFromI4)(LONG,DATE*); -static HRESULT (WINAPI *pVarDateFromR4)(FLOAT,DATE*); -static HRESULT (WINAPI *pVarDateFromCy)(CY,DATE*); -static HRESULT (WINAPI *pVarDateFromR8)(double,DATE*); -static HRESULT (WINAPI *pVarDateFromStr)(OLECHAR*,LCID,ULONG,DATE*); -static HRESULT (WINAPI *pVarDateFromBool)(VARIANT_BOOL,DATE*); -static HRESULT (WINAPI *pVarDateFromI1)(signed char,DATE*); -static HRESULT (WINAPI *pVarDateFromUI2)(USHORT,DATE*); -static HRESULT (WINAPI *pVarDateFromUI4)(ULONG,DATE*); -static HRESULT (WINAPI *pVarDateFromDec)(DECIMAL*,DATE*); -static HRESULT (WINAPI *pVarDateFromI8)(LONG64,DATE*); -static HRESULT (WINAPI *pVarDateFromUI8)(ULONG64,DATE*); - -static HRESULT (WINAPI *pVarCyFromUI1)(BYTE,CY*); -static HRESULT (WINAPI *pVarCyFromI2)(SHORT,CY*); -static HRESULT (WINAPI *pVarCyFromI4)(LONG,CY*); -static HRESULT (WINAPI *pVarCyFromR4)(FLOAT,CY*); -static HRESULT (WINAPI *pVarCyFromR8)(double,CY*); -static HRESULT (WINAPI *pVarCyFromDate)(DATE,CY*); -static HRESULT (WINAPI *pVarCyFromBool)(VARIANT_BOOL,CY*); -static HRESULT (WINAPI *pVarCyFromI1)(signed char,CY*); -static HRESULT (WINAPI *pVarCyFromUI2)(USHORT,CY*); -static HRESULT (WINAPI *pVarCyFromUI4)(ULONG,CY*); -static HRESULT (WINAPI *pVarCyFromDec)(DECIMAL*,CY*); -static HRESULT (WINAPI *pVarCyFromI8)(LONG64,CY*); -static HRESULT (WINAPI *pVarCyFromUI8)(ULONG64,CY*); -static HRESULT (WINAPI *pVarCyAdd)(const CY,const CY,CY*); -static HRESULT (WINAPI *pVarCyMul)(const CY,const CY,CY*); -static HRESULT (WINAPI *pVarCyMulI4)(const CY,LONG,CY*); -static HRESULT (WINAPI *pVarCySub)(const CY,const CY,CY*); -static HRESULT (WINAPI *pVarCyAbs)(const CY,CY*); -static HRESULT (WINAPI *pVarCyFix)(const CY,CY*); -static HRESULT (WINAPI *pVarCyInt)(const CY,CY*); -static HRESULT (WINAPI *pVarCyNeg)(const CY,CY*); -static HRESULT (WINAPI *pVarCyRound)(const CY,int,CY*); -static HRESULT (WINAPI *pVarCyCmp)(const CY,const CY); -static HRESULT (WINAPI *pVarCyCmpR8)(const CY,double); -static HRESULT (WINAPI *pVarCyMulI8)(const CY,LONG64,CY*); - -static HRESULT (WINAPI *pVarDecFromUI1)(BYTE,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromI2)(SHORT,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromI4)(LONG,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromI8)(LONG64,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromR4)(FLOAT,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromR8)(DOUBLE,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromDate)(DATE,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromStr)(OLECHAR*,LCID,ULONG,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromBool)(VARIANT_BOOL,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromI1)(signed char,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromUI2)(USHORT,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromUI4)(ULONG,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromUI8)(ULONG64,DECIMAL*); -static HRESULT (WINAPI *pVarDecFromCy)(CY,DECIMAL*); -static HRESULT (WINAPI *pVarDecAbs)(const DECIMAL*,DECIMAL*); -static HRESULT (WINAPI *pVarDecAdd)(const DECIMAL*,const DECIMAL*,DECIMAL*); -static HRESULT (WINAPI *pVarDecSub)(const DECIMAL*,const DECIMAL*,DECIMAL*); -static HRESULT (WINAPI *pVarDecMul)(const DECIMAL*,const DECIMAL*,DECIMAL*); -static HRESULT (WINAPI *pVarDecDiv)(const DECIMAL*,const DECIMAL*,DECIMAL*); -static HRESULT (WINAPI *pVarDecCmp)(const DECIMAL*,const DECIMAL*); -static HRESULT (WINAPI *pVarDecCmpR8)(const DECIMAL*,double); -static HRESULT (WINAPI *pVarDecNeg)(const DECIMAL*,DECIMAL*); -static HRESULT (WINAPI *pVarDecRound)(const DECIMAL*,int,DECIMAL*); - -static HRESULT (WINAPI *pVarBoolFromUI1)(BYTE,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromI2)(SHORT,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromI4)(LONG,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromR4)(FLOAT,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromR8)(DOUBLE,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromDate)(DATE,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromCy)(CY,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromStr)(OLECHAR*,LCID,ULONG,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromI1)(signed char,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromUI2)(USHORT,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromUI4)(ULONG,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromDec)(DECIMAL*,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromI8)(LONG64,VARIANT_BOOL*); -static HRESULT (WINAPI *pVarBoolFromUI8)(ULONG64,VARIANT_BOOL*); - -static HRESULT (WINAPI *pVarBstrFromR4)(FLOAT,LCID,ULONG,BSTR*); -static HRESULT (WINAPI *pVarBstrFromDate)(DATE,LCID,ULONG,BSTR*); -static HRESULT (WINAPI *pVarBstrFromCy)(CY,LCID,ULONG,BSTR*); -static HRESULT (WINAPI *pVarBstrFromDec)(DECIMAL*,LCID,ULONG,BSTR*); -static HRESULT (WINAPI *pVarBstrCmp)(BSTR,BSTR,LCID,ULONG); -static HRESULT (WINAPI *pVarBstrCat)(BSTR,BSTR,BSTR*); - -static INT (WINAPI *pSystemTimeToVariantTime)(LPSYSTEMTIME,double*); -static void (WINAPI *pClearCustData)(LPCUSTDATA); - /* Internal representation of a BSTR */ typedef struct tagINTERNAL_BSTR { @@ -658,7 +416,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarI1FromI2); OVERFLOWRANGE(VarI1FromI2, -32768, -128); CONVERTRANGE(VarI1FromI2, -128, 128); OVERFLOWRANGE(VarI1FromI2, 129, 32768); @@ -669,7 +426,6 @@ CONVVARS(LONG); int i; - CHECKPTR(VarI1FromI4); CONVERT(VarI1FromI4, -129); EXPECT_OVERFLOW; CONVERTRANGE(VarI1FromI4, -128, 128); CONVERT(VarI1FromI4, 128); EXPECT_OVERFLOW; @@ -680,7 +436,6 @@ CONVVARS(LONG64); int i; - CHECKPTR(VarI1FromI8); CONVERT(VarI1FromI8, -129); EXPECT_OVERFLOW; CONVERTRANGE(VarI1FromI8, -127, 128); CONVERT(VarI1FromI8, 128); EXPECT_OVERFLOW; @@ -691,7 +446,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarI1FromUI1); CONVERTRANGE(VarI1FromUI1, 0, 127); OVERFLOWRANGE(VarI1FromUI1, 128, 255); } @@ -701,7 +455,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarI1FromUI2); CONVERTRANGE(VarI1FromUI2, 0, 127); OVERFLOWRANGE(VarI1FromUI2, 128, 32768); } @@ -711,7 +464,6 @@ CONVVARS(ULONG); int i; - CHECKPTR(VarI1FromUI4); CONVERTRANGE(VarI1FromUI4, 0, 127); CONVERT(VarI1FromUI4, 128); EXPECT_OVERFLOW; } @@ -721,7 +473,6 @@ CONVVARS(ULONG64); int i; - CHECKPTR(VarI1FromUI8); CONVERTRANGE(VarI1FromUI8, 0, 127); CONVERT(VarI1FromUI8, 128); EXPECT_OVERFLOW; } @@ -731,7 +482,6 @@ CONVVARS(VARIANT_BOOL); int i; - CHECKPTR(VarI1FromBool); /* Note that conversions from bool wrap around! */ CONVERT(VarI1FromBool, -129); EXPECT(127); CONVERTRANGE(VarI1FromBool, -128, 128); @@ -742,7 +492,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarI1FromR4); CONVERT(VarI1FromR4, -129.0f); EXPECT_OVERFLOW; CONVERT(VarI1FromR4, -128.51f); EXPECT_OVERFLOW; CONVERT(VarI1FromR4, -128.5f); EXPECT(-128); @@ -769,7 +518,6 @@ { CONVVARS(DOUBLE); - CHECKPTR(VarI1FromR8); CONVERT(VarI1FromR8, -129.0); EXPECT_OVERFLOW; CONVERT(VarI1FromR8, -128.51); EXPECT_OVERFLOW; CONVERT(VarI1FromR8, -128.5); EXPECT(-128); @@ -796,7 +544,6 @@ { CONVVARS(DATE); - CHECKPTR(VarI1FromDate); CONVERT(VarI1FromDate, -129.0); EXPECT_OVERFLOW; CONVERT(VarI1FromDate, -128.0); EXPECT(-128); CONVERT(VarI1FromDate, -1.0); EXPECT(-1); @@ -819,7 +566,6 @@ { CONVVARS(CY); - CHECKPTR(VarI1FromCy); CONVERT_CY(VarI1FromCy,-129); EXPECT_OVERFLOW; CONVERT_CY(VarI1FromCy,-128); EXPECT(128); CONVERT_CY(VarI1FromCy,-1); EXPECT(-1); @@ -842,8 +588,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarI1FromDec); - CONVERT_BADDEC(VarI1FromDec); CONVERT_DEC(VarI1FromDec,0,0x80,0,129); EXPECT_OVERFLOW; @@ -864,8 +608,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarI1FromStr); CONVERT_STR(VarI1FromStr,NULL, 0); EXPECT_MISMATCH; CONVERT_STR(VarI1FromStr,"0", 0); EXPECT(0); @@ -910,7 +652,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarUI1FromI1); OVERFLOWRANGE(VarUI1FromI1, -128, 0); CONVERTRANGE(VarUI1FromI1, 0, 128); } @@ -920,7 +661,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarUI1FromI2); OVERFLOWRANGE(VarUI1FromI2, -32768, 0); CONVERTRANGE(VarUI1FromI2, 0, 256); OVERFLOWRANGE(VarUI1FromI2, 256, 32768); @@ -931,7 +671,6 @@ CONVVARS(LONG); int i; - CHECKPTR(VarUI1FromI4); CONVERT(VarUI1FromI4, -1); EXPECT_OVERFLOW; CONVERTRANGE(VarUI1FromI4, 0, 256); CONVERT(VarUI1FromI4, 256); EXPECT_OVERFLOW; @@ -942,7 +681,6 @@ CONVVARS(LONG64); int i; - CHECKPTR(VarUI1FromI8); CONVERT(VarUI1FromI8, -1); EXPECT_OVERFLOW; CONVERTRANGE(VarUI1FromI8, 0, 256); CONVERT(VarUI1FromI8, 256); EXPECT_OVERFLOW; @@ -953,7 +691,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarUI1FromUI2); CONVERTRANGE(VarUI1FromUI2, 0, 256); OVERFLOWRANGE(VarUI1FromUI2, 256, 65536); } @@ -963,7 +700,6 @@ CONVVARS(ULONG); int i; - CHECKPTR(VarUI1FromUI4); CONVERTRANGE(VarUI1FromUI4, 0, 256); CONVERT(VarUI1FromUI4, 256); EXPECT_OVERFLOW; } @@ -973,7 +709,6 @@ CONVVARS(ULONG64); int i; - CHECKPTR(VarUI1FromUI8); CONVERTRANGE(VarUI1FromUI8, 0, 256); CONVERT(VarUI1FromUI8, 256); EXPECT_OVERFLOW; } @@ -983,7 +718,6 @@ CONVVARS(VARIANT_BOOL); int i; - CHECKPTR(VarUI1FromBool); /* Note that conversions from bool overflow! */ CONVERT(VarUI1FromBool, -1); EXPECT(255); CONVERTRANGE(VarUI1FromBool, 0, 256); @@ -994,7 +728,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarUI1FromR4); CONVERT(VarUI1FromR4, -1.0f); EXPECT_OVERFLOW; CONVERT(VarUI1FromR4, -0.51f); EXPECT_OVERFLOW; CONVERT(VarUI1FromR4, -0.5f); EXPECT(0); @@ -1020,7 +753,6 @@ { CONVVARS(DOUBLE); - CHECKPTR(VarUI1FromR8); CONVERT(VarUI1FromR8, -1.0); EXPECT_OVERFLOW; CONVERT(VarUI1FromR8, -0.51); EXPECT_OVERFLOW; CONVERT(VarUI1FromR8, -0.5); EXPECT(0); @@ -1046,7 +778,6 @@ { CONVVARS(DATE); - CHECKPTR(VarUI1FromDate); CONVERT(VarUI1FromDate, -1.0); EXPECT_OVERFLOW; CONVERT(VarUI1FromDate, 0.0); EXPECT(0); CONVERT(VarUI1FromDate, 1.0); EXPECT(1); @@ -1068,7 +799,6 @@ { CONVVARS(CY); - CHECKPTR(VarUI1FromCy); CONVERT_CY(VarUI1FromCy,-1); EXPECT_OVERFLOW; CONVERT_CY(VarUI1FromCy,0); EXPECT(0); CONVERT_CY(VarUI1FromCy,1); EXPECT(1); @@ -1090,8 +820,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarUI1FromDec); - CONVERT_BADDEC(VarUI1FromDec); CONVERT_DEC(VarUI1FromDec,0,0x80,0,1); EXPECT_OVERFLOW; @@ -1110,8 +838,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarUI1FromStr); CONVERT_STR(VarUI1FromStr,NULL, 0); EXPECT_MISMATCH; CONVERT_STR(VarUI1FromStr,"0", 0); EXPECT(0); @@ -1135,8 +861,6 @@ DummyDispatch dispatch; CONVVARS(LCID); VARIANTARG vSrc, vDst; - - CHECKPTR(VarUI1FromDisp); /* FIXME * Conversions from IDispatch should get the default 'value' property @@ -1161,7 +885,7 @@ SET_EXPECT(dispatch_invoke); out = 10; - hres = pVarUI1FromDisp(&dispatch.IDispatch_iface, in, &out); + hres = VarUI1FromDisp(&dispatch.IDispatch_iface, in, &out); ok(broken(hres == DISP_E_BADVARTYPE) || hres == S_OK, "got 0x%08x\n", hres); ok(broken(out == 10) || out == 1, "got %d\n", out); CHECK_CALLED(dispatch_invoke); @@ -1179,7 +903,7 @@ SET_EXPECT(dispatch_invoke); out = 10; - hres = pVarUI1FromDisp(&dispatch.IDispatch_iface, in, &out); + hres = VarUI1FromDisp(&dispatch.IDispatch_iface, in, &out); ok(hres == DISP_E_TYPEMISMATCH, "got 0x%08x\n", hres); ok(out == 10, "got %d\n", out); CHECK_CALLED(dispatch_invoke); @@ -1222,7 +946,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarI2FromI1); CONVERTRANGE(VarI2FromI1, -128, 128); } @@ -1231,7 +954,6 @@ CONVVARS(LONG); int i; - CHECKPTR(VarI2FromI4); CONVERT(VarI2FromI4, -32769); EXPECT_OVERFLOW; CONVERTRANGE(VarI2FromI4, -32768, 32768); CONVERT(VarI2FromI4, 32768); EXPECT_OVERFLOW; @@ -1241,7 +963,6 @@ { CONVVARS(LONG64); - CHECKPTR(VarI2FromI8); CONVERT(VarI2FromI8, -32769); EXPECT_OVERFLOW; CONVERT(VarI2FromI8, -32768); EXPECT(-32768); CONVERT(VarI2FromI8, 32767); EXPECT(32767); @@ -1253,7 +974,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarI2FromUI1); CONVERTRANGE(VarI2FromUI1, 0, 256); } @@ -1262,7 +982,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarI2FromUI2); CONVERTRANGE(VarI2FromUI2, 0, 32768); CONVERT(VarI2FromUI2, 32768); EXPECT_OVERFLOW; } @@ -1272,7 +991,6 @@ CONVVARS(ULONG); int i; - CHECKPTR(VarI2FromUI4); CONVERTRANGE(VarI2FromUI4, 0, 32768); CONVERT(VarI2FromUI4, 32768); EXPECT_OVERFLOW; } @@ -1282,7 +1000,6 @@ CONVVARS(ULONG64); int i; - CHECKPTR(VarI2FromUI8); CONVERTRANGE(VarI2FromUI8, 0, 32768); CONVERT(VarI2FromUI8, 32768); EXPECT_OVERFLOW; } @@ -1292,7 +1009,6 @@ CONVVARS(VARIANT_BOOL); int i; - CHECKPTR(VarI2FromBool); CONVERTRANGE(VarI2FromBool, -32768, 32768); } @@ -1300,7 +1016,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarI2FromR4); CONVERT(VarI2FromR4, -32769.0f); EXPECT_OVERFLOW; CONVERT(VarI2FromR4, -32768.51f); EXPECT_OVERFLOW; CONVERT(VarI2FromR4, -32768.5f); EXPECT(-32768); @@ -1328,7 +1043,6 @@ { CONVVARS(DOUBLE); - CHECKPTR(VarI2FromR8); CONVERT(VarI2FromR8, -32769.0); EXPECT_OVERFLOW; CONVERT(VarI2FromR8, -32768.51); EXPECT_OVERFLOW; CONVERT(VarI2FromR8, -32768.5); EXPECT(-32768); @@ -1356,7 +1070,6 @@ { CONVVARS(DATE); - CHECKPTR(VarI2FromDate); CONVERT(VarI2FromDate, -32769.0); EXPECT_OVERFLOW; CONVERT(VarI2FromDate, -32768.0); EXPECT(-32768); CONVERT(VarI2FromDate, -1.0); EXPECT(-1); @@ -1380,7 +1093,6 @@ { CONVVARS(CY); - CHECKPTR(VarI2FromCy); CONVERT_CY(VarI2FromCy,-32769); EXPECT_OVERFLOW; CONVERT_CY(VarI2FromCy,-32768); EXPECT(32768); CONVERT_CY(VarI2FromCy,-1); EXPECT(-1); @@ -1404,8 +1116,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarI2FromDec); - CONVERT_BADDEC(VarI2FromDec); CONVERT_DEC(VarI2FromDec,0,0x80,0,32769); EXPECT_OVERFLOW; @@ -1427,8 +1137,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarI2FromStr); CONVERT_STR(VarI2FromStr,NULL, 0); EXPECT_MISMATCH; CONVERT_STR(VarI2FromStr,"0", 0); EXPECT(0); @@ -1474,7 +1182,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarUI2FromI1); OVERFLOWRANGE(VarUI2FromI1, -128, 0); CONVERTRANGE(VarUI2FromI1, 0, 128); } @@ -1484,7 +1191,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarUI2FromI2); OVERFLOWRANGE(VarUI2FromI2, -32768, 0); CONVERTRANGE(VarUI2FromI2, 0, 32768); } @@ -1494,7 +1200,6 @@ CONVVARS(LONG); int i; - CHECKPTR(VarUI2FromI4); OVERFLOWRANGE(VarUI2FromI4, -32768, 0); CONVERT(VarUI2FromI4, 0); EXPECT(0); CONVERT(VarUI2FromI4, 65535); EXPECT(65535); @@ -1506,7 +1211,6 @@ CONVVARS(LONG64); int i; - CHECKPTR(VarUI2FromI8); OVERFLOWRANGE(VarUI2FromI8, -32768, 0); CONVERT(VarUI2FromI8, 0); EXPECT(0); CONVERT(VarUI2FromI8, 65535); EXPECT(65535); @@ -1518,7 +1222,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarUI2FromUI1); CONVERTRANGE(VarUI2FromUI1, 0, 256); } @@ -1526,7 +1229,6 @@ { CONVVARS(ULONG); - CHECKPTR(VarUI2FromUI4); CONVERT(VarUI2FromUI4, 0); EXPECT(0); CONVERT(VarUI2FromUI4, 65535); EXPECT(65535); CONVERT(VarUI2FromUI4, 65536); EXPECT_OVERFLOW; @@ -1536,7 +1238,6 @@ { CONVVARS(ULONG64); - CHECKPTR(VarUI2FromUI8); CONVERT(VarUI2FromUI8, 0); EXPECT(0); CONVERT(VarUI2FromUI8, 65535); EXPECT(65535); CONVERT(VarUI2FromUI8, 65536); EXPECT_OVERFLOW; @@ -1547,7 +1248,6 @@ CONVVARS(VARIANT_BOOL); int i; - CHECKPTR(VarUI2FromBool); CONVERT(VarUI2FromBool, -1); EXPECT(65535); /* Wraps! */ CONVERTRANGE(VarUI2FromBool, 0, 32768); } @@ -1556,7 +1256,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarUI2FromR4); CONVERT(VarUI2FromR4, -1.0f); EXPECT_OVERFLOW; CONVERT(VarUI2FromR4, -0.51f); EXPECT_OVERFLOW; CONVERT(VarUI2FromR4, -0.5f); EXPECT(0); @@ -1582,7 +1281,6 @@ { CONVVARS(DOUBLE); - CHECKPTR(VarUI2FromR8); CONVERT(VarUI2FromR8, -1.0); EXPECT_OVERFLOW; CONVERT(VarUI2FromR8, -0.51); EXPECT_OVERFLOW; CONVERT(VarUI2FromR8, -0.5); EXPECT(0); @@ -1608,7 +1306,6 @@ { CONVVARS(DATE); - CHECKPTR(VarUI2FromDate); CONVERT(VarUI2FromDate, -1.0); EXPECT_OVERFLOW; CONVERT(VarUI2FromDate, 0.0); EXPECT(0); CONVERT(VarUI2FromDate, 1.0); EXPECT(1); @@ -1630,7 +1327,6 @@ { CONVVARS(CY); - CHECKPTR(VarUI2FromCy); CONVERT_CY(VarUI2FromCy,-1); EXPECT_OVERFLOW; CONVERT_CY(VarUI2FromCy,0); EXPECT(0); CONVERT_CY(VarUI2FromCy,1); EXPECT(1); @@ -1652,8 +1348,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarUI2FromDec); - CONVERT_BADDEC(VarUI2FromDec); CONVERT_DEC(VarUI2FromDec,0,0x80,0,1); EXPECT_OVERFLOW; @@ -1673,8 +1367,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarUI2FromStr); CONVERT_STR(VarUI2FromStr,NULL, 0); EXPECT_MISMATCH; CONVERT_STR(VarUI2FromStr,"0", 0); EXPECT(0); @@ -1723,7 +1415,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarI4FromI1); CONVERTRANGE(VarI4FromI1, -128, 128); } @@ -1732,16 +1423,12 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarI4FromI2); CONVERTRANGE(VarI4FromI2, -32768, 32768); } static void test_VarI4FromI8(void) { CONVVARS(LONG64); - - CHECKPTR(VarI4FromI8); - CHECKPTR(VarI4FromDec); CONVERT(VarI4FromI8, -1); EXPECT(-1); CONVERT(VarI4FromI8, 0); EXPECT(0); @@ -1758,7 +1445,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarI4FromUI1); CONVERTRANGE(VarI4FromUI1, 0, 256); } @@ -1767,7 +1453,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarI4FromUI2); CONVERTRANGE(VarI4FromUI2, 0, 65536); } @@ -1775,7 +1460,6 @@ { CONVVARS(ULONG); - CHECKPTR(VarI4FromUI4); CONVERT(VarI4FromUI4, 0); EXPECT(0); CONVERT(VarI4FromUI4, 1); EXPECT(1); CONVERT(VarI4FromUI4, 2147483647); EXPECT(2147483647); @@ -1786,7 +1470,6 @@ { CONVVARS(ULONG64); - CHECKPTR(VarI4FromUI8); CONVERT(VarI4FromUI8, 0); EXPECT(0); CONVERT(VarI4FromUI8, 1); EXPECT(1); CONVERT(VarI4FromUI8, 2147483647); EXPECT(2147483647); @@ -1798,15 +1481,12 @@ CONVVARS(VARIANT_BOOL); int i; - CHECKPTR(VarI4FromBool); CONVERTRANGE(VarI4FromBool, -32768, 32768); } static void test_VarI4FromR4(void) { CONVVARS(FLOAT); - - CHECKPTR(VarI4FromR4); /* min/max values are not exactly representable in a float */ CONVERT(VarI4FromR4, -1.0f); EXPECT(-1); @@ -1827,7 +1507,6 @@ { CONVVARS(DOUBLE); - CHECKPTR(VarI4FromR8); CONVERT(VarI4FromR8, -2147483649.0); EXPECT_OVERFLOW; CONVERT(VarI4FromR8, -2147483648.51); EXPECT_OVERFLOW; CONVERT(VarI4FromR8, -2147483648.5); EXPECT(-2147483647 - 1); @@ -1854,7 +1533,6 @@ { CONVVARS(DATE); - CHECKPTR(VarI4FromDate); CONVERT(VarI4FromDate, -2147483649.0); EXPECT_OVERFLOW; CONVERT(VarI4FromDate, -2147483648.0); EXPECT(-2147483647 - 1); CONVERT(VarI4FromDate, -1.0); EXPECT(-1); @@ -1877,7 +1555,6 @@ { CONVVARS(CY); - CHECKPTR(VarI4FromCy); CONVERT_CY(VarI4FromCy,-1); EXPECT(-1); CONVERT_CY(VarI4FromCy,0); EXPECT(0); CONVERT_CY(VarI4FromCy,1); EXPECT(1); @@ -1901,8 +1578,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarI4FromDec); - CONVERT_BADDEC(VarI4FromDec); CONVERT_DEC(VarI4FromDec,0,0x80,0,1); EXPECT(-1); @@ -1926,8 +1601,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarI4FromStr); CONVERT_STR(VarI4FromStr,NULL,0); EXPECT_MISMATCH; CONVERT_STR(VarI4FromStr,"0",0); EXPECT(0); @@ -1975,7 +1648,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarUI4FromI1); OVERFLOWRANGE(VarUI4FromI1, -127, 0); CONVERTRANGE(VarUI4FromI1, 0, 128); } @@ -1985,7 +1657,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarUI4FromI2); OVERFLOWRANGE(VarUI4FromI2, -32768, 0); CONVERTRANGE(VarUI4FromI2, 0, 32768); } @@ -1995,7 +1666,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarUI4FromUI2); CONVERTRANGE(VarUI4FromUI2, 0, 65536); } @@ -2003,7 +1673,6 @@ { CONVVARS(LONG64); - CHECKPTR(VarUI4FromI8); CONVERT(VarUI4FromI8, -1); EXPECT_OVERFLOW; CONVERT(VarUI4FromI8, 0); EXPECT(0); CONVERT(VarUI4FromI8, 1); EXPECT(1); @@ -2016,7 +1685,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarUI4FromUI1); CONVERTRANGE(VarUI4FromUI1, 0, 256); } @@ -2024,7 +1692,6 @@ { CONVVARS(int); - CHECKPTR(VarUI4FromI4); CONVERT(VarUI4FromI4, -1); EXPECT_OVERFLOW; CONVERT(VarUI4FromI4, 0); EXPECT(0); CONVERT(VarUI4FromI4, 1); EXPECT(1); @@ -2035,7 +1702,6 @@ { CONVVARS(ULONG64); - CHECKPTR(VarUI4FromUI8); CONVERT(VarUI4FromUI8, 0); EXPECT(0); CONVERT(VarUI4FromUI8, 1); EXPECT(1); CONVERT(VarUI4FromI8, 4294967295ul); EXPECT(4294967295ul); @@ -2047,7 +1713,6 @@ CONVVARS(VARIANT_BOOL); int i; - CHECKPTR(VarUI4FromBool); CONVERTRANGE(VarUI4FromBool, -32768, 32768); } @@ -2055,7 +1720,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarUI4FromR4); /* We can't test max values as they are not exactly representable in a float */ CONVERT(VarUI4FromR4, -1.0f); EXPECT_OVERFLOW; CONVERT(VarUI4FromR4, -0.51f); EXPECT_OVERFLOW; @@ -2078,7 +1742,6 @@ { CONVVARS(DOUBLE); - CHECKPTR(VarUI4FromR8); CONVERT(VarUI4FromR8, -1.0); EXPECT_OVERFLOW; CONVERT(VarUI4FromR4, -0.51f); EXPECT_OVERFLOW; CONVERT(VarUI4FromR4, -0.5f); EXPECT(0); @@ -2103,7 +1766,6 @@ { CONVVARS(DOUBLE); - CHECKPTR(VarUI4FromDate); CONVERT(VarUI4FromDate, -1.0); EXPECT_OVERFLOW; CONVERT(VarUI4FromDate, 0.0); EXPECT(0); CONVERT(VarUI4FromDate, 1.0); EXPECT(1); @@ -2124,7 +1786,6 @@ { CONVVARS(CY); - CHECKPTR(VarUI4FromCy); CONVERT_CY(VarUI4FromCy,-1); EXPECT_OVERFLOW; CONVERT_CY(VarUI4FromCy,0); EXPECT(0); CONVERT_CY(VarUI4FromCy,1); EXPECT(1); @@ -2145,8 +1806,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarUI4FromDec); - CONVERT_BADDEC(VarUI4FromDec); CONVERT_DEC(VarUI4FromDec,0,0x80,0,1); EXPECT_OVERFLOW; @@ -2165,8 +1824,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarUI4FromStr); CONVERT_STR(VarUI4FromStr,NULL,0); EXPECT_MISMATCH; CONVERT_STR(VarUI4FromStr,"-1",0); EXPECT_OVERFLOW; @@ -2227,7 +1884,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarI8FromI1); for (i = -128; i < 128; i++) { CONVERT(VarI8FromI1,i); EXPECTI8(i); @@ -2239,7 +1895,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarI8FromUI1); for (i = 0; i < 256; i++) { CONVERT(VarI8FromUI1,i); EXPECTI8(i); @@ -2251,7 +1906,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarI8FromI2); for (i = -32768; i < 32768; i++) { CONVERT(VarI8FromI2,i); EXPECTI8(i); @@ -2263,7 +1917,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarI8FromUI2); for (i = -0; i < 65535; i++) { CONVERT(VarI8FromUI2,i); EXPECTI8(i); @@ -2274,7 +1927,6 @@ { CONVVARS(ULONG); - CHECKPTR(VarI8FromUI4); CONVERT(VarI8FromUI4, 0); EXPECTI8(0); CONVERT(VarI8FromUI4, 1); EXPECTI8(1); CONVERT(VarI8FromUI4, 4294967295ul); EXPECTI8(4294967295ul); @@ -2283,8 +1935,6 @@ static void test_VarI8FromR4(void) { CONVVARS(FLOAT); - - CHECKPTR(VarI8FromR4); CONVERT(VarI8FromR4, -128.0f); EXPECTI8(-128); CONVERT(VarI8FromR4, -1.0f); EXPECTI8(-1); @@ -2306,7 +1956,6 @@ { CONVVARS(DOUBLE); - CHECKPTR(VarI8FromR8); CONVERT(VarI8FromR8, -128.0); EXPECTI8(-128); CONVERT(VarI8FromR8, -1.0); EXPECTI8(-1); CONVERT(VarI8FromR8, 0.0); EXPECTI8(0); @@ -2327,7 +1976,6 @@ { CONVVARS(DATE); - CHECKPTR(VarI8FromDate); CONVERT(VarI8FromDate, -128.0); EXPECTI8(-128); CONVERT(VarI8FromDate, -1.0); EXPECTI8(-1); CONVERT(VarI8FromDate, 0.0); EXPECTI8(0); @@ -2349,7 +1997,6 @@ CONVVARS(VARIANT_BOOL); int i; - CHECKPTR(VarI8FromBool); for (i = -32768; i < 32768; i++) { CONVERT(VarI8FromBool,i); EXPECTI8(i); @@ -2360,7 +2007,6 @@ { CONVVARS(ULONG64); - CHECKPTR(VarI8FromUI8); CONVERT(VarI8FromUI8, 0); EXPECTI8(0); CONVERT(VarI8FromUI8, 1); EXPECTI8(1); CONVERT_I8(VarI8FromUI8, 0x7fffffff, 0xffffffff); EXPECTI864(0x7fffffff, 0xffffffff); @@ -2371,7 +2017,6 @@ { CONVVARS(CY); - CHECKPTR(VarI8FromCy); CONVERT_CY(VarI8FromCy,-128); EXPECTI8(-129); CONVERT_CY(VarI8FromCy,-1); EXPECTI8(-2); CONVERT_CY(VarI8FromCy,0); EXPECTI8(0); @@ -2392,8 +2037,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarI8FromDec); - CONVERT_BADDEC(VarI8FromDec); CONVERT_DEC(VarI8FromDec,0,0x80,0,128); EXPECTI8(-128); @@ -2412,8 +2055,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarI8FromStr); CONVERT_STR(VarI8FromStr,NULL,0); EXPECT_MISMATCH; CONVERT_STR(VarI8FromStr,"0",0); EXPECTI8(0); @@ -2488,7 +2129,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarUI8FromI1); for (i = -128; i < 128; i++) { CONVERT(VarUI8FromI1,i); @@ -2504,7 +2144,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarUI8FromUI1); for (i = 0; i < 256; i++) { CONVERT(VarUI8FromUI1,i); EXPECTI8(i); @@ -2516,7 +2155,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarUI8FromI2); for (i = -32768; i < 32768; i++) { CONVERT(VarUI8FromI2,i); @@ -2532,7 +2170,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarUI8FromUI2); for (i = 0; i < 65535; i++) { CONVERT(VarUI8FromUI2,i); EXPECTI8(i); @@ -2543,7 +2180,6 @@ { CONVVARS(ULONG); - CHECKPTR(VarUI8FromUI4); CONVERT(VarUI8FromUI4, 0); EXPECTI8(0); CONVERT(VarUI8FromUI4, 0xffffffff); EXPECTI8(0xffffffff); } @@ -2552,7 +2188,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarUI8FromR4); CONVERT(VarUI8FromR4, -1.0f); EXPECT_OVERFLOW; CONVERT(VarUI8FromR4, 0.0f); EXPECTI8(0); CONVERT(VarUI8FromR4, 1.0f); EXPECTI8(1); @@ -2572,7 +2207,6 @@ { CONVVARS(DOUBLE); - CHECKPTR(VarUI8FromR8); CONVERT(VarUI8FromR8, -1.0); EXPECT_OVERFLOW; CONVERT(VarUI8FromR8, 0.0); EXPECTI8(0); CONVERT(VarUI8FromR8, 1.0); EXPECTI8(1); @@ -2592,7 +2226,6 @@ { CONVVARS(DATE); - CHECKPTR(VarUI8FromDate); CONVERT(VarUI8FromDate, -1.0); EXPECT_OVERFLOW; CONVERT(VarUI8FromDate, 0.0); EXPECTI8(0); CONVERT(VarUI8FromDate, 1.0); EXPECTI8(1); @@ -2613,7 +2246,6 @@ CONVVARS(VARIANT_BOOL); int i; - CHECKPTR(VarUI8FromBool); for (i = -32768; i < 32768; i++) { CONVERT(VarUI8FromBool, i); EXPECTI8(i); @@ -2624,7 +2256,6 @@ { CONVVARS(LONG64); - CHECKPTR(VarUI8FromI8); CONVERT(VarUI8FromI8, -1); EXPECT_OVERFLOW; CONVERT(VarUI8FromI8, 0); EXPECTI8(0); CONVERT(VarUI8FromI8, 1); EXPECTI8(1); @@ -2634,7 +2265,6 @@ { CONVVARS(CY); - CHECKPTR(VarUI8FromCy); CONVERT_CY(VarUI8FromCy,-1); EXPECT_OVERFLOW; CONVERT_CY(VarUI8FromCy,0); EXPECTI8(0); CONVERT_CY(VarUI8FromCy,1); EXPECTI8(1); @@ -2654,8 +2284,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarUI8FromDec); - CONVERT_BADDEC(VarUI8FromDec); /* This returns 1 under native; Wine fixes this bug and returns overflow */ @@ -2678,8 +2306,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarUI8FromStr); CONVERT_STR(VarUI8FromStr,NULL,0); EXPECT_MISMATCH; CONVERT_STR(VarUI8FromStr,"0",0); EXPECTI8(0); @@ -2762,7 +2388,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarR4FromI1); CONVERTRANGE(VarR4FromI1, -128, 128); } @@ -2771,7 +2396,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarR4FromUI1); CONVERTRANGE(VarR4FromUI1, 0, 256); } @@ -2780,7 +2404,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarR4FromI2); CONVERTRANGE(VarR4FromI2, -32768, 32768); } @@ -2789,7 +2412,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarR4FromUI2); CONVERTRANGE(VarR4FromUI2, 0, 65536); } @@ -2797,7 +2419,6 @@ { CONVVARS(int); - CHECKPTR(VarR4FromI4); CONVERT(VarR4FromI4, -2147483647-1); EXPECT(-2147483648.0f); CONVERT(VarR4FromI4, -1); EXPECT(-1.0f); CONVERT(VarR4FromI4, 0); EXPECT(0.0f); @@ -2809,7 +2430,6 @@ { CONVVARS(unsigned int); - CHECKPTR(VarR4FromUI4); CONVERT(VarR4FromUI4, 0); EXPECT(0.0f); CONVERT(VarR4FromUI4, 1); EXPECT(1.0f); #if defined(__i386__) && (defined(_MSC_VER) || defined(__GNUC__)) @@ -2821,7 +2441,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarR4FromR8); CONVERT(VarR4FromR8, -1.0); EXPECT(-1.0f); CONVERT(VarR4FromR8, 0.0); EXPECT(0.0f); CONVERT(VarR4FromR8, 1.0); EXPECT(1.0f); @@ -2834,7 +2453,6 @@ { CONVVARS(VARIANT_BOOL); - CHECKPTR(VarR4FromBool); CONVERT(VarR4FromBool, VARIANT_TRUE); EXPECT(VARIANT_TRUE * 1.0f); CONVERT(VarR4FromBool, VARIANT_FALSE); EXPECT(VARIANT_FALSE * 1.0f); } @@ -2843,7 +2461,6 @@ { CONVVARS(CY); - CHECKPTR(VarR4FromCy); CONVERT_CY(VarR4FromCy,-32768); EXPECT(-32768.0f); CONVERT_CY(VarR4FromCy,-1); EXPECT(-1.0f); CONVERT_CY(VarR4FromCy,0); EXPECT(0.0f); @@ -2864,7 +2481,6 @@ { CONVVARS(LONG64); - CHECKPTR(VarR4FromI8); CONVERT(VarR4FromI8, -1); EXPECT(-1.0f); CONVERT(VarR4FromI8, 0); EXPECT(0.0f); CONVERT(VarR4FromI8, 1); EXPECT(1.0f); @@ -2874,7 +2490,6 @@ { CONVVARS(ULONG64); - CHECKPTR(VarR4FromUI8); CONVERT(VarR4FromUI8, 0); EXPECT(0.0f); CONVERT(VarR4FromUI8, 1); EXPECT(1.0f); } @@ -2882,8 +2497,6 @@ static void test_VarR4FromDec(void) { CONVVARS(DECIMAL); - - CHECKPTR(VarR4FromDec); CONVERT_BADDEC(VarR4FromDec); @@ -2904,7 +2517,6 @@ { CONVVARS(DATE); - CHECKPTR(VarR4FromDate); CONVERT(VarR4FromDate, -1.0); EXPECT(-1.0f); CONVERT(VarR4FromDate, 0.0); EXPECT(0.0f); CONVERT(VarR4FromDate, 1.0); EXPECT(1.0f); @@ -2916,8 +2528,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarR4FromStr); CONVERT_STR(VarR4FromStr,NULL,0); EXPECT_MISMATCH; CONVERT_STR(VarR4FromStr,"-1", 0); EXPECT(-1.0f); @@ -2965,7 +2575,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarR8FromI1); CONVERTRANGE(VarR8FromI1, -128, 128); } @@ -2974,7 +2583,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarR8FromUI1); CONVERTRANGE(VarR8FromUI1, 0, 256); } @@ -2983,7 +2591,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarR8FromI2); CONVERTRANGE(VarR8FromI2, -32768, 32768); } @@ -2992,7 +2599,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarR8FromUI2); CONVERTRANGE(VarR8FromUI2, 0, 65536); } @@ -3000,7 +2606,6 @@ { CONVVARS(int); - CHECKPTR(VarR8FromI4); CONVERT(VarR8FromI4, -2147483647-1); EXPECT(-2147483648.0); CONVERT(VarR8FromI4, -1); EXPECT(-1.0); CONVERT(VarR8FromI4, 0); EXPECT(0.0); @@ -3012,7 +2617,6 @@ { CONVVARS(unsigned int); - CHECKPTR(VarR8FromUI4); CONVERT(VarR8FromUI4, 0); EXPECT(0.0); CONVERT(VarR8FromUI4, 1); EXPECT(1.0); CONVERT(VarR8FromUI4, 0xffffffff); EXPECT(4294967295.0); @@ -3022,7 +2626,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarR8FromR4); CONVERT(VarR8FromR4, -1.0f); EXPECT(-1.0); CONVERT(VarR8FromR4, 0.0f); EXPECT(0.0); CONVERT(VarR8FromR4, 1.0f); EXPECT(1.0); @@ -3035,7 +2638,6 @@ { CONVVARS(VARIANT_BOOL); - CHECKPTR(VarR8FromBool); CONVERT(VarR8FromBool, VARIANT_TRUE); EXPECT(VARIANT_TRUE * 1.0); CONVERT(VarR8FromBool, VARIANT_FALSE); EXPECT(VARIANT_FALSE * 1.0); } @@ -3044,7 +2646,6 @@ { CONVVARS(CY); - CHECKPTR(VarR8FromCy); CONVERT_CY(VarR8FromCy,-32769); EXPECT(-32769.0); CONVERT_CY(VarR8FromCy,-32768); EXPECT(-32768.0); CONVERT_CY(VarR8FromCy,-1); EXPECT(-1.0); @@ -3067,7 +2668,6 @@ { CONVVARS(LONG64); - CHECKPTR(VarR8FromI8); CONVERT(VarR8FromI8, -1); EXPECT(-1.0); CONVERT(VarR8FromI8, 0); EXPECT(0.0); CONVERT(VarR8FromI8, 1); EXPECT(1.0); @@ -3080,7 +2680,6 @@ { CONVVARS(ULONG64); - CHECKPTR(VarR8FromUI8); CONVERT(VarR8FromUI8, 0); EXPECT(0.0); CONVERT(VarR8FromUI8, 1); EXPECT(1.0); #if defined(__i386__) && (defined(_MSC_VER) || defined(__GNUC__)) @@ -3092,8 +2691,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarR8FromDec); - CONVERT_BADDEC(VarR8FromDec); CONVERT_DEC(VarR8FromDec,0,0x80,0,32768); EXPECT(-32768.0); @@ -3112,7 +2709,6 @@ { CONVVARS(DATE); - CHECKPTR(VarR8FromDate); CONVERT(VarR8FromDate, -1.0); EXPECT(-1.0); CONVERT(VarR8FromDate, -0.0); EXPECT(0.0); CONVERT(VarR8FromDate, 1.0); EXPECT(1.0); @@ -3124,8 +2720,6 @@ OLECHAR buff[128]; in = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarR8FromStr); CONVERT_STR(VarR8FromStr,NULL,0); EXPECT_MISMATCH; CONVERT_STR(VarR8FromStr,"",0); EXPECT_MISMATCH; @@ -3163,7 +2757,7 @@ #endif } -#define MATHRND(l, r) left = l; right = r; hres = pVarR8Round(left, right, &out) +#define MATHRND(l, r) left = l; right = r; hres = VarR8Round(left, right, &out) static void test_VarR8Round(void) { @@ -3171,7 +2765,6 @@ double left = 0.0, out; int right; - CHECKPTR(VarR8Round); MATHRND(0.5432, 5); EXPECT(0.5432); MATHRND(0.5432, 4); EXPECT(0.5432); MATHRND(0.5432, 3); EXPECT(0.543); @@ -3208,7 +2801,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarDateFromI1); CONVERTRANGE(VarDateFromI1, -128, 128); } @@ -3217,7 +2809,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarDateFromUI1); CONVERTRANGE(VarDateFromUI1, 0, 256); } @@ -3226,7 +2817,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarDateFromI2); CONVERTRANGE(VarDateFromI2, -32768, 32768); } @@ -3235,7 +2825,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarDateFromUI2); CONVERTRANGE(VarDateFromUI2, 0, 65536); } @@ -3243,7 +2832,6 @@ { CONVVARS(int); - CHECKPTR(VarDateFromI4); CONVERT(VarDateFromI4, DATE_MIN-1); if (hres != DISP_E_TYPEMISMATCH) /* Early versions return this, incorrectly */ EXPECT_OVERFLOW; @@ -3261,7 +2849,6 @@ { CONVVARS(unsigned int); - CHECKPTR(VarDateFromUI4); CONVERT(VarDateFromUI4, 0); EXPECT(0.0); CONVERT(VarDateFromUI4, 1); EXPECT(1.0); CONVERT(VarDateFromUI4, DATE_MAX); EXPECT(DATE_MAX); @@ -3274,7 +2861,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarDateFromR4); CONVERT(VarDateFromR4, -1.0f); EXPECT(-1.0); CONVERT(VarDateFromR4, 0.0f); EXPECT(0.0); CONVERT(VarDateFromR4, 1.0f); EXPECT(1.0); @@ -3285,7 +2871,6 @@ { CONVVARS(double); - CHECKPTR(VarDateFromR8); CONVERT(VarDateFromR8, -1.0f); EXPECT(-1.0); CONVERT(VarDateFromR8, 0.0f); EXPECT(0.0); CONVERT(VarDateFromR8, 1.0f); EXPECT(1.0); @@ -3296,7 +2881,6 @@ { CONVVARS(VARIANT_BOOL); - CHECKPTR(VarDateFromBool); CONVERT(VarDateFromBool, VARIANT_TRUE); EXPECT(VARIANT_TRUE * 1.0); CONVERT(VarDateFromBool, VARIANT_FALSE); EXPECT(VARIANT_FALSE * 1.0); } @@ -3305,7 +2889,6 @@ { CONVVARS(CY); - CHECKPTR(VarDateFromCy); CONVERT_CY(VarDateFromCy,-32769); EXPECT(-32769.0); CONVERT_CY(VarDateFromCy,-32768); EXPECT(-32768.0); CONVERT_CY(VarDateFromCy,-1); EXPECT(-1.0); @@ -3328,7 +2911,6 @@ { CONVVARS(LONG64); - CHECKPTR(VarDateFromI8); CONVERT(VarDateFromI8, DATE_MIN-1); EXPECT_OVERFLOW; CONVERT(VarDateFromI8, DATE_MIN); EXPECT(DATE_MIN); CONVERT(VarDateFromI8, -1); EXPECT(-1.0); @@ -3342,7 +2924,6 @@ { CONVVARS(ULONG64); - CHECKPTR(VarDateFromUI8); CONVERT(VarDateFromUI8, 0); EXPECT(0.0); CONVERT(VarDateFromUI8, 1); EXPECT(1.0); CONVERT(VarDateFromUI8, DATE_MAX); EXPECT(DATE_MAX); @@ -3352,8 +2933,6 @@ static void test_VarDateFromDec(void) { CONVVARS(DECIMAL); - - CHECKPTR(VarDateFromDec); CONVERT_BADDEC(VarDateFromDec); @@ -3370,10 +2949,10 @@ #define DFS(str) \ buff[0] = '\0'; out = 0.0; \ if (str) MultiByteToWideChar(CP_ACP,0,str,-1,buff,sizeof(buff)/sizeof(WCHAR)); \ - hres = pVarDateFromStr(str ? buff : NULL,lcid,LOCALE_NOUSEROVERRIDE,&out) + hres = VarDateFromStr(str ? buff : NULL,lcid,LOCALE_NOUSEROVERRIDE,&out) #define MKRELDATE(day,mth) st.wMonth = mth; st.wDay = day; \ - pSystemTimeToVariantTime(&st,&relative) + SystemTimeToVariantTime(&st,&relative) static const char * const BadDateStrings[] = { @@ -3419,9 +2998,6 @@ '1',':','2','0',':','3','4',0 }; lcid = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - - CHECKPTR(VarDateFromStr); - CHECKPTR(SystemTimeToVariantTime); /* Some date formats are relative, so we need to find the current year */ GetSystemTime(&st); @@ -3542,7 +3118,7 @@ /* test a data with ideographic space */ out = 0.0; - hres = pVarDateFromStr(with_ideographic_spaceW, lcid, LOCALE_NOUSEROVERRIDE, &out); + hres = VarDateFromStr(with_ideographic_spaceW, lcid, LOCALE_NOUSEROVERRIDE, &out); EXPECT_DBL(40724.05594907407); /* test a non-english data string */ @@ -3638,7 +3214,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarCyFromI1); for (i = -128; i < 128; i++) { CONVERT(VarCyFromI1,i); EXPECTCY(i); @@ -3650,7 +3225,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarCyFromUI1); for (i = 0; i < 256; i++) { CONVERT(VarCyFromUI1,i); EXPECTCY(i); @@ -3662,7 +3236,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarCyFromI2); for (i = -16384; i < 16384; i++) { CONVERT(VarCyFromI2,i); EXPECTCY(i); @@ -3674,7 +3247,6 @@ CONVVARS(int); int i; - CHECKPTR(VarCyFromUI2); for (i = 0; i < 32768; i++) { CONVERT(VarCyFromUI2,i); EXPECTCY(i); @@ -3685,7 +3257,6 @@ { CONVVARS(int); - CHECKPTR(VarCyFromI4); CONVERT(VarCyFromI4, -1); EXPECTCY(-1); CONVERT(VarCyFromI4, 0); EXPECTCY(0); CONVERT(VarCyFromI4, 1); EXPECTCY(1); @@ -3697,7 +3268,6 @@ { CONVVARS(unsigned int); - CHECKPTR(VarCyFromUI4); CONVERT(VarCyFromUI4, 0); EXPECTCY(0); CONVERT(VarCyFromUI4, 1); EXPECTCY(1); CONVERT(VarCyFromUI4, 0x80000000); EXPECTCY64(5000, 0); @@ -3707,7 +3277,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarCyFromR4); CONVERT(VarCyFromR4, -1.0f); EXPECTCY(-1); CONVERT(VarCyFromR4, 0.0f); EXPECTCY(0); CONVERT(VarCyFromR4, 1.0f); EXPECTCY(1); @@ -3738,8 +3307,6 @@ static void test_VarCyFromR8(void) { CONVVARS(DOUBLE); - - CHECKPTR(VarCyFromR8); #if defined(__i386__) && (defined(_MSC_VER) || defined(__GNUC__)) /* Test our rounding is exactly the same. This fails if the special x86 @@ -3782,7 +3349,6 @@ CONVVARS(VARIANT_BOOL); int i; - CHECKPTR(VarCyFromBool); for (i = -32768; i < 32768; i++) { CONVERT(VarCyFromBool, i); EXPECTCY(i); @@ -3793,7 +3359,6 @@ { CONVVARS(LONG64); - CHECKPTR(VarCyFromI8); CONVERT_I8(VarCyFromI8, -214749, 2728163227ul); EXPECT_OVERFLOW; CONVERT_I8(VarCyFromI8, -214749, 2728163228ul); EXPECTCY64(2147483648ul,15808); CONVERT(VarCyFromI8, -1); EXPECTCY(-1); @@ -3807,7 +3372,6 @@ { CONVVARS(ULONG64); - CHECKPTR(VarCyFromUI8); CONVERT(VarCyFromUI8, 0); EXPECTCY(0); CONVERT(VarCyFromUI8, 1); EXPECTCY(1); CONVERT_I8(VarCyFromUI8, 214748, 1566804068); EXPECTCY64(2147483647ul, 4294951488ul); @@ -3819,8 +3383,6 @@ static void test_VarCyFromDec(void) { CONVVARS(DECIMAL); - - CHECKPTR(VarCyFromDec); CONVERT_BADDEC(VarCyFromDec); @@ -3847,8 +3409,6 @@ static void test_VarCyFromDate(void) { CONVVARS(DATE); - - CHECKPTR(VarCyFromDate); #if defined(__i386__) && (defined(_MSC_VER) || defined(__GNUC__)) CONVERT(VarCyFromR8, -461168601842738.7904); EXPECTCY64(0xbfffffff, 0xffffff23); @@ -3885,16 +3445,15 @@ #define MATHVARS1 HRESULT hres; double left = 0.0; CY cyLeft, out #define MATHVARS2 MATHVARS1; double right = 0.0; CY cyRight -#define MATH1(func, l) left = (double)l; pVarCyFromR8(left, &cyLeft); hres = p##func(cyLeft, &out) +#define MATH1(func, l) left = (double)l; VarCyFromR8(left, &cyLeft); hres = func(cyLeft, &out) #define MATH2(func, l, r) left = (double)l; right = (double)r; \ - pVarCyFromR8(left, &cyLeft); pVarCyFromR8(right, &cyRight); \ - hres = p##func(cyLeft, cyRight, &out) + VarCyFromR8(left, &cyLeft); VarCyFromR8(right, &cyRight); \ + hres = func(cyLeft, cyRight, &out) static void test_VarCyAdd(void) { MATHVARS2; - CHECKPTR(VarCyAdd); MATH2(VarCyAdd, 0.5, 0.5); EXPECTCY(1); MATH2(VarCyAdd, 0.5, -0.4); EXPECTCY(0.1); MATH2(VarCyAdd, 0.5, -0.6); EXPECTCY(-0.1); @@ -3909,7 +3468,6 @@ { MATHVARS2; - CHECKPTR(VarCyMul); MATH2(VarCyMul, 534443.0, 0.0); EXPECTCY(0); MATH2(VarCyMul, 0.5, 0.5); EXPECTCY(0.25); MATH2(VarCyMul, 0.5, -0.4); EXPECTCY(-0.2); @@ -3922,7 +3480,6 @@ { MATHVARS2; - CHECKPTR(VarCySub); MATH2(VarCySub, 0.5, 0.5); EXPECTCY(0); MATH2(VarCySub, 0.5, -0.4); EXPECTCY(0.9); MATH2(VarCySub, 0.5, -0.6); EXPECTCY(1.1); @@ -3937,7 +3494,6 @@ { MATHVARS1; - CHECKPTR(VarCyAbs); MATH1(VarCyAbs, 0.5); EXPECTCY(0.5); MATH1(VarCyAbs, -0.5); EXPECTCY(0.5); MATH1(VarCyAbs, 922337203685476.0); EXPECTCY64(2147483647ul,4294951488ul); @@ -3948,22 +3504,20 @@ { MATHVARS1; - CHECKPTR(VarCyNeg); MATH1(VarCyNeg, 0.5); EXPECTCY(-0.5); MATH1(VarCyNeg, -0.5); EXPECTCY(0.5); MATH1(VarCyNeg, 922337203685476.0); EXPECTCY64(2147483648ul,15808); MATH1(VarCyNeg, -922337203685476.0); EXPECTCY64(2147483647ul,4294951488ul); } -#define MATHMULI4(l, r) left = l; right = r; pVarCyFromR8(left, &cyLeft); \ - hres = pVarCyMulI4(cyLeft, right, &out) +#define MATHMULI4(l, r) left = l; right = r; VarCyFromR8(left, &cyLeft); \ + hres = VarCyMulI4(cyLeft, right, &out) static void test_VarCyMulI4(void) { MATHVARS1; LONG right; - CHECKPTR(VarCyMulI4); MATHMULI4(534443.0, 0); EXPECTCY(0); MATHMULI4(0.5, 1); EXPECTCY(0.5); MATHMULI4(0.5, 2); EXPECTCY(1); @@ -3971,15 +3525,14 @@ MATHMULI4(922337203685476.0, 2); EXPECT_OVERFLOW; } -#define MATHMULI8(l, r) left = l; right = r; pVarCyFromR8(left, &cyLeft); \ - hres = pVarCyMulI8(cyLeft, right, &out) +#define MATHMULI8(l, r) left = l; right = r; VarCyFromR8(left, &cyLeft); \ + hres = VarCyMulI8(cyLeft, right, &out) static void test_VarCyMulI8(void) { MATHVARS1; LONG64 right; - CHECKPTR(VarCyMulI8); MATHMULI8(534443.0, 0); EXPECTCY(0); MATHMULI8(0.5, 1); EXPECTCY(0.5); MATHMULI8(0.5, 2); EXPECTCY(1); @@ -3987,8 +3540,8 @@ MATHMULI8(922337203685476.0, 2); EXPECT_OVERFLOW; } -#define MATHCMP(l, r) left = l; right = r; pVarCyFromR8(left, &cyLeft); pVarCyFromR8(right, &cyRight); \ - hres = pVarCyCmp(cyLeft, cyRight) +#define MATHCMP(l, r) left = l; right = r; VarCyFromR8(left, &cyLeft); VarCyFromR8(right, &cyRight); \ + hres = VarCyCmp(cyLeft, cyRight) static void test_VarCyCmp(void) { @@ -3996,7 +3549,6 @@ double left = 0.0, right = 0.0; CY cyLeft, cyRight; - CHECKPTR(VarCyCmp); MATHCMP(-1.0, -1.0); EXPECT_EQ; MATHCMP(-1.0, 0.0); EXPECT_LT; MATHCMP(-1.0, 1.0); EXPECT_LT; @@ -4010,8 +3562,8 @@ MATHCMP(1.0, 2.0); EXPECT_LT; } -#define MATHCMPR8(l, r) left = l; right = r; pVarCyFromR8(left, &cyLeft); \ - hres = pVarCyCmpR8(cyLeft, right); +#define MATHCMPR8(l, r) left = l; right = r; VarCyFromR8(left, &cyLeft); \ + hres = VarCyCmpR8(cyLeft, right); static void test_VarCyCmpR8(void) { @@ -4020,7 +3572,6 @@ CY cyLeft; double right; - CHECKPTR(VarCyCmpR8); MATHCMPR8(-1.0, -1.0); EXPECT_EQ; MATHCMPR8(-1.0, 0.0); EXPECT_LT; MATHCMPR8(-1.0, 1.0); EXPECT_LT; @@ -4035,15 +3586,14 @@ } #undef MATHRND -#define MATHRND(l, r) left = l; right = r; pVarCyFromR8(left, &cyLeft); \ - hres = pVarCyRound(cyLeft, right, &out) +#define MATHRND(l, r) left = l; right = r; VarCyFromR8(left, &cyLeft); \ + hres = VarCyRound(cyLeft, right, &out) static void test_VarCyRound(void) { MATHVARS1; int right; - CHECKPTR(VarCyRound); MATHRND(0.5432, 5); EXPECTCY(0.5432); MATHRND(0.5432, 4); EXPECTCY(0.5432); MATHRND(0.5432, 3); EXPECTCY(0.543); @@ -4068,14 +3618,13 @@ MATHRND(1.5001, 0); EXPECTCY(2); } -#define MATHFIX(l) left = l; pVarCyFromR8(left, &cyLeft); \ - hres = pVarCyFix(cyLeft, &out) +#define MATHFIX(l) left = l; VarCyFromR8(left, &cyLeft); \ + hres = VarCyFix(cyLeft, &out) static void test_VarCyFix(void) { MATHVARS1; - CHECKPTR(VarCyFix); MATHFIX(-1.0001); EXPECTCY(-1); MATHFIX(-1.4999); EXPECTCY(-1); MATHFIX(-1.5001); EXPECTCY(-1); @@ -4094,14 +3643,13 @@ MATHFIX(1.9999); EXPECTCY(1); } -#define MATHINT(l) left = l; pVarCyFromR8(left, &cyLeft); \ - hres = pVarCyInt(cyLeft, &out) +#define MATHINT(l) left = l; VarCyFromR8(left, &cyLeft); \ + hres = VarCyInt(cyLeft, &out) static void test_VarCyInt(void) { MATHVARS1; - CHECKPTR(VarCyInt); MATHINT(-1.0001); EXPECTCY(-2); MATHINT(-1.4999); EXPECTCY(-2); MATHINT(-1.5001); EXPECTCY(-2); @@ -4155,7 +3703,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarDecFromI1); for (i = -128; i < 128; i++) { CONVERT(VarDecFromI1,i); EXPECTDECI; @@ -4167,7 +3714,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarDecFromI2); for (i = -32768; i < 32768; i++) { CONVERT(VarDecFromI2,i); EXPECTDECI; @@ -4179,7 +3725,6 @@ CONVVARS(LONG); int i; - CHECKPTR(VarDecFromI4); for (i = -32768; i < 32768; i++) { CONVERT(VarDecFromI4,i); EXPECTDECI; @@ -4191,7 +3736,6 @@ CONVVARS(LONG64); int i; - CHECKPTR(VarDecFromI8); for (i = -32768; i < 32768; i++) { CONVERT(VarDecFromI8,i); EXPECTDECI; @@ -4203,7 +3747,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarDecFromUI1); for (i = 0; i < 256; i++) { CONVERT(VarDecFromUI1,i); EXPECTDECI; @@ -4215,7 +3758,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarDecFromUI2); for (i = 0; i < 65536; i++) { CONVERT(VarDecFromUI2,i); EXPECTDECI; @@ -4227,7 +3769,6 @@ CONVVARS(ULONG); int i; - CHECKPTR(VarDecFromUI4); for (i = 0; i < 65536; i++) { CONVERT(VarDecFromUI4,i); EXPECTDECI; @@ -4239,7 +3780,6 @@ CONVVARS(ULONG64); int i; - CHECKPTR(VarDecFromUI8); for (i = 0; i < 65536; i++) { CONVERT(VarDecFromUI8,i); EXPECTDECI; @@ -4251,7 +3791,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarDecFromBool); /* Test all possible type values. Note that the result is reduced to 0 or -1 */ for (i = -32768; i < 0; i++) { @@ -4267,8 +3806,6 @@ { CONVVARS(float); - CHECKPTR(VarDecFromR4); - CONVERT(VarDecFromR4,-0.6f); EXPECTDEC(1,0x80,0,6); CONVERT(VarDecFromR4,-0.5f); EXPECTDEC(1,0x80,0,5); CONVERT(VarDecFromR4,-0.4f); EXPECTDEC(1,0x80,0,4); @@ -4282,8 +3819,6 @@ { CONVVARS(double); - CHECKPTR(VarDecFromR8); - CONVERT(VarDecFromR8,-0.6); EXPECTDEC(1,0x80,0,6); CONVERT(VarDecFromR8,-0.5); EXPECTDEC(1,0x80,0,5); CONVERT(VarDecFromR8,-0.4); EXPECTDEC(1,0x80,0,4); @@ -4297,8 +3832,6 @@ { CONVVARS(DATE); - CHECKPTR(VarDecFromDate); - CONVERT(VarDecFromDate,-0.6); EXPECTDEC(1,0x80,0,6); CONVERT(VarDecFromDate,-0.5); EXPECTDEC(1,0x80,0,5); CONVERT(VarDecFromDate,-0.4); EXPECTDEC(1,0x80,0,4); @@ -4312,8 +3845,6 @@ { CONVVARS(LCID); OLECHAR buff[128]; - - CHECKPTR(VarDecFromStr); in = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); @@ -4332,8 +3863,6 @@ { CONVVARS(CY); - CHECKPTR(VarDecFromCy); - CONVERT_CY(VarDecFromCy, -1); EXPECTDEC(4,0x80,0,10000); CONVERT_CY(VarDecFromCy, 0); EXPECTDEC(4,0,0,0); CONVERT_CY(VarDecFromCy, 1); EXPECTDEC(4,0,0,10000); @@ -4345,17 +3874,16 @@ #undef MATHVARS2 #define MATHVARS2 MATHVARS1; DECIMAL r #undef MATH1 -#define MATH1(func) hres = p##func(&l, &out) +#define MATH1(func) hres = func(&l, &out) #undef MATH2 -#define MATH2(func) hres = p##func(&l, &r, &out) +#define MATH2(func) hres = func(&l, &r, &out) #undef MATH3 -#define MATH3(func) hres = p##func(&l, r) +#define MATH3(func) hres = func(&l, r) static void test_VarDecAbs(void) { MATHVARS1; - CHECKPTR(VarDecAbs); SETDEC(l,0,0x80,0,1); MATH1(VarDecAbs); EXPECTDEC(0,0,0,1); SETDEC(l,0,0,0,0); MATH1(VarDecAbs); EXPECTDEC(0,0,0,0); SETDEC(l,0,0x80,0,0); MATH1(VarDecAbs); EXPECTDEC(0,0,0,0); @@ -4370,7 +3898,6 @@ { MATHVARS1; - CHECKPTR(VarDecNeg); SETDEC(l,0,0x80,0,1); MATH1(VarDecNeg); EXPECTDEC(0,0,0,1); SETDEC(l,0,0,0,0); MATH1(VarDecNeg); EXPECTDEC(0,0x80,0,0); /* '-0'! */ SETDEC(l,0,0x80,0,0); MATH1(VarDecNeg); EXPECTDEC(0,0,0,0); @@ -4386,7 +3913,6 @@ { MATHVARS2; - CHECKPTR(VarDecAdd); SETDEC(l,0,0,0,0); SETDEC(r,0,0,0,0); MATH2(VarDecAdd); EXPECTDEC(0,0,0,0); SETDEC(l,0,0,0,0); SETDEC(r,0,0x80,0,1); MATH2(VarDecAdd); EXPECTDEC(0,0x80,0,1); SETDEC(l,0,0,0,0); SETDEC(r,0,0,0,1); MATH2(VarDecAdd); EXPECTDEC(0,0,0,1); @@ -4467,7 +3993,6 @@ { MATHVARS2; - CHECKPTR(VarDecSub); SETDEC(l,0,0,0,0); SETDEC(r,0,0,0,0); MATH2(VarDecSub); EXPECTDECZERO(); SETDEC(l,0,0,0,0); SETDEC(r,0,0,0,1); MATH2(VarDecSub); EXPECTDEC(0,0x80,0,1); SETDEC(l,0,0,0,1); SETDEC(r,0,0,0,1); MATH2(VarDecSub); EXPECTDECZERO(); @@ -4478,7 +4003,6 @@ { MATHVARS2; - CHECKPTR(VarDecMul); SETDEC(l,0,0,0,0); SETDEC(r,0,0,0,0); MATH2(VarDecMul); EXPECTDEC(0,0,0,0); SETDEC(l,0,0,0,1); SETDEC(r,0,0,0,0); MATH2(VarDecMul); EXPECTDEC(0,0,0,0); SETDEC(l,0,0,0,0); SETDEC(r,0,0,0,1); MATH2(VarDecMul); EXPECTDEC(0,0,0,0); @@ -4529,7 +4053,6 @@ { MATHVARS2; - CHECKPTR(VarDecDiv); /* identity divisions */ SETDEC(l,0,0,0,0); SETDEC(r,0,0,0,1); MATH2(VarDecDiv); EXPECTDEC(0,0,0,0); SETDEC(l,0,0,0,1); SETDEC(r,0,0,0,1); MATH2(VarDecDiv); EXPECTDEC(0,0,0,1); @@ -4579,8 +4102,6 @@ { MATHVARS1; - CHECKPTR(VarDecCmp); - SETDEC(l,0,0,0,1); SETDEC(out,0,0,0,1); MATH1(VarDecCmp); EXPECT_EQ; SETDEC(l,0,0,0,1); SETDEC(out,0,0,0,0); MATH1(VarDecCmp); EXPECT_GT; SETDEC(l,0,0,0,1); SETDEC(out,0,0,-1,-1); MATH1(VarDecCmp); EXPECT_LT; @@ -4687,8 +4208,6 @@ HRESULT hres; DECIMAL l; double r; - - CHECKPTR(VarDecCmpR8); SETDEC(l,0,0,0,1); r = 0.0; MATH3(VarDecCmpR8); EXPECT_GT; SETDEC(l,0,0,0,1); r = 0.1; MATH3(VarDecCmpR8); EXPECT_GT; @@ -4719,30 +4238,28 @@ HRESULT hres; DECIMAL l, out; - CHECKPTR(VarDecRound); - - CLEAR(out); SETDEC(l, 0, 0, 0, 1); hres = pVarDecRound(&l, 3, &out); EXPECTDEC(0, 0, 0, 1); - - CLEAR(out); SETDEC(l, 0, 0, 0, 1); hres = pVarDecRound(&l, 0, &out); EXPECTDEC(0, 0, 0, 1); - CLEAR(out); SETDEC(l, 1, 0, 0, 1); hres = pVarDecRound(&l, 0, &out); EXPECTDEC(0, 0, 0, 0); - CLEAR(out); SETDEC(l, 1, 0, 0, 1); hres = pVarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 1); - CLEAR(out); SETDEC(l, 2, 0, 0, 11); hres = pVarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 1); - CLEAR(out); SETDEC(l, 2, 0, 0, 15); hres = pVarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 2); - CLEAR(out); SETDEC(l, 6, 0, 0, 550001); hres = pVarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 6); - - CLEAR(out); SETDEC(l, 0, DECIMAL_NEG, 0, 1); hres = pVarDecRound(&l, 0, &out); EXPECTDEC(0, DECIMAL_NEG, 0, 1); - CLEAR(out); SETDEC(l, 1, DECIMAL_NEG, 0, 1); hres = pVarDecRound(&l, 0, &out); EXPECTDEC(0, DECIMAL_NEG, 0, 0); - CLEAR(out); SETDEC(l, 1, DECIMAL_NEG, 0, 1); hres = pVarDecRound(&l, 1, &out); EXPECTDEC(1, DECIMAL_NEG, 0, 1); - CLEAR(out); SETDEC(l, 2, DECIMAL_NEG, 0, 11); hres = pVarDecRound(&l, 1, &out); EXPECTDEC(1, DECIMAL_NEG, 0, 1); - CLEAR(out); SETDEC(l, 2, DECIMAL_NEG, 0, 15); hres = pVarDecRound(&l, 1, &out); EXPECTDEC(1, DECIMAL_NEG, 0, 2); - CLEAR(out); SETDEC(l, 6, DECIMAL_NEG, 0, 550001); hres = pVarDecRound(&l, 1, &out); EXPECTDEC(1, DECIMAL_NEG, 0, 6); - - CLEAR(out); SETDEC64(l, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff); hres = pVarDecRound(&l, 0, &out); EXPECTDEC64(0, 0, 0xffffffff, 0xffffffff, 0xffffffff); - CLEAR(out); SETDEC64(l, 28, 0, 0xffffffff, 0xffffffff, 0xffffffff); hres = pVarDecRound(&l, 0, &out); EXPECTDEC64(0, 0, 0, 0, 8); - CLEAR(out); SETDEC64(l, 0, DECIMAL_NEG, 0xffffffff, 0xffffffff, 0xffffffff); hres = pVarDecRound(&l, 0, &out); EXPECTDEC64(0, DECIMAL_NEG, 0xffffffff, 0xffffffff, 0xffffffff); - CLEAR(out); SETDEC64(l, 28, DECIMAL_NEG, 0xffffffff, 0xffffffff, 0xffffffff); hres = pVarDecRound(&l, 0, &out); EXPECTDEC64(0, DECIMAL_NEG, 0, 0, 8); - - CLEAR(out); SETDEC(l, 2, 0, 0, 0); hres = pVarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 0); + CLEAR(out); SETDEC(l, 0, 0, 0, 1); hres = VarDecRound(&l, 3, &out); EXPECTDEC(0, 0, 0, 1); + + CLEAR(out); SETDEC(l, 0, 0, 0, 1); hres = VarDecRound(&l, 0, &out); EXPECTDEC(0, 0, 0, 1); + CLEAR(out); SETDEC(l, 1, 0, 0, 1); hres = VarDecRound(&l, 0, &out); EXPECTDEC(0, 0, 0, 0); + CLEAR(out); SETDEC(l, 1, 0, 0, 1); hres = VarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 1); + CLEAR(out); SETDEC(l, 2, 0, 0, 11); hres = VarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 1); + CLEAR(out); SETDEC(l, 2, 0, 0, 15); hres = VarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 2); + CLEAR(out); SETDEC(l, 6, 0, 0, 550001); hres = VarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 6); + + CLEAR(out); SETDEC(l, 0, DECIMAL_NEG, 0, 1); hres = VarDecRound(&l, 0, &out); EXPECTDEC(0, DECIMAL_NEG, 0, 1); + CLEAR(out); SETDEC(l, 1, DECIMAL_NEG, 0, 1); hres = VarDecRound(&l, 0, &out); EXPECTDEC(0, DECIMAL_NEG, 0, 0); + CLEAR(out); SETDEC(l, 1, DECIMAL_NEG, 0, 1); hres = VarDecRound(&l, 1, &out); EXPECTDEC(1, DECIMAL_NEG, 0, 1); + CLEAR(out); SETDEC(l, 2, DECIMAL_NEG, 0, 11); hres = VarDecRound(&l, 1, &out); EXPECTDEC(1, DECIMAL_NEG, 0, 1); + CLEAR(out); SETDEC(l, 2, DECIMAL_NEG, 0, 15); hres = VarDecRound(&l, 1, &out); EXPECTDEC(1, DECIMAL_NEG, 0, 2); + CLEAR(out); SETDEC(l, 6, DECIMAL_NEG, 0, 550001); hres = VarDecRound(&l, 1, &out); EXPECTDEC(1, DECIMAL_NEG, 0, 6); + + CLEAR(out); SETDEC64(l, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff); hres = VarDecRound(&l, 0, &out); EXPECTDEC64(0, 0, 0xffffffff, 0xffffffff, 0xffffffff); + CLEAR(out); SETDEC64(l, 28, 0, 0xffffffff, 0xffffffff, 0xffffffff); hres = VarDecRound(&l, 0, &out); EXPECTDEC64(0, 0, 0, 0, 8); + CLEAR(out); SETDEC64(l, 0, DECIMAL_NEG, 0xffffffff, 0xffffffff, 0xffffffff); hres = VarDecRound(&l, 0, &out); EXPECTDEC64(0, DECIMAL_NEG, 0xffffffff, 0xffffffff, 0xffffffff); + CLEAR(out); SETDEC64(l, 28, DECIMAL_NEG, 0xffffffff, 0xffffffff, 0xffffffff); hres = VarDecRound(&l, 0, &out); EXPECTDEC64(0, DECIMAL_NEG, 0, 0, 8); + + CLEAR(out); SETDEC(l, 2, 0, 0, 0); hres = VarDecRound(&l, 1, &out); EXPECTDEC(1, 0, 0, 0); } /* @@ -4762,7 +4279,6 @@ CONVVARS(signed char); int i; - CHECKPTR(VarBoolFromI1); CONVERTRANGE(VarBoolFromI1, -128, 128); } @@ -4771,7 +4287,6 @@ CONVVARS(BYTE); int i; - CHECKPTR(VarBoolFromUI1); CONVERTRANGE(VarBoolFromUI1, 0, 256); } @@ -4780,7 +4295,6 @@ CONVVARS(SHORT); int i; - CHECKPTR(VarBoolFromI2); CONVERTRANGE(VarBoolFromI2, -32768, 32768); } @@ -4789,7 +4303,6 @@ CONVVARS(USHORT); int i; - CHECKPTR(VarBoolFromUI2); CONVERTRANGE(VarBoolFromUI2, 0, 65536); } @@ -4797,7 +4310,6 @@ { CONVVARS(int); - CHECKPTR(VarBoolFromI4); CONVERT(VarBoolFromI4, 0x80000000); EXPECT(VARIANT_TRUE); CONVERT(VarBoolFromI4, -1); EXPECT(VARIANT_TRUE); CONVERT(VarBoolFromI4, 0); EXPECT(VARIANT_FALSE); @@ -4809,7 +4321,6 @@ { CONVVARS(ULONG); - CHECKPTR(VarBoolFromUI4); CONVERT(VarBoolFromI4, 0); EXPECT(VARIANT_FALSE); CONVERT(VarBoolFromI4, 1); EXPECT(VARIANT_TRUE); CONVERT(VarBoolFromI4, 0x80000000); EXPECT(VARIANT_TRUE); @@ -4819,7 +4330,6 @@ { CONVVARS(FLOAT); - CHECKPTR(VarBoolFromR4); CONVERT(VarBoolFromR4, -1.0f); EXPECT(VARIANT_TRUE); CONVERT(VarBoolFromR4, 0.0f); EXPECT(VARIANT_FALSE); CONVERT(VarBoolFromR4, 1.0f); EXPECT(VARIANT_TRUE); @@ -4843,7 +4353,6 @@ /* Hopefully we made the point with R4 above that rounding is * irrelevant, so we'll skip that for R8 and Date */ - CHECKPTR(VarBoolFromR8); CONVERT(VarBoolFromR8, -1.0); EXPECT(VARIANT_TRUE); CONVERT(VarBoolFromR8, -0.0); EXPECT(VARIANT_FALSE); CONVERT(VarBoolFromR8, 1.0); EXPECT(VARIANT_TRUE); @@ -4853,7 +4362,6 @@ { CONVVARS(CY); - CHECKPTR(VarBoolFromCy); CONVERT_CY(VarBoolFromCy, -32769); EXPECT(VARIANT_TRUE); CONVERT_CY(VarBoolFromCy, -32768); EXPECT(VARIANT_TRUE); CONVERT_CY(VarBoolFromCy, -1); EXPECT(VARIANT_TRUE); @@ -4867,7 +4375,6 @@ { CONVVARS(LONG64); - CHECKPTR(VarBoolFromI8); CONVERT(VarBoolFromI8, -1); EXPECT(VARIANT_TRUE); CONVERT(VarBoolFromI8, 0); EXPECT(VARIANT_FALSE); CONVERT(VarBoolFromI8, 1); EXPECT(VARIANT_TRUE); @@ -4877,7 +4384,6 @@ { CONVVARS(ULONG64); - CHECKPTR(VarBoolFromUI8); CONVERT(VarBoolFromUI8, 0); EXPECT(VARIANT_FALSE); CONVERT(VarBoolFromUI8, 1); EXPECT(VARIANT_TRUE); } @@ -4886,7 +4392,6 @@ { CONVVARS(DECIMAL); - CHECKPTR(VarBoolFromDec); CONVERT_BADDEC(VarBoolFromDec); CONVERT_DEC(VarBoolFromDec,29,0,0,0); EXPECT_INVALID; @@ -4907,7 +4412,6 @@ { CONVVARS(DATE); - CHECKPTR(VarBoolFromDate); CONVERT(VarBoolFromDate, -1.0); EXPECT(VARIANT_TRUE); CONVERT(VarBoolFromDate, -0.0); EXPECT(VARIANT_FALSE); CONVERT(VarBoolFromDate, 1.0); EXPECT(VARIANT_TRUE); @@ -4917,8 +4421,6 @@ { CONVVARS(LCID); OLECHAR buff[128]; - - CHECKPTR(VarBoolFromStr); in = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); @@ -5053,12 +4555,10 @@ float f; - CHECKPTR(VarBstrFromR4); - lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); lcid_spanish = MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), SORT_DEFAULT); f = 654322.23456f; - hres = pVarBstrFromR4(f, lcid, 0, &bstr); + hres = VarBstrFromR4(f, lcid, 0, &bstr); ok(hres == S_OK, "got hres 0x%08x\n", hres); if (bstr) { @@ -5073,7 +4573,7 @@ } f = -0.0; - hres = pVarBstrFromR4(f, lcid, 0, &bstr); + hres = VarBstrFromR4(f, lcid, 0, &bstr); ok(hres == S_OK, "got hres 0x%08x\n", hres); if (bstr) { @@ -5086,7 +4586,7 @@ /* The following tests that lcid is used for decimal separator even without LOCALE_USE_NLS */ f = 0.5; - hres = pVarBstrFromR4(f, lcid, LOCALE_NOUSEROVERRIDE, &bstr); + hres = VarBstrFromR4(f, lcid, LOCALE_NOUSEROVERRIDE, &bstr); ok(hres == S_OK, "got hres 0x%08x\n", hres); if (bstr) { @@ -5094,7 +4594,7 @@ SysFreeString(bstr); } f = 0.5; - hres = pVarBstrFromR4(f, lcid_spanish, LOCALE_NOUSEROVERRIDE, &bstr); + hres = VarBstrFromR4(f, lcid_spanish, LOCALE_NOUSEROVERRIDE, &bstr); ok(hres == S_OK, "got hres 0x%08x\n", hres); if (bstr) { @@ -5110,7 +4610,7 @@ BSTR bstr = NULL; HRESULT hres; - hres = pVarBstrFromDate(dt, lcid, LOCALE_NOUSEROVERRIDE, &bstr); + hres = VarBstrFromDate(dt, lcid, LOCALE_NOUSEROVERRIDE, &bstr); if (bstr) { WideCharToMultiByte(CP_ACP, 0, bstr, -1, buff, sizeof(buff), 0, 0); @@ -5125,8 +4625,6 @@ static void test_VarBstrFromDate(void) { #define BSTR_DATE(dt,str) _BSTR_DATE(dt,str,__LINE__) - - CHECKPTR(VarBstrFromDate); BSTR_DATE(0.0, "12:00:00 AM"); BSTR_DATE(3.34, "1/2/1900 8:09:36 AM"); @@ -5151,7 +4649,7 @@ S(l).Lo = b; S(l).Hi = a; - hr = pVarBstrFromCy(l, lcid, LOCALE_NOUSEROVERRIDE, &bstr); + hr = VarBstrFromCy(l, lcid, LOCALE_NOUSEROVERRIDE, &bstr); ok(hr == S_OK, "got hr 0x%08x\n", hr); if(bstr) @@ -5173,8 +4671,6 @@ #define BSTR_CY(a, b, str, lcid) _BSTR_CY(a, b, str, lcid, __LINE__) LCID en_us, sp; - - CHECKPTR(VarBstrFromCy); en_us = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); sp = MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_DEFAULT), SORT_DEFAULT); @@ -5204,7 +4700,7 @@ DECIMAL dec; SETDEC64(dec, scale, sign, hi, mid, lo); - hr = pVarBstrFromDec(&dec, lcid, LOCALE_NOUSEROVERRIDE, &bstr); + hr = VarBstrFromDec(&dec, lcid, LOCALE_NOUSEROVERRIDE, &bstr); ok_(__FILE__, line)(hr == S_OK, "got hr 0x%08x\n", hr); if(bstr) @@ -5227,8 +4723,6 @@ #define BSTR_DEC64(scale, sign, hi, mid, lo, str, lcid) _BSTR_DEC(scale, sign, hi, mid, lo, str, lcid, __LINE__) LCID en_us, sp; - - CHECKPTR(VarBstrFromDec); en_us = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); sp = MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_DEFAULT), SORT_DEFAULT); @@ -5280,7 +4774,7 @@ } #define _VARBSTRCMP(left,right,lcid,flags,result) \ - hres = pVarBstrCmp(left,right,lcid,flags); \ + hres = VarBstrCmp(left,right,lcid,flags); \ ok(hres == result, "VarBstrCmp: expected " #result ", got hres=0x%x\n", hres) #define VARBSTRCMP(left,right,flags,result) \ _VARBSTRCMP(left,right,lcid,flags,result) @@ -5301,8 +4795,6 @@ static const char sbchr00[] = {0,0,0}; BSTR bstr, bstrempty, bstr2; - CHECKPTR(VarBstrCmp); - lcid = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); bstr = SysAllocString(sz); bstrempty = SysAllocString(szempty); @@ -5711,16 +5203,14 @@ BSTR str1, str2, res; UINT len; - CHECKPTR(VarBstrCat); - if (0) { /* Crash */ - pVarBstrCat(NULL, NULL, NULL); + VarBstrCat(NULL, NULL, NULL); } /* Concatenation of two NULL strings works */ - ret = pVarBstrCat(NULL, NULL, &res); + ret = VarBstrCat(NULL, NULL, &res); ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret); ok(res != NULL, "Expected a string\n"); ok(SysStringLen(res) == 0, "Expected a 0-length string\n"); @@ -5729,13 +5219,13 @@ str1 = SysAllocString(sz1); /* Concatenation with one NULL arg */ - ret = pVarBstrCat(NULL, str1, &res); + ret = VarBstrCat(NULL, str1, &res); ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret); ok(res != NULL, "Expected a string\n"); ok(SysStringLen(res) == SysStringLen(str1), "Unexpected length\n"); ok(!memcmp(res, sz1, SysStringLen(str1)), "Unexpected value\n"); SysFreeString(res); - ret = pVarBstrCat(str1, NULL, &res); + ret = VarBstrCat(str1, NULL, &res); ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret); ok(res != NULL, "Expected a string\n"); ok(SysStringLen(res) == SysStringLen(str1), "Unexpected length\n"); @@ -5744,7 +5234,7 @@ /* Concatenation of two zero-terminated strings */ str2 = SysAllocString(sz2); - ret = pVarBstrCat(str1, str2, &res); + ret = VarBstrCat(str1, str2, &res); ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret); ok(res != NULL, "Expected a string\n"); ok(SysStringLen(res) == sizeof(sz1sz2) / sizeof(WCHAR) - 1, @@ -5759,7 +5249,7 @@ str1 = SysAllocStringLen(s1, sizeof(s1) / sizeof(WCHAR)); str2 = SysAllocStringLen(s2, sizeof(s2) / sizeof(WCHAR)); - ret = pVarBstrCat(str1, str2, &res); + ret = VarBstrCat(str1, str2, &res); ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret); ok(res != NULL, "Expected a string\n"); ok(SysStringLen(res) == sizeof(s1s2) / sizeof(WCHAR), @@ -5778,7 +5268,7 @@ len = SysStringLen(str2); ok(len == (sizeof(str2A)-1)/sizeof(WCHAR), "got length %u\n", len); - ret = pVarBstrCat(str1, str2, &res); + ret = VarBstrCat(str1, str2, &res); ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret); ok(res != NULL, "Expected a string\n"); len = (sizeof(str1A) + sizeof(str2A) - 2)/sizeof(WCHAR); @@ -5797,7 +5287,7 @@ len = SysStringLen(str2); ok(len == 0, "got length %u\n", len); - ret = pVarBstrCat(str1, str2, &res); + ret = VarBstrCat(str1, str2, &res); ok(ret == S_OK, "VarBstrCat failed: %08x\n", ret); ok(res != NULL, "Expected a string\n"); ok(SysStringLen(res) == 1, "got %d, expected 1\n", SysStringLen(res)); @@ -6307,13 +5797,11 @@ CUSTDATA ci; unsigned i; - CHECKPTR(ClearCustData); - ci.cCustData = NUM_CUST_ITEMS; ci.prgCustData = CoTaskMemAlloc( sizeof(CUSTDATAITEM) * NUM_CUST_ITEMS ); for (i = 0; i < NUM_CUST_ITEMS; i++) VariantInit(&ci.prgCustData[i].varValue); - pClearCustData(&ci); + ClearCustData(&ci); ok(!ci.cCustData && !ci.prgCustData, "ClearCustData didn't clear fields!\n"); }
7 years, 3 months
1
0
0
0
[akhaldi] 75892: [OLEAUT32] Sync with Wine Staging 2.16. CORE-13762 8da116d oleaut32: Don't copy uninitialized data. 0dde882 oleaut32: Use variable with the correct type in LIST_FOR_EACH_ENTRY_SAFE...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:56:37 2017 New Revision: 75892 URL:
http://svn.reactos.org/svn/reactos?rev=75892&view=rev
Log: [OLEAUT32] Sync with Wine Staging 2.16. CORE-13762 8da116d oleaut32: Don't copy uninitialized data. 0dde882 oleaut32: Use variable with the correct type in LIST_FOR_EACH_ENTRY_SAFE macro. 840ab7c oleaut32: Simplify VarCat implementation. 538e46a oleaut32: Improve support for IDispatch in VarCat. cf45f3b oleaut32: Add an arguments check to LoadTypeLibEx. 4be8d83 oleaut32: Make VARIANT_GetLocalisedText() static. Modified: trunk/reactos/dll/win32/oleaut32/tmarshal.c trunk/reactos/dll/win32/oleaut32/typelib.c trunk/reactos/dll/win32/oleaut32/variant.c trunk/reactos/dll/win32/oleaut32/variant.h trunk/reactos/dll/win32/oleaut32/vartype.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/oleaut32/tmarshal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/tmarsha…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/tmarshal.c [iso-8859-1] Sun Sep 17 22:56:37 2017 @@ -1127,7 +1127,7 @@ DWORD x; hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD)); if (hres) ERR("Failed to read integer 4 byte\n"); - memcpy(arg,&x,2); + else memcpy(arg,&x,2); } if (debugout) TRACE_(olerelay)("%04x", *(WORD *)arg); return hres; @@ -1137,7 +1137,7 @@ DWORD x; hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD)); if (hres) ERR("Failed to read integer 4 byte\n"); - memcpy(arg,&x,1); + else memcpy(arg,&x,1); } if (debugout) TRACE_(olerelay)("%02x", *(BYTE *)arg); return hres; Modified: trunk/reactos/dll/win32/oleaut32/typelib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] Sun Sep 17 22:56:37 2017 @@ -4809,10 +4809,9 @@ if (!ref) { TLBImpLib *pImpLib, *pImpLibNext; - TLBRefType *ref_type; + TLBRefType *ref_type, *ref_type_next; TLBString *tlbstr, *tlbstr_next; TLBGuid *tlbguid, *tlbguid_next; - void *cursor2; int i; /* remove cache entry */ @@ -4862,7 +4861,7 @@ heap_free(pImpLib); } - LIST_FOR_EACH_ENTRY_SAFE(ref_type, cursor2, &This->ref_list, TLBRefType, entry) + LIST_FOR_EACH_ENTRY_SAFE(ref_type, ref_type_next, &This->ref_list, TLBRefType, entry) { list_remove(&ref_type->entry); heap_free(ref_type); Modified: trunk/reactos/dll/win32/oleaut32/variant.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/variant…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] Sun Sep 17 22:56:37 2017 @@ -497,6 +497,22 @@ return SafeArrayCopy(V_ARRAY(ps), &V_ARRAY(pd)); return DISP_E_TYPEMISMATCH; +} + +static HRESULT VARIANT_FetchDispatchValue(LPVARIANT pvDispatch, LPVARIANT pValue) +{ + HRESULT hres; + static DISPPARAMS emptyParams = { NULL, NULL, 0, 0 }; + + if ((V_VT(pvDispatch) & VT_TYPEMASK) == VT_DISPATCH) { + if (NULL == V_DISPATCH(pvDispatch)) return DISP_E_TYPEMISMATCH; + hres = IDispatch_Invoke(V_DISPATCH(pvDispatch), DISPID_VALUE, &IID_NULL, + LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, &emptyParams, pValue, + NULL, NULL); + } else { + hres = DISP_E_TYPEMISMATCH; + } + return hres; } /****************************************************************************** @@ -2485,23 +2501,21 @@ */ HRESULT WINAPI VarCat(LPVARIANT left, LPVARIANT right, LPVARIANT out) { - VARTYPE leftvt,rightvt,resultvt; + BSTR left_str = NULL, right_str = NULL; + VARTYPE leftvt, rightvt; HRESULT hres; - static const WCHAR sz_empty[] = {'\0'}; + + TRACE("%s,%s,%p)\n", debugstr_variant(left), debugstr_variant(right), out); + leftvt = V_VT(left); rightvt = V_VT(right); - TRACE("%s,%s,%p)\n", debugstr_variant(left), debugstr_variant(right), out); - /* when both left and right are NULL the result is NULL */ if (leftvt == VT_NULL && rightvt == VT_NULL) { V_VT(out) = VT_NULL; return S_OK; } - - hres = S_OK; - resultvt = VT_EMPTY; /* There are many special case for errors and return types */ if (leftvt == VT_VARIANT && (rightvt == VT_ERROR || @@ -2528,7 +2542,7 @@ rightvt == VT_UINT || rightvt == VT_EMPTY || rightvt == VT_NULL || rightvt == VT_DATE || rightvt == VT_DECIMAL || rightvt == VT_DISPATCH)) - resultvt = VT_BSTR; + hres = S_OK; else if (rightvt == VT_ERROR && leftvt < VT_VOID) hres = DISP_E_TYPEMISMATCH; else if (leftvt == VT_ERROR && (rightvt == VT_DATE || @@ -2558,72 +2572,72 @@ /* if result type is not S_OK, then no need to go further */ if (hres != S_OK) { - V_VT(out) = resultvt; + V_VT(out) = VT_EMPTY; return hres; } - /* Else proceed with formatting inputs to strings */ + + if (leftvt == VT_BSTR) + left_str = V_BSTR(left); else { - VARIANT bstrvar_left, bstrvar_right; - V_VT(out) = VT_BSTR; - - VariantInit(&bstrvar_left); - VariantInit(&bstrvar_right); - - /* Convert left side variant to string */ - if (leftvt != VT_BSTR) + VARIANT converted, *tmp = left; + + VariantInit(&converted); + if(leftvt == VT_DISPATCH) { - /* Fill with empty string for later concat with right side */ - if (leftvt == VT_NULL) - { - V_VT(&bstrvar_left) = VT_BSTR; - V_BSTR(&bstrvar_left) = SysAllocString(sz_empty); - } - else - { - hres = VariantChangeTypeEx(&bstrvar_left,left,0,VARIANT_ALPHABOOL|VARIANT_LOCALBOOL,VT_BSTR); - if (hres != S_OK) { - VariantClear(&bstrvar_left); - VariantClear(&bstrvar_right); - return hres; - } - } + hres = VARIANT_FetchDispatchValue(left, &converted); + if(FAILED(hres)) + goto failed; + + tmp = &converted; } - /* convert right side variant to string */ - if (rightvt != VT_BSTR) + hres = VariantChangeTypeEx(&converted, tmp, 0, VARIANT_ALPHABOOL|VARIANT_LOCALBOOL, VT_BSTR); + if (SUCCEEDED(hres)) + left_str = V_BSTR(&converted); + else if (hres != DISP_E_TYPEMISMATCH) { - /* Fill with empty string for later concat with right side */ - if (rightvt == VT_NULL) - { - V_VT(&bstrvar_right) = VT_BSTR; - V_BSTR(&bstrvar_right) = SysAllocString(sz_empty); - } - else - { - hres = VariantChangeTypeEx(&bstrvar_right,right,0,VARIANT_ALPHABOOL|VARIANT_LOCALBOOL,VT_BSTR); - if (hres != S_OK) { - VariantClear(&bstrvar_left); - VariantClear(&bstrvar_right); - return hres; - } - } + VariantClear(&converted); + goto failed; } - - /* Concat the resulting strings together */ - if (leftvt == VT_BSTR && rightvt == VT_BSTR) - VarBstrCat (V_BSTR(left), V_BSTR(right), &V_BSTR(out)); - else if (leftvt != VT_BSTR && rightvt != VT_BSTR) - VarBstrCat (V_BSTR(&bstrvar_left), V_BSTR(&bstrvar_right), &V_BSTR(out)); - else if (leftvt != VT_BSTR && rightvt == VT_BSTR) - VarBstrCat (V_BSTR(&bstrvar_left), V_BSTR(right), &V_BSTR(out)); - else if (leftvt == VT_BSTR && rightvt != VT_BSTR) - VarBstrCat (V_BSTR(left), V_BSTR(&bstrvar_right), &V_BSTR(out)); - - VariantClear(&bstrvar_left); - VariantClear(&bstrvar_right); - return S_OK; - } + } + + if (rightvt == VT_BSTR) + right_str = V_BSTR(right); + else + { + VARIANT converted, *tmp = right; + + VariantInit(&converted); + if(rightvt == VT_DISPATCH) + { + hres = VARIANT_FetchDispatchValue(right, &converted); + if(FAILED(hres)) + goto failed; + + tmp = &converted; + } + + hres = VariantChangeTypeEx(&converted, tmp, 0, VARIANT_ALPHABOOL|VARIANT_LOCALBOOL, VT_BSTR); + if (SUCCEEDED(hres)) + right_str = V_BSTR(&converted); + else if (hres != DISP_E_TYPEMISMATCH) + { + VariantClear(&converted); + goto failed; + } + } + + + V_VT(out) = VT_BSTR; + hres = VarBstrCat(left_str, right_str, &V_BSTR(out)); + +failed: + if(V_VT(left) != VT_BSTR) + SysFreeString(left_str); + if(V_VT(right) != VT_BSTR) + SysFreeString(right_str); + return hres; } @@ -2847,22 +2861,6 @@ return E_FAIL; } #undef _VARCMP -} - -static HRESULT VARIANT_FetchDispatchValue(LPVARIANT pvDispatch, LPVARIANT pValue) -{ - HRESULT hres; - static DISPPARAMS emptyParams = { NULL, NULL, 0, 0 }; - - if ((V_VT(pvDispatch) & VT_TYPEMASK) == VT_DISPATCH) { - if (NULL == V_DISPATCH(pvDispatch)) return DISP_E_TYPEMISMATCH; - hres = IDispatch_Invoke(V_DISPATCH(pvDispatch), DISPID_VALUE, &IID_NULL, - LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, &emptyParams, pValue, - NULL, NULL); - } else { - hres = DISP_E_TYPEMISMATCH; - } - return hres; } /********************************************************************** Modified: trunk/reactos/dll/win32/oleaut32/variant.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/variant…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/variant.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/variant.h [iso-8859-1] Sun Sep 17 22:56:37 2017 @@ -113,7 +113,6 @@ } VARIANT_NUMBER_CHARS; unsigned int get_type_size(ULONG*, VARTYPE) DECLSPEC_HIDDEN; -BOOL VARIANT_GetLocalisedText(LANGID, DWORD, WCHAR *) DECLSPEC_HIDDEN; HRESULT VARIANT_ClearInd(VARIANTARG *) DECLSPEC_HIDDEN; BOOL get_date_format(LCID, DWORD, const SYSTEMTIME *, const WCHAR *, WCHAR *, int) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/oleaut32/vartype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/vartype…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] Sun Sep 17 22:56:37 2017 @@ -6051,7 +6051,7 @@ * Get a localized string from the resources * */ -BOOL VARIANT_GetLocalisedText(LANGID langId, DWORD dwId, WCHAR *lpszDest) +static BOOL VARIANT_GetLocalisedText(LANGID langId, DWORD dwId, WCHAR *lpszDest) { HRSRC hrsrc; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Sep 17 22:56:37 2017 @@ -141,7 +141,7 @@ reactos/dll/win32/odbccp32 # Synced to WineStaging-2.9 reactos/dll/win32/ole32 # Synced to WineStaging-2.16 reactos/dll/win32/oleacc # Synced to WineStaging-2.9 -reactos/dll/win32/oleaut32 # Synced to WineStaging-2.9 +reactos/dll/win32/oleaut32 # Synced to WineStaging-2.16 reactos/dll/win32/olecli32 # Synced to WineStaging-2.9 reactos/dll/win32/oledlg # Synced to WineStaging-2.9 reactos/dll/win32/olepro32 # Synced to WineStaging-2.9
7 years, 3 months
1
0
0
0
[akhaldi] 75891: [OLE32_WINETEST] Sync with Wine Staging 2.16. CORE-13762
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Sep 17 22:56:20 2017 New Revision: 75891 URL:
http://svn.reactos.org/svn/reactos?rev=75891&view=rev
Log: [OLE32_WINETEST] Sync with Wine Staging 2.16. CORE-13762 Modified: trunk/rostests/winetests/ole32/compobj.c trunk/rostests/winetests/ole32/ole2.c Modified: trunk/rostests/winetests/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/compobj.c…
============================================================================== --- trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] Sun Sep 17 22:56:20 2017 @@ -1166,12 +1166,35 @@ {0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd} }; /* 52011640-8164-4fd0-a1a2-5d5a3654d3bd */ +static DWORD CALLBACK register_ps_clsid_thread(void *context) +{ + HRESULT hr; + CLSID clsid = {0}; + + pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + hr = CoGetPSClsid(&IID_IWineTest, &clsid); + ok_ole_success(hr, "CoGetPSClsid"); + ok(IsEqualGUID(&clsid, &CLSID_WineTestPSFactoryBuffer), "expected %s, got %s\n", + wine_dbgstr_guid(&CLSID_WineTestPSFactoryBuffer), wine_dbgstr_guid(&clsid)); + + /* test registering a PSClsid in an apartment which is then destroyed */ + hr = CoRegisterPSClsid(&IID_TestPS, &clsid); + ok_ole_success(hr, "CoRegisterPSClsid"); + + CoUninitialize(); + + return hr; +} + static void test_CoRegisterPSClsid(void) { HRESULT hr; DWORD dwRegistrationKey; IStream *stream; CLSID clsid; + HANDLE thread; + DWORD tid; hr = CoRegisterPSClsid(&IID_IWineTest, &CLSID_WineTestPSFactoryBuffer); ok(hr == CO_E_NOTINITIALIZED, "CoRegisterPSClsid should have returned CO_E_NOTINITIALIZED instead of 0x%08x\n", hr); @@ -1184,6 +1207,21 @@ hr = CoRegisterPSClsid(&IID_IWineTest, &CLSID_WineTestPSFactoryBuffer); ok_ole_success(hr, "CoRegisterPSClsid"); + + hr = CoGetPSClsid(&IID_IWineTest, &clsid); + ok_ole_success(hr, "CoGetPSClsid"); + ok(IsEqualGUID(&clsid, &CLSID_WineTestPSFactoryBuffer), "expected %s, got %s\n", + wine_dbgstr_guid(&CLSID_WineTestPSFactoryBuffer), wine_dbgstr_guid(&clsid)); + + thread = CreateThread(NULL, 0, register_ps_clsid_thread, NULL, 0, &tid); + ok(thread != NULL, "CreateThread failed with error %d\n", GetLastError()); + ok(!WaitForSingleObject(thread, 10000), "wait timed out\n"); + CloseHandle(thread); + + hr = CoGetPSClsid(&IID_TestPS, &clsid); + ok_ole_success(hr, "CoGetPSClsid"); + ok(IsEqualGUID(&clsid, &CLSID_WineTestPSFactoryBuffer), "expected %s, got %s\n", + wine_dbgstr_guid(&CLSID_WineTestPSFactoryBuffer), wine_dbgstr_guid(&clsid)); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok_ole_success(hr, "CreateStreamOnHGlobal"); @@ -1204,11 +1242,11 @@ SET_EXPECT(CreateStub); hr = CoMarshalInterface(stream, &IID_IEnumOLEVERB, (IUnknown*)&EnumOLEVERB, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); - ok(hr == S_OK, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); + ok(hr == S_OK, "CoMarshalInterface should have returned S_OK instead of 0x%08x\n", hr); CHECK_CALLED(CreateStub); hr = CoMarshalInterface(stream, &IID_IEnumOLEVERB, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); - ok(hr == S_OK, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); + ok(hr == S_OK, "CoMarshalInterface should have returned S_OK instead of 0x%08x\n", hr); IStream_Release(stream); IPSFactoryBuffer_Release(ps_factory_buffer); @@ -1223,6 +1261,31 @@ hr = CoGetPSClsid(&IID_IWineTest, &clsid); ok(hr == REGDB_E_IIDNOTREG, "CoGetPSClsid should have returned REGDB_E_IIDNOTREG instead of 0x%08x\n", hr); + + hr = CoGetPSClsid(&IID_TestPS, &clsid); + ok(hr == REGDB_E_IIDNOTREG, "CoGetPSClsid should have returned REGDB_E_IIDNOTREG instead of 0x%08x\n", hr); + + CoUninitialize(); + + pCoInitializeEx(NULL, COINIT_MULTITHREADED); + + hr = CoRegisterPSClsid(&IID_IWineTest, &CLSID_WineTestPSFactoryBuffer); + ok_ole_success(hr, "CoRegisterPSClsid"); + + hr = CoGetPSClsid(&IID_IWineTest, &clsid); + ok_ole_success(hr, "CoGetPSClsid"); + ok(IsEqualGUID(&clsid, &CLSID_WineTestPSFactoryBuffer), "expected %s, got %s\n", + wine_dbgstr_guid(&CLSID_WineTestPSFactoryBuffer), wine_dbgstr_guid(&clsid)); + + thread = CreateThread(NULL, 0, register_ps_clsid_thread, NULL, 0, &tid); + ok(thread != NULL, "CreateThread failed with error %d\n", GetLastError()); + ok(!WaitForSingleObject(thread, 10000), "wait timed out\n"); + CloseHandle(thread); + + hr = CoGetPSClsid(&IID_TestPS, &clsid); + ok_ole_success(hr, "CoGetPSClsid"); + ok(IsEqualGUID(&clsid, &CLSID_WineTestPSFactoryBuffer), "expected %s, got %s\n", + wine_dbgstr_guid(&CLSID_WineTestPSFactoryBuffer), wine_dbgstr_guid(&clsid)); CoUninitialize(); } @@ -2184,9 +2247,17 @@ win_skip("CoGetTreatAsClass not present\n"); return; } + hr = pCoGetTreatAsClass(&deadbeef,&out); ok (hr == S_FALSE, "expected S_FALSE got %x\n",hr); ok (IsEqualGUID(&out,&deadbeef), "expected to get same clsid back\n"); + + hr = pCoGetTreatAsClass(NULL, &out); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr); + ok(IsEqualGUID(&out, &deadbeef), "expected no change to the clsid\n"); + + hr = pCoGetTreatAsClass(&deadbeef, NULL); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr); lr = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID", 0, KEY_READ, &clsidkey); ok(!lr, "Couldn't open CLSID key, error %d\n", lr); Modified: trunk/rostests/winetests/ole32/ole2.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/ole2.c?re…
============================================================================== --- trunk/rostests/winetests/ole32/ole2.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/ole2.c [iso-8859-1] Sun Sep 17 22:56:20 2017 @@ -39,10 +39,13 @@ #include <wine/test.h> +#ifndef __REACTOS__ #include "initguid.h" DEFINE_GUID(CLSID_Picture_Metafile,0x315,0,0,0xc0,0,0,0,0,0,0,0x46); DEFINE_GUID(CLSID_Picture_Dib,0x316,0,0,0xc0,0,0,0,0,0,0,0x46); +DEFINE_GUID(CLSID_Picture_EnhMetafile,0x319,0,0,0xc0,0,0,0,0,0,0,0x46); +#endif #define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr) @@ -142,7 +145,7 @@ DWORD unknown3; /* 4, possibly TYMED_ISTREAM */ DVASPECT dvAspect; DWORD lindex; - DWORD tymed; + DWORD advf; DWORD unknown7; /* 0 */ DWORD dwObjectExtentX; DWORD dwObjectExtentY; @@ -1180,7 +1183,7 @@ IStorage *stg; IStream *stream; IUnknown *obj; - DWORD data, i, tymed, data_size; + DWORD data, i, data_size; PresentationDataHeader header; HDC hdc; HGDIOBJ hobj; @@ -1229,12 +1232,10 @@ break; } - tymed = 1 << i; - header.unknown3 = 4; header.dvAspect = DVASPECT_CONTENT; header.lindex = -1; - header.tymed = tymed; + header.advf = 1 << i; header.unknown7 = 0; header.dwObjectExtentX = 1; header.dwObjectExtentY = 1; @@ -1254,19 +1255,19 @@ IStorage_Release(stg); continue; } - ok(hr == S_OK, "OleLoad error %#x: cfFormat = %u, tymed = %u\n", hr, fmt, tymed); + ok(hr == S_OK, "OleLoad error %#x: cfFormat = %u, advf = %#x\n", hr, fmt, header.advf); hdc = CreateCompatibleDC(0); SetRect(&rc, 0, 0, 100, 100); hr = OleDraw(obj, DVASPECT_CONTENT, hdc, &rc); DeleteDC(hdc); if (fmt == CF_METAFILEPICT) - ok(hr == S_OK, "OleDraw error %#x: cfFormat = %u, tymed = %u\n", hr, fmt, tymed); + ok(hr == S_OK, "OleDraw error %#x: cfFormat = %u, advf = %#x\n", hr, fmt, header.advf); else if (fmt == CF_ENHMETAFILE) todo_wine - ok(hr == S_OK, "OleDraw error %#x: cfFormat = %u, tymed = %u\n", hr, fmt, tymed); + ok(hr == S_OK, "OleDraw error %#x: cfFormat = %u, advf = %#x\n", hr, fmt, header.advf); else - ok(hr == OLE_E_BLANK || hr == OLE_E_NOTRUNNING || hr == E_FAIL, "OleDraw should fail: %#x, cfFormat = %u, tymed = %u\n", hr, fmt, header.tymed); + ok(hr == OLE_E_BLANK || hr == OLE_E_NOTRUNNING || hr == E_FAIL, "OleDraw should fail: %#x, cfFormat = %u, advf = %#x\n", hr, fmt, header.advf); IUnknown_Release(obj); IStorage_Release(stg); @@ -1529,7 +1530,7 @@ static IUnknown unknown = { &UnknownVtbl }; -static void check_enum_cache(IOleCache2 *cache, STATDATA *expect, int num) +static void check_enum_cache(IOleCache2 *cache, const STATDATA *expect, int num) { IEnumSTATDATA *enum_stat; STATDATA stat; @@ -2149,6 +2150,7 @@ hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); ok( hr == S_OK, "got %08x\n", hr ); + ok( conn == 2, "got %d\n", conn ); expect[0].dwConnection = conn; expect[1].dwConnection = conn; @@ -2167,6 +2169,7 @@ hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); ok( hr == S_OK, "got %08x\n", hr ); + ok( conn == 3, "got %d\n", conn ); expect[2].dwConnection = conn; check_enum_cache( cache, expect, 3); @@ -2177,6 +2180,7 @@ hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); ok( hr == S_OK, "got %08x\n", hr ); + ok( conn == 4, "got %d\n", conn ); expect[3].dwConnection = conn; check_enum_cache( cache, expect, 4 ); @@ -2256,6 +2260,166 @@ ReleaseStgMedium( &med ); IDataObject_Release( data ); + IOleCache2_Release( cache ); +} + +/* The CLSID_Picture_ classes automatically create appropriate cache entries */ +static void test_data_cache_init(void) +{ + HRESULT hr; + IOleCache2 *cache; + IPersistStorage *persist; + int i; + CLSID clsid; + static const STATDATA enum_expect[] = + { + {{ CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0, NULL, 1 }, + {{ CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0, NULL, 1 }, + {{ CF_METAFILEPICT, 0, DVASPECT_CONTENT, -1, TYMED_MFPICT }, 0, NULL, 1 }, + {{ CF_ENHMETAFILE, 0, DVASPECT_CONTENT, -1, TYMED_ENHMF }, 0, NULL, 1 } + }; + static const struct + { + const CLSID *clsid; + int enum_start, enum_num; + } data[] = + { + { &CLSID_NULL, 0, 0 }, + { &CLSID_WineTestOld, 0, 0 }, + { &CLSID_Picture_Dib, 0, 2 }, + { &CLSID_Picture_Metafile, 2, 1 }, + { &CLSID_Picture_EnhMetafile, 3, 1 } + }; + + for (i = 0; i < sizeof(data) / sizeof(data[0]); i++) + { + hr = CreateDataCache( NULL, data[i].clsid, &IID_IOleCache2, (void **)&cache ); + ok( hr == S_OK, "got %08x\n", hr ); + + check_enum_cache( cache, enum_expect + data[i].enum_start , data[i].enum_num ); + + IOleCache2_QueryInterface( cache, &IID_IPersistStorage, (void **) &persist ); + hr = IPersistStorage_GetClassID( persist, &clsid ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( IsEqualCLSID( &clsid, data[i].clsid ), "class id mismatch %s %s\n", wine_dbgstr_guid( &clsid ), + wine_dbgstr_guid( data[i].clsid ) ); + + IPersistStorage_Release( persist ); + IOleCache2_Release( cache ); + } +} + +static void test_data_cache_initnew(void) +{ + HRESULT hr; + IOleCache2 *cache; + IPersistStorage *persist; + IStorage *stg_dib, *stg_mf, *stg_wine; + CLSID clsid; + static const STATDATA initnew_expect[] = + { + {{ CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0, NULL, 1 }, + {{ CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0, NULL, 1 }, + }; + static const STATDATA initnew2_expect[] = + { + {{ CF_METAFILEPICT, 0, DVASPECT_CONTENT, -1, TYMED_MFPICT }, 0, NULL, 1 }, + {{ CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0, NULL, 2 }, + {{ CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0, NULL, 2 }, + }; + static const STATDATA initnew3_expect[] = + { + {{ CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0, NULL, 1 }, + {{ CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0, NULL, 1 }, + {{ CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0, NULL, 2 }, + {{ CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0, NULL, 2 }, + {{ CF_METAFILEPICT, 0, DVASPECT_CONTENT, -1, TYMED_MFPICT }, 0, NULL, 3 }, + }; + static const STATDATA initnew4_expect[] = + { + {{ CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0, NULL, 2 }, + {{ CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0, NULL, 2 }, + {{ CF_METAFILEPICT, 0, DVASPECT_CONTENT, -1, TYMED_MFPICT }, 0, NULL, 3 }, + {{ CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0, NULL, 4 }, + {{ CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0, NULL, 4 }, + }; + + hr = StgCreateDocfile( NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &stg_dib ); + ok( hr == S_OK, "got %08x\n", hr); + hr = IStorage_SetClass( stg_dib, &CLSID_Picture_Dib ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = StgCreateDocfile( NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &stg_mf ); + ok( hr == S_OK, "got %08x\n", hr); + hr = IStorage_SetClass( stg_mf, &CLSID_Picture_Metafile ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = StgCreateDocfile( NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &stg_wine ); + ok( hr == S_OK, "got %08x\n", hr); + hr = IStorage_SetClass( stg_wine, &CLSID_WineTestOld ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = CreateDataCache( NULL, &CLSID_WineTestOld, &IID_IOleCache2, (void **)&cache ); + ok( hr == S_OK, "got %08x\n", hr ); + IOleCache2_QueryInterface( cache, &IID_IPersistStorage, (void **) &persist ); + + hr = IPersistStorage_InitNew( persist, stg_dib ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = IPersistStorage_GetClassID( persist, &clsid ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( IsEqualCLSID( &clsid, &CLSID_Picture_Dib ), "got %s\n", wine_dbgstr_guid( &clsid ) ); + + check_enum_cache( cache, initnew_expect, 2 ); + + hr = IPersistStorage_InitNew( persist, stg_mf ); + ok( hr == CO_E_ALREADYINITIALIZED, "got %08x\n", hr); + + hr = IPersistStorage_HandsOffStorage( persist ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = IPersistStorage_GetClassID( persist, &clsid ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( IsEqualCLSID( &clsid, &CLSID_Picture_Dib ), "got %s\n", wine_dbgstr_guid( &clsid ) ); + + hr = IPersistStorage_InitNew( persist, stg_mf ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = IPersistStorage_GetClassID( persist, &clsid ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( IsEqualCLSID( &clsid, &CLSID_Picture_Metafile ), "got %s\n", wine_dbgstr_guid( &clsid ) ); + + check_enum_cache( cache, initnew2_expect, 3 ); + + hr = IPersistStorage_HandsOffStorage( persist ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = IPersistStorage_InitNew( persist, stg_dib ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = IPersistStorage_GetClassID( persist, &clsid ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( IsEqualCLSID( &clsid, &CLSID_Picture_Dib ), "got %s\n", wine_dbgstr_guid( &clsid ) ); + + check_enum_cache( cache, initnew3_expect, 5 ); + + hr = IPersistStorage_HandsOffStorage( persist ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = IPersistStorage_InitNew( persist, stg_wine ); + ok( hr == S_OK, "got %08x\n", hr); + + hr = IPersistStorage_GetClassID( persist, &clsid ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( IsEqualCLSID( &clsid, &CLSID_WineTestOld ), "got %s\n", wine_dbgstr_guid( &clsid ) ); + + check_enum_cache( cache, initnew4_expect, 5 ); + + IStorage_Release( stg_wine ); + IStorage_Release( stg_mf ); + IStorage_Release( stg_dib ); + + IPersistStorage_Release( persist ); IOleCache2_Release( cache ); } @@ -3012,6 +3176,8 @@ test_data_cache_dib_contents_stream( 0 ); test_data_cache_dib_contents_stream( 1 ); test_data_cache_bitmap(); + test_data_cache_init(); + test_data_cache_initnew(); test_default_handler(); test_runnable(); test_OleRun();
7 years, 3 months
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
29
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
Results per page:
10
25
50
100
200