ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2019
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
24 participants
322 discussions
Start a n
N
ew thread
[reactos] 01/01: [OLE32_WINETEST] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fc6e4ed57615eead1c9dc…
commit fc6e4ed57615eead1c9dc6941ca90396749a6b66 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:11:19 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:11:19 2019 +0100 [OLE32_WINETEST] Sync with Wine Staging 4.18. CORE-16441 --- modules/rostests/winetests/ole32/clipboard.c | 2 +- modules/rostests/winetests/ole32/compobj.c | 210 +++++++++++++++++-------- modules/rostests/winetests/ole32/marshal.c | 14 +- modules/rostests/winetests/ole32/ole_server.c | 2 +- modules/rostests/winetests/ole32/propvariant.c | 124 ++++++++++++--- 5 files changed, 264 insertions(+), 88 deletions(-) diff --git a/modules/rostests/winetests/ole32/clipboard.c b/modules/rostests/winetests/ole32/clipboard.c index d7f18ef2458..e3e1b27fb5e 100644 --- a/modules/rostests/winetests/ole32/clipboard.c +++ b/modules/rostests/winetests/ole32/clipboard.c @@ -46,7 +46,7 @@ static inline char *dump_fmtetc(FORMATETC *fmt) { static char buf[100]; - snprintf(buf, sizeof(buf), "cf %04x ptd %p aspect %x lindex %d tymed %x", + sprintf(buf, "cf %04x ptd %p aspect %x lindex %d tymed %x", fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed); return buf; } diff --git a/modules/rostests/winetests/ole32/compobj.c b/modules/rostests/winetests/ole32/compobj.c index 33a75853653..49faabdece3 100644 --- a/modules/rostests/winetests/ole32/compobj.c +++ b/modules/rostests/winetests/ole32/compobj.c @@ -39,7 +39,7 @@ #include "initguid.h" #define DEFINE_EXPECT(func) \ - static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + static BOOL expect_ ## func = FALSE; static unsigned int called_ ## func = 0 #define SET_EXPECT(func) \ expect_ ## func = TRUE @@ -47,7 +47,7 @@ #define CHECK_EXPECT2(func) \ do { \ ok(expect_ ##func, "unexpected call " #func "\n"); \ - called_ ## func = TRUE; \ + called_ ## func++; \ }while(0) #define CHECK_EXPECT(func) \ @@ -56,13 +56,18 @@ expect_ ## func = FALSE; \ }while(0) -#define CHECK_CALLED(func) \ +#define CHECK_CALLED(func, n) \ do { \ - ok(called_ ## func, "expected " #func "\n"); \ - expect_ ## func = called_ ## func = FALSE; \ + ok(called_ ## func == n, "expected " #func " called %u times, got %u\n", n, called_ ## func); \ + expect_ ## func = FALSE; \ + called_ ## func = 0; \ }while(0) DEFINE_EXPECT(CreateStub); +DEFINE_EXPECT(PreInitialize); +DEFINE_EXPECT(PostInitialize); +DEFINE_EXPECT(PreUninitialize); +DEFINE_EXPECT(PostUninitialize); /* functions that are not present on all versions of Windows */ static HRESULT (WINAPI * pCoInitializeEx)(LPVOID lpReserved, DWORD dwCoInit); @@ -788,7 +793,7 @@ static HRESULT WINAPI MessageFilter_QueryInterface(IMessageFilter *iface, REFIID if (ppvObj == NULL) return E_POINTER; if (IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_IClassFactory)) + IsEqualGUID(riid, &IID_IMessageFilter)) { *ppvObj = iface; IMessageFilter_AddRef(iface); @@ -1031,7 +1036,7 @@ static HRESULT WINAPI PSFactoryBuffer_CreateStub( { CHECK_EXPECT(CreateStub); - ok(pUnkServer == (IUnknown*)&Test_Unknown, "unexpected pUnkServer %p\n", pUnkServer); + ok(pUnkServer == &Test_Unknown, "unexpected pUnkServer %p\n", pUnkServer); if(!ps_factory_buffer) return E_NOTIMPL; @@ -1120,7 +1125,7 @@ static void test_CoRegisterPSClsid(void) SET_EXPECT(CreateStub); hr = CoMarshalInterface(stream, &IID_IWineTest, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); ok(hr == E_NOTIMPL, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); - CHECK_CALLED(CreateStub); + CHECK_CALLED(CreateStub, 1); hr = CoGetPSClsid(&IID_IEnumOLEVERB, &clsid); ok_ole_success(hr, "CoGetPSClsid"); @@ -1134,7 +1139,7 @@ static void test_CoRegisterPSClsid(void) SET_EXPECT(CreateStub); hr = CoMarshalInterface(stream, &IID_IEnumOLEVERB, (IUnknown*)&EnumOLEVERB, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); ok(hr == S_OK, "CoMarshalInterface should have returned S_OK instead of 0x%08x\n", hr); - CHECK_CALLED(CreateStub); + CHECK_CALLED(CreateStub, 1); hr = CoMarshalInterface(stream, &IID_IEnumOLEVERB, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); ok(hr == S_OK, "CoMarshalInterface should have returned S_OK instead of 0x%08x\n", hr); @@ -3306,27 +3311,47 @@ static ULONG WINAPI testinitialize_Release(IInitializeSpy *iface) return 1; } +static DWORD expected_coinit_flags; +static ULARGE_INTEGER init_cookies[3]; +static BOOL revoke_spies_on_uninit; + static HRESULT WINAPI testinitialize_PreInitialize(IInitializeSpy *iface, DWORD coinit, DWORD aptrefs) { - ok(0, "unexpected call\n"); - return E_NOTIMPL; + CHECK_EXPECT2(PreInitialize); + ok(coinit == expected_coinit_flags, "Unexpected init flags %#x, expected %#x.\n", coinit, expected_coinit_flags); + return S_OK; } static HRESULT WINAPI testinitialize_PostInitialize(IInitializeSpy *iface, HRESULT hr, DWORD coinit, DWORD aptrefs) { - ok(0, "unexpected call\n"); - return E_NOTIMPL; + CHECK_EXPECT2(PostInitialize); + ok(coinit == expected_coinit_flags, "Unexpected init flags %#x, expected %#x.\n", coinit, expected_coinit_flags); + return hr; } static HRESULT WINAPI testinitialize_PreUninitialize(IInitializeSpy *iface, DWORD aptrefs) { - ok(0, "unexpected call\n"); - return E_NOTIMPL; + HRESULT hr; + CHECK_EXPECT2(PreUninitialize); + if (revoke_spies_on_uninit) + { + hr = CoRevokeInitializeSpy(init_cookies[0]); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = CoRevokeInitializeSpy(init_cookies[1]); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = CoRevokeInitializeSpy(init_cookies[2]); + ok(hr == S_OK, "got 0x%08x\n", hr); + + revoke_spies_on_uninit = FALSE; + } + return S_OK; } static HRESULT WINAPI testinitialize_PostUninitialize(IInitializeSpy *iface, DWORD aptrefs) { - ok(0, "unexpected call\n"); + CHECK_EXPECT2(PostUninitialize); return E_NOTIMPL; } @@ -3343,76 +3368,134 @@ static const IInitializeSpyVtbl testinitializevtbl = static IInitializeSpy testinitialize = { &testinitializevtbl }; -static void test_IInitializeSpy(void) +static DWORD WINAPI test_init_spies_proc(void *arg) +{ + HRESULT hr; + + hr = CoInitializeEx(NULL, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE); + ok(hr == S_OK, "Failed to initialize COM, hr %#x.\n", hr); + + hr = CoRevokeInitializeSpy(init_cookies[2]); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + CoUninitialize(); + return 0; +} + +static void test_IInitializeSpy(BOOL mt) { - ULARGE_INTEGER cookie, cookie1, cookie2; HRESULT hr; + if (mt) + { + hr = pCoInitializeEx(NULL, COINIT_MULTITHREADED); + ok(hr == S_OK, "CoInitializeEx failed: %#x\n", hr); + } + hr = CoRegisterInitializeSpy(NULL, NULL); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); - cookie.QuadPart = 1; - hr = CoRegisterInitializeSpy(NULL, &cookie); + init_cookies[0].QuadPart = 1; + hr = CoRegisterInitializeSpy(NULL, &init_cookies[0]); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); - ok(cookie.QuadPart == 1, "got wrong cookie\n"); + ok(init_cookies[0].QuadPart == 1, "got wrong cookie\n"); hr = CoRegisterInitializeSpy(&testinitialize, NULL); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); - cookie.HighPart = 0; - cookie.LowPart = 1; - hr = CoRegisterInitializeSpy(&testinitialize, &cookie); + init_cookies[0].HighPart = 0; + init_cookies[0].LowPart = 1; + hr = CoRegisterInitializeSpy(&testinitialize, &init_cookies[0]); ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine { - ok(cookie.HighPart == GetCurrentThreadId(), "got high part 0x%08x, expected 0x%08x\n", cookie.HighPart, + ok(init_cookies[0].HighPart == GetCurrentThreadId(), "got high part 0x%08x, expected 0x%08x\n", init_cookies[0].HighPart, GetCurrentThreadId()); - ok(cookie.LowPart == 0, "got wrong low part 0x%x\n", cookie.LowPart); -} + if (!mt) ok(init_cookies[0].LowPart == 0, "got wrong low part 0x%x\n", init_cookies[0].LowPart); + /* register same instance one more time */ - cookie1.HighPart = 0; - cookie1.LowPart = 0; - hr = CoRegisterInitializeSpy(&testinitialize, &cookie1); -todo_wine { + init_cookies[1].HighPart = 0; + init_cookies[1].LowPart = 0; + hr = CoRegisterInitializeSpy(&testinitialize, &init_cookies[1]); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(cookie1.HighPart == GetCurrentThreadId(), "got high part 0x%08x, expected 0x%08x\n", cookie1.HighPart, + ok(init_cookies[1].HighPart == GetCurrentThreadId(), "got high part 0x%08x, expected 0x%08x\n", init_cookies[1].HighPart, GetCurrentThreadId()); - ok(cookie1.LowPart == 1, "got wrong low part 0x%x\n", cookie1.LowPart); -} - cookie2.HighPart = 0; - cookie2.LowPart = 0; - hr = CoRegisterInitializeSpy(&testinitialize, &cookie2); -todo_wine { + if (!mt) ok(init_cookies[1].LowPart == 1, "got wrong low part 0x%x\n", init_cookies[1].LowPart); + + init_cookies[2].HighPart = 0; + init_cookies[2].LowPart = 0; + hr = CoRegisterInitializeSpy(&testinitialize, &init_cookies[2]); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(cookie2.HighPart == GetCurrentThreadId(), "got high part 0x%08x, expected 0x%08x\n", cookie2.HighPart, + ok(init_cookies[2].HighPart == GetCurrentThreadId(), "got high part 0x%08x, expected 0x%08x\n", init_cookies[2].HighPart, GetCurrentThreadId()); - ok(cookie2.LowPart == 2, "got wrong low part 0x%x\n", cookie2.LowPart); -} - hr = CoRevokeInitializeSpy(cookie1); -todo_wine + if (!mt) ok(init_cookies[2].LowPart == 2, "got wrong low part 0x%x\n", init_cookies[2].LowPart); + + hr = CoRevokeInitializeSpy(init_cookies[1]); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = CoRevokeInitializeSpy(cookie1); + hr = CoRevokeInitializeSpy(init_cookies[1]); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); - cookie1.HighPart = 0; - cookie1.LowPart = 0; - hr = CoRegisterInitializeSpy(&testinitialize, &cookie1); -todo_wine { + init_cookies[1].HighPart = 0; + init_cookies[1].LowPart = 0; + hr = CoRegisterInitializeSpy(&testinitialize, &init_cookies[1]); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(cookie1.HighPart == GetCurrentThreadId(), "got high part 0x%08x, expected 0x%08x\n", cookie1.HighPart, + ok(init_cookies[1].HighPart == GetCurrentThreadId(), "got high part 0x%08x, expected 0x%08x\n", init_cookies[1].HighPart, GetCurrentThreadId()); - ok(cookie1.LowPart == 1, "got wrong low part 0x%x\n", cookie1.LowPart); -} - hr = CoRevokeInitializeSpy(cookie); - ok(hr == S_OK, "got 0x%08x\n", hr); + if (!mt) ok(init_cookies[1].LowPart == 1, "got wrong low part 0x%x\n", init_cookies[1].LowPart); - hr = CoRevokeInitializeSpy(cookie1); -todo_wine - ok(hr == S_OK, "got 0x%08x\n", hr); + SET_EXPECT(PreInitialize); + SET_EXPECT(PostInitialize); + hr = CoInitializeEx(NULL, expected_coinit_flags = ((mt ? COINIT_MULTITHREADED : COINIT_APARTMENTTHREADED) | COINIT_DISABLE_OLE1DDE)); + ok(hr == (mt ? S_FALSE : S_OK), "Failed to initialize COM, hr %#x.\n", hr); + CHECK_CALLED(PreInitialize, 3); + CHECK_CALLED(PostInitialize, 3); - hr = CoRevokeInitializeSpy(cookie2); -todo_wine - ok(hr == S_OK, "got 0x%08x\n", hr); + if (mt) + { + HANDLE thread; + thread = CreateThread(NULL, 0, test_init_spies_proc, NULL, 0, NULL); + ok(thread != NULL, "CreateThread failed: %u\n", GetLastError()); + ok(!WaitForSingleObject(thread, 1000), "wait failed\n"); + } + + SET_EXPECT(PreInitialize); + SET_EXPECT(PostInitialize); + hr = CoInitializeEx(NULL, expected_coinit_flags = ((mt ? COINIT_MULTITHREADED : COINIT_APARTMENTTHREADED) | COINIT_DISABLE_OLE1DDE)); + ok(hr == S_FALSE, "Failed to initialize COM, hr %#x.\n", hr); + CHECK_CALLED(PreInitialize, 3); + CHECK_CALLED(PostInitialize, 3); + + SET_EXPECT(PreUninitialize); + SET_EXPECT(PostUninitialize); + CoUninitialize(); + CHECK_CALLED(PreUninitialize, 3); + CHECK_CALLED(PostUninitialize, 3); + + SET_EXPECT(PreUninitialize); + SET_EXPECT(PostUninitialize); + CoUninitialize(); + CHECK_CALLED(PreUninitialize, 3); + CHECK_CALLED(PostUninitialize, 3); + + if (mt) + { + SET_EXPECT(PreUninitialize); + SET_EXPECT(PostUninitialize); + CoUninitialize(); + CHECK_CALLED(PreUninitialize, 3); + CHECK_CALLED(PostUninitialize, 3); + } + + SET_EXPECT(PreInitialize); + SET_EXPECT(PostInitialize); + hr = CoInitializeEx(NULL, expected_coinit_flags = ((mt ? COINIT_MULTITHREADED : COINIT_APARTMENTTHREADED) | COINIT_DISABLE_OLE1DDE)); + ok(hr == S_OK, "Failed to initialize COM, hr %#x.\n", hr); + CHECK_CALLED(PreInitialize, 3); + CHECK_CALLED(PostInitialize, 3); + + SET_EXPECT(PreUninitialize); + revoke_spies_on_uninit = TRUE; + CoUninitialize(); + CHECK_CALLED(PreUninitialize, 1); } static HRESULT g_persistfile_qi_ret; @@ -3755,10 +3838,10 @@ static DWORD CALLBACK implicit_mta_proc(void *param) hr = CoRegisterMessageFilter(NULL, NULL); ok(hr == CO_E_NOT_SUPPORTED, "got %#x\n", hr); - hr = CoLockObjectExternal((IUnknown *)&Test_Unknown, TRUE, TRUE); + hr = CoLockObjectExternal(&Test_Unknown, TRUE, TRUE); ok_ole_success(hr, "CoLockObjectExternal"); - hr = CoDisconnectObject((IUnknown *)&Test_Unknown, 0); + hr = CoDisconnectObject(&Test_Unknown, 0); ok_ole_success(hr, "CoDisconnectObject"); return 0; @@ -3824,7 +3907,8 @@ START_TEST(compobj) test_CoGetApartmentType(); test_IMallocSpy(); test_CoGetCurrentLogicalThreadId(); - test_IInitializeSpy(); + test_IInitializeSpy(FALSE); + test_IInitializeSpy(TRUE); test_CoGetInstanceFromFile(); test_GlobalOptions(); test_implicit_mta(); diff --git a/modules/rostests/winetests/ole32/marshal.c b/modules/rostests/winetests/ole32/marshal.c index 22a67960120..881eddde70c 100644 --- a/modules/rostests/winetests/ole32/marshal.c +++ b/modules/rostests/winetests/ole32/marshal.c @@ -329,7 +329,7 @@ static HRESULT WINAPI Test_IClassFactory_CreateInstance( LPVOID *ppvObj) { if (pUnkOuter) return CLASS_E_NOAGGREGATION; - return IUnknown_QueryInterface((IUnknown*)&Test_Unknown, riid, ppvObj); + return IUnknown_QueryInterface(&Test_Unknown, riid, ppvObj); } static HRESULT WINAPI Test_IClassFactory_LockServer( @@ -1205,7 +1205,9 @@ static void test_marshal_proxy_apartment_shutdown(void) { HRESULT hr; IStream *pStream = NULL; - IUnknown *pProxy = NULL; + IClassFactory *proxy; + IUnknown *unk; + ULONG ref; DWORD tid; HANDLE thread; @@ -1220,7 +1222,7 @@ static void test_marshal_proxy_apartment_shutdown(void) ok_non_zero_external_conn(); IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL); - hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy); + hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&proxy); ok_ole_success(hr, CoUnmarshalInterface); IStream_Release(pStream); @@ -1233,7 +1235,11 @@ static void test_marshal_proxy_apartment_shutdown(void) ok_zero_external_conn(); ok_last_release_closes(TRUE); - IUnknown_Release(pProxy); + hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IUnknown, (void **)&unk); + ok(hr == CO_E_OBJNOTCONNECTED, "got %#x\n", hr); + + ref = IClassFactory_Release(proxy); + ok(!ref, "got %d refs\n", ref); ok_no_locks(); diff --git a/modules/rostests/winetests/ole32/ole_server.c b/modules/rostests/winetests/ole32/ole_server.c index 2f5a3ca5ea7..83f7c660dbb 100644 --- a/modules/rostests/winetests/ole32/ole_server.c +++ b/modules/rostests/winetests/ole32/ole_server.c @@ -244,7 +244,7 @@ static void ole_server(void) if (hr == S_OK) { trace("server: registering class object\n"); - hr = CoRegisterClassObject(&CLSID_WineTestObject, (IUnknown *)&factory, + hr = CoRegisterClassObject(&CLSID_WineTestObject, (IUnknown *)&factory.IClassFactory_iface, CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &key); if (hr == S_OK) { diff --git a/modules/rostests/winetests/ole32/propvariant.c b/modules/rostests/winetests/ole32/propvariant.c index 97c4eec4cac..b1ec76dfc91 100644 --- a/modules/rostests/winetests/ole32/propvariant.c +++ b/modules/rostests/winetests/ole32/propvariant.c @@ -18,6 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS +#ifdef __REACTOS__ +#define CONST_VTABLE +#endif + #include "windows.h" #include "wtypes.h" #include "ddeml.h" @@ -44,28 +49,28 @@ static const struct valid_mapping { { PROP_V0 , PROP_INV, PROP_INV, PROP_INV }, /* VT_EMPTY */ { PROP_V0 , PROP_INV, PROP_INV, PROP_INV }, /* VT_NULL */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_I2 */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_I4 */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_R4 */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_R8 */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_CY */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_DATE */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_BSTR */ - { PROP_V1 , PROP_V1 | PROP_TODO , PROP_INV, PROP_V1 | PROP_TODO }, /* VT_DISPATCH */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_ERROR */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_BOOL */ - { PROP_V1 | PROP_TODO , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_VARIANT */ - { PROP_V1 , PROP_V1 | PROP_TODO , PROP_INV, PROP_V1 | PROP_TODO }, /* VT_UNKNOWN */ - { PROP_V1 , PROP_V1 | PROP_TODO , PROP_INV, PROP_V1 | PROP_TODO }, /* VT_DECIMAL */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_I2 */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_I4 */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_R4 */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_R8 */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_CY */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_DATE */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_BSTR */ + { PROP_V1 , PROP_V1 , PROP_INV, PROP_V1 | PROP_TODO }, /* VT_DISPATCH */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_ERROR */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_BOOL */ + { PROP_V1 | PROP_TODO , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_VARIANT */ + { PROP_V1 , PROP_V1, PROP_INV, PROP_V1 | PROP_TODO }, /* VT_UNKNOWN */ + { PROP_V1 , PROP_V1 , PROP_INV, PROP_V1 | PROP_TODO }, /* VT_DECIMAL */ { PROP_INV, PROP_INV, PROP_INV, PROP_INV }, /* 15 */ - { PROP_V1 , PROP_V1 | PROP_TODO , PROP_V1 , PROP_V1 | PROP_TODO }, /* VT_I1 */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_UI1 */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_UI2 */ - { PROP_V0 , PROP_V1 | PROP_TODO , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_UI4 */ + { PROP_V1 , PROP_V1 , PROP_V1 , PROP_V1 | PROP_TODO }, /* VT_I1 */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_UI1 */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_UI2 */ + { PROP_V0 , PROP_V1 , PROP_V0 , PROP_V1 | PROP_TODO }, /* VT_UI4 */ { PROP_V0 , PROP_V1A | PROP_TODO, PROP_V0 , PROP_V1A | PROP_TODO }, /* VT_I8 */ { PROP_V0 , PROP_V1A | PROP_TODO, PROP_V0 , PROP_V1A | PROP_TODO }, /* VT_UI8 */ - { PROP_V1 , PROP_V1 | PROP_TODO , PROP_INV, PROP_V1 | PROP_TODO }, /* VT_INT */ - { PROP_V1 , PROP_V1 | PROP_TODO , PROP_INV, PROP_V1 | PROP_TODO }, /* VT_UINT */ + { PROP_V1 , PROP_V1 , PROP_INV, PROP_V1 | PROP_TODO }, /* VT_INT */ + { PROP_V1 , PROP_V1 , PROP_INV, PROP_V1 | PROP_TODO }, /* VT_UINT */ { PROP_INV, PROP_INV, PROP_INV, PROP_INV }, /* VT_VOID */ { PROP_INV, PROP_INV, PROP_INV, PROP_INV }, /* VT_HRESULT */ { PROP_INV, PROP_INV, PROP_INV, PROP_INV }, /* VT_PTR */ @@ -298,12 +303,60 @@ static void test_validtypes(void) } } +struct unk_impl +{ + IUnknown IUnknown_iface; + LONG ref; +}; + +static inline struct unk_impl *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, struct unk_impl, IUnknown_iface); +} + +static HRESULT WINAPI unk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) +{ + struct unk_impl *This = impl_from_IUnknown(iface); + if(winetest_debug > 1) + trace("Call to unk_QueryInterface()\n"); + *ppv = &This->IUnknown_iface; + IUnknown_AddRef(iface); + return S_OK; +} + +static ULONG WINAPI unk_AddRef(IUnknown *iface) +{ + struct unk_impl *This = impl_from_IUnknown(iface); + if(winetest_debug > 1) + trace("Call to unk_AddRef()\n"); + return InterlockedIncrement(&This->ref); +} + +static ULONG WINAPI unk_Release(IUnknown *iface) +{ + struct unk_impl *This = impl_from_IUnknown(iface); + if(winetest_debug > 1) + trace("Call to unk_Release()\n"); + return InterlockedDecrement(&This->ref); +} + +static const IUnknownVtbl unk_vtbl = +{ + unk_QueryInterface, + unk_AddRef, + unk_Release +}; + static void test_copy(void) { static char szTestString[] = "Test String"; static WCHAR wszTestString[] = {'T','e','s','t',' ','S','t','r','i','n','g',0}; + struct unk_impl unk_obj = {{&unk_vtbl}, 1}; PROPVARIANT propvarSrc; PROPVARIANT propvarDst; + SAFEARRAY *sa; + SAFEARRAYBOUND sabound; + LONG saindex; HRESULT hr; propvarSrc.vt = VT_BSTR; @@ -334,6 +387,39 @@ static void test_copy(void) hr = PropVariantClear(&propvarDst); ok(hr == S_OK, "PropVariantClear(...VT_LPSTR...) failed\n"); memset(&propvarSrc, 0, sizeof(propvarSrc)); + + propvarSrc.vt = VT_UNKNOWN; + U(propvarSrc).punkVal = &unk_obj.IUnknown_iface; + hr = PropVariantCopy(&propvarDst, &propvarSrc); + ok(hr == S_OK, "PropVariantCopy(...VT_UNKNOWN...) failed: 0x%08x.\n", hr); + ok(U(propvarDst).punkVal == &unk_obj.IUnknown_iface, "Got wrong IUnknown pointer\n"); + ok(unk_obj.ref == 2, "got wrong refcount: %d.\n", unk_obj.ref); + hr = PropVariantClear(&propvarDst); + ok(hr == S_OK, "PropVariantClear(...VT_UNKNOWN...) failed: 0x%08x.\n", hr); + ok(unk_obj.ref == 1, "got wrong refcount: %d.\n", unk_obj.ref); + memset(&propvarSrc, 0, sizeof(propvarSrc)); + + sabound.lLbound = 0; + sabound.cElements = 2; + sa = SafeArrayCreate(VT_UNKNOWN, 1, &sabound); + saindex = 0; + SafeArrayPutElement(sa, &saindex, &unk_obj.IUnknown_iface); + saindex = 1; + SafeArrayPutElement(sa, &saindex, &unk_obj.IUnknown_iface); + ok(unk_obj.ref == 3, "got wrong refcount: %d.\n", unk_obj.ref); + + propvarSrc.vt = VT_ARRAY | VT_UNKNOWN; + U(propvarSrc).parray = sa; + hr = PropVariantCopy(&propvarDst, &propvarSrc); + ok(hr == S_OK, "PropVariantCopy(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08x.\n", hr); + ok(unk_obj.ref == 5, "got wrong refcount: %d.\n", unk_obj.ref); + hr = PropVariantClear(&propvarDst); + ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08x.\n", hr); + ok(unk_obj.ref == 3, "got wrong refcount: %d.\n", unk_obj.ref); + hr = PropVariantClear(&propvarSrc); + ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08x.\n", hr); + ok(unk_obj.ref == 1, "got wrong refcount: %d.\n", unk_obj.ref); + memset(&propvarSrc, 0, sizeof(propvarSrc)); } struct _PMemoryAllocator_vtable {
5 years, 1 month
1
0
0
0
[reactos] 01/01: [OLE32] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f5d91b750c854d34f69a…
commit 0f5d91b750c854d34f69af03faab0209fcb152ee Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:10:55 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:10:55 2019 +0100 [OLE32] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/ole32/bindctx.c | 2 +- dll/win32/ole32/classmoniker.c | 5 +- dll/win32/ole32/clipboard.c | 4 +- dll/win32/ole32/comcat.c | 9 +- dll/win32/ole32/compobj.c | 209 ++++++++++++++++++++++++++++--------- dll/win32/ole32/compobj_private.h | 18 +++- dll/win32/ole32/compositemoniker.c | 19 ++-- dll/win32/ole32/datacache.c | 3 +- dll/win32/ole32/defaulthandler.c | 5 +- dll/win32/ole32/errorinfo.c | 3 +- dll/win32/ole32/filelockbytes.c | 5 +- dll/win32/ole32/filemoniker.c | 49 +++++---- dll/win32/ole32/ftmarshal.c | 2 - dll/win32/ole32/hglobalstream.c | 2 - dll/win32/ole32/ifs.c | 2 - dll/win32/ole32/itemmoniker.c | 9 +- dll/win32/ole32/marshal.c | 1 - dll/win32/ole32/memlockbytes.c | 2 - dll/win32/ole32/moniker.c | 12 +-- dll/win32/ole32/ole2.c | 47 ++++++--- dll/win32/ole32/ole2stubs.c | 2 - dll/win32/ole32/ole32.spec | 4 +- dll/win32/ole32/ole32_main.c | 3 - dll/win32/ole32/oleobj.c | 7 +- dll/win32/ole32/oleproxy.c | 2 - dll/win32/ole32/precomp.h | 3 - dll/win32/ole32/rpc.c | 8 +- dll/win32/ole32/stg_prop.c | 15 +-- dll/win32/ole32/storage32.c | 17 ++- dll/win32/ole32/usrmarshal.c | 11 +- media/doc/README.WINE | 2 +- 31 files changed, 295 insertions(+), 187 deletions(-) diff --git a/dll/win32/ole32/bindctx.c b/dll/win32/ole32/bindctx.c index 8be88a64c0d..1951100b0bb 100644 --- a/dll/win32/ole32/bindctx.c +++ b/dll/win32/ole32/bindctx.c @@ -446,7 +446,7 @@ static HRESULT BindCtxImpl_GetObjectIndex(BindCtxImpl* This, if ( ( (This->bindCtxTable[i].pkeyObj==NULL) && (pszkey==NULL) ) || ( (This->bindCtxTable[i].pkeyObj!=NULL) && (pszkey!=NULL) && - (lstrcmpW(This->bindCtxTable[i].pkeyObj,pszkey)==0) + (wcscmp(This->bindCtxTable[i].pkeyObj,pszkey)==0) ) ) diff --git a/dll/win32/ole32/classmoniker.c b/dll/win32/ole32/classmoniker.c index 30a24d23e5e..3837a1f74c1 100644 --- a/dll/win32/ole32/classmoniker.c +++ b/dll/win32/ole32/classmoniker.c @@ -31,7 +31,6 @@ #include "winuser.h" #include "wine/debug.h" #include "ole2.h" -#include "wine/unicode.h" #include "moniker.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -402,7 +401,7 @@ static HRESULT WINAPI ClassMoniker_IsEqual(IMoniker* iface,IMoniker* pmkOtherMon if(SUCCEEDED ((res = CreateBindCtx(0,&bind)))) { if(SUCCEEDED (IMoniker_GetDisplayName(iface,bind,NULL,&dispName1))) { if(SUCCEEDED (IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&dispName2))) { - if(lstrcmpW(dispName1,dispName2)==0) res = S_OK; + if(wcscmp(dispName1,dispName2)==0) res = S_OK; CoTaskMemFree(dispName2); } CoTaskMemFree(dispName1); @@ -727,7 +726,7 @@ HRESULT ClassMoniker_CreateFromDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LP IMoniker **ppmk) { HRESULT hr; - LPCWSTR s = strchrW(szDisplayName, ':'); + LPCWSTR s = wcschr(szDisplayName, ':'); LPCWSTR end; CLSID clsid; BYTE table[256]; diff --git a/dll/win32/ole32/clipboard.c b/dll/win32/ole32/clipboard.c index f3e9a6bc56a..a43f104ba80 100644 --- a/dll/win32/ole32/clipboard.c +++ b/dll/win32/ole32/clipboard.c @@ -1363,7 +1363,7 @@ static inline BOOL string_off_equal(const DVTARGETDEVICE *t1, WORD off1, const D str1 = (const WCHAR*)((const char*)t1 + off1); str2 = (const WCHAR*)((const char*)t2 + off2); - return !lstrcmpW(str1, str2); + return !wcscmp(str1, str2); } static inline BOOL td_equal(const DVTARGETDEVICE *t1, const DVTARGETDEVICE *t2) @@ -1602,7 +1602,7 @@ end: */ static HRESULT WINAPI snapshot_QueryGetData(IDataObject *iface, FORMATETC *fmt) { - FIXME("(%p, %p {%s})\n", iface, fmt, dump_fmtetc(fmt)); + TRACE("(%p, %p {%s})\n", iface, fmt, dump_fmtetc(fmt)); if (!fmt) return E_INVALIDARG; diff --git a/dll/win32/ole32/comcat.c b/dll/win32/ole32/comcat.c index d43c3afc0d4..467724c5ba3 100644 --- a/dll/win32/ole32/comcat.c +++ b/dll/win32/ole32/comcat.c @@ -33,7 +33,6 @@ #include "comcat.h" #include "compobj_private.h" -#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -267,7 +266,7 @@ static HRESULT COMCAT_IsClassOfCategories( if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break; if (size != CHARS_IN_GUID-1) continue; /* bogus catid in registry */ for (string = req_strings; *string; string += CHARS_IN_GUID) - if (!strcmpiW(string, keyname)) break; + if (!wcsicmp(string, keyname)) break; if (!*string) { RegCloseKey(subkey); return S_FALSE; @@ -1279,9 +1278,9 @@ static HRESULT CATIDEnumGUID_Construct(REFCLSID rclsid, LPCWSTR postfix, IEnumGU This->IEnumGUID_iface.lpVtbl = &CATIDEnumGUIDVtbl; This->ref = 1; - strcpyW(keyname, prefixW); - strcatW(keyname, clsidW); - strcatW(keyname, postfix); + lstrcpyW(keyname, prefixW); + lstrcatW(keyname, clsidW); + lstrcatW(keyname, postfix); open_classes_key(HKEY_CLASSES_ROOT, keyname, KEY_READ, &This->key); diff --git a/dll/win32/ole32/compobj.c b/dll/win32/ole32/compobj.c index eae39335fbb..e0c1b0b745f 100644 --- a/dll/win32/ole32/compobj.c +++ b/dll/win32/ole32/compobj.c @@ -36,8 +36,6 @@ * */ -#include "config.h" - #include <stdarg.h> #include <stdio.h> #include <string.h> @@ -67,7 +65,6 @@ #include "compobj_private.h" #include "moniker.h" -#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -496,7 +493,7 @@ static OpenDll *COMPOBJ_DllList_Get(LPCWSTR library_name) EnterCriticalSection(&csOpenDllList); LIST_FOR_EACH_ENTRY(ptr, &openDllList, OpenDll, entry) { - if (!strcmpiW(library_name, ptr->library_name) && + if (!wcsicmp(library_name, ptr->library_name) && (InterlockedIncrement(&ptr->refs) != 1) /* entry is being destroy if == 1 */) { ret = ptr; @@ -554,7 +551,7 @@ static HRESULT COMPOBJ_DllList_Add(LPCWSTR library_name, OpenDll **ret) } else { - len = strlenW(library_name); + len = lstrlenW(library_name); entry = HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll)); if (entry) entry->library_name = HeapAlloc(GetProcessHeap(), 0, (len + 1)*sizeof(WCHAR)); @@ -1349,7 +1346,7 @@ static HRESULT apartment_getclassobject(struct apartment *apt, LPCWSTR dllpath, BOOL found = FALSE; struct apartment_loaded_dll *apartment_loaded_dll; - if (!strcmpiW(dllpath, wszOle32)) + if (!wcsicmp(dllpath, wszOle32)) { /* we don't need to control the lifetime of this dll, so use the local * implementation of DllGetClassObject directly */ @@ -1365,7 +1362,7 @@ static HRESULT apartment_getclassobject(struct apartment *apt, LPCWSTR dllpath, EnterCriticalSection(&apt->cs); LIST_FOR_EACH_ENTRY(apartment_loaded_dll, &apt->loaded_dlls, struct apartment_loaded_dll, entry) - if (!strcmpiW(dllpath, apartment_loaded_dll->dll->library_name)) + if (!wcsicmp(dllpath, apartment_loaded_dll->dll->library_name)) { TRACE("found %s already loaded\n", debugstr_w(dllpath)); found = TRUE; @@ -1428,9 +1425,9 @@ static BOOL get_object_dll_path(const struct class_reg_data *regdata, WCHAR *dst if (dstlen <= ExpandEnvironmentStringsW(src, dst, dstlen)) ret = ERROR_MORE_DATA; } else { const WCHAR *quote_start; - quote_start = strchrW(src, '\"'); + quote_start = wcschr(src, '\"'); if (quote_start) { - const WCHAR *quote_end = strchrW(quote_start + 1, '\"'); + const WCHAR *quote_end = wcschr(quote_start + 1, '\"'); if (quote_end) { memmove(src, quote_start + 1, (quote_end - quote_start - 1) * sizeof(WCHAR)); @@ -1744,11 +1741,21 @@ static void COM_TlsDestroy(void) struct oletls *info = NtCurrentTeb()->ReservedForOle; if (info) { + struct init_spy *cursor, *cursor2; + if (info->apt) apartment_release(info->apt); if (info->errorinfo) IErrorInfo_Release(info->errorinfo); if (info->state) IUnknown_Release(info->state); - if (info->spy) IInitializeSpy_Release(info->spy); + + LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, &info->spies, struct init_spy, entry) + { + list_remove(&cursor->entry); + if (cursor->spy) IInitializeSpy_Release(cursor->spy); + heap_free(cursor); + } + if (info->context_token) IObjContext_Release(info->context_token); + HeapFree(GetProcessHeap(), 0, info); NtCurrentTeb()->ReservedForOle = NULL; } @@ -1770,6 +1777,42 @@ DWORD WINAPI CoBuildVersion(void) return (rmm<<16)+rup; } +static struct init_spy *get_spy_entry(struct oletls *info, unsigned int id) +{ + struct init_spy *spy; + + LIST_FOR_EACH_ENTRY(spy, &info->spies, struct init_spy, entry) + { + if (id == spy->id && spy->spy) + return spy; + } + + return NULL; +} + +/* + * When locked, don't modify list (unless we add a new head), so that it's + * safe to iterate it. Freeing of list entries is delayed and done on unlock. + */ +static inline void lock_init_spies(struct oletls *info) +{ + info->spies_lock++; +} + +static void unlock_init_spies(struct oletls *info) +{ + struct init_spy *spy, *next; + + if (--info->spies_lock) return; + + LIST_FOR_EACH_ENTRY_SAFE(spy, next, &info->spies, struct init_spy, entry) + { + if (spy->spy) continue; + list_remove(&spy->entry); + heap_free(spy); + } +} + /****************************************************************************** * CoRegisterInitializeSpy [OLE32.@] * @@ -1789,6 +1832,8 @@ DWORD WINAPI CoBuildVersion(void) HRESULT WINAPI CoRegisterInitializeSpy(IInitializeSpy *spy, ULARGE_INTEGER *cookie) { struct oletls *info = COM_CurrentInfo(); + struct init_spy *entry; + unsigned int id; HRESULT hr; TRACE("(%p, %p)\n", spy, cookie); @@ -1800,19 +1845,32 @@ HRESULT WINAPI CoRegisterInitializeSpy(IInitializeSpy *spy, ULARGE_INTEGER *cook return E_INVALIDARG; } - if (info->spy) + hr = IInitializeSpy_QueryInterface(spy, &IID_IInitializeSpy, (void **)&spy); + if (FAILED(hr)) + return hr; + + entry = heap_alloc(sizeof(*entry)); + if (!entry) { - FIXME("Already registered?\n"); - return E_UNEXPECTED; + IInitializeSpy_Release(spy); + return E_OUTOFMEMORY; } - hr = IInitializeSpy_QueryInterface(spy, &IID_IInitializeSpy, (void **) &info->spy); - if (SUCCEEDED(hr)) + entry->spy = spy; + + id = 0; + while (get_spy_entry(info, id) != NULL) { - cookie->QuadPart = (DWORD_PTR)spy; - return S_OK; + id++; } - return hr; + + entry->id = id; + list_add_head(&info->spies, &entry->entry); + + cookie->s.HighPart = GetCurrentThreadId(); + cookie->s.LowPart = entry->id; + + return S_OK; } /****************************************************************************** @@ -1833,13 +1891,22 @@ HRESULT WINAPI CoRegisterInitializeSpy(IInitializeSpy *spy, ULARGE_INTEGER *cook HRESULT WINAPI CoRevokeInitializeSpy(ULARGE_INTEGER cookie) { struct oletls *info = COM_CurrentInfo(); + struct init_spy *spy; + TRACE("(%s)\n", wine_dbgstr_longlong(cookie.QuadPart)); - if (!info || !info->spy || cookie.QuadPart != (DWORD_PTR)info->spy) + if (!info || cookie.s.HighPart != GetCurrentThreadId()) return E_INVALIDARG; - IInitializeSpy_Release(info->spy); - info->spy = NULL; + if (!(spy = get_spy_entry(info, cookie.s.LowPart))) return E_INVALIDARG; + + IInitializeSpy_Release(spy->spy); + spy->spy = NULL; + if (!info->spies_lock) + { + list_remove(&spy->entry); + heap_free(spy); + } return S_OK; } @@ -1935,6 +2002,7 @@ HRESULT WINAPI CoInitialize(LPVOID lpReserved) HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit) { struct oletls *info = COM_CurrentInfo(); + struct init_spy *cursor; HRESULT hr; TRACE("(%p, %x)\n", lpReserved, (int)dwCoInit); @@ -1961,13 +2029,21 @@ HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoIni RunningObjectTableImpl_Initialize(); } - if (info->spy) - IInitializeSpy_PreInitialize(info->spy, dwCoInit, info->inits); + lock_init_spies(info); + LIST_FOR_EACH_ENTRY(cursor, &info->spies, struct init_spy, entry) + { + if (cursor->spy) IInitializeSpy_PreInitialize(cursor->spy, dwCoInit, info->inits); + } + unlock_init_spies(info); hr = enter_apartment( info, dwCoInit ); - if (info->spy) - IInitializeSpy_PostInitialize(info->spy, hr, dwCoInit, info->inits); + lock_init_spies(info); + LIST_FOR_EACH_ENTRY(cursor, &info->spies, struct init_spy, entry) + { + if (cursor->spy) hr = IInitializeSpy_PostInitialize(cursor->spy, hr, dwCoInit, info->inits); + } + unlock_init_spies(info); return hr; } @@ -1991,6 +2067,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoIni void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void) { struct oletls * info = COM_CurrentInfo(); + struct init_spy *cursor, *next; LONG lCOMRefCnt; TRACE("()\n"); @@ -1998,17 +2075,26 @@ void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void) /* will only happen on OOM */ if (!info) return; - if (info->spy) - IInitializeSpy_PreUninitialize(info->spy, info->inits); + lock_init_spies(info); + LIST_FOR_EACH_ENTRY_SAFE(cursor, next, &info->spies, struct init_spy, entry) + { + if (cursor->spy) IInitializeSpy_PreUninitialize(cursor->spy, info->inits); + } + unlock_init_spies(info); /* sanity check */ if (!info->inits) { - ERR("Mismatched CoUninitialize\n"); + ERR("Mismatched CoUninitialize\n"); + + lock_init_spies(info); + LIST_FOR_EACH_ENTRY_SAFE(cursor, next, &info->spies, struct init_spy, entry) + { + if (cursor->spy) IInitializeSpy_PostUninitialize(cursor->spy, info->inits); + } + unlock_init_spies(info); - if (info->spy) - IInitializeSpy_PostUninitialize(info->spy, info->inits); - return; + return; } leave_apartment( info ); @@ -2030,8 +2116,13 @@ void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void) ERR( "CoUninitialize() - not CoInitialized.\n" ); InterlockedExchangeAdd(&s_COMLockCount,1); /* restore the lock count. */ } - if (info->spy) - IInitializeSpy_PostUninitialize(info->spy, info->inits); + + lock_init_spies(info); + LIST_FOR_EACH_ENTRY(cursor, &info->spies, struct init_spy, entry) + { + if (cursor->spy) IInitializeSpy_PostUninitialize(cursor->spy, info->inits); + } + unlock_init_spies(info); } /****************************************************************************** @@ -2205,10 +2296,10 @@ static HRESULT clsid_from_string_reg(LPCOLESTR progid, CLSID *clsid) WCHAR *buf; memset(clsid, 0, sizeof(*clsid)); - buf = HeapAlloc( GetProcessHeap(),0,(strlenW(progid)+8) * sizeof(WCHAR) ); + buf = HeapAlloc( GetProcessHeap(),0,(lstrlenW(progid)+8) * sizeof(WCHAR) ); if (!buf) return E_OUTOFMEMORY; - strcpyW( buf, progid ); - strcatW( buf, clsidW ); + lstrcpyW( buf, progid ); + lstrcatW( buf, clsidW ); if (open_classes_key(HKEY_CLASSES_ROOT, buf, MAXIMUM_ALLOWED, &xhkey)) { HeapFree(GetProcessHeap(),0,buf); @@ -2291,7 +2382,7 @@ HRESULT WINAPI IIDFromString(LPCOLESTR s, IID *iid) } /* length mismatch is a special case */ - if (strlenW(s) + 1 != CHARS_IN_GUID) + if (lstrlenW(s) + 1 != CHARS_IN_GUID) return E_INVALIDARG; if (s[0] != '{') @@ -2347,7 +2438,7 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax) '%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X', '%','0','2','X','%','0','2','X','}',0 }; if (!id || cmax < CHARS_IN_GUID) return 0; - sprintfW( str, formatW, id->Data1, id->Data2, id->Data3, + swprintf( str, formatW, id->Data1, id->Data2, id->Data3, id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3], id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] ); return CHARS_IN_GUID; @@ -2361,8 +2452,8 @@ HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY LONG res; HKEY key; - strcpyW(path, wszCLSIDSlash); - StringFromGUID2(clsid, path + strlenW(wszCLSIDSlash), CHARS_IN_GUID); + lstrcpyW(path, wszCLSIDSlash); + StringFromGUID2(clsid, path + lstrlenW(wszCLSIDSlash), CHARS_IN_GUID); res = open_classes_key(HKEY_CLASSES_ROOT, path, keyname ? KEY_READ : access, &key); if (res == ERROR_FILE_NOT_FOUND) return REGDB_E_CLASSNOTREG; @@ -2411,8 +2502,8 @@ HRESULT COM_OpenKeyForAppIdFromCLSID(REFCLSID clsid, REGSAM access, HKEY *subkey else if (res != ERROR_SUCCESS || type!=REG_SZ) return REGDB_E_READREGDB; - strcpyW(keyname, szAppIdKey); - strcatW(keyname, buf); + lstrcpyW(keyname, szAppIdKey); + lstrcatW(keyname, buf); res = open_classes_key(HKEY_CLASSES_ROOT, keyname, access, subkey); if (res == ERROR_FILE_NOT_FOUND) return REGDB_E_KEYMISSING; @@ -2642,9 +2733,9 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid) } /* Interface\\{string form of riid}\\ProxyStubClsid32 */ - strcpyW(path, wszInterface); + lstrcpyW(path, wszInterface); StringFromGUID2(riid, path + ARRAY_SIZE(wszInterface) - 1, CHARS_IN_GUID); - strcpyW(path + ARRAY_SIZE(wszInterface) - 1 + CHARS_IN_GUID - 1, wszPSC); + lstrcpyW(path + ARRAY_SIZE(wszInterface) - 1 + CHARS_IN_GUID - 1, wszPSC); hr = get_ps_clsid_from_registry(path, 0, pclsid); if (FAILED(hr) && (opposite == KEY_WOW64_32KEY || @@ -2911,7 +3002,7 @@ static enum comclass_threadingmodel get_threading_model(const struct class_reg_d static const WCHAR wszApartment[] = {'A','p','a','r','t','m','e','n','t',0}; static const WCHAR wszFree[] = {'F','r','e','e',0}; static const WCHAR wszBoth[] = {'B','o','t','h',0}; - WCHAR threading_model[10 /* strlenW(L"apartment")+1 */]; + WCHAR threading_model[10 /* lstrlenW(L"apartment")+1 */]; DWORD dwLength = sizeof(threading_model); DWORD keytype; DWORD ret; @@ -2920,9 +3011,9 @@ static enum comclass_threadingmodel get_threading_model(const struct class_reg_d if ((ret != ERROR_SUCCESS) || (keytype != REG_SZ)) threading_model[0] = '\0'; - if (!strcmpiW(threading_model, wszApartment)) return ThreadingModel_Apartment; - if (!strcmpiW(threading_model, wszFree)) return ThreadingModel_Free; - if (!strcmpiW(threading_model, wszBoth)) return ThreadingModel_Both; + if (!wcsicmp(threading_model, wszApartment)) return ThreadingModel_Apartment; + if (!wcsicmp(threading_model, wszFree)) return ThreadingModel_Free; + if (!wcsicmp(threading_model, wszBoth)) return ThreadingModel_Both; /* there's not specific handling for this case */ if (threading_model[0]) return ThreadingModel_Neutral; @@ -5091,7 +5182,7 @@ HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) if (get_object_dll_path(®data, dllpath, ARRAY_SIZE(dllpath))) { static const WCHAR wszOle32[] = {'o','l','e','3','2','.','d','l','l',0}; - if (!strcmpiW(dllpath, wszOle32)) + if (!wcsicmp(dllpath, wszOle32)) { RegCloseKey(hkey); return HandlerCF_Create(rclsid, riid, ppv); @@ -5142,6 +5233,26 @@ HRESULT WINAPI CoGetApartmentType(APTTYPE *type, APTTYPEQUALIFIER *qualifier) return info->apt ? S_OK : CO_E_NOTINITIALIZED; } +/*********************************************************************** + * CoDisableCallCancellation [OLE32.@] + */ +HRESULT WINAPI CoDisableCallCancellation(void *reserved) +{ + FIXME("(%p): stub\n", reserved); + + return E_NOTIMPL; +} + +/*********************************************************************** + * CoEnableCallCancellation [OLE32.@] + */ +HRESULT WINAPI CoEnableCallCancellation(void *reserved) +{ + FIXME("(%p): stub\n", reserved); + + return E_NOTIMPL; +} + /*********************************************************************** * CoRegisterSurrogate [OLE32.@] */ diff --git a/dll/win32/ole32/compobj_private.h b/dll/win32/ole32/compobj_private.h index 1e564a3de11..bda1c6bff2a 100644 --- a/dll/win32/ole32/compobj_private.h +++ b/dll/win32/ole32/compobj_private.h @@ -153,6 +153,13 @@ struct apartment BOOL main; /* is this a main-threaded-apartment? (RO) */ }; +struct init_spy +{ + struct list entry; + IInitializeSpy *spy; + unsigned int id; +}; + /* this is what is stored in TEB->ReservedForOle */ struct oletls { @@ -160,7 +167,7 @@ struct oletls IErrorInfo *errorinfo; /* see errorinfo.c */ IUnknown *state; /* see CoSetState */ DWORD apt_mask; /* apartment mask (+0Ch on x86) */ - IInitializeSpy *spy; /* The "SPY" from CoInitializeSpy */ + void *unknown0; DWORD inits; /* number of times CoInitializeEx called */ DWORD ole_inits; /* number of times OleInitialize called */ GUID causality_id; /* unique identifier for each COM call */ @@ -171,6 +178,8 @@ struct oletls IUnknown *call_state; /* current call context (+3Ch on x86) */ DWORD unknown2[46]; IUnknown *cancel_object; /* cancel object set by CoSetCancelObject (+F8h on x86) */ + struct list spies; /* Spies installed with CoRegisterInitializeSpy */ + DWORD spies_lock; }; @@ -262,7 +271,12 @@ APARTMENT *apartment_get_current_or_mta(void) DECLSPEC_HIDDEN; static inline struct oletls *COM_CurrentInfo(void) { if (!NtCurrentTeb()->ReservedForOle) - NtCurrentTeb()->ReservedForOle = heap_alloc_zero(sizeof(struct oletls)); + { + struct oletls *oletls = heap_alloc_zero(sizeof(*oletls)); + if (oletls) + list_init(&oletls->spies); + NtCurrentTeb()->ReservedForOle = oletls; + } return NtCurrentTeb()->ReservedForOle; } diff --git a/dll/win32/ole32/compositemoniker.c b/dll/win32/ole32/compositemoniker.c index 75d97fa7e30..5f5c8c7deb1 100644 --- a/dll/win32/ole32/compositemoniker.c +++ b/dll/win32/ole32/compositemoniker.c @@ -29,7 +29,6 @@ #include "winuser.h" #include "winerror.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "ole2.h" #include "moniker.h" @@ -433,6 +432,7 @@ static HRESULT WINAPI CompositeMonikerImpl_Reduce(IMoniker* iface, IBindCtx* pbc, DWORD dwReduceHowFar, IMoniker** ppmkToLeft, IMoniker** ppmkReduced) { + HRESULT res; IMoniker *tempMk,*antiMk,*rightMostMk,*leftReducedComposedMk,*rightMostReducedMk; IEnumMoniker *enumMoniker; @@ -453,7 +453,11 @@ CompositeMonikerImpl_Reduce(IMoniker* iface, IBindCtx* pbc, DWORD dwReduceHowFar IMoniker_ComposeWith(iface,antiMk,0,&tempMk); IMoniker_Release(antiMk); - return IMoniker_Reduce(rightMostMk,pbc,dwReduceHowFar,&tempMk, ppmkReduced); + res = IMoniker_Reduce(rightMostMk,pbc,dwReduceHowFar,&tempMk, ppmkReduced); + IMoniker_Release(tempMk); + IMoniker_Release(rightMostMk); + + return res; } else if (*ppmkToLeft==NULL) @@ -473,13 +477,16 @@ CompositeMonikerImpl_Reduce(IMoniker* iface, IBindCtx* pbc, DWORD dwReduceHowFar /* If any of the components reduces itself, the method returns S_OK and passes back a composite */ /* of the reduced components */ if (IMoniker_Reduce(rightMostMk,pbc,dwReduceHowFar,NULL,&rightMostReducedMk) && - IMoniker_Reduce(rightMostMk,pbc,dwReduceHowFar,&tempMk,&leftReducedComposedMk) - ) + IMoniker_Reduce(rightMostMk,pbc,dwReduceHowFar,&tempMk,&leftReducedComposedMk) ){ + IMoniker_Release(tempMk); + IMoniker_Release(rightMostMk); return CreateGenericComposite(leftReducedComposedMk,rightMostReducedMk,ppmkReduced); - + } else{ /* If no reduction occurred, the method passes back the same moniker and returns MK_S_REDUCED_TO_SELF.*/ + IMoniker_Release(tempMk); + IMoniker_Release(rightMostMk); IMoniker_AddRef(iface); @@ -1133,7 +1140,7 @@ CompositeMonikerImpl_GetDisplayName(IMoniker* iface, IBindCtx* pbc, if (*ppszDisplayName==NULL) return E_OUTOFMEMORY; - strcatW(*ppszDisplayName,tempStr); + lstrcatW(*ppszDisplayName,tempStr); CoTaskMemFree(tempStr); IMoniker_Release(tempMk); diff --git a/dll/win32/ole32/datacache.c b/dll/win32/ole32/datacache.c index 3eff56908d5..4e4f264860a 100644 --- a/dll/win32/ole32/datacache.c +++ b/dll/win32/ole32/datacache.c @@ -57,7 +57,6 @@ #include "winerror.h" #include "ole2.h" #include "compobj_private.h" -#include "wine/unicode.h" #include "wine/list.h" #include "wine/debug.h" @@ -1003,7 +1002,7 @@ static HRESULT save_mfpict(DataCacheEntry *entry, BOOL contents, IStream *stream meta_place_rec.bounding_box[3] = (LONGLONG)mfpict->yExt * meta_place_rec.inch / 2540; GlobalUnlock(entry->stgmedium.u.hMetaFilePict); - for (check = (WORD *)&meta_place_rec; check != (WORD *)&meta_place_rec.checksum; check++) + for (check = (WORD *)&meta_place_rec; check != &meta_place_rec.checksum; check++) meta_place_rec.checksum ^= *check; hr = IStream_Write(stream, &meta_place_rec, sizeof(struct meta_placeable), NULL); if (hr == S_OK && data_size) diff --git a/dll/win32/ole32/defaulthandler.c b/dll/win32/ole32/defaulthandler.c index e6c52cd0933..c1045c15466 100644 --- a/dll/win32/ole32/defaulthandler.c +++ b/dll/win32/ole32/defaulthandler.c @@ -60,7 +60,6 @@ #include "compobj_private.h" #include "storage32.h" -#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -449,14 +448,14 @@ static HRESULT WINAPI DefaultHandler_SetHostNames( { if ((This->containerApp = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) ))) - strcpyW( This->containerApp, szContainerApp ); + lstrcpyW( This->containerApp, szContainerApp ); } if (szContainerObj) { if ((This->containerObj = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) ))) - strcpyW( This->containerObj, szContainerObj ); + lstrcpyW( This->containerObj, szContainerObj ); } return S_OK; } diff --git a/dll/win32/ole32/errorinfo.c b/dll/win32/ole32/errorinfo.c index d5ec17207af..6aa3a336b8d 100644 --- a/dll/win32/ole32/errorinfo.c +++ b/dll/win32/ole32/errorinfo.c @@ -34,7 +34,6 @@ #include "oleauto.h" #include "winerror.h" -#include "wine/unicode.h" #include "compobj_private.h" #include "wine/debug.h" @@ -48,7 +47,7 @@ static inline WCHAR *heap_strdupW(const WCHAR *str) if(str) { size_t size; - size = (strlenW(str)+1)*sizeof(WCHAR); + size = (lstrlenW(str)+1)*sizeof(WCHAR); ret = heap_alloc(size); if(ret) memcpy(ret, str, size); diff --git a/dll/win32/ole32/filelockbytes.c b/dll/win32/ole32/filelockbytes.c index c5cb45f77fc..e9699c01650 100644 --- a/dll/win32/ole32/filelockbytes.c +++ b/dll/win32/ole32/filelockbytes.c @@ -41,7 +41,6 @@ #include "storage32.h" #include "wine/debug.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(storage); @@ -117,7 +116,7 @@ HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsN HeapFree(GetProcessHeap(), 0, This); return E_OUTOFMEMORY; } - strcpyW(This->pwcsName, fullpath); + lstrcpyW(This->pwcsName, fullpath); } else This->pwcsName = NULL; @@ -376,7 +375,7 @@ static HRESULT WINAPI FileLockBytesImpl_Stat(ILockBytes* iface, pstatstg->pwcsName = CoTaskMemAlloc((lstrlenW(This->pwcsName)+1)*sizeof(WCHAR)); - strcpyW(pstatstg->pwcsName, This->pwcsName); + lstrcpyW(pstatstg->pwcsName, This->pwcsName); } else pstatstg->pwcsName = NULL; diff --git a/dll/win32/ole32/filemoniker.c b/dll/win32/ole32/filemoniker.c index 271e5bb8a8b..1e945f9a5f5 100644 --- a/dll/win32/ole32/filemoniker.c +++ b/dll/win32/ole32/filemoniker.c @@ -30,7 +30,6 @@ #include "winbase.h" #include "winerror.h" #include "winnls.h" -#include "wine/unicode.h" #include "wine/debug.h" #include "objbase.h" #include "moniker.h" @@ -693,14 +692,14 @@ FileMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight, lastIdx1=FileMonikerImpl_DecomposePath(str1,&strDec1)-1; lastIdx2=FileMonikerImpl_DecomposePath(str2,&strDec2)-1; - if ((lastIdx1==-1 && lastIdx2>-1)||(lastIdx1==1 && lstrcmpW(strDec1[0],twoPoint)==0)) + if ((lastIdx1==-1 && lastIdx2>-1)||(lastIdx1==1 && wcscmp(strDec1[0],twoPoint)==0)) res = MK_E_SYNTAX; else{ - if(lstrcmpW(strDec1[lastIdx1],bkSlash)==0) + if(wcscmp(strDec1[lastIdx1],bkSlash)==0) lastIdx1--; /* for each "..\" in the left of str2 remove the right element from str1 */ - for(i=0; ( (lastIdx1>=0) && (strDec2[i]!=NULL) && (lstrcmpW(strDec2[i],twoPoint)==0) ); i+=2){ + for(i=0; ( (lastIdx1>=0) && (strDec2[i]!=NULL) && (wcscmp(strDec2[i],twoPoint)==0) ); i+=2){ lastIdx1-=2; } @@ -711,13 +710,13 @@ FileMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight, if (newStr){ /* new path is the concatenation of the rest of str1 and str2 */ for(*newStr=0,j=0;j<=lastIdx1;j++) - strcatW(newStr,strDec1[j]); + lstrcatW(newStr,strDec1[j]); - if ((strDec2[i]==NULL && lastIdx1>-1 && lastIdx2>-1) || lstrcmpW(strDec2[i],bkSlash)!=0) - strcatW(newStr,bkSlash); + if ((strDec2[i]==NULL && lastIdx1>-1 && lastIdx2>-1) || wcscmp(strDec2[i],bkSlash)!=0) + lstrcatW(newStr,bkSlash); for(j=i;j<=lastIdx2;j++) - strcatW(newStr,strDec2[j]); + lstrcatW(newStr,strDec2[j]); /* create a new moniker with the new string */ res=CreateFileMoniker(newStr,ppmkComposite); @@ -1003,7 +1002,7 @@ FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** p else { for (i = 0; i < sameIdx; i++) - strcatW(commonPath,stringTable1[i]); + lstrcatW(commonPath,stringTable1[i]); ret = CreateFileMoniker(commonPath, ppmkPrefix); } @@ -1057,7 +1056,7 @@ int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable) goto lend; } - strcpyW(strgtable[tabIndex++],bSlash); + lstrcpyW(strgtable[tabIndex++],bSlash); i++; @@ -1077,7 +1076,7 @@ int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable) goto lend; } - strcpyW(strgtable[tabIndex++],word); + lstrcpyW(strgtable[tabIndex++],word); } } strgtable[tabIndex]=NULL; @@ -1157,11 +1156,11 @@ FileMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppm if (len2>0 && !(len1==1 && len2==1 && sameIdx==0)) for(j=sameIdx;(tabStr1[j] != NULL); j++) if (*tabStr1[j]!='\\') - strcatW(relPath,back); + lstrcatW(relPath,back); /* add items of the second path (similar items with the first path are not included) to the relativePath */ for(j=sameIdx;tabStr2[j]!=NULL;j++) - strcatW(relPath,tabStr2[j]); + lstrcatW(relPath,tabStr2[j]); res=CreateFileMoniker(relPath,ppmkRelPath); @@ -1199,7 +1198,7 @@ FileMonikerImpl_GetDisplayName(IMoniker* iface, IBindCtx* pbc, if (*ppszDisplayName==NULL) return E_OUTOFMEMORY; - strcpyW(*ppszDisplayName,This->filePathName); + lstrcpyW(*ppszDisplayName,This->filePathName); TRACE("-- %s\n", debugstr_w(*ppszDisplayName)); @@ -1281,7 +1280,7 @@ FileMonikerROTDataImpl_GetComparisonData(IROTData* iface, BYTE* pbData, ULONG cbMax, ULONG* pcbData) { FileMonikerImpl *This = impl_from_IROTData(iface); - int len = strlenW(This->filePathName)+1; + int len = lstrlenW(This->filePathName)+1; int i; LPWSTR pszFileName; @@ -1294,7 +1293,7 @@ FileMonikerROTDataImpl_GetComparisonData(IROTData* iface, BYTE* pbData, memcpy(pbData, &CLSID_FileMoniker, sizeof(CLSID)); pszFileName = (LPWSTR)(pbData+sizeof(CLSID)); for (i = 0; i < len; i++) - pszFileName[i] = toupperW(This->filePathName[i]); + pszFileName[i] = towupper(This->filePathName[i]); return S_OK; } @@ -1364,25 +1363,25 @@ static HRESULT FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa if (This->filePathName==NULL) return E_OUTOFMEMORY; - strcpyW(This->filePathName,lpszPathName); + lstrcpyW(This->filePathName,lpszPathName); nb=FileMonikerImpl_DecomposePath(This->filePathName,&tabStr); if (nb > 0 ){ addBkSlash = TRUE; - if (lstrcmpW(tabStr[0],twoPoint)!=0) + if (wcscmp(tabStr[0],twoPoint)!=0) addBkSlash = FALSE; else for(i=0;i<nb;i++){ - if ( (lstrcmpW(tabStr[i],twoPoint)!=0) && (lstrcmpW(tabStr[i],bkSlash)!=0) ){ + if ( (wcscmp(tabStr[i],twoPoint)!=0) && (wcscmp(tabStr[i],bkSlash)!=0) ){ addBkSlash = FALSE; break; } else - if (lstrcmpW(tabStr[i],bkSlash)==0 && i<nb-1 && lstrcmpW(tabStr[i+1],bkSlash)==0){ + if (wcscmp(tabStr[i],bkSlash)==0 && i<nb-1 && wcscmp(tabStr[i+1],bkSlash)==0){ *tabStr[i]=0; sizeStr--; addBkSlash = FALSE; @@ -1390,7 +1389,7 @@ static HRESULT FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa } } - if (lstrcmpW(tabStr[nb-1],bkSlash)==0) + if (wcscmp(tabStr[nb-1],bkSlash)==0) addBkSlash = FALSE; This->filePathName=HeapReAlloc(GetProcessHeap(),0,This->filePathName,(sizeStr+1)*sizeof(WCHAR)); @@ -1398,10 +1397,10 @@ static HRESULT FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa *This->filePathName=0; for(i=0;tabStr[i]!=NULL;i++) - strcatW(This->filePathName,tabStr[i]); + lstrcatW(This->filePathName,tabStr[i]); if (addBkSlash) - strcatW(This->filePathName,bkSlash); + lstrcatW(This->filePathName,bkSlash); } free_stringtable(tabStr); @@ -1446,7 +1445,7 @@ HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, IMoniker **ppmk) static inline WCHAR *memrpbrkW(const WCHAR *ptr, size_t n, const WCHAR *accept) { const WCHAR *end, *ret = NULL; - for (end = ptr + n; ptr < end; ptr++) if (strchrW(accept, *ptr)) ret = ptr; + for (end = ptr + n; ptr < end; ptr++) if (wcschr(accept, *ptr)) ret = ptr; return (WCHAR *)ret; } @@ -1456,7 +1455,7 @@ HRESULT FileMoniker_CreateFromDisplayName(LPBC pbc, LPCOLESTR szDisplayName, LPCWSTR end; static const WCHAR wszSeparators[] = {':','\\','/','!',0}; - for (end = szDisplayName + strlenW(szDisplayName); + for (end = szDisplayName + lstrlenW(szDisplayName); end && (end != szDisplayName); end = memrpbrkW(szDisplayName, end - szDisplayName, wszSeparators)) { diff --git a/dll/win32/ole32/ftmarshal.c b/dll/win32/ole32/ftmarshal.c index c36f5f61697..851810df42a 100644 --- a/dll/win32/ole32/ftmarshal.c +++ b/dll/win32/ole32/ftmarshal.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <stdlib.h> #include <stdarg.h> #include <stdio.h> diff --git a/dll/win32/ole32/hglobalstream.c b/dll/win32/ole32/hglobalstream.c index 2c08710b054..c9ec529d52f 100644 --- a/dll/win32/ole32/hglobalstream.c +++ b/dll/win32/ole32/hglobalstream.c @@ -22,8 +22,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <assert.h> #include <stdlib.h> #include <stdarg.h> diff --git a/dll/win32/ole32/ifs.c b/dll/win32/ole32/ifs.c index c9e5625e910..ea03e9b0a28 100644 --- a/dll/win32/ole32/ifs.c +++ b/dll/win32/ole32/ifs.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <ctype.h> #include <stdarg.h> #include <stdlib.h> diff --git a/dll/win32/ole32/itemmoniker.c b/dll/win32/ole32/itemmoniker.c index 14beadadee4..3bf12013629 100644 --- a/dll/win32/ole32/itemmoniker.c +++ b/dll/win32/ole32/itemmoniker.c @@ -32,7 +32,6 @@ #include "winnls.h" #include "wine/debug.h" #include "ole2.h" -#include "wine/unicode.h" #include "moniker.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -487,7 +486,7 @@ static HRESULT WINAPI ItemMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOther if(SUCCEEDED ((res = CreateBindCtx(0,&bind)))) { if(SUCCEEDED (IMoniker_GetDisplayName(iface,bind,NULL,&dispName1))) { if(SUCCEEDED (IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&dispName2))) { - if(lstrcmpW(dispName1,dispName2)==0) res = S_OK; + if(wcscmp(dispName1,dispName2)==0) res = S_OK; CoTaskMemFree(dispName2); } CoTaskMemFree(dispName1); @@ -514,7 +513,7 @@ static HRESULT WINAPI ItemMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash) len = lstrlenW(val); for (i = len ; i > 0; i--) - h = (h * 3) ^ toupperW(val[off++]); + h = (h * 3) ^ towupper(val[off++]); *pdwHash=h; @@ -813,7 +812,7 @@ static HRESULT WINAPI ItemMonikerROTDataImpl_GetComparisonData(IROTData* iface, ULONG* pcbData) { ItemMonikerImpl *This = impl_from_IROTData(iface); - int len = (strlenW(This->itemName)+1); + int len = (lstrlenW(This->itemName)+1); int i; LPWSTR pszItemName; LPWSTR pszItemDelimiter; @@ -832,7 +831,7 @@ static HRESULT WINAPI ItemMonikerROTDataImpl_GetComparisonData(IROTData* iface, /* write name */ pszItemName = pszItemDelimiter + 1; for (i = 0; i < len; i++) - pszItemName[i] = toupperW(This->itemName[i]); + pszItemName[i] = towupper(This->itemName[i]); return S_OK; } diff --git a/dll/win32/ole32/marshal.c b/dll/win32/ole32/marshal.c index b12082cc9fe..4b8945db6f9 100644 --- a/dll/win32/ole32/marshal.c +++ b/dll/win32/ole32/marshal.c @@ -32,7 +32,6 @@ #include "objbase.h" #include "ole2.h" #include "winerror.h" -#include "wine/unicode.h" #include "compobj_private.h" diff --git a/dll/win32/ole32/memlockbytes.c b/dll/win32/ole32/memlockbytes.c index b2fc5b4f4db..2d7d4572584 100644 --- a/dll/win32/ole32/memlockbytes.c +++ b/dll/win32/ole32/memlockbytes.c @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <assert.h> #include <stdarg.h> #include <string.h> diff --git a/dll/win32/ole32/moniker.c b/dll/win32/ole32/moniker.c index c1312d1e1e3..23ce0326d66 100644 --- a/dll/win32/ole32/moniker.c +++ b/dll/win32/ole32/moniker.c @@ -21,9 +21,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include <stdarg.h> #include <string.h> @@ -39,7 +36,6 @@ #include "wine/list.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "wine/exception.h" #include "compobj_private.h" @@ -282,7 +278,7 @@ static HRESULT get_moniker_comparison_data(IMoniker *pMoniker, MonikerComparison return hr; } - len = strlenW(pszDisplayName); + len = lstrlenW(pszDisplayName); *moniker_data = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(MonikerComparisonData, abData[sizeof(CLSID) + (len+1)*sizeof(WCHAR)])); if (!*moniker_data) @@ -1152,7 +1148,7 @@ HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szDisplayName, *pchEaten = 0; *ppmk = NULL; - if (!strncmpiW(szDisplayName, wszClsidColon, ARRAY_SIZE(wszClsidColon))) + if (!_wcsnicmp(szDisplayName, wszClsidColon, ARRAY_SIZE(wszClsidColon))) { hr = ClassMoniker_CreateFromDisplayName(pbc, szDisplayName, &chEaten, &moniker); if (FAILED(hr) && (hr != MK_E_SYNTAX)) @@ -1269,7 +1265,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid) absFile=pathDec[nbElm-1]; /* failed if the path represents a directory and not an absolute file name*/ - if (!lstrcmpW(absFile, bkslashW)) { + if (!wcscmp(absFile, bkslashW)) { CoTaskMemFree(pathDec); return MK_E_INVALIDEXTENSION; } @@ -1280,7 +1276,7 @@ HRESULT WINAPI GetClassFile(LPCOLESTR filePathName,CLSID *pclsid) for(i = length-1; (i >= 0) && *(extension = &absFile[i]) != '.'; i--) /* nothing */; - if (!extension || !lstrcmpW(extension, dotW)) { + if (!extension || !wcscmp(extension, dotW)) { CoTaskMemFree(pathDec); return MK_E_INVALIDEXTENSION; } diff --git a/dll/win32/ole32/ole2.c b/dll/win32/ole32/ole2.c index f1459829951..0ab5f37df5d 100644 --- a/dll/win32/ole32/ole2.c +++ b/dll/win32/ole32/ole2.c @@ -23,8 +23,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <assert.h> #include <stdlib.h> #include <stdarg.h> @@ -44,7 +42,6 @@ #include "ole2.h" #include "ole2ver.h" -#include "wine/unicode.h" #include "compobj_private.h" #include "olestd.h" #include "wine/list.h" @@ -706,7 +703,7 @@ HRESULT WINAPI OleRegGetUserType(REFCLSID clsid, DWORD form, LPOLESTR *usertype) { HKEY auxkey; - sprintfW(auxkeynameW, auxusertypeW, form); + swprintf(auxkeynameW, auxusertypeW, form); if (COM_OpenKeyForCLSID(clsid, auxkeynameW, KEY_READ, &auxkey) == S_OK) { if (!RegQueryValueExW(auxkey, emptyW, NULL, &valuetype, NULL, &valuelen) && valuelen) @@ -895,7 +892,7 @@ HRESULT WINAPI OleRegGetMiscStatus( /* * Open the key specific to the requested aspect. */ - sprintfW(keyName, dfmtW, dwAspect); + swprintf(keyName, dfmtW, dwAspect); result = open_classes_key(miscStatusKey, keyName, KEY_READ, &aspectKey); if (result == ERROR_SUCCESS) @@ -1014,7 +1011,7 @@ static HRESULT WINAPI EnumOLEVERB_Next( } TRACE("verb string: %s\n", debugstr_w(pwszOLEVERB)); - pwszMenuFlags = strchrW(pwszOLEVERB, ','); + pwszMenuFlags = wcschr(pwszOLEVERB, ','); if (!pwszMenuFlags) { hr = OLEOBJ_E_INVALIDVERB; @@ -1024,7 +1021,7 @@ static HRESULT WINAPI EnumOLEVERB_Next( /* nul terminate the name string and advance to first character */ *pwszMenuFlags = '\0'; pwszMenuFlags++; - pwszAttribs = strchrW(pwszMenuFlags, ','); + pwszAttribs = wcschr(pwszMenuFlags, ','); if (!pwszAttribs) { hr = OLEOBJ_E_INVALIDVERB; @@ -1036,10 +1033,10 @@ static HRESULT WINAPI EnumOLEVERB_Next( pwszAttribs++; /* fill out structure for this verb */ - rgelt->lVerb = atolW(wszSubKey); + rgelt->lVerb = wcstol(wszSubKey, NULL, 10); rgelt->lpszVerbName = pwszOLEVERB; /* user should free */ - rgelt->fuFlags = atolW(pwszMenuFlags); - rgelt->grfAttribs = atolW(pwszAttribs); + rgelt->fuFlags = wcstol(pwszMenuFlags, NULL, 10); + rgelt->grfAttribs = wcstol(pwszAttribs, NULL, 10); if (pceltFetched) (*pceltFetched)++; @@ -2552,7 +2549,7 @@ static void OLEUTL_ReadRegistryDWORDValue( case REG_EXPAND_SZ: case REG_MULTI_SZ: case REG_SZ: - *pdwValue = (DWORD)strtoulW(buffer, NULL, 10); + *pdwValue = wcstoul(buffer, NULL, 10); break; } } @@ -2744,7 +2741,7 @@ HRESULT WINAPI OleSetAutoConvert(REFCLSID clsidOld, REFCLSID clsidNew) if (FAILED(res)) goto done; StringFromGUID2(clsidNew, szClsidNew, CHARS_IN_GUID); - if (RegSetValueW(hkey, wszAutoConvertTo, REG_SZ, szClsidNew, (strlenW(szClsidNew)+1) * sizeof(WCHAR))) + if (RegSetValueW(hkey, wszAutoConvertTo, REG_SZ, szClsidNew, (lstrlenW(szClsidNew)+1) * sizeof(WCHAR))) { res = REGDB_E_WRITEREGDB; goto done; @@ -2940,6 +2937,25 @@ static inline HRESULT PROPVARIANT_ValidateType(VARTYPE vt) case VT_FILETIME|VT_VECTOR: case VT_CF|VT_VECTOR: case VT_CLSID|VT_VECTOR: + case VT_ARRAY|VT_I1: + case VT_ARRAY|VT_UI1: + case VT_ARRAY|VT_I2: + case VT_ARRAY|VT_UI2: + case VT_ARRAY|VT_I4: + case VT_ARRAY|VT_UI4: + case VT_ARRAY|VT_INT: + case VT_ARRAY|VT_UINT: + case VT_ARRAY|VT_R4: + case VT_ARRAY|VT_R8: + case VT_ARRAY|VT_CY: + case VT_ARRAY|VT_DATE: + case VT_ARRAY|VT_BSTR: + case VT_ARRAY|VT_BOOL: + case VT_ARRAY|VT_DECIMAL: + case VT_ARRAY|VT_DISPATCH: + case VT_ARRAY|VT_UNKNOWN: + case VT_ARRAY|VT_ERROR: + case VT_ARRAY|VT_VARIANT: return S_OK; } WARN("Bad type %d\n", vt); @@ -3051,6 +3067,8 @@ HRESULT WINAPI PropVariantClear(PROPVARIANT * pvar) /* [in/out] */ CoTaskMemFree(pvar->u.capropvar.pElems); } } + else if (pvar->vt & VT_ARRAY) + hr = SafeArrayDestroy(pvar->u.parray); else { WARN("Invalid/unsupported type %d\n", pvar->vt); @@ -3231,6 +3249,11 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */ else CopyMemory(pvarDest->u.capropvar.pElems, pvarSrc->u.capropvar.pElems, len * elemSize); } + else if (pvarSrc->vt & VT_ARRAY) + { + pvarDest->u.uhVal.QuadPart = 0; + return SafeArrayCopy(pvarSrc->u.parray, &pvarDest->u.parray); + } else WARN("Invalid/unsupported type %d\n", pvarSrc->vt); } diff --git a/dll/win32/ole32/ole2stubs.c b/dll/win32/ole32/ole2stubs.c index d7fd58c5264..49130c51584 100644 --- a/dll/win32/ole32/ole2stubs.c +++ b/dll/win32/ole32/ole2stubs.c @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <stdarg.h> #include "windef.h" diff --git a/dll/win32/ole32/ole32.spec b/dll/win32/ole32/ole32.spec index 97667918e9e..b56b01d84c6 100644 --- a/dll/win32/ole32/ole32.spec +++ b/dll/win32/ole32/ole32.spec @@ -22,11 +22,11 @@ @ stdcall CoCreateInstanceEx(ptr ptr long ptr long ptr) # CoCreateObjectInContext # CoDeactivateObject -@ stdcall -stub CoDisableCallCancellation(ptr) +@ stdcall CoDisableCallCancellation(ptr) @ stdcall -stub -version=0x600+ CoDisconnectContext(long) @ stdcall CoDisconnectObject(ptr long) @ stdcall CoDosDateTimeToFileTime(long long ptr) kernel32.DosDateTimeToFileTime -@ stdcall -stub CoEnableCallCancellation(ptr) +@ stdcall CoEnableCallCancellation(ptr) @ stdcall CoFileTimeNow(ptr) @ stdcall CoFileTimeToDosDateTime(ptr ptr ptr) kernel32.FileTimeToDosDateTime @ stdcall CoFreeAllLibraries() diff --git a/dll/win32/ole32/ole32_main.c b/dll/win32/ole32/ole32_main.c index 7c12f1ce33a..c38c525d5a6 100644 --- a/dll/win32/ole32/ole32_main.c +++ b/dll/win32/ole32/ole32_main.c @@ -18,9 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include <stdarg.h> #include <stdio.h> diff --git a/dll/win32/ole32/oleobj.c b/dll/win32/ole32/oleobj.c index 44e15e551f5..13a873655f5 100644 --- a/dll/win32/ole32/oleobj.c +++ b/dll/win32/ole32/oleobj.c @@ -41,11 +41,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); static void release_statdata(STATDATA *data) { - if(data->formatetc.ptd) - { - CoTaskMemFree(data->formatetc.ptd); - data->formatetc.ptd = NULL; - } + CoTaskMemFree(data->formatetc.ptd); + data->formatetc.ptd = NULL; if(data->pAdvSink) { diff --git a/dll/win32/ole32/oleproxy.c b/dll/win32/ole32/oleproxy.c index a7b8e395104..b5c08ff1c5b 100644 --- a/dll/win32/ole32/oleproxy.c +++ b/dll/win32/ole32/oleproxy.c @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include <stdlib.h> #include <stdarg.h> #include <stdio.h> diff --git a/dll/win32/ole32/precomp.h b/dll/win32/ole32/precomp.h index c9ea8458419..634e3238ae8 100644 --- a/dll/win32/ole32/precomp.h +++ b/dll/win32/ole32/precomp.h @@ -2,8 +2,6 @@ #ifndef _OLE32_PCH_ #define _OLE32_PCH_ -#include <wine/config.h> - #include <assert.h> #include <stdarg.h> #include <stdio.h> @@ -30,7 +28,6 @@ #include <wine/debug.h> #include <wine/list.h> -#include <wine/unicode.h> #include "compobj_private.h" #include "dictionary.h" diff --git a/dll/win32/ole32/rpc.c b/dll/win32/ole32/rpc.c index bd4611d7d5f..895aa4010cd 100644 --- a/dll/win32/ole32/rpc.c +++ b/dll/win32/ole32/rpc.c @@ -20,9 +20,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include <stdarg.h> #include <string.h> @@ -39,7 +36,6 @@ #include "winerror.h" #include "winreg.h" #include "servprov.h" -#include "wine/unicode.h" #include "compobj_private.h" @@ -1684,7 +1680,7 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process) /* EXE servers are started with the -Embedding switch. */ - strcatW(command, embedding); + lstrcatW(command, embedding); TRACE("activating local server %s for %s\n", debugstr_w(command), debugstr_guid(rclsid)); @@ -1800,7 +1796,7 @@ static HRESULT create_local_service(REFCLSID rclsid) static void get_localserver_pipe_name(WCHAR *pipefn, REFCLSID rclsid) { static const WCHAR wszPipeRef[] = {'\\','\\','.','\\','p','i','p','e','\\',0}; - strcpyW(pipefn, wszPipeRef); + lstrcpyW(pipefn, wszPipeRef); StringFromGUID2(rclsid, pipefn + ARRAY_SIZE(wszPipeRef) - 1, CHARS_IN_GUID); } diff --git a/dll/win32/ole32/stg_prop.c b/dll/win32/ole32/stg_prop.c index 4b968d6e9cc..d2e66a15c1e 100644 --- a/dll/win32/ole32/stg_prop.c +++ b/dll/win32/ole32/stg_prop.c @@ -36,9 +36,6 @@ * PropertyStorage_ReadFromStream */ -#include "config.h" -#include "wine/port.h" - #include <assert.h> #include <stdarg.h> #include <stdio.h> @@ -52,7 +49,7 @@ #include "winbase.h" #include "winnls.h" #include "winuser.h" -#include "wine/unicode.h" +#include "wine/asm.h" #include "wine/debug.h" #include "dictionary.h" #include "storage32.h" @@ -61,10 +58,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(storage); -#ifdef _MSC_VER -#define __ASM_STDCALL_FUNC(name,args,code) -#endif - static inline StorageImpl *impl_from_IPropertySetStorage( IPropertySetStorage *iface ) { return CONTAINING_RECORD(iface, StorageImpl, base.IPropertySetStorage_iface); @@ -375,7 +368,7 @@ static HRESULT PropertyStorage_StringCopy(LPCSTR src, LCID srcCP, LPSTR *dst, size_t len; if (dstCP == CP_UNICODE) - len = (strlenW((LPCWSTR)src) + 1) * sizeof(WCHAR); + len = (lstrlenW((LPCWSTR)src) + 1) * sizeof(WCHAR); else len = strlen(src) + 1; *dst = CoTaskMemAlloc(len * sizeof(WCHAR)); @@ -943,7 +936,7 @@ static int PropertyStorage_PropNameCompare(const void *a, const void *b, { TRACE("(%s, %s)\n", debugstr_w(a), debugstr_w(b)); if (This->grfFlags & PROPSETFLAG_CASE_SENSITIVE) - return lstrcmpW(a, b); + return wcscmp(a, b); else return lstrcmpiW(a, b); } @@ -2513,7 +2506,7 @@ static void prop_enum_copy_cb(IUnknown *parent, void *orig, void *dest) if (dictionary_find(storage->propid_to_name, UlongToPtr(src_prop->propid), (void**)&name)) { - DWORD size = (strlenW(name) + 1) * sizeof(WCHAR); + DWORD size = (lstrlenW(name) + 1) * sizeof(WCHAR); dest_prop->lpwstrName = CoTaskMemAlloc(size); if (!dest_prop->lpwstrName) return; diff --git a/dll/win32/ole32/storage32.c b/dll/win32/ole32/storage32.c index a8bbd407dd7..fa3872dad07 100644 --- a/dll/win32/ole32/storage32.c +++ b/dll/win32/ole32/storage32.c @@ -43,7 +43,6 @@ #include "winbase.h" #include "winnls.h" #include "winuser.h" -#include "wine/unicode.h" #include "wine/debug.h" #include "storage32.h" @@ -519,7 +518,7 @@ static LONG entryNameCmp( /* * We compare the string themselves only when they are of the same length */ - diff = toupperW(*name1++) - toupperW(*name2++); + diff = towupper(*name1++) - towupper(*name2++); } return diff; @@ -1347,7 +1346,7 @@ static HRESULT StorageBaseImpl_CopyChildEntryTo(StorageBaseImpl *This, while ( *snb != NULL && !skip ) { - if ( lstrcmpW(data.name, *snb) == 0 ) + if ( wcscmp(data.name, *snb) == 0 ) skip = TRUE; ++snb; } @@ -1891,7 +1890,7 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement( currentEntryRef); /* Change the name of the element */ - strcpyW(currentEntry.name, pwcsNewName); + lstrcpyW(currentEntry.name, pwcsNewName); /* Delete any sibling links */ currentEntry.leftChild = DIRENTRY_NULL; @@ -2013,7 +2012,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream( if (newStreamEntry.sizeOfNameString > DIRENTRY_NAME_BUFFER_LEN) return STG_E_INVALIDNAME; - strcpyW(newStreamEntry.name, pwcsName); + lstrcpyW(newStreamEntry.name, pwcsName); newStreamEntry.stgType = STGTY_STREAM; newStreamEntry.startingBlock = BLOCK_END_OF_CHAIN; @@ -2209,7 +2208,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage( return STG_E_INVALIDNAME; } - strcpyW(newEntry.name, pwcsName); + lstrcpyW(newEntry.name, pwcsName); newEntry.stgType = STGTY_STORAGE; newEntry.startingBlock = BLOCK_END_OF_CHAIN; @@ -2357,7 +2356,7 @@ static HRESULT WINAPI StorageBaseImpl_CopyTo( while ( *snb != NULL && fail ) { - if ( lstrcmpW(data.name, *snb) == 0 ) + if ( wcscmp(data.name, *snb) == 0 ) fail = FALSE; ++snb; } @@ -4768,7 +4767,7 @@ static HRESULT StorageImpl_Refresh(StorageImpl *This, BOOL new_object, BOOL crea * Initialize the directory table */ memset(&rootEntry, 0, sizeof(rootEntry)); - strcpyW(rootEntry.name, rootentryW); + lstrcpyW(rootEntry.name, rootentryW); rootEntry.sizeOfNameString = sizeof(rootentryW); rootEntry.stgType = STGTY_ROOT; rootEntry.leftChild = DIRENTRY_NULL; @@ -7040,7 +7039,7 @@ void StorageUtl_CopyDirEntryToSTATSTG( destination->pwcsName = CoTaskMemAlloc((lstrlenW(source->name)+1)*sizeof(WCHAR)); - strcpyW(destination->pwcsName, source->name); + lstrcpyW(destination->pwcsName, source->name); } switch (source->stgType) diff --git a/dll/win32/ole32/usrmarshal.c b/dll/win32/ole32/usrmarshal.c index 9f19b66d635..ba318c66b62 100644 --- a/dll/win32/ole32/usrmarshal.c +++ b/dll/win32/ole32/usrmarshal.c @@ -35,7 +35,6 @@ #include "oleauto.h" #include "rpcproxy.h" -#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -1716,7 +1715,7 @@ ULONG __RPC_USER STGMEDIUM_UserSize(ULONG *pFlags, ULONG StartingSize, STGMEDIUM { TRACE("file name is %s\n", debugstr_w(pStgMedium->u.lpszFileName)); size += 3 * sizeof(DWORD) + - (strlenW(pStgMedium->u.lpszFileName) + 1) * sizeof(WCHAR); + (lstrlenW(pStgMedium->u.lpszFileName) + 1) * sizeof(WCHAR); } break; case TYMED_ISTREAM: @@ -1814,7 +1813,7 @@ unsigned char * __RPC_USER STGMEDIUM_UserMarshal(ULONG *pFlags, unsigned char *p if (pStgMedium->u.lpszFileName) { DWORD len; - len = strlenW(pStgMedium->u.lpszFileName); + len = lstrlenW(pStgMedium->u.lpszFileName); /* conformance */ *(DWORD *)pBuffer = len + 1; pBuffer += sizeof(DWORD); @@ -2126,7 +2125,7 @@ ULONG __RPC_USER SNB_UserSize(ULONG *pFlags, ULONG StartingSize, SNB *pSnb) while (*ptrW) { - size += (strlenW(*ptrW) + 1)*sizeof(WCHAR); + size += (lstrlenW(*ptrW) + 1)*sizeof(WCHAR); ptrW++; } } @@ -2161,7 +2160,7 @@ unsigned char * __RPC_USER SNB_UserMarshal(ULONG *pFlags, unsigned char *pBuffer while (*ptrW) { - ULONG len = strlenW(*ptrW) + 1; + ULONG len = lstrlenW(*ptrW) + 1; wire->strcnt++; wire->charcnt += len; @@ -2202,7 +2201,7 @@ unsigned char * __RPC_USER SNB_UserUnmarshal(ULONG *pFlags, unsigned char *pBuff for (i = 0; i < wire->strcnt; i++) { - ULONG len = strlenW(src); + ULONG len = lstrlenW(src); memcpy(dest, src, (len + 1)*sizeof(WCHAR)); *ptrW = dest; src += len + 1; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 352ad732cf6..2376a96c5ae 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -140,7 +140,7 @@ dll/win32/ntdsapi # Synced to WineStaging-4.18 dll/win32/objsel # Synced to WineStaging-4.18 dll/win32/odbc32 # Synced to WineStaging-4.18. Depends on port of Linux ODBC. dll/win32/odbccp32 # Synced to WineStaging-4.18 -dll/win32/ole32 # Synced to WineStaging-4.0 +dll/win32/ole32 # Synced to WineStaging-4.18 dll/win32/oleacc # Synced to WineStaging-4.0 dll/win32/oleaut32 # Synced to WineStaging-4.0 dll/win32/olecli32 # Synced to WineStaging-3.3
5 years, 1 month
1
0
0
0
[reactos] 01/01: [ODBCCP32_WINETEST] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6816ff8dbd3a3af612be1…
commit 6816ff8dbd3a3af612be1e115880567e8af8d71c Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:10:31 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:10:31 2019 +0100 [ODBCCP32_WINETEST] Sync with Wine Staging 4.18. CORE-16441 --- modules/rostests/winetests/odbccp32/misc.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/modules/rostests/winetests/odbccp32/misc.c b/modules/rostests/winetests/odbccp32/misc.c index dc65bdf3f9a..dc2ca7ed3f4 100644 --- a/modules/rostests/winetests/odbccp32/misc.c +++ b/modules/rostests/winetests/odbccp32/misc.c @@ -741,6 +741,31 @@ static void test_SQLValidDSNW(void) ok(ret, "got %d\n", ret); } +static void test_SQLConfigDataSource(void) +{ + BOOL ret; + + ret = SQLConfigDataSource(0, ODBC_ADD_DSN, "SQL Server", "DSN=WINEMQIS\0Database=MQIS\0\0"); + ok(ret, "got %d\n", ret); + + ret = SQLConfigDataSource(0, ODBC_REMOVE_DSN, "SQL Server", "DSN=WINEMQIS\0\0"); + ok(ret, "got %d\n", ret); + + ret = SQLConfigDataSource(0, ODBC_REMOVE_DSN, "SQL Server", "DSN=WINEMQIS\0\0"); + if(!ret) + { + RETCODE ret; + DWORD err; + ret = SQLInstallerError(1, &err, NULL, 0, NULL); + ok(ret == SQL_SUCCESS_WITH_INFO, "got %d\n", ret); + todo_wine ok(err == ODBC_ERROR_INVALID_DSN, "got %u\n", err); + } + + ret = SQLConfigDataSource(0, ODBC_ADD_DSN, "ODBC driver", "DSN=ODBC data source\0\0"); + todo_wine ok(!ret, "got %d\n", ret); + todo_wine check_error(ODBC_ERROR_COMPONENT_NOT_FOUND); +} + START_TEST(misc) { test_SQLConfigMode(); @@ -754,4 +779,5 @@ START_TEST(misc) test_SQLGetInstalledDrivers(); test_SQLValidDSN(); test_SQLValidDSNW(); + test_SQLConfigDataSource(); }
5 years, 1 month
1
0
0
0
[reactos] 01/01: [ODBCCP32] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=64106410255d4c0a00b3b…
commit 64106410255d4c0a00b3bae90a01d47f92d19573 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:10:08 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:10:08 2019 +0100 [ODBCCP32] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/odbccp32/odbccp32.c | 13 ++++++------- media/doc/README.WINE | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dll/win32/odbccp32/odbccp32.c b/dll/win32/odbccp32/odbccp32.c index ae2fe9c35cf..5debf2d2307 100644 --- a/dll/win32/odbccp32/odbccp32.c +++ b/dll/win32/odbccp32/odbccp32.c @@ -30,7 +30,6 @@ #include "winreg.h" #include "winnls.h" #include "sqlext.h" -#include "wine/unicode.h" #ifdef __REACTOS__ #undef TRACE_ON #endif @@ -292,7 +291,7 @@ static HMODULE load_config_driver(const WCHAR *driver) if(ret != ERROR_SUCCESS) { HeapFree(GetProcessHeap(), 0, filename); - push_error(ODBC_ERROR_INVALID_DSN, odbc_error_invalid_dsn); + push_error(ODBC_ERROR_COMPONENT_NOT_FOUND, odbc_error_component_not_found); return NULL; } @@ -320,7 +319,7 @@ static BOOL write_config_value(const WCHAR *driver, const WCHAR *args) { WCHAR *divider, *value; - name = heap_alloc( (strlenW(args) + 1) * sizeof(WCHAR)); + name = heap_alloc( (lstrlenW(args) + 1) * sizeof(WCHAR)); if(!name) { push_error(ODBC_ERROR_OUT_OF_MEM, odbc_error_out_of_mem); @@ -328,7 +327,7 @@ static BOOL write_config_value(const WCHAR *driver, const WCHAR *args) } lstrcpyW(name, args); - divider = strchrW(name,'='); + divider = wcschr(name,'='); if(!divider) { push_error(ODBC_ERROR_INVALID_KEYWORD_VALUE, odbc_error_invalid_keyword); @@ -340,7 +339,7 @@ static BOOL write_config_value(const WCHAR *driver, const WCHAR *args) TRACE("Write pair: %s = %s\n", debugstr_w(name), debugstr_w(value)); if(RegSetValueExW(hkeydriver, name, 0, REG_SZ, (BYTE*)value, - (strlenW(value)+1) * sizeof(WCHAR)) != ERROR_SUCCESS) + (lstrlenW(value)+1) * sizeof(WCHAR)) != ERROR_SUCCESS) ERR("Failed to write registry installed key\n"); heap_free(name); @@ -863,7 +862,7 @@ static void write_registry_values(const WCHAR *regkey, const WCHAR *driver, cons for (; *p; p += lstrlenW(p) + 1) { - WCHAR *divider = strchrW(p,'='); + WCHAR *divider = wcschr(p,'='); if (divider) { @@ -1522,7 +1521,7 @@ BOOL WINAPI SQLValidDSNW(LPCWSTR lpszDSN) clear_errors(); TRACE("%s\n", debugstr_w(lpszDSN)); - if(strlenW(lpszDSN) > SQL_MAX_DSN_LENGTH || strpbrkW(lpszDSN, invalid) != NULL) + if(lstrlenW(lpszDSN) > SQL_MAX_DSN_LENGTH || wcspbrk(lpszDSN, invalid) != NULL) { return FALSE; } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 07846b56cd3..352ad732cf6 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -139,7 +139,7 @@ dll/win32/npptools # Synced to WineStaging-4.18 dll/win32/ntdsapi # Synced to WineStaging-4.18 dll/win32/objsel # Synced to WineStaging-4.18 dll/win32/odbc32 # Synced to WineStaging-4.18. Depends on port of Linux ODBC. -dll/win32/odbccp32 # Synced to WineStaging-4.0 +dll/win32/odbccp32 # Synced to WineStaging-4.18 dll/win32/ole32 # Synced to WineStaging-4.0 dll/win32/oleacc # Synced to WineStaging-4.0 dll/win32/oleaut32 # Synced to WineStaging-4.0
5 years, 1 month
1
0
0
0
[reactos] 01/01: [ODBC32] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4658658fb4aeaac99c539…
commit 4658658fb4aeaac99c539a74fd604e5cde6c7707 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:09:45 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:09:45 2019 +0100 [ODBC32] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/odbc32/proxyodbc.c | 2676 ++++++++++++++++++++++++------------------ media/doc/README.WINE | 2 +- 2 files changed, 1524 insertions(+), 1154 deletions(-) diff --git a/dll/win32/odbc32/proxyodbc.c b/dll/win32/odbc32/proxyodbc.c index c9aaefd9555..111531d3764 100644 --- a/dll/win32/odbc32/proxyodbc.c +++ b/dll/win32/odbc32/proxyodbc.c @@ -684,1341 +684,1589 @@ static BOOL ODBC_LoadDMFunctions(void) return TRUE; } - /************************************************************************* * SQLAllocConnect [ODBC32.001] */ SQLRETURN WINAPI ODBC32_SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle) { - SQLRETURN ret; - TRACE("(EnvironmentHandle %p)\n",EnvironmentHandle); + SQLRETURN ret; - if (!pSQLAllocConnect) - { - *ConnectionHandle = SQL_NULL_HDBC; - TRACE("Not ready\n"); - return SQL_ERROR; - } + TRACE("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); - ret = pSQLAllocConnect(EnvironmentHandle, ConnectionHandle); - TRACE("Returns %d, Handle %p\n", ret, *ConnectionHandle); - return ret; -} + if (!pSQLAllocConnect) + { + *ConnectionHandle = SQL_NULL_HDBC; + TRACE("Not ready\n"); + return SQL_ERROR; + } + ret = pSQLAllocConnect(EnvironmentHandle, ConnectionHandle); + TRACE("Returning %d, ConnectionHandle %p\n", ret, *ConnectionHandle); + return ret; +} /************************************************************************* * SQLAllocEnv [ODBC32.002] */ SQLRETURN WINAPI ODBC32_SQLAllocEnv(SQLHENV *EnvironmentHandle) { - SQLRETURN ret; - TRACE("\n"); + SQLRETURN ret; - if (!pSQLAllocEnv) - { - *EnvironmentHandle = SQL_NULL_HENV; - TRACE("Not ready\n"); - return SQL_ERROR; - } + TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); - ret = pSQLAllocEnv(EnvironmentHandle); - TRACE("Returns %d, EnvironmentHandle %p\n", ret, *EnvironmentHandle); - return ret; -} + if (!pSQLAllocEnv) + { + *EnvironmentHandle = SQL_NULL_HENV; + TRACE("Not ready\n"); + return SQL_ERROR; + } + ret = pSQLAllocEnv(EnvironmentHandle); + TRACE("Returning %d, EnvironmentHandle %p\n", ret, *EnvironmentHandle); + return ret; +} /************************************************************************* * SQLAllocHandle [ODBC32.024] */ SQLRETURN WINAPI ODBC32_SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) { - SQLRETURN ret; - TRACE("(Type %d, Handle %p)\n", HandleType, InputHandle); + SQLRETURN ret; - if (!pSQLAllocHandle) - { - if (nErrorType == ERROR_LIBRARY_NOT_FOUND) - WARN("ProxyODBC: Cannot load ODBC driver manager library.\n"); - - if (HandleType == SQL_HANDLE_ENV) - *OutputHandle = SQL_NULL_HENV; - else if (HandleType == SQL_HANDLE_DBC) - *OutputHandle = SQL_NULL_HDBC; - else if (HandleType == SQL_HANDLE_STMT) - *OutputHandle = SQL_NULL_HSTMT; - else if (HandleType == SQL_HANDLE_DESC) - *OutputHandle = SQL_NULL_HDESC; - - TRACE ("Not ready\n"); - return SQL_ERROR; - } + TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); - ret = pSQLAllocHandle(HandleType, InputHandle, OutputHandle); - TRACE("Returns %d, Handle %p\n", ret, *OutputHandle); - return ret; -} + if (!pSQLAllocHandle) + { + if (nErrorType == ERROR_LIBRARY_NOT_FOUND) + WARN("ProxyODBC: Cannot load ODBC driver manager library.\n"); + + if (HandleType == SQL_HANDLE_ENV) + *OutputHandle = SQL_NULL_HENV; + else if (HandleType == SQL_HANDLE_DBC) + *OutputHandle = SQL_NULL_HDBC; + else if (HandleType == SQL_HANDLE_STMT) + *OutputHandle = SQL_NULL_HSTMT; + else if (HandleType == SQL_HANDLE_DESC) + *OutputHandle = SQL_NULL_HDESC; + + TRACE ("Not ready\n"); + return SQL_ERROR; + } + ret = pSQLAllocHandle(HandleType, InputHandle, OutputHandle); + TRACE("Returning %d, Handle %p\n", ret, *OutputHandle); + return ret; +} /************************************************************************* * SQLAllocStmt [ODBC32.003] */ SQLRETURN WINAPI ODBC32_SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) { - SQLRETURN ret; + SQLRETURN ret; - TRACE("(Connection %p)\n", ConnectionHandle); + TRACE("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle, StatementHandle); - if (!pSQLAllocStmt) - { - *StatementHandle = SQL_NULL_HSTMT; - TRACE ("Not ready\n"); - return SQL_ERROR; - } + if (!pSQLAllocStmt) + { + *StatementHandle = SQL_NULL_HSTMT; + TRACE("Not ready\n"); + return SQL_ERROR; + } - ret = pSQLAllocStmt(ConnectionHandle, StatementHandle); - TRACE ("Returns %d, Handle %p\n", ret, *StatementHandle); - return ret; + ret = pSQLAllocStmt(ConnectionHandle, StatementHandle); + TRACE ("Returning %d, StatementHandle %p\n", ret, *StatementHandle); + return ret; } - /************************************************************************* * SQLAllocHandleStd [ODBC32.077] */ -SQLRETURN WINAPI ODBC32_SQLAllocHandleStd( SQLSMALLINT HandleType, - SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) +SQLRETURN WINAPI ODBC32_SQLAllocHandleStd(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) { - TRACE("ProxyODBC: SQLAllocHandleStd.\n"); + SQLRETURN ret; - if (!pSQLAllocHandleStd) - { - if (nErrorType == ERROR_LIBRARY_NOT_FOUND) - WARN("ProxyODBC: Cannot load ODBC driver manager library.\n"); - - if (HandleType == SQL_HANDLE_ENV) - *OutputHandle = SQL_NULL_HENV; - else if (HandleType == SQL_HANDLE_DBC) - *OutputHandle = SQL_NULL_HDBC; - else if (HandleType == SQL_HANDLE_STMT) - *OutputHandle = SQL_NULL_HSTMT; - else if (HandleType == SQL_HANDLE_DESC) - *OutputHandle = SQL_NULL_HDESC; - - return SQL_ERROR; - } + TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); + + if (!pSQLAllocHandleStd) + { + if (nErrorType == ERROR_LIBRARY_NOT_FOUND) + WARN("ProxyODBC: Cannot load ODBC driver manager library.\n"); + + if (HandleType == SQL_HANDLE_ENV) + *OutputHandle = SQL_NULL_HENV; + else if (HandleType == SQL_HANDLE_DBC) + *OutputHandle = SQL_NULL_HDBC; + else if (HandleType == SQL_HANDLE_STMT) + *OutputHandle = SQL_NULL_HSTMT; + else if (HandleType == SQL_HANDLE_DESC) + *OutputHandle = SQL_NULL_HDESC; + + return SQL_ERROR; + } - return pSQLAllocHandleStd(HandleType, InputHandle, OutputHandle); + ret = pSQLAllocHandleStd(HandleType, InputHandle, OutputHandle); + TRACE ("Returning %d, OutputHandle %p\n", ret, *OutputHandle); + return ret; } +static const char *debugstr_sqllen( SQLLEN len ) +{ +#ifdef _WIN64 + return wine_dbg_sprintf( "%ld", len ); +#else + return wine_dbg_sprintf( "%d", len ); +#endif +} /************************************************************************* * SQLBindCol [ODBC32.004] */ -SQLRETURN WINAPI ODBC32_SQLBindCol(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, - SQLPOINTER TargetValue, SQLLEN BufferLength, - SQLLEN *StrLen_or_Ind) +SQLRETURN WINAPI ODBC32_SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, + SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLBindCol) - { - TRACE ("Not ready\n"); - return SQL_ERROR; - } + TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", + StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); - return pSQLBindCol(StatementHandle, ColumnNumber, TargetType, - TargetValue, BufferLength, StrLen_or_Ind); + if (!pSQLBindCol) + { + TRACE("Not ready\n"); + return SQL_ERROR; + } + + ret = pSQLBindCol(StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_Ind); + TRACE ("Returning %d\n", ret); + return ret; } +static const char *debugstr_sqlulen( SQLULEN len ) +{ +#ifdef _WIN64 + return wine_dbg_sprintf( "%lu", len ); +#else + return wine_dbg_sprintf( "%u", len ); +#endif +} /************************************************************************* * SQLBindParam [ODBC32.025] */ -SQLRETURN WINAPI ODBC32_SQLBindParam(SQLHSTMT StatementHandle, - SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, - SQLSMALLINT ParameterType, SQLULEN LengthPrecision, - SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, - SQLLEN *StrLen_or_Ind) +SQLRETURN WINAPI ODBC32_SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, + SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, + SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLBindParam) return SQL_ERROR; - return pSQLBindParam(StatementHandle, ParameterNumber, ValueType, - ParameterType, LengthPrecision, ParameterScale, - ParameterValue, StrLen_or_Ind); -} + TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," + " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, + ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); + if (!pSQLBindParam) return SQL_ERROR; + + ret = pSQLBindParam(StatementHandle, ParameterNumber, ValueType, ParameterType, LengthPrecision, ParameterScale, + ParameterValue, StrLen_or_Ind); + TRACE ("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLCancel [ODBC32.005] */ SQLRETURN WINAPI ODBC32_SQLCancel(SQLHSTMT StatementHandle) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLCancel) return SQL_ERROR; - return pSQLCancel(StatementHandle); -} + TRACE("(StatementHandle %p)\n", StatementHandle); + + if (!pSQLCancel) return SQL_ERROR; + ret = pSQLCancel(StatementHandle); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLCloseCursor [ODBC32.026] */ SQLRETURN WINAPI ODBC32_SQLCloseCursor(SQLHSTMT StatementHandle) { - SQLRETURN ret; - TRACE("(Handle %p)\n", StatementHandle); + SQLRETURN ret; - if (!pSQLCloseCursor) return SQL_ERROR; + TRACE("(StatementHandle %p)\n", StatementHandle); - ret = pSQLCloseCursor(StatementHandle); - TRACE("Returns %d\n", ret); - return ret; -} + if (!pSQLCloseCursor) return SQL_ERROR; + ret = pSQLCloseCursor(StatementHandle); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLColAttribute [ODBC32.027] */ -SQLRETURN WINAPI ODBC32_SQLColAttribute (SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, - SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength, SQLLEN *NumericAttribute) +SQLRETURN WINAPI ODBC32_SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, + SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLLEN *NumericAttribute) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLColAttribute) return SQL_ERROR; - return pSQLColAttribute(StatementHandle, ColumnNumber, FieldIdentifier, - CharacterAttribute, BufferLength, StringLength, NumericAttribute); -} + TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," + " StringLength %p, NumericAttribute %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, + CharacterAttribute, BufferLength, StringLength, NumericAttribute); + if (!pSQLColAttribute) return SQL_ERROR; + + ret = pSQLColAttribute(StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, + StringLength, NumericAttribute); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLColumns [ODBC32.040] */ -SQLRETURN WINAPI ODBC32_SQLColumns(SQLHSTMT StatementHandle, - SQLCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLCHAR *TableName, SQLSMALLINT NameLength3, - SQLCHAR *ColumnName, SQLSMALLINT NameLength4) +SQLRETURN WINAPI ODBC32_SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, + SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLColumns) return SQL_ERROR; - return pSQLColumns(StatementHandle, CatalogName, NameLength1, - SchemaName, NameLength2, TableName, NameLength3, ColumnName, NameLength4); -} + TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," + " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle, + debugstr_an((const char *)CatalogName, NameLength1), NameLength1, + debugstr_an((const char *)SchemaName, NameLength2), NameLength2, + debugstr_an((const char *)TableName, NameLength3), NameLength3, + debugstr_an((const char *)ColumnName, NameLength4), NameLength4); + if (!pSQLColumns) return SQL_ERROR; + + ret = pSQLColumns(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, + NameLength3, ColumnName, NameLength4); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLConnect [ODBC32.007] */ -SQLRETURN WINAPI ODBC32_SQLConnect(SQLHDBC ConnectionHandle, - SQLCHAR *ServerName, SQLSMALLINT NameLength1, - SQLCHAR *UserName, SQLSMALLINT NameLength2, - SQLCHAR *Authentication, SQLSMALLINT NameLength3) +SQLRETURN WINAPI ODBC32_SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSMALLINT NameLength1, + SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication, + SQLSMALLINT NameLength3) { - SQLRETURN ret; - TRACE("(Server=%.*s)\n",NameLength1, ServerName); + SQLRETURN ret; - if (!pSQLConnect) return SQL_ERROR; + TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," + " NameLength3 %d)\n", ConnectionHandle, + debugstr_an((const char *)ServerName, NameLength1), NameLength1, + debugstr_an((const char *)UserName, NameLength2), NameLength2, + debugstr_an((const char *)Authentication, NameLength3), NameLength3); - ret = pSQLConnect(ConnectionHandle, ServerName, NameLength1, - UserName, NameLength2, Authentication, NameLength3); + if (!pSQLConnect) return SQL_ERROR; - TRACE("Returns %d\n", ret); - return ret; + ret = pSQLConnect(ConnectionHandle, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3); + TRACE("Returning %d\n", ret); + return ret; } - /************************************************************************* * SQLCopyDesc [ODBC32.028] */ SQLRETURN WINAPI ODBC32_SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLCopyDesc) return SQL_ERROR; - return pSQLCopyDesc(SourceDescHandle, TargetDescHandle); -} + TRACE("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle); + + if (!pSQLCopyDesc) return SQL_ERROR; + ret = pSQLCopyDesc(SourceDescHandle, TargetDescHandle); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLDataSources [ODBC32.057] */ -SQLRETURN WINAPI ODBC32_SQLDataSources(SQLHENV EnvironmentHandle, - SQLUSMALLINT Direction, SQLCHAR *ServerName, - SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, - SQLCHAR *Description, SQLSMALLINT BufferLength2, - SQLSMALLINT *NameLength2) +SQLRETURN WINAPI ODBC32_SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName, + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, + SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) { - SQLRETURN ret; - - TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); + SQLRETURN ret; - if (!pSQLDataSources) return SQL_ERROR; + TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," + " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, + NameLength1, Description, BufferLength2, NameLength2); - ret = pSQLDataSources(EnvironmentHandle, Direction, ServerName, - BufferLength1, NameLength1, Description, BufferLength2, NameLength2); + if (!pSQLDataSources) return SQL_ERROR; - if (TRACE_ON(odbc)) - { - TRACE("Returns %d \t", ret); - if (NameLength1 && *NameLength1 > 0) - TRACE("DataSource = %s,", ServerName); - if (NameLength2 && *NameLength2 > 0) - TRACE(" Description = %s", Description); - TRACE("\n"); - } + ret = pSQLDataSources(EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description, + BufferLength2, NameLength2); + if (ret >= 0 && TRACE_ON(odbc)) + { + if (ServerName && NameLength1 && *NameLength1 > 0) + TRACE(" DataSource %s", debugstr_an((const char *)ServerName, *NameLength1)); + if (Description && NameLength2 && *NameLength2 > 0) + TRACE(" Description %s", debugstr_an((const char *)Description, *NameLength2)); + TRACE("\n"); + } - return ret; + TRACE("Returning %d\n", ret); + return ret; } -SQLRETURN WINAPI ODBC32_SQLDataSourcesA(SQLHENV EnvironmentHandle, - SQLUSMALLINT Direction, SQLCHAR *ServerName, - SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, - SQLCHAR *Description, SQLSMALLINT BufferLength2, - SQLSMALLINT *NameLength2) +SQLRETURN WINAPI ODBC32_SQLDataSourcesA(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName, + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, + SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) { SQLRETURN ret; - TRACE("EnvironmentHandle = %p\n", EnvironmentHandle); + TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," + " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, + NameLength1, Description, BufferLength2, NameLength2); if (!pSQLDataSourcesA) return SQL_ERROR; - ret = pSQLDataSourcesA(EnvironmentHandle, Direction, ServerName, - BufferLength1, NameLength1, Description, BufferLength2, NameLength2); + ret = pSQLDataSourcesA(EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description, + BufferLength2, NameLength2); if (TRACE_ON(odbc)) { - TRACE("Returns %d \t", ret); - if (NameLength1 && *NameLength1 > 0) - TRACE("DataSource = %s,", ServerName); - if (NameLength2 && *NameLength2 > 0) - TRACE(" Description = %s", Description); + if (ServerName && NameLength1 && *NameLength1 > 0) + TRACE(" DataSource %s", debugstr_an((const char *)ServerName, *NameLength1)); + if (Description && NameLength2 && *NameLength2 > 0) + TRACE(" Description %s", debugstr_an((const char *)Description, *NameLength2)); TRACE("\n"); } + TRACE("Returning %d\n", ret); return ret; } /************************************************************************* * SQLDescribeCol [ODBC32.008] */ -SQLRETURN WINAPI ODBC32_SQLDescribeCol(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, - SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, - SQLSMALLINT *DataType, SQLULEN *ColumnSize, - SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) +SQLRETURN WINAPI ODBC32_SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, + SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) { - TRACE("\n"); + SQLSMALLINT dummy; + SQLRETURN ret; - if (!pSQLDescribeCol) return SQL_ERROR; - return pSQLDescribeCol(StatementHandle, ColumnNumber, ColumnName, - BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); -} + TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," + " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, + BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); + if (!pSQLDescribeCol) return SQL_ERROR; + if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ + + ret = pSQLDescribeCol(StatementHandle, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize, + DecimalDigits, Nullable); + if (ret >= 0) + { + if (ColumnName && NameLength) TRACE(" ColumnName %s\n", debugstr_an((const char *)ColumnName, *NameLength)); + if (DataType) TRACE(" DataType %d\n", *DataType); + if (ColumnSize) TRACE(" ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); + if (DecimalDigits) TRACE(" DecimalDigits %d\n", *DecimalDigits); + if (Nullable) TRACE(" Nullable %d\n", *Nullable); + } + + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLDisconnect [ODBC32.009] */ SQLRETURN WINAPI ODBC32_SQLDisconnect(SQLHDBC ConnectionHandle) { - SQLRETURN ret; - TRACE("(Handle %p)\n", ConnectionHandle); + SQLRETURN ret; - if (!pSQLDisconnect) return SQL_ERROR; + TRACE("(ConnectionHandle %p)\n", ConnectionHandle); - ret = pSQLDisconnect(ConnectionHandle); - TRACE("Returns %d\n", ret); - return ret; -} + if (!pSQLDisconnect) return SQL_ERROR; + ret = pSQLDisconnect(ConnectionHandle); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLEndTran [ODBC32.029] */ SQLRETURN WINAPI ODBC32_SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLEndTran) return SQL_ERROR; - return pSQLEndTran(HandleType, Handle, CompletionType); -} + TRACE("(HandleType %d, Handle %p, CompletionType %d)\n", HandleType, Handle, CompletionType); + + if (!pSQLEndTran) return SQL_ERROR; + ret = pSQLEndTran(HandleType, Handle, CompletionType); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLError [ODBC32.010] */ -SQLRETURN WINAPI ODBC32_SQLError(SQLHENV EnvironmentHandle, - SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, - SQLCHAR *Sqlstate, SQLINTEGER *NativeError, - SQLCHAR *MessageText, SQLSMALLINT BufferLength, - SQLSMALLINT *TextLength) +SQLRETURN WINAPI ODBC32_SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, + SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) { - SQLRETURN ret; + SQLRETURN ret; - TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, BufferLength %d)\n", - EnvironmentHandle, ConnectionHandle, StatementHandle, BufferLength); + TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," + " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, + StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); - if (!pSQLError) return SQL_ERROR; - ret = pSQLError(EnvironmentHandle, ConnectionHandle, StatementHandle, - Sqlstate, NativeError, MessageText, BufferLength, TextLength); - if (ret == SQL_SUCCESS) - TRACE("SQLState %s, Error %d, Text %s, Textlen %d\n", - debugstr_an((char *)Sqlstate, 5), *NativeError, - debugstr_an((char *)MessageText, *TextLength), *TextLength); - else - TRACE("Returns %d\n", ret); - return ret; -} + if (!pSQLError) return SQL_ERROR; + + ret = pSQLError(EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate, NativeError, MessageText, + BufferLength, TextLength); + + if (ret == SQL_SUCCESS) + { + TRACE(" SQLState %s\n", debugstr_an((const char *)Sqlstate, 5)); + TRACE(" Error %d\n", *NativeError); + TRACE(" MessageText %s\n", debugstr_an((const char *)MessageText, *TextLength)); + } + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLExecDirect [ODBC32.011] */ SQLRETURN WINAPI ODBC32_SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLExecDirect) return SQL_ERROR; - return pSQLExecDirect(StatementHandle, StatementText, TextLength); -} + TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_an((const char *)StatementText, TextLength), TextLength); + + if (!pSQLExecDirect) return SQL_ERROR; + ret = pSQLExecDirect(StatementHandle, StatementText, TextLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLExecute [ODBC32.012] */ SQLRETURN WINAPI ODBC32_SQLExecute(SQLHSTMT StatementHandle) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLExecute) return SQL_ERROR; - return pSQLExecute(StatementHandle); -} + TRACE("(StatementHandle %p)\n", StatementHandle); + if (!pSQLExecute) return SQL_ERROR; + + ret = pSQLExecute(StatementHandle); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLFetch [ODBC32.013] */ SQLRETURN WINAPI ODBC32_SQLFetch(SQLHSTMT StatementHandle) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLFetch) return SQL_ERROR; - return pSQLFetch(StatementHandle); -} + TRACE("(StatementHandle %p)\n", StatementHandle); + if (!pSQLFetch) return SQL_ERROR; + + ret = pSQLFetch(StatementHandle); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLFetchScroll [ODBC32.030] */ SQLRETURN WINAPI ODBC32_SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLFetchScroll) return SQL_ERROR; - return pSQLFetchScroll(StatementHandle, FetchOrientation, FetchOffset); -} + TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation, + debugstr_sqllen(FetchOffset)); + if (!pSQLFetchScroll) return SQL_ERROR; + + ret = pSQLFetchScroll(StatementHandle, FetchOrientation, FetchOffset); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLFreeConnect [ODBC32.014] */ SQLRETURN WINAPI ODBC32_SQLFreeConnect(SQLHDBC ConnectionHandle) { - SQLRETURN ret; - TRACE("(Handle %p)\n", ConnectionHandle); + SQLRETURN ret; - if (!pSQLFreeConnect) return SQL_ERROR; + TRACE("(ConnectionHandle %p)\n", ConnectionHandle); - ret = pSQLFreeConnect(ConnectionHandle); - TRACE("Returns %d\n", ret); - return ret; -} + if (!pSQLFreeConnect) return SQL_ERROR; + ret = pSQLFreeConnect(ConnectionHandle); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLFreeEnv [ODBC32.015] */ SQLRETURN WINAPI ODBC32_SQLFreeEnv(SQLHENV EnvironmentHandle) { - SQLRETURN ret; - TRACE("(EnvironmentHandle %p)\n",EnvironmentHandle); + SQLRETURN ret; - if (!pSQLFreeEnv) return SQL_ERROR; + TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); - ret = pSQLFreeEnv(EnvironmentHandle); - TRACE("Returns %d\n", ret); - return ret; -} + if (!pSQLFreeEnv) return SQL_ERROR; + ret = pSQLFreeEnv(EnvironmentHandle); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLFreeHandle [ODBC32.031] */ SQLRETURN WINAPI ODBC32_SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) { - SQLRETURN ret; - TRACE("(Type %d, Handle %p)\n", HandleType, Handle); + SQLRETURN ret; - if (!pSQLFreeHandle) return SQL_ERROR; + TRACE("(HandleType %d, Handle %p)\n", HandleType, Handle); - ret = pSQLFreeHandle(HandleType, Handle); - TRACE ("Returns %d\n", ret); - return ret; -} + if (!pSQLFreeHandle) return SQL_ERROR; + ret = pSQLFreeHandle(HandleType, Handle); + TRACE ("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLFreeStmt [ODBC32.016] */ SQLRETURN WINAPI ODBC32_SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) { - SQLRETURN ret; - TRACE("(Handle %p, Option %d)\n", StatementHandle, Option); + SQLRETURN ret; - if (!pSQLFreeStmt) return SQL_ERROR; + TRACE("(StatementHandle %p, Option %d)\n", StatementHandle, Option); - ret = pSQLFreeStmt(StatementHandle, Option); - TRACE("Returns %d\n", ret); - return ret; -} + if (!pSQLFreeStmt) return SQL_ERROR; + ret = pSQLFreeStmt(StatementHandle, Option); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetConnectAttr [ODBC32.032] */ -SQLRETURN WINAPI ODBC32_SQLGetConnectAttr(SQLHDBC ConnectionHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetConnectAttr) return SQL_ERROR; - return pSQLGetConnectAttr(ConnectionHandle, Attribute, Value, - BufferLength, StringLength); -} + TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + Attribute, Value, BufferLength, StringLength); + + if (!pSQLGetConnectAttr) return SQL_ERROR; + ret = pSQLGetConnectAttr(ConnectionHandle, Attribute, Value, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetConnectOption [ODBC32.042] */ SQLRETURN WINAPI ODBC32_SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetConnectOption) return SQL_ERROR; - return pSQLGetConnectOption(ConnectionHandle, Option, Value); -} + TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); + if (!pSQLGetConnectOption) return SQL_ERROR; + + ret = pSQLGetConnectOption(ConnectionHandle, Option, Value); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetCursorName [ODBC32.017] */ -SQLRETURN WINAPI ODBC32_SQLGetCursorName(SQLHSTMT StatementHandle, - SQLCHAR *CursorName, SQLSMALLINT BufferLength, - SQLSMALLINT *NameLength) +SQLRETURN WINAPI ODBC32_SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT BufferLength, + SQLSMALLINT *NameLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetCursorName) return SQL_ERROR; - return pSQLGetCursorName(StatementHandle, CursorName, BufferLength, NameLength); -} + TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, + BufferLength, NameLength); + if (!pSQLGetCursorName) return SQL_ERROR; + + ret = pSQLGetCursorName(StatementHandle, CursorName, BufferLength, NameLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetData [ODBC32.043] */ -SQLRETURN WINAPI ODBC32_SQLGetData(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, - SQLPOINTER TargetValue, SQLLEN BufferLength, - SQLLEN *StrLen_or_Ind) +SQLRETURN WINAPI ODBC32_SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, + SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetData) return SQL_ERROR; - return pSQLGetData(StatementHandle, ColumnNumber, TargetType, - TargetValue, BufferLength, StrLen_or_Ind); -} + TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", + StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); + + if (!pSQLGetData) return SQL_ERROR; + ret = pSQLGetData(StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_Ind); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetDescField [ODBC32.033] */ -SQLRETURN WINAPI ODBC32_SQLGetDescField(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength, - SQLINTEGER *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetDescField) return SQL_ERROR; - return pSQLGetDescField(DescriptorHandle, RecNumber, FieldIdentifier, - Value, BufferLength, StringLength); -} + TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", + DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); + if (!pSQLGetDescField) return SQL_ERROR; + + ret = pSQLGetDescField(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetDescRec [ODBC32.034] */ -SQLRETURN WINAPI ODBC32_SQLGetDescRec(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLCHAR *Name, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, - SQLSMALLINT *Type, SQLSMALLINT *SubType, - SQLLEN *Length, SQLSMALLINT *Precision, - SQLSMALLINT *Scale, SQLSMALLINT *Nullable) +SQLRETURN WINAPI ODBC32_SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR *Name, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, + SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, + SQLSMALLINT *Scale, SQLSMALLINT *Nullable) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetDescRec) return SQL_ERROR; - return pSQLGetDescRec(DescriptorHandle, RecNumber, Name, BufferLength, - StringLength, Type, SubType, Length, Precision, Scale, Nullable); -} + TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," + " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, + StringLength, Type, SubType, Length, Precision, Scale, Nullable); + + if (!pSQLGetDescRec) return SQL_ERROR; + ret = pSQLGetDescRec(DescriptorHandle, RecNumber, Name, BufferLength, StringLength, Type, SubType, Length, + Precision, Scale, Nullable); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetDiagField [ODBC32.035] */ -SQLRETURN WINAPI ODBC32_SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, - SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, + SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, + SQLSMALLINT *StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetDiagField) return SQL_ERROR; - return pSQLGetDiagField(HandleType, Handle, RecNumber, DiagIdentifier, - DiagInfo, BufferLength, StringLength); -} + TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," + " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + if (!pSQLGetDiagField) return SQL_ERROR; + + ret = pSQLGetDiagField(HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetDiagRec [ODBC32.036] */ -SQLRETURN WINAPI ODBC32_SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, - SQLINTEGER *NativeError, SQLCHAR *MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) +SQLRETURN WINAPI ODBC32_SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, + SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetDiagRec) return SQL_ERROR; - return pSQLGetDiagRec(HandleType, Handle, RecNumber, Sqlstate, NativeError, - MessageText, BufferLength, TextLength); -} + TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," + " TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, + TextLength); + if (!pSQLGetDiagRec) return SQL_ERROR; + + ret = pSQLGetDiagRec(HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetEnvAttr [ODBC32.037] */ -SQLRETURN WINAPI ODBC32_SQLGetEnvAttr(SQLHENV EnvironmentHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetEnvAttr) return SQL_ERROR; - return pSQLGetEnvAttr(EnvironmentHandle, Attribute, Value, BufferLength, StringLength); -} + TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", + EnvironmentHandle, Attribute, Value, BufferLength, StringLength); + + if (!pSQLGetEnvAttr) return SQL_ERROR; + ret = pSQLGetEnvAttr(EnvironmentHandle, Attribute, Value, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetFunctions [ODBC32.044] */ SQLRETURN WINAPI ODBC32_SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetFunctions) return SQL_ERROR; - return pSQLGetFunctions(ConnectionHandle, FunctionId, Supported); -} + TRACE("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); + + if (!pSQLGetFunctions) return SQL_ERROR; + ret = pSQLGetFunctions(ConnectionHandle, FunctionId, Supported); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetInfo [ODBC32.045] */ -SQLRETURN WINAPI ODBC32_SQLGetInfo(SQLHDBC ConnectionHandle, - SQLUSMALLINT InfoType, SQLPOINTER InfoValue, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetInfo) return SQL_ERROR; - return pSQLGetInfo(ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength); -} + TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); + + if (!InfoValue) + { + WARN("Unexpected NULL InfoValue address\n"); + return SQL_ERROR; + } + if (!pSQLGetInfo) return SQL_ERROR; + + ret = pSQLGetInfo(ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetStmtAttr [ODBC32.038] */ -SQLRETURN WINAPI ODBC32_SQLGetStmtAttr(SQLHSTMT StatementHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetStmtAttr) return SQL_ERROR; - return pSQLGetStmtAttr(StatementHandle, Attribute, Value, BufferLength, StringLength); -} + TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, + Attribute, Value, BufferLength, StringLength); + + if (!Value) + { + WARN("Unexpected NULL Value return address\n"); + return SQL_ERROR; + } + if (!pSQLGetStmtAttr) return SQL_ERROR; + + ret = pSQLGetStmtAttr(StatementHandle, Attribute, Value, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetStmtOption [ODBC32.046] */ SQLRETURN WINAPI ODBC32_SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetStmtOption) return SQL_ERROR; - return pSQLGetStmtOption(StatementHandle, Option, Value); -} + TRACE("(StatementHandle %p, Option %d, Value %p)\n", StatementHandle, Option, Value); + + if (!pSQLGetStmtOption) return SQL_ERROR; + ret = pSQLGetStmtOption(StatementHandle, Option, Value); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLGetTypeInfo [ODBC32.047] */ SQLRETURN WINAPI ODBC32_SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetTypeInfo) return SQL_ERROR; - return pSQLGetTypeInfo(StatementHandle, DataType); -} + TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); + if (!pSQLGetTypeInfo) return SQL_ERROR; + + ret = pSQLGetTypeInfo(StatementHandle, DataType); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLNumResultCols [ODBC32.018] */ SQLRETURN WINAPI ODBC32_SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLNumResultCols) return SQL_ERROR; - return pSQLNumResultCols(StatementHandle, ColumnCount); -} + TRACE("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); + if (!pSQLNumResultCols) return SQL_ERROR; + + ret = pSQLNumResultCols(StatementHandle, ColumnCount); + TRACE("Returning %d ColumnCount %d\n", ret, *ColumnCount); + return ret; +} /************************************************************************* * SQLParamData [ODBC32.048] */ SQLRETURN WINAPI ODBC32_SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLParamData) return SQL_ERROR; - return pSQLParamData(StatementHandle, Value); -} + TRACE("(StatementHandle %p, Value %p)\n", StatementHandle, Value); + if (!pSQLParamData) return SQL_ERROR; + + ret = pSQLParamData(StatementHandle, Value); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLPrepare [ODBC32.019] */ SQLRETURN WINAPI ODBC32_SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLPrepare) return SQL_ERROR; - return pSQLPrepare(StatementHandle, StatementText, TextLength); -} + TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_an((const char *)StatementText, TextLength), TextLength); + + if (!pSQLPrepare) return SQL_ERROR; + ret = pSQLPrepare(StatementHandle, StatementText, TextLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLPutData [ODBC32.049] */ SQLRETURN WINAPI ODBC32_SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLPutData) return SQL_ERROR; - return pSQLPutData(StatementHandle, Data, StrLen_or_Ind); -} + TRACE("(StatementHandle %p, Data %p, StrLen_or_Ind %s)\n", StatementHandle, Data, debugstr_sqllen(StrLen_or_Ind)); + if (!pSQLPutData) return SQL_ERROR; + + ret = pSQLPutData(StatementHandle, Data, StrLen_or_Ind); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLRowCount [ODBC32.020] */ SQLRETURN WINAPI ODBC32_SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLRowCount) return SQL_ERROR; - return pSQLRowCount(StatementHandle, RowCount); -} + TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); + if (!pSQLRowCount) return SQL_ERROR; + + ret = pSQLRowCount(StatementHandle, RowCount); + if (ret == SQL_SUCCESS && RowCount) TRACE(" RowCount %s\n", debugstr_sqllen(*RowCount)); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetConnectAttr [ODBC32.039] */ -SQLRETURN WINAPI ODBC32_SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, - SQLPOINTER Value, SQLINTEGER StringLength) +SQLRETURN WINAPI ODBC32_SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetConnectAttr) return SQL_ERROR; - return pSQLSetConnectAttr(ConnectionHandle, Attribute, Value, StringLength); -} + TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, + StringLength); + if (!pSQLSetConnectAttr) return SQL_ERROR; + + ret = pSQLSetConnectAttr(ConnectionHandle, Attribute, Value, StringLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetConnectOption [ODBC32.050] */ SQLRETURN WINAPI ODBC32_SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetConnectOption) return SQL_ERROR; - return pSQLSetConnectOption(ConnectionHandle, Option, Value); -} + TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); + + if (!pSQLSetConnectOption) return SQL_ERROR; + ret = pSQLSetConnectOption(ConnectionHandle, Option, Value); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetCursorName [ODBC32.021] */ SQLRETURN WINAPI ODBC32_SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetCursorName) return SQL_ERROR; - return pSQLSetCursorName(StatementHandle, CursorName, NameLength); -} + TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, + debugstr_an((const char *)CursorName, NameLength), NameLength); + if (!pSQLSetCursorName) return SQL_ERROR; + + ret = pSQLSetCursorName(StatementHandle, CursorName, NameLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetDescField [ODBC32.073] */ -SQLRETURN WINAPI ODBC32_SQLSetDescField(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength) +SQLRETURN WINAPI ODBC32_SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetDescField) return SQL_ERROR; - return pSQLSetDescField(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength); -} + TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, + RecNumber, FieldIdentifier, Value, BufferLength); + + if (!pSQLSetDescField) return SQL_ERROR; + ret = pSQLSetDescField(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetDescRec [ODBC32.074] */ -SQLRETURN WINAPI ODBC32_SQLSetDescRec(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT Type, - SQLSMALLINT SubType, SQLLEN Length, - SQLSMALLINT Precision, SQLSMALLINT Scale, - SQLPOINTER Data, SQLLEN *StringLength, - SQLLEN *Indicator) +SQLRETURN WINAPI ODBC32_SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, + SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, + SQLPOINTER Data, SQLLEN *StringLength, SQLLEN *Indicator) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetDescRec) return SQL_ERROR; - return pSQLSetDescRec(DescriptorHandle, RecNumber, Type, SubType, Length, - Precision, Scale, Data, StringLength, Indicator); -} + TRACE("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p," + " StringLength %p, Indicator %p)\n", DescriptorHandle, RecNumber, Type, SubType, debugstr_sqllen(Length), + Precision, Scale, Data, StringLength, Indicator); + if (!pSQLSetDescRec) return SQL_ERROR; + + ret = pSQLSetDescRec(DescriptorHandle, RecNumber, Type, SubType, Length, Precision, Scale, Data, + StringLength, Indicator); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetEnvAttr [ODBC32.075] */ -SQLRETURN WINAPI ODBC32_SQLSetEnvAttr(SQLHENV EnvironmentHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength) +SQLRETURN WINAPI ODBC32_SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetEnvAttr) return SQL_ERROR; - return pSQLSetEnvAttr(EnvironmentHandle, Attribute, Value, StringLength); -} + TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, + StringLength); + if (!pSQLSetEnvAttr) return SQL_ERROR; + + ret = pSQLSetEnvAttr(EnvironmentHandle, Attribute, Value, StringLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetParam [ODBC32.022] */ -SQLRETURN WINAPI ODBC32_SQLSetParam(SQLHSTMT StatementHandle, - SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, - SQLSMALLINT ParameterType, SQLULEN LengthPrecision, - SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, - SQLLEN *StrLen_or_Ind) +SQLRETURN WINAPI ODBC32_SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, + SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, + SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetParam) return SQL_ERROR; - return pSQLSetParam(StatementHandle, ParameterNumber, ValueType, ParameterType, LengthPrecision, - ParameterScale, ParameterValue, StrLen_or_Ind); -} + TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," + " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, + ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); + if (!pSQLSetParam) return SQL_ERROR; + + ret = pSQLSetParam(StatementHandle, ParameterNumber, ValueType, ParameterType, LengthPrecision, + ParameterScale, ParameterValue, StrLen_or_Ind); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetStmtAttr [ODBC32.076] */ -SQLRETURN WINAPI ODBC32_SQLSetStmtAttr(SQLHSTMT StatementHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength) +SQLRETURN WINAPI ODBC32_SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetStmtAttr) return SQL_ERROR; - return pSQLSetStmtAttr(StatementHandle, Attribute, Value, StringLength); -} + TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, + StringLength); + if (!pSQLSetStmtAttr) return SQL_ERROR; + + ret = pSQLSetStmtAttr(StatementHandle, Attribute, Value, StringLength); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetStmtOption [ODBC32.051] */ SQLRETURN WINAPI ODBC32_SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetStmtOption) return SQL_ERROR; - return pSQLSetStmtOption(StatementHandle, Option, Value); -} + TRACE("(StatementHandle %p, Option %d, Value %s)\n", StatementHandle, Option, debugstr_sqlulen(Value)); + if (!pSQLSetStmtOption) return SQL_ERROR; + + ret = pSQLSetStmtOption(StatementHandle, Option, Value); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSpecialColumns [ODBC32.052] */ -SQLRETURN WINAPI ODBC32_SQLSpecialColumns(SQLHSTMT StatementHandle, - SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, - SQLSMALLINT NameLength1, SQLCHAR *SchemaName, - SQLSMALLINT NameLength2, SQLCHAR *TableName, - SQLSMALLINT NameLength3, SQLUSMALLINT Scope, - SQLUSMALLINT Nullable) +SQLRETURN WINAPI ODBC32_SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, + SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, + SQLUSMALLINT Nullable) { + SQLRETURN ret; - if (!pSQLSpecialColumns) return SQL_ERROR; - return pSQLSpecialColumns(StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName, - NameLength2, TableName, NameLength3, Scope, Nullable); -} + TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," + " TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle, IdentifierType, + debugstr_an((const char *)CatalogName, NameLength1), NameLength1, + debugstr_an((const char *)SchemaName, NameLength2), NameLength2, + debugstr_an((const char *)TableName, NameLength3), NameLength3, Scope, Nullable); + if (!pSQLSpecialColumns) return SQL_ERROR; + + ret = pSQLSpecialColumns(StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName, + NameLength2, TableName, NameLength3, Scope, Nullable); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLStatistics [ODBC32.053] */ -SQLRETURN WINAPI ODBC32_SQLStatistics(SQLHSTMT StatementHandle, - SQLCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLCHAR *TableName, SQLSMALLINT NameLength3, - SQLUSMALLINT Unique, SQLUSMALLINT Reserved) +SQLRETURN WINAPI ODBC32_SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, + SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLStatistics) return SQL_ERROR; - return pSQLStatistics(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, - TableName, NameLength3, Unique, Reserved); -} + TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" + " NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle, + debugstr_an((const char *)CatalogName, NameLength1), NameLength1, + debugstr_an((const char *)SchemaName, NameLength2), NameLength2, + debugstr_an((const char *)TableName, NameLength3), NameLength3, Unique, Reserved); + + if (!pSQLStatistics) return SQL_ERROR; + ret = pSQLStatistics(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, + NameLength3, Unique, Reserved); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLTables [ODBC32.054] */ -SQLRETURN WINAPI ODBC32_SQLTables(SQLHSTMT StatementHandle, - SQLCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLCHAR *TableName, SQLSMALLINT NameLength3, - SQLCHAR *TableType, SQLSMALLINT NameLength4) +SQLRETURN WINAPI ODBC32_SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, + SQLSMALLINT NameLength3, SQLCHAR *TableType, SQLSMALLINT NameLength4) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLTables) return SQL_ERROR; - return pSQLTables(StatementHandle, CatalogName, NameLength1, - SchemaName, NameLength2, TableName, NameLength3, TableType, NameLength4); -} + TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," + " NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle, + debugstr_an((const char *)CatalogName, NameLength1), NameLength1, + debugstr_an((const char *)SchemaName, NameLength2), NameLength2, + debugstr_an((const char *)TableName, NameLength3), NameLength3, + debugstr_an((const char *)TableType, NameLength4), NameLength4); + if (!pSQLTables) return SQL_ERROR; + + ret = pSQLTables(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3, + TableType, NameLength4); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLTransact [ODBC32.023] */ -SQLRETURN WINAPI ODBC32_SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, - SQLUSMALLINT CompletionType) +SQLRETURN WINAPI ODBC32_SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLTransact) return SQL_ERROR; - return pSQLTransact(EnvironmentHandle, ConnectionHandle, CompletionType); -} + TRACE("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, + CompletionType); + if (!pSQLTransact) return SQL_ERROR; + + ret = pSQLTransact(EnvironmentHandle, ConnectionHandle, CompletionType); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLBrowseConnect [ODBC32.055] */ -SQLRETURN WINAPI ODBC32_SQLBrowseConnect( - SQLHDBC hdbc, - SQLCHAR *szConnStrIn, - SQLSMALLINT cbConnStrIn, - SQLCHAR *szConnStrOut, - SQLSMALLINT cbConnStrOutMax, - SQLSMALLINT *pcbConnStrOut) +SQLRETURN WINAPI ODBC32_SQLBrowseConnect(SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, + SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLBrowseConnect) return SQL_ERROR; - return pSQLBrowseConnect(hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); -} + TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", + hdbc, debugstr_an((const char *)szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, + pcbConnStrOut); + if (!pSQLBrowseConnect) return SQL_ERROR; + + ret = pSQLBrowseConnect(hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLBulkOperations [ODBC32.078] */ -SQLRETURN WINAPI ODBC32_SQLBulkOperations( - SQLHSTMT StatementHandle, - SQLSMALLINT Operation) +SQLRETURN WINAPI ODBC32_SQLBulkOperations(SQLHSTMT StatementHandle, SQLSMALLINT Operation) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLBulkOperations) return SQL_ERROR; - return pSQLBulkOperations(StatementHandle, Operation); -} + TRACE("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); + if (!pSQLBulkOperations) return SQL_ERROR; + + ret = pSQLBulkOperations(StatementHandle, Operation); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLColAttributes [ODBC32.006] */ -SQLRETURN WINAPI ODBC32_SQLColAttributes( - SQLHSTMT hstmt, - SQLUSMALLINT icol, - SQLUSMALLINT fDescType, - SQLPOINTER rgbDesc, - SQLSMALLINT cbDescMax, - SQLSMALLINT *pcbDesc, - SQLLEN *pfDesc) +SQLRETURN WINAPI ODBC32_SQLColAttributes(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, + SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, + SQLLEN *pfDesc) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLColAttributes) return SQL_ERROR; - return pSQLColAttributes(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); -} + TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, + fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + + if (!pSQLColAttributes) return SQL_ERROR; + ret = pSQLColAttributes(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLColumnPrivileges [ODBC32.056] */ -SQLRETURN WINAPI ODBC32_SQLColumnPrivileges( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLCHAR *szTableName, - SQLSMALLINT cbTableName, - SQLCHAR *szColumnName, - SQLSMALLINT cbColumnName) +SQLRETURN WINAPI ODBC32_SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, + SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLColumnPrivileges) return SQL_ERROR; - return pSQLColumnPrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szTableName, cbTableName, szColumnName, cbColumnName); -} + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," + " cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt, + debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, + debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, + debugstr_an((const char *)szTableName, cbTableName), cbTableName, + debugstr_an((const char *)szColumnName, cbColumnName), cbColumnName); + + if (!pSQLColumnPrivileges) return SQL_ERROR; + ret = pSQLColumnPrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, + szTableName, cbTableName, szColumnName, cbColumnName); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLDescribeParam [ODBC32.058] */ -SQLRETURN WINAPI ODBC32_SQLDescribeParam( - SQLHSTMT hstmt, - SQLUSMALLINT ipar, - SQLSMALLINT *pfSqlType, - SQLULEN *pcbParamDef, - SQLSMALLINT *pibScale, - SQLSMALLINT *pfNullable) +SQLRETURN WINAPI ODBC32_SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, + SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLDescribeParam) return SQL_ERROR; - return pSQLDescribeParam(hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable); -} + TRACE("(hstmt %p, ipar %d, pfSqlType %p, pcbParamDef %p, pibScale %p, pfNullable %p)\n", hstmt, ipar, + pfSqlType, pcbParamDef, pibScale, pfNullable); + if (!pSQLDescribeParam) return SQL_ERROR; + + ret = pSQLDescribeParam(hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLExtendedFetch [ODBC32.059] */ -SQLRETURN WINAPI ODBC32_SQLExtendedFetch( - SQLHSTMT hstmt, - SQLUSMALLINT fFetchType, - SQLLEN irow, - SQLULEN *pcrow, - SQLUSMALLINT *rgfRowStatus) +SQLRETURN WINAPI ODBC32_SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow, + SQLUSMALLINT *rgfRowStatus) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLExtendedFetch) return SQL_ERROR; - return pSQLExtendedFetch(hstmt, fFetchType, irow, pcrow, rgfRowStatus); -} + TRACE("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow), + pcrow, rgfRowStatus); + if (!pSQLExtendedFetch) return SQL_ERROR; + + ret = pSQLExtendedFetch(hstmt, fFetchType, irow, pcrow, rgfRowStatus); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLForeignKeys [ODBC32.060] */ -SQLRETURN WINAPI ODBC32_SQLForeignKeys( - SQLHSTMT hstmt, - SQLCHAR *szPkCatalogName, - SQLSMALLINT cbPkCatalogName, - SQLCHAR *szPkSchemaName, - SQLSMALLINT cbPkSchemaName, - SQLCHAR *szPkTableName, - SQLSMALLINT cbPkTableName, - SQLCHAR *szFkCatalogName, - SQLSMALLINT cbFkCatalogName, - SQLCHAR *szFkSchemaName, - SQLSMALLINT cbFkSchemaName, - SQLCHAR *szFkTableName, - SQLSMALLINT cbFkTableName) +SQLRETURN WINAPI ODBC32_SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, + SQLCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLCHAR *szPkTableName, + SQLSMALLINT cbPkTableName, SQLCHAR *szFkCatalogName, + SQLSMALLINT cbFkCatalogName, SQLCHAR *szFkSchemaName, + SQLSMALLINT cbFkSchemaName, SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLForeignKeys) return SQL_ERROR; - return pSQLForeignKeys(hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName, - szPkTableName, cbPkTableName, szFkCatalogName, cbFkCatalogName, - szFkSchemaName, cbFkSchemaName, szFkTableName, cbFkTableName); + TRACE("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," + " szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s," + " cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt, + debugstr_an((const char *)szPkCatalogName, cbPkCatalogName), cbPkCatalogName, + debugstr_an((const char *)szPkSchemaName, cbPkSchemaName), cbPkSchemaName, + debugstr_an((const char *)szPkTableName, cbPkTableName), cbPkTableName, + debugstr_an((const char *)szFkCatalogName, cbFkCatalogName), cbFkCatalogName, + debugstr_an((const char *)szFkSchemaName, cbFkSchemaName), cbFkSchemaName, + debugstr_an((const char *)szFkTableName, cbFkTableName), cbFkTableName); + + if (!pSQLForeignKeys) return SQL_ERROR; + + ret = pSQLForeignKeys(hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName, szPkTableName, + cbPkTableName, szFkCatalogName, cbFkCatalogName, szFkSchemaName, cbFkSchemaName, + szFkTableName, cbFkTableName); + TRACE("Returning %d\n", ret); + return ret; } - /************************************************************************* * SQLMoreResults [ODBC32.061] */ -SQLRETURN WINAPI ODBC32_SQLMoreResults(SQLHSTMT hstmt) +SQLRETURN WINAPI ODBC32_SQLMoreResults(SQLHSTMT StatementHandle) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLMoreResults) return SQL_ERROR; - return pSQLMoreResults(hstmt); -} + TRACE("(%p)\n", StatementHandle); + + if (!pSQLMoreResults) return SQL_ERROR; + ret = pSQLMoreResults(StatementHandle); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLNativeSql [ODBC32.062] */ -SQLRETURN WINAPI ODBC32_SQLNativeSql( - SQLHDBC hdbc, - SQLCHAR *szSqlStrIn, - SQLINTEGER cbSqlStrIn, - SQLCHAR *szSqlStr, - SQLINTEGER cbSqlStrMax, - SQLINTEGER *pcbSqlStr) +SQLRETURN WINAPI ODBC32_SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, + SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLNativeSql) return SQL_ERROR; - return pSQLNativeSql(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); -} + TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, + debugstr_an((const char *)szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + if (!pSQLNativeSql) return SQL_ERROR; + + ret = pSQLNativeSql(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLNumParams [ODBC32.063] */ -SQLRETURN WINAPI ODBC32_SQLNumParams( - SQLHSTMT hstmt, - SQLSMALLINT *pcpar) +SQLRETURN WINAPI ODBC32_SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLNumParams) return SQL_ERROR; - return pSQLNumParams(hstmt, pcpar); -} + TRACE("(hstmt %p, pcpar %p)\n", hstmt, pcpar); + + if (!pSQLNumParams) return SQL_ERROR; + ret = pSQLNumParams(hstmt, pcpar); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLParamOptions [ODBC32.064] */ -SQLRETURN WINAPI ODBC32_SQLParamOptions( - SQLHSTMT hstmt, - SQLULEN crow, - SQLULEN *pirow) +SQLRETURN WINAPI ODBC32_SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLParamOptions) return SQL_ERROR; - return pSQLParamOptions(hstmt, crow, pirow); -} + TRACE("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow); + if (!pSQLParamOptions) return SQL_ERROR; + + ret = pSQLParamOptions(hstmt, crow, pirow); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLPrimaryKeys [ODBC32.065] */ -SQLRETURN WINAPI ODBC32_SQLPrimaryKeys( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLCHAR *szTableName, - SQLSMALLINT cbTableName) +SQLRETURN WINAPI ODBC32_SQLPrimaryKeys(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, + SQLSMALLINT cbTableName) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLPrimaryKeys) return SQL_ERROR; - return pSQLPrimaryKeys(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szTableName, cbTableName); -} + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," + " cbTableName %d)\n", hstmt, + debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, + debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, + debugstr_an((const char *)szTableName, cbTableName), cbTableName); + if (!pSQLPrimaryKeys) return SQL_ERROR; + + ret = pSQLPrimaryKeys(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLProcedureColumns [ODBC32.066] */ -SQLRETURN WINAPI ODBC32_SQLProcedureColumns( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLCHAR *szProcName, - SQLSMALLINT cbProcName, - SQLCHAR *szColumnName, - SQLSMALLINT cbColumnName) +SQLRETURN WINAPI ODBC32_SQLProcedureColumns(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, + SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," + " cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt, + debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, + debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, + debugstr_an((const char *)szProcName, cbProcName), cbProcName, + debugstr_an((const char *)szColumnName, cbColumnName), cbColumnName); + + if (!pSQLProcedureColumns) return SQL_ERROR; - if (!pSQLProcedureColumns) return SQL_ERROR; - return pSQLProcedureColumns(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szProcName, cbProcName, szColumnName, cbColumnName); + ret = pSQLProcedureColumns(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName, + cbProcName, szColumnName, cbColumnName); + TRACE("Returning %d\n", ret); + return ret; } - /************************************************************************* * SQLProcedures [ODBC32.067] */ -SQLRETURN WINAPI ODBC32_SQLProcedures( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLCHAR *szProcName, - SQLSMALLINT cbProcName) +SQLRETURN WINAPI ODBC32_SQLProcedures(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, + SQLSMALLINT cbProcName) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLProcedures) return SQL_ERROR; - return pSQLProcedures(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szProcName, cbProcName); -} + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," + " cbProcName %d)\n", hstmt, + debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, + debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, + debugstr_an((const char *)szProcName, cbProcName), cbProcName); + + if (!pSQLProcedures) return SQL_ERROR; + ret = pSQLProcedures(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName, cbProcName); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetPos [ODBC32.068] */ -SQLRETURN WINAPI ODBC32_SQLSetPos( - SQLHSTMT hstmt, - SQLSETPOSIROW irow, - SQLUSMALLINT fOption, - SQLUSMALLINT fLock) +SQLRETURN WINAPI ODBC32_SQLSetPos(SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetPos) return SQL_ERROR; - return pSQLSetPos(hstmt, irow, fOption, fLock); -} + TRACE("(hstmt %p, irow %s, fOption %d, fLock %d)\n", hstmt, debugstr_sqlulen(irow), fOption, fLock); + + if (!pSQLSetPos) return SQL_ERROR; + ret = pSQLSetPos(hstmt, irow, fOption, fLock); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLTablePrivileges [ODBC32.070] */ -SQLRETURN WINAPI ODBC32_SQLTablePrivileges( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLCHAR *szTableName, - SQLSMALLINT cbTableName) +SQLRETURN WINAPI ODBC32_SQLTablePrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, + SQLSMALLINT cbTableName) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLTablePrivileges) return SQL_ERROR; - return pSQLTablePrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szTableName, cbTableName); -} + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," + " cbTableName %d)\n", hstmt, + debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, + debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, + debugstr_an((const char *)szTableName, cbTableName), cbTableName); + + if (!pSQLTablePrivileges) return SQL_ERROR; + ret = pSQLTablePrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, + cbTableName); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLDrivers [ODBC32.071] */ -SQLRETURN WINAPI ODBC32_SQLDrivers( - SQLHENV henv, - SQLUSMALLINT fDirection, - SQLCHAR *szDriverDesc, - SQLSMALLINT cbDriverDescMax, - SQLSMALLINT *pcbDriverDesc, - SQLCHAR *szDriverAttributes, - SQLSMALLINT cbDriverAttrMax, - SQLSMALLINT *pcbDriverAttr) +SQLRETURN WINAPI ODBC32_SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc, + SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc, + SQLCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax, + SQLSMALLINT *pcbDriverAttr) { - SQLRETURN ret; + SQLRETURN ret; - TRACE("(Direction %d)\n", fDirection); + TRACE("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p," + " DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle, fDirection, + szDriverDesc, cbDriverDescMax, pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); - if (!pSQLDrivers) return SQL_ERROR; - ret = pSQLDrivers(henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc, - szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); + if (!pSQLDrivers) return SQL_ERROR; - if (ret == SQL_NO_DATA && fDirection == SQL_FETCH_FIRST) - ERR_(winediag)("No ODBC drivers could be found. " - "Check the settings for your libodbc provider.\n"); + ret = pSQLDrivers(EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc, + szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); - return ret; -} + if (ret == SQL_NO_DATA && fDirection == SQL_FETCH_FIRST) + ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n"); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLBindParameter [ODBC32.072] */ -SQLRETURN WINAPI ODBC32_SQLBindParameter( - SQLHSTMT hstmt, - SQLUSMALLINT ipar, - SQLSMALLINT fParamType, - SQLSMALLINT fCType, - SQLSMALLINT fSqlType, - SQLULEN cbColDef, - SQLSMALLINT ibScale, - SQLPOINTER rgbValue, - SQLLEN cbValueMax, - SQLLEN *pcbValue) +SQLRETURN WINAPI ODBC32_SQLBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, + SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef, + SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, + SQLLEN *pcbValue) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLBindParameter) return SQL_ERROR; - return pSQLBindParameter(hstmt, ipar, fParamType, fCType, fSqlType, cbColDef, ibScale, - rgbValue, cbValueMax, pcbValue); -} + TRACE("(hstmt %p, ipar %d, fParamType %d, fCType %d, fSqlType %d, cbColDef %s, ibScale %d, rgbValue %p," + " cbValueMax %s, pcbValue %p)\n", hstmt, ipar, fParamType, fCType, fSqlType, debugstr_sqlulen(cbColDef), + ibScale, rgbValue, debugstr_sqllen(cbValueMax), pcbValue); + + if (!pSQLBindParameter) return SQL_ERROR; + ret = pSQLBindParameter(hstmt, ipar, fParamType, fCType, fSqlType, cbColDef, ibScale, rgbValue, cbValueMax, + pcbValue); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLDriverConnect [ODBC32.041] */ -SQLRETURN WINAPI ODBC32_SQLDriverConnect( - SQLHDBC hdbc, - SQLHWND hwnd, - SQLCHAR *conn_str_in, - SQLSMALLINT len_conn_str_in, - SQLCHAR *conn_str_out, - SQLSMALLINT conn_str_out_max, - SQLSMALLINT *ptr_conn_str_out, - SQLUSMALLINT driver_completion ) +SQLRETURN WINAPI ODBC32_SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *ConnectionString, SQLSMALLINT Length, + SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, + SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion) { - SQLRETURN ret; + SQLRETURN ret; - TRACE("(ConnectionString %s, Length %d)\n", - debugstr_a((char *)conn_str_in), len_conn_str_in); + TRACE("(hdbc %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d," + " ptr_conn_str_out %p, driver_completion %d)\n", hdbc, hwnd, + debugstr_an((const char *)ConnectionString, Length), Length, conn_str_out, conn_str_out_max, + ptr_conn_str_out, driver_completion); - if (!pSQLDriverConnect) return SQL_ERROR; - ret = pSQLDriverConnect(hdbc, hwnd, conn_str_in, len_conn_str_in, conn_str_out, - conn_str_out_max, ptr_conn_str_out, driver_completion); - TRACE("Returns %d\n", ret); - return ret; -} + if (!pSQLDriverConnect) return SQL_ERROR; + ret = pSQLDriverConnect(hdbc, hwnd, ConnectionString, Length, conn_str_out, conn_str_out_max, + ptr_conn_str_out, driver_completion); + TRACE("Returning %d\n", ret); + return ret; +} /************************************************************************* * SQLSetScrollOptions [ODBC32.069] */ -SQLRETURN WINAPI ODBC32_SQLSetScrollOptions( - SQLHSTMT statement_handle, - SQLUSMALLINT f_concurrency, - SQLLEN crow_keyset, - SQLUSMALLINT crow_rowset ) +SQLRETURN WINAPI ODBC32_SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset, + SQLUSMALLINT crow_rowset) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetScrollOptions) return SQL_ERROR; - return pSQLSetScrollOptions(statement_handle, f_concurrency, crow_keyset, crow_rowset); + TRACE("(statement_handle %p, f_concurrency %d, crow_keyset %s, crow_rowset %d)\n", statement_handle, + f_concurrency, debugstr_sqllen(crow_keyset), crow_rowset); + + if (!pSQLSetScrollOptions) return SQL_ERROR; + + ret = pSQLSetScrollOptions(statement_handle, f_concurrency, crow_keyset, crow_rowset); + TRACE("Returning %d\n", ret); + return ret; } static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) @@ -2054,137 +2302,161 @@ static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) /************************************************************************* * SQLColAttributesW [ODBC32.106] */ -SQLRETURN WINAPI ODBC32_SQLColAttributesW( - SQLHSTMT hstmt, - SQLUSMALLINT icol, - SQLUSMALLINT fDescType, - SQLPOINTER rgbDesc, - SQLSMALLINT cbDescMax, - SQLSMALLINT *pcbDesc, - SQLLEN *pfDesc) -{ - SQLRETURN iResult; - - TRACE("hstmt=%p icol=%d fDescType=%d rgbDesc=%p cbDescMax=%d pcbDesc=%p pfDesc=%p\n", - hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); - - if (!pSQLColAttributesW) return SQL_ERROR; - - iResult = pSQLColAttributesW(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); - if (iResult == SQL_SUCCESS && rgbDesc != NULL && SQLColAttributes_KnownStringAttribute(fDescType)) { - /* - TRACE("Dumping values fetched via SQLColAttributesW:\n"); - TRACE(" Attribute name : %s\n", debugstr_w(rgbDesc)); - TRACE(" Declared length: %d\n", *pcbDesc); - */ - if (*pcbDesc != lstrlenW(rgbDesc) * 2) { - TRACE("CHEAT: resetting name length for ADO\n"); - *pcbDesc = lstrlenW(rgbDesc) * 2; - } - } - return iResult; +SQLRETURN WINAPI ODBC32_SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, + SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, + SQLLEN *pfDesc) +{ + SQLRETURN ret; + + TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, + fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + + if (!pSQLColAttributesW) return SQL_ERROR; + + ret = pSQLColAttributesW(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + + if (ret == SQL_SUCCESS && SQLColAttributes_KnownStringAttribute(fDescType) && rgbDesc && pcbDesc && + *pcbDesc != lstrlenW(rgbDesc) * 2) + { + TRACE("CHEAT: resetting name length for ADO\n"); + *pcbDesc = lstrlenW(rgbDesc) * 2; + } + + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLConnectW [ODBC32.107] */ -SQLRETURN WINAPI ODBC32_SQLConnectW(SQLHDBC ConnectionHandle, - WCHAR *ServerName, SQLSMALLINT NameLength1, - WCHAR *UserName, SQLSMALLINT NameLength2, - WCHAR *Authentication, SQLSMALLINT NameLength3) +SQLRETURN WINAPI ODBC32_SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMALLINT NameLength1, + WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication, + SQLSMALLINT NameLength3) { - SQLRETURN ret; - TRACE("(Server=%.*s)\n",NameLength1+3, debugstr_w(ServerName)); + SQLRETURN ret; - if (!pSQLConnectW) return SQL_ERROR; + TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," + " NameLength3 %d)\n", ConnectionHandle, debugstr_wn(ServerName, NameLength1), NameLength1, + debugstr_wn(UserName, NameLength2), NameLength2, debugstr_wn(Authentication, NameLength3), NameLength3); - ret = pSQLConnectW(ConnectionHandle, ServerName, NameLength1, - UserName, NameLength2, Authentication, NameLength3); + if (!pSQLConnectW) return SQL_ERROR; - TRACE("Returns %d\n", ret); - return ret; + ret = pSQLConnectW(ConnectionHandle, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLDescribeColW [ODBC32.108] */ -SQLRETURN WINAPI ODBC32_SQLDescribeColW(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, WCHAR *ColumnName, - SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, - SQLSMALLINT *DataType, SQLULEN *ColumnSize, - SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) +SQLRETURN WINAPI ODBC32_SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, WCHAR *ColumnName, + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, + SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) { - SQLRETURN iResult; - TRACE("\n"); + SQLSMALLINT dummy; + SQLRETURN ret; - if (!pSQLDescribeColW) return SQL_ERROR; - - iResult = pSQLDescribeColW(StatementHandle, ColumnNumber, ColumnName, - BufferLength, NameLength, DataType, ColumnSize, - DecimalDigits, Nullable); - if (iResult >= 0) { - TRACE("Successfully recovered the following column information:\n"); - TRACE("\tRequested column index: %d\n", ColumnNumber); - TRACE("\tAvailable length for column name: %d\n", BufferLength); - if (NameLength != NULL) - TRACE("\tActual length for column name: %d\n", *NameLength); - else TRACE("\tActual length for column name: (null)\n"); - TRACE("\tReturned column name: %s\n", debugstr_w(ColumnName)); - } - return iResult; + TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," + " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, + BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); + + if (!pSQLDescribeColW) return SQL_ERROR; + if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ + + ret = pSQLDescribeColW(StatementHandle, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize, + DecimalDigits, Nullable); + if (ret >= 0) + { + if (ColumnName && NameLength) TRACE("ColumnName %s\n", debugstr_wn(ColumnName, *NameLength)); + if (DataType) TRACE("DataType %d\n", *DataType); + if (ColumnSize) TRACE("ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); + if (DecimalDigits) TRACE("DecimalDigits %d\n", *DecimalDigits); + if (Nullable) TRACE("Nullable %d\n", *Nullable); + } + + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLErrorW [ODBC32.110] */ -SQLRETURN WINAPI ODBC32_SQLErrorW(SQLHENV EnvironmentHandle, - SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, - WCHAR *Sqlstate, SQLINTEGER *NativeError, - WCHAR *MessageText, SQLSMALLINT BufferLength, - SQLSMALLINT *TextLength) +SQLRETURN WINAPI ODBC32_SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, + WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLErrorW) return SQL_ERROR; - return pSQLErrorW(EnvironmentHandle, ConnectionHandle, StatementHandle, - Sqlstate, NativeError, MessageText, BufferLength, TextLength); + TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," + " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, + StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + + if (!pSQLErrorW) return SQL_ERROR; + + ret = pSQLErrorW(EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate, NativeError, MessageText, + BufferLength, TextLength); + + if (ret == SQL_SUCCESS) + { + TRACE(" SQLState %s\n", debugstr_wn(Sqlstate, 5)); + TRACE(" Error %d\n", *NativeError); + TRACE(" MessageText %s\n", debugstr_wn(MessageText, *TextLength)); + } + + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLExecDirectW [ODBC32.111] */ -SQLRETURN WINAPI ODBC32_SQLExecDirectW(SQLHSTMT StatementHandle, - WCHAR *StatementText, SQLINTEGER TextLength) +SQLRETURN WINAPI ODBC32_SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_wn(StatementText, TextLength), TextLength); - if (!pSQLExecDirectW) return SQL_ERROR; - return pSQLExecDirectW(StatementHandle, StatementText, TextLength); + if (!pSQLExecDirectW) return SQL_ERROR; + + ret = pSQLExecDirectW(StatementHandle, StatementText, TextLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLGetCursorNameW [ODBC32.117] */ -SQLRETURN WINAPI ODBC32_SQLGetCursorNameW(SQLHSTMT StatementHandle, - WCHAR *CursorName, SQLSMALLINT BufferLength, - SQLSMALLINT *NameLength) +SQLRETURN WINAPI ODBC32_SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT BufferLength, + SQLSMALLINT *NameLength) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, + BufferLength, NameLength); + + if (!pSQLGetCursorNameW) return SQL_ERROR; - if (!pSQLGetCursorNameW) return SQL_ERROR; - return pSQLGetCursorNameW(StatementHandle, CursorName, BufferLength, NameLength); + ret = pSQLGetCursorNameW(StatementHandle, CursorName, BufferLength, NameLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLPrepareW [ODBC32.119] */ -SQLRETURN WINAPI ODBC32_SQLPrepareW(SQLHSTMT StatementHandle, - WCHAR *StatementText, SQLINTEGER TextLength) +SQLRETURN WINAPI ODBC32_SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_wn(StatementText, TextLength), TextLength); - if (!pSQLPrepareW) return SQL_ERROR; - return pSQLPrepareW(StatementHandle, StatementText, TextLength); + if (!pSQLPrepareW) return SQL_ERROR; + + ret = pSQLPrepareW(StatementHandle, StatementText, TextLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* @@ -2192,195 +2464,229 @@ SQLRETURN WINAPI ODBC32_SQLPrepareW(SQLHSTMT StatementHandle, */ SQLRETURN WINAPI ODBC32_SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLSetCursorNameW) return SQL_ERROR; - return pSQLSetCursorNameW(StatementHandle, CursorName, NameLength); + TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, + debugstr_wn(CursorName, NameLength), NameLength); + + if (!pSQLSetCursorNameW) return SQL_ERROR; + + ret = pSQLSetCursorNameW(StatementHandle, CursorName, NameLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLColAttributeW [ODBC32.127] */ -SQLRETURN WINAPI ODBC32_SQLColAttributeW (SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, - SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength, SQLLEN *NumericAttribute) -{ - SQLRETURN iResult; - - TRACE("StatementHandle=%p ColumnNumber=%d FieldIdentifier=%d CharacterAttribute=%p BufferLength=%d StringLength=%p NumericAttribute=%p\n", - StatementHandle, ColumnNumber, FieldIdentifier, - CharacterAttribute, BufferLength, StringLength, NumericAttribute); - - if (!pSQLColAttributeW) return SQL_ERROR; - - iResult = pSQLColAttributeW(StatementHandle, ColumnNumber, FieldIdentifier, - CharacterAttribute, BufferLength, StringLength, NumericAttribute); - if (iResult == SQL_SUCCESS && CharacterAttribute != NULL && SQLColAttributes_KnownStringAttribute(FieldIdentifier)) { - /* - TRACE("Dumping values fetched via SQLColAttributeW:\n"); - TRACE(" Attribute name : %s\n", debugstr_w(rgbDesc)); - TRACE(" Declared length: %d\n", *pcbDesc); - */ - if (*StringLength != lstrlenW(CharacterAttribute) * 2) { - TRACE("CHEAT: resetting name length for ADO\n"); - *StringLength = lstrlenW(CharacterAttribute) * 2; - } - } - return iResult; +SQLRETURN WINAPI ODBC32_SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, + SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLLEN *NumericAttribute) +{ + SQLRETURN ret; + + TRACE("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" + " StringLength %p NumericAttribute %p\n", StatementHandle, ColumnNumber, FieldIdentifier, + CharacterAttribute, BufferLength, StringLength, NumericAttribute); + + if (!pSQLColAttributeW) return SQL_ERROR; + + ret = pSQLColAttributeW(StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, + StringLength, NumericAttribute); + + if (ret == SQL_SUCCESS && CharacterAttribute != NULL && SQLColAttributes_KnownStringAttribute(FieldIdentifier) && + StringLength && *StringLength != lstrlenW(CharacterAttribute) * 2) + { + TRACE("CHEAT: resetting name length for ADO\n"); + *StringLength = lstrlenW(CharacterAttribute) * 2; + } + + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLGetConnectAttrW [ODBC32.132] */ -SQLRETURN WINAPI ODBC32_SQLGetConnectAttrW(SQLHDBC ConnectionHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + Attribute, Value, BufferLength, StringLength); - if (!pSQLGetConnectAttrW) return SQL_ERROR; - return pSQLGetConnectAttrW(ConnectionHandle, Attribute, Value, - BufferLength, StringLength); + if (!pSQLGetConnectAttrW) return SQL_ERROR; + + ret = pSQLGetConnectAttrW(ConnectionHandle, Attribute, Value, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLGetDescFieldW [ODBC32.133] */ -SQLRETURN WINAPI ODBC32_SQLGetDescFieldW(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength, - SQLINTEGER *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", + DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); + + if (!pSQLGetDescFieldW) return SQL_ERROR; - if (!pSQLGetDescFieldW) return SQL_ERROR; - return pSQLGetDescFieldW(DescriptorHandle, RecNumber, FieldIdentifier, - Value, BufferLength, StringLength); + ret = pSQLGetDescFieldW(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLGetDescRecW [ODBC32.134] */ -SQLRETURN WINAPI ODBC32_SQLGetDescRecW(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, WCHAR *Name, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, - SQLSMALLINT *Type, SQLSMALLINT *SubType, - SQLLEN *Length, SQLSMALLINT *Precision, - SQLSMALLINT *Scale, SQLSMALLINT *Nullable) +SQLRETURN WINAPI ODBC32_SQLGetDescRecW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, WCHAR *Name, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, + SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, + SQLSMALLINT *Scale, SQLSMALLINT *Nullable) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," + " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, + StringLength, Type, SubType, Length, Precision, Scale, Nullable); - if (!pSQLGetDescRecW) return SQL_ERROR; - return pSQLGetDescRecW(DescriptorHandle, RecNumber, Name, BufferLength, - StringLength, Type, SubType, Length, Precision, Scale, Nullable); + if (!pSQLGetDescRecW) return SQL_ERROR; + + ret = pSQLGetDescRecW(DescriptorHandle, RecNumber, Name, BufferLength, StringLength, Type, SubType, Length, + Precision, Scale, Nullable); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLGetDiagFieldW [ODBC32.135] */ -SQLRETURN WINAPI ODBC32_SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, - SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, + SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, + SQLSMALLINT *StringLength) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetDiagFieldW) return SQL_ERROR; - return pSQLGetDiagFieldW(HandleType, Handle, RecNumber, DiagIdentifier, - DiagInfo, BufferLength, StringLength); + TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," + " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + + if (!pSQLGetDiagFieldW) return SQL_ERROR; + + ret = pSQLGetDiagFieldW(HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLGetDiagRecW [ODBC32.136] */ -SQLRETURN WINAPI ODBC32_SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT RecNumber, WCHAR *Sqlstate, - SQLINTEGER *NativeError, WCHAR *MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) +SQLRETURN WINAPI ODBC32_SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, + WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," + " TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, + TextLength); - if (!pSQLGetDiagRecW) return SQL_ERROR; - return pSQLGetDiagRecW(HandleType, Handle, RecNumber, Sqlstate, NativeError, - MessageText, BufferLength, TextLength); + if (!pSQLGetDiagRecW) return SQL_ERROR; + + ret = pSQLGetDiagRecW(HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLGetStmtAttrW [ODBC32.138] */ -SQLRETURN WINAPI ODBC32_SQLGetStmtAttrW(SQLHSTMT StatementHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) { - SQLRETURN iResult; + SQLRETURN ret; - TRACE("Attribute = (%02d) Value = %p BufferLength = (%d) StringLength = %p\n", - Attribute, Value, BufferLength, StringLength); + TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, + Attribute, Value, BufferLength, StringLength); - if (Value == NULL) { - WARN("Unexpected NULL in Value return address\n"); - iResult = SQL_ERROR; -/* - } else if (StringLength == NULL) { - WARN("Unexpected NULL in StringLength return address\n"); - iResult = SQL_ERROR; -*/ - } else { - if (!pSQLGetStmtAttrW) return SQL_ERROR; - iResult = pSQLGetStmtAttrW(StatementHandle, Attribute, Value, BufferLength, StringLength); - TRACE("returning %d...\n", iResult); - } - return iResult; + if (!Value) + { + WARN("Unexpected NULL Value return address\n"); + return SQL_ERROR; + } + + if (!pSQLGetStmtAttrW) return SQL_ERROR; + + ret = pSQLGetStmtAttrW(StatementHandle, Attribute, Value, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLSetConnectAttrW [ODBC32.139] */ -SQLRETURN WINAPI ODBC32_SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, - SQLPOINTER Value, SQLINTEGER StringLength) +SQLRETURN WINAPI ODBC32_SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, + StringLength); + + if (!pSQLSetConnectAttrW) return SQL_ERROR; - if (!pSQLSetConnectAttrW) return SQL_ERROR; - return pSQLSetConnectAttrW(ConnectionHandle, Attribute, Value, StringLength); + ret = pSQLSetConnectAttrW(ConnectionHandle, Attribute, Value, StringLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLColumnsW [ODBC32.140] */ -SQLRETURN WINAPI ODBC32_SQLColumnsW(SQLHSTMT StatementHandle, - WCHAR *CatalogName, SQLSMALLINT NameLength1, - WCHAR *SchemaName, SQLSMALLINT NameLength2, - WCHAR *TableName, SQLSMALLINT NameLength3, - WCHAR *ColumnName, SQLSMALLINT NameLength4) +SQLRETURN WINAPI ODBC32_SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSMALLINT NameLength1, + WCHAR *SchemaName, SQLSMALLINT NameLength2, WCHAR *TableName, + SQLSMALLINT NameLength3, WCHAR *ColumnName, SQLSMALLINT NameLength4) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," + " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle, + debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, + debugstr_wn(TableName, NameLength3), NameLength3, debugstr_wn(ColumnName, NameLength4), NameLength4); - if (!pSQLColumnsW) return SQL_ERROR; - return pSQLColumnsW(StatementHandle, CatalogName, NameLength1, - SchemaName, NameLength2, TableName, NameLength3, ColumnName, NameLength4); + if (!pSQLColumnsW) return SQL_ERROR; + + ret = pSQLColumnsW(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3, + ColumnName, NameLength4); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLDriverConnectW [ODBC32.141] */ -SQLRETURN WINAPI ODBC32_SQLDriverConnectW( - SQLHDBC hdbc, - SQLHWND hwnd, - WCHAR *conn_str_in, - SQLSMALLINT len_conn_str_in, - WCHAR *conn_str_out, - SQLSMALLINT conn_str_out_max, - SQLSMALLINT *ptr_conn_str_out, - SQLUSMALLINT driver_completion ) +SQLRETURN WINAPI ODBC32_SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandle, WCHAR *InConnectionString, + SQLSMALLINT Length, WCHAR *OutConnectionString, SQLSMALLINT BufferLength, + SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) { - TRACE("(ConnectionString %s, Length %d)\n", - debugstr_w(conn_str_in), len_conn_str_in); + SQLRETURN ret; + + TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," + " BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle, + debugstr_wn(InConnectionString, Length), Length, OutConnectionString, BufferLength, Length2, + DriverCompletion); - if (!pSQLDriverConnectW) return SQL_ERROR; - return pSQLDriverConnectW(hdbc, hwnd, conn_str_in, len_conn_str_in, conn_str_out, - conn_str_out_max, ptr_conn_str_out, driver_completion); + if (!pSQLDriverConnectW) return SQL_ERROR; + + ret = pSQLDriverConnectW(ConnectionHandle, WindowHandle, InConnectionString, Length, OutConnectionString, + BufferLength, Length2, DriverCompletion); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* @@ -2388,31 +2694,39 @@ SQLRETURN WINAPI ODBC32_SQLDriverConnectW( */ SQLRETURN WINAPI ODBC32_SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLGetConnectOptionW) return SQL_ERROR; - return pSQLGetConnectOptionW(ConnectionHandle, Option, Value); + TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); + + if (!pSQLGetConnectOptionW) return SQL_ERROR; + + ret = pSQLGetConnectOptionW(ConnectionHandle, Option, Value); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLGetInfoW [ODBC32.145] */ -SQLRETURN WINAPI ODBC32_SQLGetInfoW(SQLHDBC ConnectionHandle, - SQLUSMALLINT InfoType, SQLPOINTER InfoValue, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) +SQLRETURN WINAPI ODBC32_SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) { - SQLRETURN iResult; + SQLRETURN ret; - TRACE("InfoType = (%02u), InfoValue = %p, BufferLength = %d bytes\n", InfoType, InfoValue, BufferLength); - if (InfoValue == NULL) { - WARN("Unexpected NULL in InfoValue address\n"); - iResult = SQL_ERROR; - } else { - if (!pSQLGetInfoW) return SQL_ERROR; - iResult = pSQLGetInfoW(ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength); - TRACE("returning %d...\n", iResult); - } - return iResult; + TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); + + if (!InfoValue) + { + WARN("Unexpected NULL InfoValue address\n"); + return SQL_ERROR; + } + + if (!pSQLGetInfoW) return SQL_ERROR; + + ret = pSQLGetInfoW(ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* @@ -2420,10 +2734,15 @@ SQLRETURN WINAPI ODBC32_SQLGetInfoW(SQLHDBC ConnectionHandle, */ SQLRETURN WINAPI ODBC32_SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); - if (!pSQLGetTypeInfoW) return SQL_ERROR; - return pSQLGetTypeInfoW(StatementHandle, DataType); + if (!pSQLGetTypeInfoW) return SQL_ERROR; + + ret = pSQLGetTypeInfoW(StatementHandle, DataType); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* @@ -2431,326 +2750,377 @@ SQLRETURN WINAPI ODBC32_SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT Da */ SQLRETURN WINAPI ODBC32_SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqllen(Value)); + + if (!pSQLSetConnectOptionW) return SQL_ERROR; - if (!pSQLSetConnectOptionW) return SQL_ERROR; - return pSQLSetConnectOptionW(ConnectionHandle, Option, Value); + ret = pSQLSetConnectOptionW(ConnectionHandle, Option, Value); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLSpecialColumnsW [ODBC32.152] */ -SQLRETURN WINAPI ODBC32_SQLSpecialColumnsW(SQLHSTMT StatementHandle, - SQLUSMALLINT IdentifierType, SQLWCHAR *CatalogName, - SQLSMALLINT NameLength1, SQLWCHAR *SchemaName, - SQLSMALLINT NameLength2, SQLWCHAR *TableName, - SQLSMALLINT NameLength3, SQLUSMALLINT Scope, - SQLUSMALLINT Nullable) +SQLRETURN WINAPI ODBC32_SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, + SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, SQLWCHAR *SchemaName, + SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3, + SQLUSMALLINT Scope, SQLUSMALLINT Nullable) { - if (!pSQLSpecialColumnsW) return SQL_ERROR; - return pSQLSpecialColumnsW(StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName, - NameLength2, TableName, NameLength3, Scope, Nullable); + SQLRETURN ret; + + TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," + " TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle, IdentifierType, + debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, + debugstr_wn(TableName, NameLength3), NameLength3, Scope, Nullable); + + if (!pSQLSpecialColumnsW) return SQL_ERROR; + + ret = pSQLSpecialColumnsW(StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName, + NameLength2, TableName, NameLength3, Scope, Nullable); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLStatisticsW [ODBC32.153] */ -SQLRETURN WINAPI ODBC32_SQLStatisticsW(SQLHSTMT StatementHandle, - SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLWCHAR *TableName, SQLSMALLINT NameLength3, - SQLUSMALLINT Unique, SQLUSMALLINT Reserved) +SQLRETURN WINAPI ODBC32_SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, + SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLStatisticsW) return SQL_ERROR; - return pSQLStatisticsW(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, - TableName, NameLength3, Unique, Reserved); + TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" + " NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle, + debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, + debugstr_wn(TableName, NameLength3), NameLength3, Unique, Reserved); + + if (!pSQLStatisticsW) return SQL_ERROR; + + ret = pSQLStatisticsW(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, + NameLength3, Unique, Reserved); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLTablesW [ODBC32.154] */ -SQLRETURN WINAPI ODBC32_SQLTablesW(SQLHSTMT StatementHandle, - SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLWCHAR *TableName, SQLSMALLINT NameLength3, - SQLWCHAR *TableType, SQLSMALLINT NameLength4) +SQLRETURN WINAPI ODBC32_SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, + SQLSMALLINT NameLength3, SQLWCHAR *TableType, SQLSMALLINT NameLength4) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," + " NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle, + debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, + debugstr_wn(TableName, NameLength3), NameLength3, debugstr_wn(TableType, NameLength4), NameLength4); - if (!pSQLTablesW) return SQL_ERROR; - return pSQLTablesW(StatementHandle, CatalogName, NameLength1, - SchemaName, NameLength2, TableName, NameLength3, TableType, NameLength4); + if (!pSQLTablesW) return SQL_ERROR; + + ret = pSQLTablesW(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3, + TableType, NameLength4); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLBrowseConnectW [ODBC32.155] */ -SQLRETURN WINAPI ODBC32_SQLBrowseConnectW( - SQLHDBC hdbc, - SQLWCHAR *szConnStrIn, - SQLSMALLINT cbConnStrIn, - SQLWCHAR *szConnStrOut, - SQLSMALLINT cbConnStrOutMax, - SQLSMALLINT *pcbConnStrOut) +SQLRETURN WINAPI ODBC32_SQLBrowseConnectW(SQLHDBC hdbc, SQLWCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, + SQLWCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", + hdbc, debugstr_wn(szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); + + if (!pSQLBrowseConnectW) return SQL_ERROR; - if (!pSQLBrowseConnectW) return SQL_ERROR; - return pSQLBrowseConnectW(hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, - cbConnStrOutMax, pcbConnStrOut); + ret = pSQLBrowseConnectW(hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLColumnPrivilegesW [ODBC32.156] */ -SQLRETURN WINAPI ODBC32_SQLColumnPrivilegesW( - SQLHSTMT hstmt, - SQLWCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLWCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLWCHAR *szTableName, - SQLSMALLINT cbTableName, - SQLWCHAR *szColumnName, - SQLSMALLINT cbColumnName) +SQLRETURN WINAPI ODBC32_SQLColumnPrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," + " cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt, + debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, + debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, + debugstr_wn(szTableName, cbTableName), cbTableName, + debugstr_wn(szColumnName, cbColumnName), cbColumnName); - if (!pSQLColumnPrivilegesW) return SQL_ERROR; - return pSQLColumnPrivilegesW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szTableName, cbTableName, szColumnName, cbColumnName); + if (!pSQLColumnPrivilegesW) return SQL_ERROR; + + ret = pSQLColumnPrivilegesW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, + cbTableName, szColumnName, cbColumnName); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLDataSourcesW [ODBC32.157] */ -SQLRETURN WINAPI ODBC32_SQLDataSourcesW(SQLHENV EnvironmentHandle, - SQLUSMALLINT Direction, WCHAR *ServerName, - SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, - WCHAR *Description, SQLSMALLINT BufferLength2, - SQLSMALLINT *NameLength2) +SQLRETURN WINAPI ODBC32_SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, WCHAR *ServerName, + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, WCHAR *Description, + SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) { - SQLRETURN ret; + SQLRETURN ret; - TRACE("EnvironmentHandle = %p\n", EnvironmentHandle); + TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," + " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, + NameLength1, Description, BufferLength2, NameLength2); - if (!pSQLDataSourcesW) return SQL_ERROR; + if (!pSQLDataSourcesW) return SQL_ERROR; - ret = pSQLDataSourcesW(EnvironmentHandle, Direction, ServerName, - BufferLength1, NameLength1, Description, BufferLength2, NameLength2); + ret = pSQLDataSourcesW(EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description, + BufferLength2, NameLength2); - if (TRACE_ON(odbc)) - { - TRACE("Returns %d \t", ret); - if (*NameLength1 > 0) - TRACE("DataSource = %s,", debugstr_w(ServerName)); - if (*NameLength2 > 0) - TRACE(" Description = %s", debugstr_w(Description)); - TRACE("\n"); - } + if (ret >= 0 && TRACE_ON(odbc)) + { + if (ServerName && NameLength1 && *NameLength1 > 0) + TRACE(" DataSource %s", debugstr_wn(ServerName, *NameLength1)); + if (Description && NameLength2 && *NameLength2 > 0) + TRACE(" Description %s", debugstr_wn(Description, *NameLength2)); + TRACE("\n"); + } - return ret; + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLForeignKeysW [ODBC32.160] */ -SQLRETURN WINAPI ODBC32_SQLForeignKeysW( - SQLHSTMT hstmt, - SQLWCHAR *szPkCatalogName, - SQLSMALLINT cbPkCatalogName, - SQLWCHAR *szPkSchemaName, - SQLSMALLINT cbPkSchemaName, - SQLWCHAR *szPkTableName, - SQLSMALLINT cbPkTableName, - SQLWCHAR *szFkCatalogName, - SQLSMALLINT cbFkCatalogName, - SQLWCHAR *szFkSchemaName, - SQLSMALLINT cbFkSchemaName, - SQLWCHAR *szFkTableName, - SQLSMALLINT cbFkTableName) +SQLRETURN WINAPI ODBC32_SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, + SQLWCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLWCHAR *szPkTableName, + SQLSMALLINT cbPkTableName, SQLWCHAR *szFkCatalogName, + SQLSMALLINT cbFkCatalogName, SQLWCHAR *szFkSchemaName, + SQLSMALLINT cbFkSchemaName, SQLWCHAR *szFkTableName, SQLSMALLINT cbFkTableName) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLForeignKeysW) return SQL_ERROR; - return pSQLForeignKeysW(hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName, - szPkTableName, cbPkTableName, szFkCatalogName, cbFkCatalogName, - szFkSchemaName, cbFkSchemaName, szFkTableName, cbFkTableName); + TRACE("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," + " szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s," + " cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt, + debugstr_wn(szPkCatalogName, cbPkCatalogName), cbPkCatalogName, + debugstr_wn(szPkSchemaName, cbPkSchemaName), cbPkSchemaName, + debugstr_wn(szPkTableName, cbPkTableName), cbPkTableName, + debugstr_wn(szFkCatalogName, cbFkCatalogName), cbFkCatalogName, + debugstr_wn(szFkSchemaName, cbFkSchemaName), cbFkSchemaName, + debugstr_wn(szFkTableName, cbFkTableName), cbFkTableName); + + if (!pSQLForeignKeysW) return SQL_ERROR; + + ret = pSQLForeignKeysW(hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName, szPkTableName, + cbPkTableName, szFkCatalogName, cbFkCatalogName, szFkSchemaName, cbFkSchemaName, + szFkTableName, cbFkTableName); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLNativeSqlW [ODBC32.162] */ -SQLRETURN WINAPI ODBC32_SQLNativeSqlW( - SQLHDBC hdbc, - SQLWCHAR *szSqlStrIn, - SQLINTEGER cbSqlStrIn, - SQLWCHAR *szSqlStr, - SQLINTEGER cbSqlStrMax, - SQLINTEGER *pcbSqlStr) +SQLRETURN WINAPI ODBC32_SQLNativeSqlW(SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR *szSqlStr, + SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, + debugstr_wn(szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + + if (!pSQLNativeSqlW) return SQL_ERROR; - if (!pSQLNativeSqlW) return SQL_ERROR; - return pSQLNativeSqlW(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + ret = pSQLNativeSqlW(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLPrimaryKeysW [ODBC32.165] */ -SQLRETURN WINAPI ODBC32_SQLPrimaryKeysW( - SQLHSTMT hstmt, - SQLWCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLWCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLWCHAR *szTableName, - SQLSMALLINT cbTableName) +SQLRETURN WINAPI ODBC32_SQLPrimaryKeysW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, + SQLSMALLINT cbTableName) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," + " cbTableName %d)\n", hstmt, + debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, + debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, + debugstr_wn(szTableName, cbTableName), cbTableName); - if (!pSQLPrimaryKeysW) return SQL_ERROR; - return pSQLPrimaryKeysW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szTableName, cbTableName); + if (!pSQLPrimaryKeysW) return SQL_ERROR; + + ret = pSQLPrimaryKeysW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLProcedureColumnsW [ODBC32.166] */ -SQLRETURN WINAPI ODBC32_SQLProcedureColumnsW( - SQLHSTMT hstmt, - SQLWCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLWCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLWCHAR *szProcName, - SQLSMALLINT cbProcName, - SQLWCHAR *szColumnName, - SQLSMALLINT cbColumnName) +SQLRETURN WINAPI ODBC32_SQLProcedureColumnsW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, + SQLSMALLINT cbProcName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName) { - TRACE("\n"); + SQLRETURN ret; - if (!pSQLProcedureColumnsW) return SQL_ERROR; - return pSQLProcedureColumnsW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szProcName, cbProcName, szColumnName, cbColumnName); + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," + " cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt, + debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, + debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, + debugstr_wn(szProcName, cbProcName), cbProcName, + debugstr_wn(szColumnName, cbColumnName), cbColumnName); + + if (!pSQLProcedureColumnsW) return SQL_ERROR; + + ret = pSQLProcedureColumnsW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName, + cbProcName, szColumnName, cbColumnName); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLProceduresW [ODBC32.167] */ -SQLRETURN WINAPI ODBC32_SQLProceduresW( - SQLHSTMT hstmt, - SQLWCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLWCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLWCHAR *szProcName, - SQLSMALLINT cbProcName) +SQLRETURN WINAPI ODBC32_SQLProceduresW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, + SQLSMALLINT cbProcName) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," + " cbProcName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, + debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szProcName, cbProcName), cbProcName); - if (!pSQLProceduresW) return SQL_ERROR; - return pSQLProceduresW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szProcName, cbProcName); + if (!pSQLProceduresW) return SQL_ERROR; + + ret = pSQLProceduresW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName, cbProcName); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLTablePrivilegesW [ODBC32.170] */ -SQLRETURN WINAPI ODBC32_SQLTablePrivilegesW( - SQLHSTMT hstmt, - SQLWCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, - SQLWCHAR *szSchemaName, - SQLSMALLINT cbSchemaName, - SQLWCHAR *szTableName, - SQLSMALLINT cbTableName) +SQLRETURN WINAPI ODBC32_SQLTablePrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, + SQLSMALLINT cbTableName) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," + " cbTableName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, + debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szTableName, cbTableName), cbTableName); + + if (!pSQLTablePrivilegesW) return SQL_ERROR; - if (!pSQLTablePrivilegesW) return SQL_ERROR; - return pSQLTablePrivilegesW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, - szTableName, cbTableName); + ret = pSQLTablePrivilegesW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, + cbTableName); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLDriversW [ODBC32.171] */ -SQLRETURN WINAPI ODBC32_SQLDriversW( - SQLHENV henv, - SQLUSMALLINT fDirection, - SQLWCHAR *szDriverDesc, - SQLSMALLINT cbDriverDescMax, - SQLSMALLINT *pcbDriverDesc, - SQLWCHAR *szDriverAttributes, - SQLSMALLINT cbDriverAttrMax, - SQLSMALLINT *pcbDriverAttr) +SQLRETURN WINAPI ODBC32_SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLWCHAR *szDriverDesc, + SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc, + SQLWCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax, + SQLSMALLINT *pcbDriverAttr) { - SQLRETURN ret; + SQLRETURN ret; - TRACE("(Direction %d)\n", fDirection); + TRACE("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p," + " DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle, fDirection, + szDriverDesc, cbDriverDescMax, pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); - if (!pSQLDriversW) return SQL_ERROR; - ret = pSQLDriversW(henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc, - szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); + if (!pSQLDriversW) return SQL_ERROR; - if (ret == SQL_NO_DATA && fDirection == SQL_FETCH_FIRST) - ERR_(winediag)("No ODBC drivers could be found. " - "Check the settings for your libodbc provider.\n"); + ret = pSQLDriversW(EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc, + szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); - return ret; + if (ret == SQL_NO_DATA && fDirection == SQL_FETCH_FIRST) + ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n"); + + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLSetDescFieldW [ODBC32.173] */ -SQLRETURN WINAPI ODBC32_SQLSetDescFieldW(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength) +SQLRETURN WINAPI ODBC32_SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, + RecNumber, FieldIdentifier, Value, BufferLength); + + if (!pSQLSetDescFieldW) return SQL_ERROR; - if (!pSQLSetDescFieldW) return SQL_ERROR; - return pSQLSetDescFieldW(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength); + ret = pSQLSetDescFieldW(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength); + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLSetStmtAttrW [ODBC32.176] */ -SQLRETURN WINAPI ODBC32_SQLSetStmtAttrW(SQLHSTMT StatementHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength) -{ - SQLRETURN iResult; - TRACE("Attribute = (%02d) Value = %p StringLength = (%d)\n", - Attribute, Value, StringLength); - - if (!pSQLSetStmtAttrW) return SQL_ERROR; - iResult = pSQLSetStmtAttrW(StatementHandle, Attribute, Value, StringLength); - if (iResult == SQL_ERROR && (Attribute == SQL_ROWSET_SIZE || Attribute == SQL_ATTR_ROW_ARRAY_SIZE)) { - TRACE("CHEAT: returning SQL_SUCCESS to ADO...\n"); - iResult = SQL_SUCCESS; - } else { - TRACE("returning %d...\n", iResult); - } - return iResult; +SQLRETURN WINAPI ODBC32_SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) +{ + SQLRETURN ret; + + TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, + StringLength); + + if (!pSQLSetStmtAttrW) return SQL_ERROR; + + ret = pSQLSetStmtAttrW(StatementHandle, Attribute, Value, StringLength); + if (ret == SQL_ERROR && (Attribute == SQL_ROWSET_SIZE || Attribute == SQL_ATTR_ROW_ARRAY_SIZE)) + { + TRACE("CHEAT: returning SQL_SUCCESS to ADO\n"); + return SQL_SUCCESS; + } + + TRACE("Returning %d\n", ret); + return ret; } /************************************************************************* * SQLGetDiagRecA [ODBC32.236] */ -SQLRETURN WINAPI ODBC32_SQLGetDiagRecA(SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT record, - SQLCHAR *sql_state, SQLINTEGER *native_error, - SQLCHAR *error_msg, SQLSMALLINT error_msg_max, - SQLSMALLINT *error_msg_size) +SQLRETURN WINAPI ODBC32_SQLGetDiagRecA(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, + SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) { - TRACE("\n"); + SQLRETURN ret; + + TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," + " TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, + TextLength); if (!pSQLGetDiagRecA) return SQL_ERROR; - return pSQLGetDiagRecA(handle_type, handle, record, sql_state, native_error, error_msg, - error_msg_max, error_msg_size); -} -/* End of file */ + ret = pSQLGetDiagRecA(HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + TRACE("Returning %d\n", ret); + return ret; +} diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 16154bf0bc2..07846b56cd3 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -138,7 +138,7 @@ dll/win32/netapi32 # Forked at Wine-1.3.34 dll/win32/npptools # Synced to WineStaging-4.18 dll/win32/ntdsapi # Synced to WineStaging-4.18 dll/win32/objsel # Synced to WineStaging-4.18 -dll/win32/odbc32 # Synced to WineStaging-4.0. Depends on port of Linux ODBC. +dll/win32/odbc32 # Synced to WineStaging-4.18. Depends on port of Linux ODBC. dll/win32/odbccp32 # Synced to WineStaging-4.0 dll/win32/ole32 # Synced to WineStaging-4.0 dll/win32/oleacc # Synced to WineStaging-4.0
5 years, 1 month
1
0
0
0
[reactos] 01/01: [OBJSEL] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=41203c9bb8f39949f3b28…
commit 41203c9bb8f39949f3b28ca61f13843b34d9874b Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:09:23 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:09:23 2019 +0100 [OBJSEL] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/objsel/objsel_private.h | 1 - media/doc/README.WINE | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dll/win32/objsel/objsel_private.h b/dll/win32/objsel/objsel_private.h index 1d5bc72ad9f..37dd1d876fb 100644 --- a/dll/win32/objsel/objsel_private.h +++ b/dll/win32/objsel/objsel_private.h @@ -37,7 +37,6 @@ #include "olectl.h" #include "unknwn.h" #include "objsel.h" -#include "wine/unicode.h" #include "uuids.h" /********************************************************************** diff --git a/media/doc/README.WINE b/media/doc/README.WINE index fa1e7c39464..16154bf0bc2 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -137,7 +137,7 @@ dll/win32/nddeapi # Synced to WineStaging-3.3 dll/win32/netapi32 # Forked at Wine-1.3.34 dll/win32/npptools # Synced to WineStaging-4.18 dll/win32/ntdsapi # Synced to WineStaging-4.18 -dll/win32/objsel # Synced to WineStaging-3.3 +dll/win32/objsel # Synced to WineStaging-4.18 dll/win32/odbc32 # Synced to WineStaging-4.0. Depends on port of Linux ODBC. dll/win32/odbccp32 # Synced to WineStaging-4.0 dll/win32/ole32 # Synced to WineStaging-4.0
5 years, 1 month
1
0
0
0
[reactos] 01/01: [NTDSAPI] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4cf1f80a0e3420e066adb…
commit 4cf1f80a0e3420e066adbb035d854cf32af22b4f Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:09:00 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:09:00 2019 +0100 [NTDSAPI] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/ntdsapi/ntdsapi.c | 27 +++++++++++++-------------- media/doc/README.WINE | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/dll/win32/ntdsapi/ntdsapi.c b/dll/win32/ntdsapi/ntdsapi.c index 003b1a23614..8966a679acf 100644 --- a/dll/win32/ntdsapi/ntdsapi.c +++ b/dll/win32/ntdsapi/ntdsapi.c @@ -24,7 +24,6 @@ #include "winuser.h" #include "ntdsapi.h" #include "wine/debug.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(ntdsapi); @@ -83,11 +82,11 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, if (!svc_class || !svc_name) return ERROR_INVALID_PARAMETER; - new_spn_length = strlenW(svc_class) + 1 /* for '/' */ + 1 /* for terminating '\0' */; + new_spn_length = lstrlenW(svc_class) + 1 /* for '/' */ + 1 /* for terminating '\0' */; if (inst_name) - new_spn_length += strlenW(inst_name); + new_spn_length += lstrlenW(inst_name); else - new_spn_length += strlenW(svc_name); + new_spn_length += lstrlenW(svc_name); if (inst_port) { USHORT n = inst_port; @@ -99,7 +98,7 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, } while (n != 0); } if (inst_name) - new_spn_length += 1 /* for '/' */ + strlenW(svc_name); + new_spn_length += 1 /* for '/' */ + lstrlenW(svc_name); if (*spn_length < new_spn_length) { @@ -109,21 +108,21 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, *spn_length = new_spn_length; p = spn; - len = strlenW(svc_class); + len = lstrlenW(svc_class); memcpy(p, svc_class, len * sizeof(WCHAR)); p += len; *p = '/'; p++; if (inst_name) { - len = strlenW(inst_name); + len = lstrlenW(inst_name); memcpy(p, inst_name, len * sizeof(WCHAR)); p += len; *p = '\0'; } else { - len = strlenW(svc_name); + len = lstrlenW(svc_name); memcpy(p, svc_name, len * sizeof(WCHAR)); p += len; *p = '\0'; @@ -135,14 +134,14 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, *p = ':'; p++; wsprintfW(p, percentU, inst_port); - p += strlenW(p); + p += lstrlenW(p); } if (inst_name) { *p = '/'; p++; - len = strlenW(svc_name); + len = lstrlenW(svc_name); memcpy(p, svc_name, len * sizeof(WCHAR)); p += len; *p = '\0'; @@ -216,7 +215,7 @@ DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR class, LPCWSTR name, DWORD if (!class || !name || !buflen) return ERROR_INVALID_PARAMETER; - len = strlenW(class) + 1 + strlenW(name) + 1; + len = lstrlenW(class) + 1 + lstrlenW(name) + 1; if (*buflen < len) { *buflen = len; @@ -224,10 +223,10 @@ DWORD WINAPI DsClientMakeSpnForTargetServerW(LPCWSTR class, LPCWSTR name, DWORD } *buflen = len; - memcpy(buf, class, strlenW(class) * sizeof(WCHAR)); - p = buf + strlenW(class); + memcpy(buf, class, lstrlenW(class) * sizeof(WCHAR)); + p = buf + lstrlenW(class); *p++ = '/'; - memcpy(p, name, strlenW(name) * sizeof(WCHAR)); + memcpy(p, name, lstrlenW(name) * sizeof(WCHAR)); buf[len - 1] = 0; return ERROR_SUCCESS; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index a793e1d3dec..fa1e7c39464 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -136,7 +136,7 @@ dll/win32/msxml6 # Synced to WineStaging-3.3 dll/win32/nddeapi # Synced to WineStaging-3.3 dll/win32/netapi32 # Forked at Wine-1.3.34 dll/win32/npptools # Synced to WineStaging-4.18 -dll/win32/ntdsapi # Synced to WineStaging-3.9 +dll/win32/ntdsapi # Synced to WineStaging-4.18 dll/win32/objsel # Synced to WineStaging-3.3 dll/win32/odbc32 # Synced to WineStaging-4.0. Depends on port of Linux ODBC. dll/win32/odbccp32 # Synced to WineStaging-4.0
5 years, 1 month
1
0
0
0
[reactos] 01/01: [NPPTOOLS] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1a3e41e7692f050b90a4d…
commit 1a3e41e7692f050b90a4d6b9b257e2509cde78ea Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:08:38 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:08:38 2019 +0100 [NPPTOOLS] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/npptools/main.c | 1 - media/doc/README.WINE | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dll/win32/npptools/main.c b/dll/win32/npptools/main.c index a72f634e02b..ad2b8931556 100644 --- a/dll/win32/npptools/main.c +++ b/dll/win32/npptools/main.c @@ -16,7 +16,6 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" #include <stdarg.h> diff --git a/media/doc/README.WINE b/media/doc/README.WINE index c4baef83eb3..a793e1d3dec 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -135,7 +135,7 @@ dll/win32/msxml4 # Synced to WineStaging-3.3 dll/win32/msxml6 # Synced to WineStaging-3.3 dll/win32/nddeapi # Synced to WineStaging-3.3 dll/win32/netapi32 # Forked at Wine-1.3.34 -dll/win32/npptools # Synced to WineStaging-3.3 +dll/win32/npptools # Synced to WineStaging-4.18 dll/win32/ntdsapi # Synced to WineStaging-3.9 dll/win32/objsel # Synced to WineStaging-3.3 dll/win32/odbc32 # Synced to WineStaging-4.0. Depends on port of Linux ODBC.
5 years, 1 month
1
0
0
0
[reactos] 01/01: [MSXML3_WINETEST] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=753e05959ceb0b15fd00d…
commit 753e05959ceb0b15fd00ddb86be294b9858af4b8 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:08:17 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:08:17 2019 +0100 [MSXML3_WINETEST] Sync with Wine Staging 4.18. CORE-16441 --- modules/rostests/winetests/msxml3/saxreader.c | 94 ++++++++++++++++++++++++++- modules/rostests/winetests/msxml3/schema.c | 4 +- 2 files changed, 95 insertions(+), 3 deletions(-) diff --git a/modules/rostests/winetests/msxml3/saxreader.c b/modules/rostests/winetests/msxml3/saxreader.c index eeef5b64c12..4e77b00a639 100644 --- a/modules/rostests/winetests/msxml3/saxreader.c +++ b/modules/rostests/winetests/msxml3/saxreader.c @@ -1162,6 +1162,9 @@ static HRESULT WINAPI contentHandler_startPrefixMapping( { struct call_entry call; + ok(prefix != NULL, "prefix == NULL\n"); + ok(uri != NULL, "uri == NULL\n"); + init_call_entry(locator, &call); call.id = CH_STARTPREFIXMAPPING; call.arg1W = SysAllocStringLen(prefix, prefix_len); @@ -1177,6 +1180,8 @@ static HRESULT WINAPI contentHandler_endPrefixMapping( { struct call_entry call; + ok(prefix != NULL, "prefix == NULL\n"); + init_call_entry(locator, &call); call.id = CH_ENDPREFIXMAPPING; call.arg1W = SysAllocStringLen(prefix, len); @@ -1197,6 +1202,10 @@ static HRESULT WINAPI contentHandler_startElement( HRESULT hr; int len; + ok(uri != NULL, "uri == NULL\n"); + ok(localname != NULL, "localname == NULL\n"); + ok(qname != NULL, "qname == NULL\n"); + hr = ISAXAttributes_QueryInterface(saxattr, &IID_IMXAttributes, (void**)&mxattr); EXPECT_HR(hr, E_NOINTERFACE); @@ -1272,6 +1281,10 @@ static HRESULT WINAPI contentHandler_endElement( { struct call_entry call; + ok(uri != NULL, "uri == NULL\n"); + ok(localname != NULL, "localname == NULL\n"); + ok(qname != NULL, "qname == NULL\n"); + init_call_entry(locator, &call); call.id = CH_ENDELEMENT; call.arg1W = SysAllocStringLen(uri, uri_len); @@ -1289,6 +1302,8 @@ static HRESULT WINAPI contentHandler_characters( { struct call_entry call; + ok(chars != NULL, "chars == NULL\n"); + init_call_entry(locator, &call); call.id = CH_CHARACTERS; call.arg1W = SysAllocStringLen(chars, len); @@ -1303,6 +1318,8 @@ static HRESULT WINAPI contentHandler_ignorableWhitespace( { struct call_entry call; + ok(chars != NULL, "chars == NULL\n"); + init_call_entry(locator, &call); call.id = CH_IGNORABLEWHITESPACE; call.arg1W = SysAllocStringLen(chars, len); @@ -1318,6 +1335,9 @@ static HRESULT WINAPI contentHandler_processingInstruction( { struct call_entry call; + ok(target != NULL, "target == NULL\n"); + ok(data != NULL, "data == NULL\n"); + init_call_entry(locator, &call); call.id = CH_PROCESSINGINSTRUCTION; call.arg1W = SysAllocStringLen(target, target_len); @@ -1333,6 +1353,8 @@ static HRESULT WINAPI contentHandler_skippedEntity( { struct call_entry call; + ok(name != NULL, "name == NULL\n"); + init_call_entry(locator, &call); call.id = CH_SKIPPEDENTITY; call.arg1W = SysAllocStringLen(name, len); @@ -3950,10 +3972,13 @@ static const struct writer_characters_t writer_characters[] = { static void test_mxwriter_characters(void) { static const WCHAR chardataW[] = {'T','E','S','T','C','H','A','R','D','A','T','A',' ','.',0}; + static const WCHAR embedded_nullbytes[] = {'a',0,'b',0,0,0,'c',0}; const struct writer_characters_t *table = writer_characters; + IVBSAXContentHandler *vb_content; ISAXContentHandler *content; IMXWriter *writer; VARIANT dest; + BSTR str; HRESULT hr; int i = 0; @@ -3964,6 +3989,9 @@ static void test_mxwriter_characters(void) hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content); EXPECT_HR(hr, S_OK); + hr = IMXWriter_QueryInterface(writer, &IID_IVBSAXContentHandler, (void**)&vb_content); + EXPECT_HR(hr, S_OK); + hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE); EXPECT_HR(hr, S_OK); @@ -3976,6 +4004,10 @@ static void test_mxwriter_characters(void) hr = ISAXContentHandler_characters(content, chardataW, 0); EXPECT_HR(hr, S_OK); + str = _bstr_("VbChars"); + hr = IVBSAXContentHandler_characters(vb_content, &str); + EXPECT_HR(hr, S_OK); + hr = ISAXContentHandler_characters(content, chardataW, ARRAY_SIZE(chardataW) - 1); EXPECT_HR(hr, S_OK); @@ -3983,13 +4015,14 @@ static void test_mxwriter_characters(void) hr = IMXWriter_get_output(writer, &dest); EXPECT_HR(hr, S_OK); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); - ok(!lstrcmpW(_bstr_("TESTCHARDATA ."), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + ok(!lstrcmpW(_bstr_("VbCharsTESTCHARDATA ."), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest); hr = ISAXContentHandler_endDocument(content); EXPECT_HR(hr, S_OK); ISAXContentHandler_Release(content); + IVBSAXContentHandler_Release(vb_content); IMXWriter_Release(writer); /* try empty characters data to see if element is closed */ @@ -4025,6 +4058,65 @@ static void test_mxwriter_characters(void) ISAXContentHandler_Release(content); IMXWriter_Release(writer); + /* test embedded null bytes */ + hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER, + &IID_IMXWriter, (void**)&writer); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE); + EXPECT_HR(hr, S_OK); + + hr = ISAXContentHandler_startDocument(content); + EXPECT_HR(hr, S_OK); + + hr = ISAXContentHandler_characters(content, embedded_nullbytes, ARRAY_SIZE(embedded_nullbytes)); + EXPECT_HR(hr, S_OK); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(SysStringLen(V_BSTR(&dest)) == ARRAY_SIZE(embedded_nullbytes), "unexpected len %d\n", SysStringLen(V_BSTR(&dest))); + ok(!memcmp(V_BSTR(&dest), embedded_nullbytes, ARRAY_SIZE(embedded_nullbytes)), + "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + + ISAXContentHandler_Release(content); + IMXWriter_Release(writer); + + hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER, + &IID_IMXWriter, (void**)&writer); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_QueryInterface(writer, &IID_IVBSAXContentHandler, (void**)&vb_content); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE); + EXPECT_HR(hr, S_OK); + + hr = IVBSAXContentHandler_startDocument(vb_content); + EXPECT_HR(hr, S_OK); + + str = SysAllocStringLen(embedded_nullbytes, ARRAY_SIZE(embedded_nullbytes)); + hr = IVBSAXContentHandler_characters(vb_content, &str); + EXPECT_HR(hr, S_OK); + SysFreeString(str); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(SysStringLen(V_BSTR(&dest)) == ARRAY_SIZE(embedded_nullbytes), "unexpected len %d\n", SysStringLen(V_BSTR(&dest))); + ok(!memcmp(V_BSTR(&dest), embedded_nullbytes, ARRAY_SIZE(embedded_nullbytes)), + "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + + IVBSAXContentHandler_Release(vb_content); + IMXWriter_Release(writer); + /* batch tests */ while (table->clsid) { diff --git a/modules/rostests/winetests/msxml3/schema.c b/modules/rostests/winetests/msxml3/schema.c index a62314dd263..c615e859817 100644 --- a/modules/rostests/winetests/msxml3/schema.c +++ b/modules/rostests/winetests/msxml3/schema.c @@ -1380,10 +1380,10 @@ static void test_XDR_datatypes(void) break; case VT_R8: if (!strcmp(ptr->typename, "float")) - ok(V_R8(&v) == (double)3.14159, "got %f\n", V_R8(&v)); + ok(V_R8(&v) == 3.14159, "got %f\n", V_R8(&v)); else todo_wine - ok(V_R8(&v) == (double)3.14159265358979323846, "got %.20f\n", V_R8(&v)); + ok(V_R8(&v) == 3.14159265358979323846, "got %.20f\n", V_R8(&v)); break; case VT_UI1: ok(V_UI1(&v) == 0xFF, "got %02x\n", V_UI1(&v));
5 years, 1 month
1
0
0
0
[reactos] 01/01: [MSXML3] Sync with Wine Staging 4.18. CORE-16441
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eb44c20c477e01a7a4edc…
commit eb44c20c477e01a7a4edca06bb805d9d3755d59c Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Nov 10 14:07:55 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Nov 10 14:07:55 2019 +0100 [MSXML3] Sync with Wine Staging 4.18. CORE-16441 --- dll/win32/msxml3/dispex.c | 30 +++++--- dll/win32/msxml3/httprequest.c | 2 +- dll/win32/msxml3/main.c | 164 +++++++++++++++++++++++++++++++++++++++++ dll/win32/msxml3/mxwriter.c | 10 +-- dll/win32/msxml3/node.c | 2 +- dll/win32/msxml3/saxreader.c | 10 ++- dll/win32/msxml3/selection.c | 2 +- media/doc/README.WINE | 2 +- 8 files changed, 200 insertions(+), 22 deletions(-) diff --git a/dll/win32/msxml3/dispex.c b/dll/win32/msxml3/dispex.c index bd29a212c8a..b1fb72847e7 100644 --- a/dll/win32/msxml3/dispex.c +++ b/dll/win32/msxml3/dispex.c @@ -150,31 +150,43 @@ static inline unsigned get_libid_from_tid(tid_t tid) return tid_ids[tid].lib; } -HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo) +static HRESULT get_typelib(unsigned lib, ITypeLib **tl) { - unsigned lib = get_libid_from_tid(tid); HRESULT hres; if(!typelib[lib]) { - ITypeLib *tl; - - hres = LoadRegTypeLib(lib_ids[lib].iid, lib_ids[lib].major, 0, LOCALE_SYSTEM_DEFAULT, &tl); + hres = LoadRegTypeLib(lib_ids[lib].iid, lib_ids[lib].major, 0, LOCALE_SYSTEM_DEFAULT, tl); if(FAILED(hres)) { ERR("LoadRegTypeLib failed: %08x\n", hres); return hres; } - if(InterlockedCompareExchangePointer((void**)&typelib[lib], tl, NULL)) - ITypeLib_Release(tl); + if (InterlockedCompareExchangePointer((void**)&typelib[lib], *tl, NULL)) + ITypeLib_Release(*tl); } + *tl = typelib[lib]; + return S_OK; +} + +HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo) +{ + unsigned lib = get_libid_from_tid(tid); + ITypeLib *typelib; + HRESULT hres; + + if (FAILED(hres = get_typelib(lib, &typelib))) + return hres; + if(!typeinfos[tid]) { ITypeInfo *ti; - hres = ITypeLib_GetTypeInfoOfGuid(typelib[lib], get_riid_from_tid(tid), &ti); + hres = ITypeLib_GetTypeInfoOfGuid(typelib, get_riid_from_tid(tid), &ti); if(FAILED(hres)) { /* try harder with typelib from msxml.dll */ - hres = ITypeLib_GetTypeInfoOfGuid(typelib[LibXml], get_riid_from_tid(tid), &ti); + if (FAILED(hres = get_typelib(LibXml, &typelib))) + return hres; + hres = ITypeLib_GetTypeInfoOfGuid(typelib, get_riid_from_tid(tid), &ti); if(FAILED(hres)) { ERR("GetTypeInfoOfGuid failed: %08x\n", hres); return hres; diff --git a/dll/win32/msxml3/httprequest.c b/dll/win32/msxml3/httprequest.c index 07eeb743702..c6f9fdb33eb 100644 --- a/dll/win32/msxml3/httprequest.c +++ b/dll/win32/msxml3/httprequest.c @@ -759,7 +759,7 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback * case VT_ARRAY|VT_UI1: { sa = V_ARRAY(body); - if ((hr = SafeArrayAccessData(sa, (void **)&ptr)) != S_OK) + if ((hr = SafeArrayAccessData(sa, &ptr)) != S_OK) { heap_free(bsc); return hr; diff --git a/dll/win32/msxml3/main.c b/dll/win32/msxml3/main.c index debd84e0903..fb94bb2de06 100644 --- a/dll/win32/msxml3/main.c +++ b/dll/win32/msxml3/main.c @@ -230,6 +230,168 @@ static void init_libxslt(void) #endif } +static int to_utf8(int cp, unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + WCHAR *tmp; + int len; + + if (!in || !inlen) return 0; + + len = MultiByteToWideChar(cp, 0, (const char *)in, *inlen, NULL, 0); + tmp = heap_alloc(len * sizeof(WCHAR)); + if (!tmp) return -1; + MultiByteToWideChar(cp, 0, (const char *)in, *inlen, tmp, len); + + len = WideCharToMultiByte(CP_UTF8, 0, tmp, len, (char *)out, *outlen, NULL, NULL); + heap_free(tmp); + if (!len) return -1; + + *outlen = len; + return len; +} + +static int from_utf8(int cp, unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + WCHAR *tmp; + int len; + + if (!in || !inlen) return 0; + + len = MultiByteToWideChar(CP_UTF8, 0, (const char *)in, *inlen, NULL, 0); + tmp = heap_alloc(len * sizeof(WCHAR)); + if (!tmp) return -1; + MultiByteToWideChar(CP_UTF8, 0, (const char *)in, *inlen, tmp, len); + + len = WideCharToMultiByte(cp, 0, tmp, len, (char *)out, *outlen, NULL, NULL); + heap_free(tmp); + if (!len) return -1; + + *outlen = len; + return len; +} + +static int win1250_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(1250, out, outlen, in, inlen); +} + +static int utf8_to_win1250(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(1250, out, outlen, in, inlen); +} + +static int win1251_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(1251, out, outlen, in, inlen); +} + +static int utf8_to_win1251(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(1251, out, outlen, in, inlen); +} + +static int win1252_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(1252, out, outlen, in, inlen); +} + +static int utf8_to_win1252(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(1252, out, outlen, in, inlen); +} + +static int win1253_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(1253, out, outlen, in, inlen); +} + +static int utf8_to_win1253(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(1253, out, outlen, in, inlen); +} +static int win1254_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(1254, out, outlen, in, inlen); +} + +static int utf8_to_win1254(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(1254, out, outlen, in, inlen); +} + +static int win1255_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(1255, out, outlen, in, inlen); +} + +static int utf8_to_win1255(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(1255, out, outlen, in, inlen); +} + +static int win1256_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(1256, out, outlen, in, inlen); +} + +static int utf8_to_win1256(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(1256, out, outlen, in, inlen); +} + +static int win1257_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(1257, out, outlen, in, inlen); +} + +static int utf8_to_win1257(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(1257, out, outlen, in, inlen); +} + +static int win1258_to_utf8(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return to_utf8(1258, out, outlen, in, inlen); +} + +static int utf8_to_win1258(unsigned char *out, int *outlen, const unsigned char *in, int *inlen) +{ + return from_utf8(1258, out, outlen, in, inlen); +} + +static void init_char_encoders(void) +{ + static const struct + { + const char *encoding; + xmlCharEncodingInputFunc input; + xmlCharEncodingOutputFunc output; + } encoder[] = + { + { "windows-1250", win1250_to_utf8, utf8_to_win1250 }, + { "windows-1251", win1251_to_utf8, utf8_to_win1251 }, + { "windows-1252", win1252_to_utf8, utf8_to_win1252 }, + { "windows-1253", win1253_to_utf8, utf8_to_win1253 }, + { "windows-1254", win1254_to_utf8, utf8_to_win1254 }, + { "windows-1255", win1255_to_utf8, utf8_to_win1255 }, + { "windows-1256", win1256_to_utf8, utf8_to_win1256 }, + { "windows-1257", win1257_to_utf8, utf8_to_win1257 }, + { "windows-1258", win1258_to_utf8, utf8_to_win1258 } + }; + int i; + + xmlInitCharEncodingHandlers(); + + for (i = 0; i < ARRAY_SIZE(encoder); i++) + { + if (!xmlFindCharEncodingHandler(encoder[i].encoding)) + { + TRACE("Adding %s encoding handler\n", encoder[i].encoding); + xmlNewCharEncodingHandler(encoder[i].encoding, encoder[i].input, encoder[i].output); + } + } +} + #endif /* HAVE_LIBXML2 */ @@ -259,6 +421,8 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID reserved) wineXmlReadCallback, wineXmlFileCloseCallback) == -1) WARN("Failed to register callbacks\n"); + init_char_encoders(); + schemasInit(); init_libxslt(); #endif diff --git a/dll/win32/msxml3/mxwriter.c b/dll/win32/msxml3/mxwriter.c index 10be2508b21..a5bfdf1e991 100644 --- a/dll/win32/msxml3/mxwriter.c +++ b/dll/win32/msxml3/mxwriter.c @@ -498,10 +498,10 @@ static WCHAR *get_escaped_string(const WCHAR *str, escape_mode mode, int *len) WCHAR *ptr, *ret; /* default buffer size to something if length is unknown */ - conv_len = *len == -1 ? default_alloc : max(2**len, default_alloc); + conv_len = max(2**len, default_alloc); ptr = ret = heap_alloc(conv_len*sizeof(WCHAR)); - while (*str && p) + while (p) { if (ptr - ret > conv_len - grow_thresh) { @@ -539,10 +539,10 @@ static WCHAR *get_escaped_string(const WCHAR *str, escape_mode mode, int *len) } str++; - if (*len != -1) p--; + p--; } - if (*len != -1) *len = ptr-ret; + *len = ptr-ret; *++ptr = 0; return ret; @@ -2206,7 +2206,7 @@ static HRESULT WINAPI VBSAXContentHandler_characters(IVBSAXContentHandler *iface if (!chars) return E_POINTER; - return ISAXContentHandler_characters(&This->ISAXContentHandler_iface, *chars, -1); + return ISAXContentHandler_characters(&This->ISAXContentHandler_iface, *chars, SysStringLen(*chars)); } static HRESULT WINAPI VBSAXContentHandler_ignorableWhitespace(IVBSAXContentHandler *iface, BSTR *chars) diff --git a/dll/win32/msxml3/node.c b/dll/win32/msxml3/node.c index fc18935b69b..27abf945301 100644 --- a/dll/win32/msxml3/node.c +++ b/dll/win32/msxml3/node.c @@ -1217,7 +1217,7 @@ static HRESULT node_transform_write(xsltStylesheetPtr style, xmlDocPtr result, B htmlSetMetaEncoding(result, (const xmlChar *)encoding); if (indent == -1) indent = 1; - htmldoc_dumpcontent(output, result, (const char*)encoding, indent); + htmldoc_dumpcontent(output, result, encoding, indent); } else if (method && xmlStrEqual(method, (const xmlChar *)"xhtml")) { diff --git a/dll/win32/msxml3/saxreader.c b/dll/win32/msxml3/saxreader.c index 04fab81708c..fc27260cc2c 100644 --- a/dll/win32/msxml3/saxreader.c +++ b/dll/win32/msxml3/saxreader.c @@ -149,6 +149,8 @@ static saxreader_feature get_saxreader_feature(const WCHAR *name) return FeatureUnknown; } +static const WCHAR empty_str; + struct bstrpool { BSTR *pool; @@ -1665,8 +1667,8 @@ static void libxmlStartElementNS( &uri, &local, &element->qname, &This->IVBSAXAttributes_iface); else hr = ISAXContentHandler_startElement(handler->handler, - uri, SysStringLen(uri), - local, SysStringLen(local), + uri ? uri : &empty_str, SysStringLen(uri), + local ? local : &empty_str, SysStringLen(local), element->qname, SysStringLen(element->qname), &This->ISAXAttributes_iface); @@ -1739,8 +1741,8 @@ static void libxmlEndElementNS( else hr = ISAXContentHandler_endElement( handler->handler, - uri, SysStringLen(uri), - local, SysStringLen(local), + uri ? uri : &empty_str, SysStringLen(uri), + local ? local : &empty_str, SysStringLen(local), element->qname, SysStringLen(element->qname)); free_attribute_values(This); diff --git a/dll/win32/msxml3/selection.c b/dll/win32/msxml3/selection.c index b7c560a9a5b..31be4d8f101 100644 --- a/dll/win32/msxml3/selection.c +++ b/dll/win32/msxml3/selection.c @@ -831,7 +831,7 @@ HRESULT create_selection(xmlNodePtr node, xmlChar* query, IXMLDOMNodeList **out) TRACE("found %d matches\n", xmlXPathNodeSetGetLength(This->result->nodesetval)); cleanup: - if (This && FAILED(hr)) + if (FAILED(hr)) IXMLDOMSelection_Release( &This->IXMLDOMSelection_iface ); xmlXPathFreeContext(ctxt); return hr; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 3e2c2f7a2e7..c4baef83eb3 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -130,7 +130,7 @@ dll/win32/msvfw32 # Synced to WineStaging-4.18 dll/win32/msvidc32 # Synced to WineStaging-4.0 dll/win32/msxml # Synced to WineStaging-3.3 dll/win32/msxml2 # Synced to WineStaging-3.3 -dll/win32/msxml3 # Synced to WineStaging-4.0 +dll/win32/msxml3 # Synced to WineStaging-4.18 dll/win32/msxml4 # Synced to WineStaging-3.3 dll/win32/msxml6 # Synced to WineStaging-3.3 dll/win32/nddeapi # Synced to WineStaging-3.3
5 years, 1 month
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
33
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Results per page:
10
25
50
100
200