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
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2019
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
31 participants
300 discussions
Start a n
N
ew thread
[reactos] 01/01: [OLEACC] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=016864f8ffb7cd11f3d83…
commit 016864f8ffb7cd11f3d83a02be1f65f9e40731ff Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:16:40 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:16:40 2019 +0100 [OLEACC] Sync with Wine Staging 4.0. CORE-15682 --- dll/win32/oleacc/client.c | 4 ++-- dll/win32/oleacc/main.c | 18 +++++++++--------- media/doc/README.WINE | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dll/win32/oleacc/client.c b/dll/win32/oleacc/client.c index 5b1f0eee5f..40e7fbd653 100644 --- a/dll/win32/oleacc/client.c +++ b/dll/win32/oleacc/client.c @@ -168,7 +168,7 @@ static HRESULT WINAPI Client_get_accName(IAccessible *iface, VARIANT varID, BSTR if(convert_child_id(&varID) != CHILDID_SELF || !IsWindow(This->hwnd)) return E_INVALIDARG; - len = SendMessageW(This->hwnd, WM_GETTEXT, sizeof(name)/sizeof(WCHAR), (LPARAM)name); + len = SendMessageW(This->hwnd, WM_GETTEXT, ARRAY_SIZE(name), (LPARAM)name); if(!len) return S_FALSE; @@ -286,7 +286,7 @@ static HRESULT WINAPI Client_get_accKeyboardShortcut(IAccessible *iface, if(convert_child_id(&varID) != CHILDID_SELF) return E_INVALIDARG; - len = SendMessageW(This->hwnd, WM_GETTEXT, sizeof(name)/sizeof(WCHAR), (LPARAM)name); + len = SendMessageW(This->hwnd, WM_GETTEXT, ARRAY_SIZE(name), (LPARAM)name); for(i=0; i<len; i++) { if(name[i] == '&') break; diff --git a/dll/win32/oleacc/main.c b/dll/win32/oleacc/main.c index ee8a6c03b1..01ff5752b8 100644 --- a/dll/win32/oleacc/main.c +++ b/dll/win32/oleacc/main.c @@ -109,11 +109,11 @@ static accessible_create get_builtin_accessible_obj(HWND hwnd, LONG objid) WCHAR class_name[64]; int i, idx; - if(!RealGetWindowClassW(hwnd, class_name, sizeof(class_name)/sizeof(WCHAR))) + if(!RealGetWindowClassW(hwnd, class_name, ARRAY_SIZE(class_name))) return NULL; TRACE("got window class: %s\n", debugstr_w(class_name)); - for(i=0; i<sizeof(builtin_classes)/sizeof(builtin_classes[0]); i++) { + for(i=0; i<ARRAY_SIZE(builtin_classes); i++) { if(!strcmpiW(class_name, builtin_classes[i].name)) { accessible_create ret; @@ -128,7 +128,7 @@ static accessible_create get_builtin_accessible_obj(HWND hwnd, LONG objid) idx = SendMessageW(hwnd, WM_GETOBJECT, 0, OBJID_QUERYCLASSNAMEIDX); if(idx) { - for(i=0; i<sizeof(builtin_classes)/sizeof(builtin_classes[0]); i++) { + for(i=0; i<ARRAY_SIZE(builtin_classes); i++) { if(idx == builtin_classes[i].idx) { accessible_create ret; @@ -172,7 +172,7 @@ HRESULT WINAPI CreateStdAccessibleObject( HWND hwnd, LONG idObject, HRESULT WINAPI ObjectFromLresult( LRESULT result, REFIID riid, WPARAM wParam, void **ppObject ) { - WCHAR atom_str[sizeof(lresult_atom_prefix)/sizeof(WCHAR)+3*8+3]; + WCHAR atom_str[ARRAY_SIZE(lresult_atom_prefix)+3*8+3]; HANDLE server_proc, server_mapping, mapping; DWORD proc_id, size; IStream *stream; @@ -193,11 +193,11 @@ HRESULT WINAPI ObjectFromLresult( LRESULT result, REFIID riid, WPARAM wParam, vo if(result != (ATOM)result) return E_FAIL; - if(!GlobalGetAtomNameW(result, atom_str, sizeof(atom_str)/sizeof(WCHAR))) + if(!GlobalGetAtomNameW(result, atom_str, ARRAY_SIZE(atom_str))) return E_FAIL; if(memcmp(atom_str, lresult_atom_prefix, sizeof(lresult_atom_prefix))) return E_FAIL; - p = atom_str + sizeof(lresult_atom_prefix)/sizeof(WCHAR); + p = atom_str + ARRAY_SIZE(lresult_atom_prefix); proc_id = strtoulW(p, &p, 16); if(*p != ':') return E_FAIL; @@ -247,7 +247,7 @@ LRESULT WINAPI LresultFromObject( REFIID riid, WPARAM wParam, LPUNKNOWN pAcc ) static const WCHAR atom_fmt[] = {'%','0','8','x',':','%','0','8','x',':','%','0','8','x',0}; static const LARGE_INTEGER seek_zero = {{0}}; - WCHAR atom_str[sizeof(lresult_atom_prefix)/sizeof(WCHAR)+3*8+3]; + WCHAR atom_str[ARRAY_SIZE(lresult_atom_prefix)+3*8+3]; IStream *stream; HANDLE mapping; STATSTG stat; @@ -320,8 +320,8 @@ LRESULT WINAPI LresultFromObject( REFIID riid, WPARAM wParam, LPUNKNOWN pAcc ) } memcpy(atom_str, lresult_atom_prefix, sizeof(lresult_atom_prefix)); - sprintfW(atom_str+sizeof(lresult_atom_prefix)/sizeof(WCHAR), - atom_fmt, GetCurrentProcessId(), HandleToUlong(mapping), stat.cbSize.u.LowPart); + sprintfW(atom_str+ARRAY_SIZE(lresult_atom_prefix), atom_fmt, GetCurrentProcessId(), + HandleToUlong(mapping), stat.cbSize.u.LowPart); atom = GlobalAddAtomW(atom_str); if(!atom) { CloseHandle(mapping); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 5313ce69e9..3a4fd476f0 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -140,7 +140,7 @@ reactos/dll/win32/objsel # Synced to WineStaging-3.3 reactos/dll/win32/odbc32 # Synced to WineStaging-4.0. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-4.0 reactos/dll/win32/ole32 # Synced to WineStaging-4.0 -reactos/dll/win32/oleacc # Synced to WineStaging-3.3 +reactos/dll/win32/oleacc # Synced to WineStaging-4.0 reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3 reactos/dll/win32/olecli32 # Synced to WineStaging-3.3 reactos/dll/win32/oledlg # Synced to WineStaging-3.3
5 years, 12 months
1
0
0
0
[reactos] 01/01: [OLE32_WINETEST] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5c1bcfec6933973cf7f67…
commit 5c1bcfec6933973cf7f674f9073e44882002e575 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:16:05 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:16:05 2019 +0100 [OLE32_WINETEST] Sync with Wine Staging 4.0. CORE-15682 --- modules/rostests/winetests/ole32/clipboard.c | 198 +++++++++++-- modules/rostests/winetests/ole32/compobj.c | 16 +- modules/rostests/winetests/ole32/dragdrop.c | 2 +- modules/rostests/winetests/ole32/marshal.c | 396 +++++++++++++++++++++++-- modules/rostests/winetests/ole32/moniker.c | 20 +- modules/rostests/winetests/ole32/ole2.c | 207 ++++++++++++- modules/rostests/winetests/ole32/ole_server.c | 5 +- modules/rostests/winetests/ole32/propvariant.c | 2 +- modules/rostests/winetests/ole32/stg_prop.c | 6 - modules/rostests/winetests/ole32/storage32.c | 12 +- modules/rostests/winetests/ole32/usrmarshal.c | 2 +- 11 files changed, 770 insertions(+), 96 deletions(-) diff --git a/modules/rostests/winetests/ole32/clipboard.c b/modules/rostests/winetests/ole32/clipboard.c index 002312d448..d7f18ef245 100644 --- a/modules/rostests/winetests/ole32/clipboard.c +++ b/modules/rostests/winetests/ole32/clipboard.c @@ -61,6 +61,7 @@ typedef struct DataObjectImpl { HANDLE text; IStream *stm; IStorage *stg; + HMETAFILEPICT hmfp; } DataObjectImpl; typedef struct EnumFormatImpl { @@ -82,6 +83,26 @@ static UINT cf_stream, cf_storage, cf_global, cf_another, cf_onemore; static HRESULT EnumFormatImpl_Create(FORMATETC *fmtetc, UINT size, LPENUMFORMATETC *lplpformatetc); +static HMETAFILE create_mf(void) +{ + RECT rect = {0, 0, 100, 100}; + HDC hdc = CreateMetaFileA(NULL); + ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, &rect, "Test String", strlen("Test String"), NULL); + return CloseMetaFile(hdc); +} + +static HMETAFILEPICT create_metafilepict(void) +{ + HGLOBAL ret = GlobalAlloc(GMEM_MOVEABLE, sizeof(METAFILEPICT)); + METAFILEPICT *mf = GlobalLock(ret); + mf->mm = MM_ANISOTROPIC; + mf->xExt = 100; + mf->yExt = 200; + mf->hMF = create_mf(); + GlobalUnlock(ret); + return ret; +} + static inline DataObjectImpl *impl_from_IDataObject(IDataObject *iface) { return CONTAINING_RECORD(iface, DataObjectImpl, IDataObject_iface); @@ -232,6 +253,12 @@ static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface) HeapFree(GetProcessHeap(), 0, This->fmtetc); if(This->stm) IStream_Release(This->stm); if(This->stg) IStorage_Release(This->stg); + if(This->hmfp) { + METAFILEPICT *mfp = GlobalLock(This->hmfp); + DeleteMetaFile(mfp->hMF); + GlobalUnlock(This->hmfp); + GlobalFree(This->hmfp); + } HeapFree(GetProcessHeap(), 0, This); } @@ -242,7 +269,6 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor { DataObjectImpl *This = impl_from_IDataObject(iface); UINT i; - BOOL foundFormat = FALSE; trace("getdata: %s\n", dump_fmtetc(pformatetc)); @@ -259,7 +285,6 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor { if(This->fmtetc[i].cfFormat == pformatetc->cfFormat) { - foundFormat = TRUE; if(This->fmtetc[i].tymed & pformatetc->tymed) { pmedium->pUnkForRelease = (LPUNKNOWN)iface; @@ -282,12 +307,17 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor IStorage_AddRef(This->stg); U(*pmedium).pstg = This->stg; } + else if(pformatetc->cfFormat == CF_METAFILEPICT) + { + pmedium->tymed = TYMED_MFPICT; + U(*pmedium).hMetaFilePict = This->hmfp; + } return S_OK; } } } - return foundFormat ? DV_E_TYMED : DV_E_FORMATETC; + return E_FAIL; } static HRESULT WINAPI DataObjectImpl_GetDataHere(IDataObject* iface, FORMATETC *pformatetc, STGMEDIUM *pmedium) @@ -384,27 +414,34 @@ static const IDataObjectVtbl VT_DataObjectImpl = DataObjectImpl_EnumDAdvise }; -static HRESULT DataObjectImpl_CreateText(LPCSTR text, LPDATAOBJECT *lplpdataobj) +static HRESULT DataObjectImpl_CreateFromHGlobal(HGLOBAL text, LPDATAOBJECT *dataobj) { DataObjectImpl *obj; obj = HeapAlloc(GetProcessHeap(), 0, sizeof(DataObjectImpl)); obj->IDataObject_iface.lpVtbl = &VT_DataObjectImpl; obj->ref = 1; - obj->text = GlobalAlloc(GMEM_MOVEABLE, strlen(text) + 1); - strcpy(GlobalLock(obj->text), text); - GlobalUnlock(obj->text); + obj->text = text; obj->stm = NULL; obj->stg = NULL; + obj->hmfp = NULL; obj->fmtetc_cnt = 1; obj->fmtetc = HeapAlloc(GetProcessHeap(), 0, obj->fmtetc_cnt*sizeof(FORMATETC)); InitFormatEtc(obj->fmtetc[0], CF_TEXT, TYMED_HGLOBAL); - *lplpdataobj = &obj->IDataObject_iface; + *dataobj = &obj->IDataObject_iface; return S_OK; } +static HRESULT DataObjectImpl_CreateText(LPCSTR text, LPDATAOBJECT *lplpdataobj) +{ + HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, strlen(text) + 1); + strcpy(GlobalLock(h), text); + GlobalUnlock(h); + return DataObjectImpl_CreateFromHGlobal(h, lplpdataobj); +} + static const char *cmpl_stm_data = "complex stream"; static const char *cmpl_text_data = "complex text"; static const WCHAR device_name[] = {'m','y','d','e','v',0}; @@ -428,7 +465,9 @@ static HRESULT DataObjectImpl_CreateComplex(LPDATAOBJECT *lplpdataobj) StgCreateDocfileOnILockBytes(lbs, STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &obj->stg); ILockBytes_Release(lbs); - obj->fmtetc_cnt = 8; + obj->hmfp = create_metafilepict(); + + obj->fmtetc_cnt = 9; /* zeroing here since FORMATETC has a hole in it, and it's confusing to have this uninitialised. */ obj->fmtetc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, obj->fmtetc_cnt*sizeof(FORMATETC)); InitFormatEtc(obj->fmtetc[0], CF_TEXT, TYMED_HGLOBAL); @@ -456,6 +495,7 @@ static HRESULT DataObjectImpl_CreateComplex(LPDATAOBJECT *lplpdataobj) InitFormatEtc(obj->fmtetc[6], cf_another, 0xfffff); InitFormatEtc(obj->fmtetc[7], cf_another, 0xfffff); obj->fmtetc[7].dwAspect = DVASPECT_ICON; + InitFormatEtc(obj->fmtetc[8], CF_METAFILEPICT, TYMED_MFPICT); *lplpdataobj = &obj->IDataObject_iface; return S_OK; @@ -510,13 +550,11 @@ static void test_get_clipboard(void) ok(hr == DV_E_FORMATETC || broken(hr == S_OK), "IDataObject_QueryGetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); - InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL); - fmtetc.cfFormat = CF_RIFF; + InitFormatEtc(fmtetc, CF_RIFF, TYMED_HGLOBAL); hr = IDataObject_QueryGetData(data_obj, &fmtetc); ok(hr == DV_E_CLIPFORMAT, "IDataObject_QueryGetData should have failed with DV_E_CLIPFORMAT instead of 0x%08x\n", hr); - InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL); - fmtetc.tymed = TYMED_FILE; + InitFormatEtc(fmtetc, CF_TEXT, TYMED_FILE); hr = IDataObject_QueryGetData(data_obj, &fmtetc); ok(hr == S_OK, "IDataObject_QueryGetData failed with error 0x%08x\n", hr); @@ -554,14 +592,12 @@ static void test_get_clipboard(void) ReleaseStgMedium(&stgmedium); } - InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL); - fmtetc.cfFormat = CF_RIFF; + InitFormatEtc(fmtetc, CF_RIFF, TYMED_HGLOBAL); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); ok(hr == DV_E_FORMATETC, "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); - InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL); - fmtetc.tymed = TYMED_FILE; + InitFormatEtc(fmtetc, CF_TEXT, TYMED_FILE); hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); ok(hr == DV_E_TYMED, "IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08x\n", hr); if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); @@ -591,6 +627,11 @@ static void test_enum_fmtetc(IDataObject *src) hr = IDataObject_EnumFormatEtc(data, DATADIR_GET, &enum_fmt); ok(hr == S_OK, "got %08x\n", hr); ok(DataObjectImpl_EnumFormatEtc_calls == 0, "EnumFormatEtc was called\n"); + if (FAILED(hr)) + { + skip("EnumFormatEtc failed, skipping tests.\n"); + return; + } if(src) IDataObject_EnumFormatEtc(src, DATADIR_GET, &src_enum); @@ -826,6 +867,44 @@ static void test_cf_dataobject(IDataObject *data) ok(found_priv_data, "didn't find cf_ole_priv_data\n"); } +static void test_complex_get_clipboard(void) +{ + HRESULT hr; + IDataObject *data_obj; + FORMATETC fmtetc; + STGMEDIUM stgmedium; + + hr = OleGetClipboard(&data_obj); + ok(hr == S_OK, "OleGetClipboard failed with error 0x%08x\n", hr); + + DataObjectImpl_GetData_calls = 0; + + InitFormatEtc(fmtetc, CF_METAFILEPICT, TYMED_MFPICT); + hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); + ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); + + InitFormatEtc(fmtetc, CF_METAFILEPICT, TYMED_HGLOBAL); + hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); + ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); + + InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_HGLOBAL); + hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); + ok(hr == DV_E_TYMED, "IDataObject_GetData failed with error 0x%08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); + + InitFormatEtc(fmtetc, CF_ENHMETAFILE, TYMED_ENHMF); + hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); + ok(hr == S_OK, "IDataObject_GetData failed with error 0x%08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&stgmedium); + + ok(DataObjectImpl_GetData_calls == 5, + "DataObjectImpl_GetData called 5 times instead of %d times\n", + DataObjectImpl_GetData_calls); + IDataObject_Release(data_obj); +} + static void test_set_clipboard(void) { HRESULT hr; @@ -933,6 +1012,7 @@ static void test_set_clipboard(void) trace("setting complex\n"); hr = OleSetClipboard(data_cmpl); ok(hr == S_OK, "failed to set clipboard to complex data, hr = 0x%08x\n", hr); + test_complex_get_clipboard(); test_cf_dataobject(data_cmpl); test_enum_fmtetc(data_cmpl); @@ -1206,6 +1286,24 @@ static void test_consumer_refs(void) IDataObject_Release(src); } +static HGLOBAL create_storage(void) +{ + ILockBytes *ilb; + IStorage *stg; + HGLOBAL hg; + HRESULT hr; + + hr = CreateILockBytesOnHGlobal(NULL, FALSE, &ilb); + ok(hr == S_OK, "got %08x\n", hr); + hr = StgCreateDocfileOnILockBytes(ilb, STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &stg); + ok(hr == S_OK, "got %08x\n", hr); + IStorage_Release(stg); + hr = GetHGlobalFromILockBytes(ilb, &hg); + ok(hr == S_OK, "got %08x\n", hr); + ILockBytes_Release(ilb); + return hg; +} + static void test_flushed_getdata(void) { HRESULT hr; @@ -1347,9 +1445,51 @@ static void test_flushed_getdata(void) HeapFree(GetProcessHeap(), 0, fmt.ptd); } + /* CF_ENHMETAFILE format */ + InitFormatEtc(fmt, CF_ENHMETAFILE, TYMED_ENHMF); + hr = IDataObject_GetData(get, &fmt, &med); + ok(hr == S_OK, "got %08x\n", hr); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + + IDataObject_Release(get); + IDataObject_Release(src); + + hr = DataObjectImpl_CreateFromHGlobal(create_storage(), &src); + ok(hr == S_OK, "got %08x\n", hr); + + hr = OleSetClipboard(src); + ok(hr == S_OK, "got %08x\n", hr); + + hr = OleGetClipboard(&get); + ok(hr == S_OK, "got %08x\n", hr); + InitFormatEtc(fmt, CF_TEXT, TYMED_ISTORAGE); + hr = IDataObject_GetData(get, &fmt, &med); + ok(hr == S_OK, "got %08x\n", hr); + ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + IDataObject_Release(get); + + hr = OleFlushClipboard(); + ok(hr == S_OK, "got %08x\n", hr); + + hr = OleGetClipboard(&get); + ok(hr == S_OK, "got %08x\n", hr); + + InitFormatEtc(fmt, CF_TEXT, TYMED_ISTORAGE); + hr = IDataObject_GetData(get, &fmt, &med); + ok(hr == S_OK, "got %08x\n", hr); + ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + + InitFormatEtc(fmt, CF_TEXT, 0xffff); + hr = IDataObject_GetData(get, &fmt, &med); + ok(hr == S_OK, "got %08x\n", hr); + ok(med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); IDataObject_Release(get); IDataObject_Release(src); + OleUninitialize(); } @@ -1377,7 +1517,7 @@ static void test_nonole_clipboard(void) IDataObject *get; IEnumFORMATETC *enum_fmt; FORMATETC fmt; - HGLOBAL h, hblob, htext; + HGLOBAL h, hblob, htext, hstorage; HENHMETAFILE emf; STGMEDIUM med; DWORD obj_type; @@ -1408,6 +1548,7 @@ static void test_nonole_clipboard(void) htext = create_text(); hblob = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE|GMEM_ZEROINIT, 10); emf = create_emf(); + hstorage = create_storage(); r = OpenClipboard(NULL); ok(r, "gle %d\n", GetLastError()); @@ -1417,6 +1558,8 @@ static void test_nonole_clipboard(void) ok(h == hblob, "got %p\n", h); h = SetClipboardData(CF_ENHMETAFILE, emf); ok(h == emf, "got %p\n", h); + h = SetClipboardData(cf_storage, hstorage); + ok(h == hstorage, "got %p\n", h); r = CloseClipboard(); ok(r, "gle %d\n", GetLastError()); @@ -1424,6 +1567,11 @@ static void test_nonole_clipboard(void) ok(hr == S_OK, "got %08x\n", hr); hr = IDataObject_EnumFormatEtc(get, DATADIR_GET, &enum_fmt); ok(hr == S_OK, "got %08x\n", hr); + if (FAILED(hr)) + { + skip("EnumFormatEtc failed, skipping tests.\n"); + return; + } hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); ok(hr == S_OK, "got %08x\n", hr); @@ -1449,6 +1597,14 @@ static void test_nonole_clipboard(void) ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex); ok(fmt.tymed == TYMED_ENHMF, "tymed %x\n", fmt.tymed); + hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); + ok(hr == S_OK, "got %08x\n", hr); + ok(fmt.cfFormat == cf_storage, "cf %04x\n", fmt.cfFormat); + ok(fmt.ptd == NULL, "ptd %p\n", fmt.ptd); + ok(fmt.dwAspect == DVASPECT_CONTENT, "aspect %x\n", fmt.dwAspect); + ok(fmt.lindex == -1, "lindex %d\n", fmt.lindex); + ok(fmt.tymed == (TYMED_ISTREAM | TYMED_HGLOBAL), "tymed %x\n", fmt.tymed); + hr = IEnumFORMATETC_Next(enum_fmt, 1, &fmt, NULL); ok(hr == S_OK, "got %08x\n", hr); /* User32 adds some synthesised formats */ @@ -1494,6 +1650,12 @@ static void test_nonole_clipboard(void) ok(obj_type == OBJ_ENHMETAFILE, "got %d\n", obj_type); if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + InitFormatEtc(fmt, cf_storage, TYMED_ISTORAGE); + hr = IDataObject_GetData(get, &fmt, &med); + ok(hr == S_OK, "got %08x\n", hr); + ok(med.tymed == TYMED_ISTORAGE, "got %x\n", med.tymed); + if(SUCCEEDED(hr)) ReleaseStgMedium(&med); + IDataObject_Release(get); r = OpenClipboard(NULL); diff --git a/modules/rostests/winetests/ole32/compobj.c b/modules/rostests/winetests/ole32/compobj.c index aedbc08f07..33a7585365 100644 --- a/modules/rostests/winetests/ole32/compobj.c +++ b/modules/rostests/winetests/ole32/compobj.c @@ -27,9 +27,6 @@ #include "windef.h" #include "winbase.h" #define USE_COM_CONTEXT_DEF -#ifndef __REACTOS__ -#include "initguid.h" -#endif #include "objbase.h" #include "shlguid.h" #include "urlmon.h" /* for CLSID_FileProtocol */ @@ -39,10 +36,7 @@ #include "ctxtcall.h" #include "wine/test.h" - -#ifdef __REACTOS__ -#include <initguid.h> -#endif +#include "initguid.h" #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE @@ -101,9 +95,7 @@ static const GUID IID_Testiface5 = { 0x62222222, 0x1234, 0x1234, { 0x12, 0x34, 0 static const GUID IID_Testiface6 = { 0x72222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } }; static const GUID IID_TestPS = { 0x66666666, 0x8888, 0x7777, { 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 } }; -DEFINE_GUID(CLSID_InProcFreeMarshaler, 0x0000033a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); DEFINE_GUID(CLSID_testclsid, 0xacd014c7,0x9535,0x4fac,0x8b,0x53,0xa4,0x8c,0xa7,0xf4,0xd7,0x26); -DEFINE_GUID(CLSID_GlobalOptions, 0x0000034b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); static const WCHAR stdfont[] = {'S','t','d','F','o','n','t',0}; static const WCHAR wszNonExistent[] = {'N','o','n','E','x','i','s','t','e','n','t',0}; @@ -203,7 +195,7 @@ static BOOL create_manifest_file(const char *filename, const char *manifest) WCHAR path[MAX_PATH]; MultiByteToWideChar( CP_ACP, 0, filename, -1, path, MAX_PATH ); - GetFullPathNameW(path, sizeof(manifest_path)/sizeof(WCHAR), manifest_path, NULL); + GetFullPathNameW(path, ARRAY_SIZE(manifest_path), manifest_path, NULL); manifest_len = strlen(manifest); file = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, @@ -2340,7 +2332,7 @@ static void test_OleRegGetUserType(void) } /* test using registered CLSID */ - StringFromGUID2(&CLSID_non_existent, clsidW, sizeof(clsidW)/sizeof(clsidW[0])); + StringFromGUID2(&CLSID_non_existent, clsidW, ARRAY_SIZE(clsidW)); ret = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsidkeyW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &clsidhkey, &disposition); if (!ret) @@ -2528,7 +2520,7 @@ static void flush_messages(void) static LRESULT CALLBACK cowait_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { - if(cowait_msgs_last < sizeof(cowait_msgs)/sizeof(*cowait_msgs)) + if(cowait_msgs_last < ARRAY_SIZE(cowait_msgs)) cowait_msgs[cowait_msgs_last++] = msg; if(msg == WM_DDE_FIRST) return 6; diff --git a/modules/rostests/winetests/ole32/dragdrop.c b/modules/rostests/winetests/ole32/dragdrop.c index 6abe4a9779..5994d60700 100644 --- a/modules/rostests/winetests/ole32/dragdrop.c +++ b/modules/rostests/winetests/ole32/dragdrop.c @@ -701,7 +701,7 @@ static void test_DoDragDrop(void) GetWindowRect(hwnd, &rect); ok(SetCursorPos(rect.left+50, rect.top+50), "SetCursorPos failed\n"); - for (seq = 0; seq < sizeof(call_lists) / sizeof(call_lists[0]); seq++) + for (seq = 0; seq < ARRAY_SIZE(call_lists); seq++) { DWORD effect_in; trace("%d\n", seq); diff --git a/modules/rostests/winetests/ole32/marshal.c b/modules/rostests/winetests/ole32/marshal.c index 943321b609..22a6796012 100644 --- a/modules/rostests/winetests/ole32/marshal.c +++ b/modules/rostests/winetests/ole32/marshal.c @@ -31,7 +31,6 @@ #include "olectl.h" #include "shlguid.h" #include "shobjidl.h" -#include "initguid.h" #include "wine/test.h" #include "wine/heap.h" @@ -60,10 +59,8 @@ expect_ ## func = called_ ## func = FALSE; \ }while(0) -DEFINE_GUID(CLSID_StdGlobalInterfaceTable,0x00000323,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); -DEFINE_GUID(CLSID_ManualResetEvent, 0x0000032c,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); - static const GUID CLSID_WineTestPSFactoryBuffer = { 0x22222222, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } }; +static const GUID CLSID_DfMarshal = { 0x0000030b, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } }; /* functions that are not present on all versions of Windows */ static HRESULT (WINAPI * pCoInitializeEx)(LPVOID lpReserved, DWORD dwCoInit); @@ -77,6 +74,51 @@ static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID,REFIID,LPVOID); #define ok_zero_external_conn() do {if (with_external_conn) ok(!external_connections, "got %d external connections\n", external_connections);} while(0); #define ok_last_release_closes(b) do {if (with_external_conn) ok(last_release_closes == b, "got %d expected %d\n", last_release_closes, b);} while(0); +#define OBJREF_SIGNATURE (0x574f454d) +#define OBJREF_STANDARD (0x1) +#define OBJREF_CUSTOM (0x4) + +typedef struct tagDUALSTRINGARRAY { + unsigned short wNumEntries; + unsigned short wSecurityOffset; + unsigned short aStringArray[1]; +} DUALSTRINGARRAY; + +typedef UINT64 OXID; +typedef UINT64 OID; +typedef GUID IPID; + +typedef struct tagSTDOBJREF { + ULONG flags; + ULONG cPublicRefs; + OXID oxid; + OID oid; + IPID ipid; +} STDOBJREF; + +typedef struct tagOBJREF { + ULONG signature; + ULONG flags; + GUID iid; + union { + struct OR_STANDARD { + STDOBJREF std; + DUALSTRINGARRAY saResAddr; + } u_standard; + struct OR_HANDLER { + STDOBJREF std; + CLSID clsid; + DUALSTRINGARRAY saResAddr; + } u_handler; + struct OR_CUSTOM { + CLSID clsid; + ULONG cbExtension; + ULONG size; + byte *pData; + } u_custom; + } u_objref; +} OBJREF; + static const IID IID_IWineTest = { 0x5201163f, @@ -1297,7 +1339,7 @@ static void test_marshal_channel_buffer(void) SET_EXPECT(GetWindow); hr = IOleWindow_GetWindow(ole_window, &hwnd); ok(hr == S_OK, "GetWindow failed: %08x\n", hr); - ok(hwnd == (HWND)0xdeadbeef, "hwnd = %p\n", hwnd); + ok((DWORD)(DWORD_PTR)hwnd == 0xdeadbeef, "hwnd = %p\n", hwnd); CHECK_CALLED(Invoke); CHECK_CALLED(GetWindow); @@ -1314,6 +1356,293 @@ todo_wine end_host_object(tid, thread); } +static const CLSID *unmarshal_class; +DEFINE_EXPECT(CustomMarshal_GetUnmarshalClass); +DEFINE_EXPECT(CustomMarshal_GetMarshalSizeMax); +DEFINE_EXPECT(CustomMarshal_MarshalInterface); + +static HRESULT WINAPI CustomMarshal_QueryInterface(IMarshal *iface, REFIID riid, void **ppv) +{ + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IMarshal)) { + *ppv = iface; + } + else + { + *ppv = NULL; + return E_NOINTERFACE; + } + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI CustomMarshal_AddRef(IMarshal *iface) +{ + return 2; +} + +static ULONG WINAPI CustomMarshal_Release(IMarshal *iface) +{ + return 1; +} + +static HRESULT WINAPI CustomMarshal_GetUnmarshalClass(IMarshal *iface, REFIID riid, + void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *clsid) +{ + CHECK_EXPECT(CustomMarshal_GetUnmarshalClass); + *clsid = *unmarshal_class; + return S_OK; +} + +static HRESULT WINAPI CustomMarshal_GetMarshalSizeMax(IMarshal *iface, REFIID riid, + void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, DWORD *size) +{ + CHECK_EXPECT(CustomMarshal_GetMarshalSizeMax); + ok(size != NULL, "size = NULL\n"); + + *size = 0; + return S_OK; +} + +static HRESULT WINAPI CustomMarshal_MarshalInterface(IMarshal *iface, IStream *stream, + REFIID riid, void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags) +{ + IMarshal *std_marshal; + STATSTG stat; + HRESULT hr; + + CHECK_EXPECT(CustomMarshal_MarshalInterface); + + if(unmarshal_class != &CLSID_StdMarshal) + return S_OK; + + hr = IStream_Stat(stream, &stat, STATFLAG_DEFAULT); + ok_ole_success(hr, IStream_Stat); + ok(U(stat.cbSize).LowPart == 0, "stream is not empty (%d)\n", U(stat.cbSize).LowPart); + ok(U(stat.cbSize).HighPart == 0, "stream is not empty (%d)\n", U(stat.cbSize).HighPart); + + hr = CoGetStandardMarshal(riid, (IUnknown*)iface, + dwDestContext, NULL, mshlflags, &std_marshal); + ok_ole_success(hr, CoGetStandardMarshal); + hr = IMarshal_MarshalInterface(std_marshal, stream, riid, pv, + dwDestContext, pvDestContext, mshlflags); + ok_ole_success(hr, IMarshal_MarshalInterface); + IMarshal_Release(std_marshal); + + return S_OK; +} + +static HRESULT WINAPI CustomMarshal_UnmarshalInterface(IMarshal *iface, + IStream *stream, REFIID riid, void **ppv) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI CustomMarshal_ReleaseMarshalData(IMarshal *iface, IStream *stream) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI CustomMarshal_DisconnectObject(IMarshal *iface, DWORD res) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static IMarshalVtbl CustomMarshalVtbl = +{ + CustomMarshal_QueryInterface, + CustomMarshal_AddRef, + CustomMarshal_Release, + CustomMarshal_GetUnmarshalClass, + CustomMarshal_GetMarshalSizeMax, + CustomMarshal_MarshalInterface, + CustomMarshal_UnmarshalInterface, + CustomMarshal_ReleaseMarshalData, + CustomMarshal_DisconnectObject +}; + +static IMarshal CustomMarshal = { &CustomMarshalVtbl }; + +static void test_StdMarshal_custom_marshaling(void) +{ + IStream *stream; + IUnknown *unk; + DWORD size; + HRESULT hr; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok_ole_success(hr, CreateStreamOnHGlobal); + + unmarshal_class = &CLSID_StdMarshal; + SET_EXPECT(CustomMarshal_GetUnmarshalClass); + SET_EXPECT(CustomMarshal_MarshalInterface); + hr = CoMarshalInterface(stream, &IID_IUnknown, (IUnknown*)&CustomMarshal, + MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoMarshalInterface); + CHECK_CALLED(CustomMarshal_GetUnmarshalClass); + CHECK_CALLED(CustomMarshal_MarshalInterface); + + hr = IStream_Seek(stream, ullZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, IStream_Seek); + hr = CoUnmarshalInterface(stream, &IID_IUnknown, (void**)&unk); + ok_ole_success(hr, CoUnmarshalInterface); + ok(unk == (IUnknown*)&CustomMarshal, "unk != &CustomMarshal\n"); + IUnknown_Release(unk); + IStream_Release(stream); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok_ole_success(hr, CreateStreamOnHGlobal); + + SET_EXPECT(CustomMarshal_GetUnmarshalClass); + SET_EXPECT(CustomMarshal_MarshalInterface); + hr = CoMarshalInterface(stream, &IID_IUnknown, (IUnknown*)&CustomMarshal, + MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoMarshalInterface); + CHECK_CALLED(CustomMarshal_GetUnmarshalClass); + CHECK_CALLED(CustomMarshal_MarshalInterface); + + hr = IStream_Seek(stream, ullZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, IStream_Seek); + hr = CoReleaseMarshalData(stream); + ok_ole_success(hr, CoReleaseMarshalData); + IStream_Release(stream); + + SET_EXPECT(CustomMarshal_GetMarshalSizeMax); + hr = CoGetMarshalSizeMax(&size, &IID_IUnknown, (IUnknown*)&CustomMarshal, + MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoGetMarshalSizeMax); + CHECK_CALLED(CustomMarshal_GetMarshalSizeMax); + ok(size == sizeof(OBJREF), "size = %d, expected %d\n", size, (int)sizeof(OBJREF)); +} + +static void test_DfMarshal_custom_marshaling(void) +{ + DWORD size, read; + IStream *stream; + OBJREF objref; + HRESULT hr; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok_ole_success(hr, CreateStreamOnHGlobal); + + unmarshal_class = &CLSID_DfMarshal; + SET_EXPECT(CustomMarshal_GetUnmarshalClass); + SET_EXPECT(CustomMarshal_GetMarshalSizeMax); + SET_EXPECT(CustomMarshal_MarshalInterface); + hr = CoMarshalInterface(stream, &IID_IUnknown, (IUnknown*)&CustomMarshal, + MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoMarshalInterface); + CHECK_CALLED(CustomMarshal_GetUnmarshalClass); + CHECK_CALLED(CustomMarshal_GetMarshalSizeMax); + CHECK_CALLED(CustomMarshal_MarshalInterface); + + hr = IStream_Seek(stream, ullZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, IStream_Seek); + size = FIELD_OFFSET(OBJREF, u_objref.u_custom.pData); + hr = IStream_Read(stream, &objref, size, &read); + ok_ole_success(hr, IStream_Read); + ok(read == size, "read = %d, expected %d\n", read, size); + ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %x\n", + objref.signature); + ok(objref.flags == OBJREF_CUSTOM, "objref.flags = %x\n", objref.flags); + ok(IsEqualIID(&objref.iid, &IID_IUnknown), "objref.iid = %s\n", + wine_dbgstr_guid(&objref.iid)); + ok(IsEqualIID(&objref.u_objref.u_custom.clsid, &CLSID_DfMarshal), + "custom.clsid = %s\n", wine_dbgstr_guid(&objref.u_objref.u_custom.clsid)); + ok(!objref.u_objref.u_custom.cbExtension, "custom.cbExtension = %d\n", + objref.u_objref.u_custom.cbExtension); + ok(!objref.u_objref.u_custom.size, "custom.size = %d\n", + objref.u_objref.u_custom.size); + + IStream_Release(stream); + + SET_EXPECT(CustomMarshal_GetMarshalSizeMax); + hr = CoGetMarshalSizeMax(&size, &IID_IUnknown, (IUnknown*)&CustomMarshal, + MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoGetMarshalSizeMax); + CHECK_CALLED(CustomMarshal_GetMarshalSizeMax); + ok(size == sizeof(OBJREF), "size = %d, expected %d\n", size, (int)sizeof(OBJREF)); +} + +static void test_CoGetStandardMarshal(void) +{ + DUALSTRINGARRAY *dualstringarr; + STDOBJREF *stdobjref; + OBJREF objref; + IMarshal *marshal; + DWORD size, read; + IStream *stream; + IUnknown *unk; + CLSID clsid; + HRESULT hr; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok_ole_success(hr, CreateStreamOnHGlobal); + + hr = CoGetStandardMarshal(&IID_IUnknown, &Test_Unknown, + MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL, &marshal); + ok_ole_success(hr, CoGetStandardMarshal); + + hr = IMarshal_GetUnmarshalClass(marshal, &IID_IUnknown, &Test_Unknown, + MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL, &clsid); + ok_ole_success(hr, IMarshal_GetUnmarshalClass); + ok(IsEqualGUID(&clsid, &CLSID_StdMarshal), "clsid = %s\n", wine_dbgstr_guid(&clsid)); + + hr = IMarshal_GetMarshalSizeMax(marshal, &IID_IUnknown, &Test_Unknown, + MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL, &size); + ok_ole_success(hr, IMarshal_GetMarshalSizeMax); + hr = CoGetMarshalSizeMax(&read, &IID_IUnknown, &Test_Unknown, + MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoGetMarshalSizeMax); + ok(size == read, "IMarshal_GetMarshalSizeMax size = %d, expected %d\n", size, read); + + hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUnknown, + &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, IMarshal_MarshalInterface); + + hr = IStream_Seek(stream, ullZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, IStream_Seek); + size = FIELD_OFFSET(OBJREF, u_objref.u_standard.saResAddr.aStringArray); + hr = IStream_Read(stream, &objref, size, &read); + ok_ole_success(hr, IStream_Read); + ok(read == size, "read = %d, expected %d\n", read, size); + ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %x\n", + objref.signature); + ok(objref.flags == OBJREF_STANDARD, "objref.flags = %x\n", objref.flags); + ok(IsEqualIID(&objref.iid, &IID_IUnknown), "objref.iid = %s\n", + wine_dbgstr_guid(&objref.iid)); + stdobjref = &objref.u_objref.u_standard.std; + ok(stdobjref->flags == 0, "stdobjref.flags = %d\n", stdobjref->flags); + ok(stdobjref->cPublicRefs == 5, "stdobjref.cPublicRefs = %d\n", + stdobjref->cPublicRefs); + dualstringarr = &objref.u_objref.u_standard.saResAddr; + ok(dualstringarr->wNumEntries == 0, "dualstringarr.wNumEntries = %d\n", + dualstringarr->wNumEntries); + ok(dualstringarr->wSecurityOffset == 0, "dualstringarr.wSecurityOffset = %d\n", + dualstringarr->wSecurityOffset); + + hr = IStream_Seek(stream, ullZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, IStream_Seek); + hr = IMarshal_UnmarshalInterface(marshal, stream, &IID_IUnknown, (void**)&unk); + ok_ole_success(hr, IMarshal_UnmarshalInterface); + IUnknown_Release(unk); + + hr = IStream_Seek(stream, ullZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, IStream_Seek); + hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUnknown, + &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, IMarshal_MarshalInterface); + + hr = IStream_Seek(stream, ullZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, IStream_Seek); + hr = IMarshal_ReleaseMarshalData(marshal, stream); + ok_ole_success(hr, IMarshal_ReleaseMarshalData); + IStream_Release(stream); + + IMarshal_Release(marshal); +} struct ncu_params { LPSTREAM stream; @@ -2878,6 +3207,7 @@ static void test_freethreadedmarshaler(void) IStream *pStream; IUnknown *pProxy; static const LARGE_INTEGER llZero; + CLSID clsid; cLocks = 0; hr = CoCreateFreeThreadedMarshaler(NULL, &pFTUnknown); @@ -2891,6 +3221,12 @@ static void test_freethreadedmarshaler(void) /* inproc normal marshaling */ + hr = IMarshal_GetUnmarshalClass(pFTMarshal, &IID_IClassFactory, + &Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL, &clsid); + ok_ole_success(hr, IMarshal_GetUnmarshalClass); + ok(IsEqualIID(&clsid, &CLSID_InProcFreeMarshaler), "clsid = %s\n", + wine_dbgstr_guid(&clsid)); + hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory, &Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); ok_ole_success(hr, IMarshal_MarshalInterface); @@ -2907,27 +3243,6 @@ static void test_freethreadedmarshaler(void) ok_no_locks(); -/* native doesn't allow us to unmarshal or release the stream data, - * presumably because it wants us to call CoMarshalInterface instead */ - if (0) - { - /* local normal marshaling */ - - IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); - hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory, &Test_ClassFactory, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL); - ok_ole_success(hr, IMarshal_MarshalInterface); - - ok_more_than_one_lock(); - - test_freethreadedmarshaldata(pStream, MSHCTX_LOCAL, &Test_ClassFactory, MSHLFLAGS_NORMAL); - - IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); - hr = IMarshal_ReleaseMarshalData(pFTMarshal, pStream); - ok_ole_success(hr, IMarshal_ReleaseMarshalData); - - ok_no_locks(); - } - /* inproc table-strong marshaling */ IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); @@ -3005,6 +3320,28 @@ static void test_freethreadedmarshaler(void) ok_no_locks(); + /* local normal marshaling */ + + hr = IMarshal_GetUnmarshalClass(pFTMarshal, &IID_IClassFactory, + &Test_ClassFactory, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL, &clsid); + ok_ole_success(hr, IMarshal_GetUnmarshalClass); + ok(IsEqualIID(&clsid, &CLSID_StdMarshal), "clsid = %s\n", + wine_dbgstr_guid(&clsid)); + + IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); + hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory, &Test_ClassFactory, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, IMarshal_MarshalInterface); + + ok_more_than_one_lock(); + + test_freethreadedmarshaldata(pStream, MSHCTX_LOCAL, &Test_ClassFactory, MSHLFLAGS_NORMAL); + + IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); + hr = CoReleaseMarshalData(pStream); + ok_ole_success(hr, CoReleaseMarshalData); + + ok_no_locks(); + IStream_Release(pStream); IMarshal_Release(pFTMarshal); } @@ -3943,8 +4280,8 @@ static const char *debugstr_iid(REFIID riid) WCHAR bufferW[39]; char buffer[39]; LONG name_size = sizeof(name); - StringFromGUID2(riid, bufferW, sizeof(bufferW)/sizeof(bufferW[0])); - WideCharToMultiByte(CP_ACP, 0, bufferW, sizeof(bufferW)/sizeof(bufferW[0]), buffer, sizeof(buffer), NULL, NULL); + StringFromGUID2(riid, bufferW, ARRAY_SIZE(bufferW)); + WideCharToMultiByte(CP_ACP, 0, bufferW, ARRAY_SIZE(bufferW), buffer, sizeof(buffer), NULL, NULL); if (RegOpenKeyExA(HKEY_CLASSES_ROOT, "Interface", 0, KEY_QUERY_VALUE, &hkeyInterface) != ERROR_SUCCESS) { memcpy(name, buffer, sizeof(buffer)); @@ -4323,6 +4660,9 @@ START_TEST(marshal) } while (with_external_conn); test_marshal_channel_buffer(); + test_StdMarshal_custom_marshaling(); + test_DfMarshal_custom_marshaling(); + test_CoGetStandardMarshal(); test_hresult_marshaling(); test_proxy_used_in_wrong_thread(); test_message_filter(); diff --git a/modules/rostests/winetests/ole32/moniker.c b/modules/rostests/winetests/ole32/moniker.c index 7b67dfdb95..5bcc136a36 100644 --- a/modules/rostests/winetests/ole32/moniker.c +++ b/modules/rostests/winetests/ole32/moniker.c @@ -29,7 +29,6 @@ #include "winbase.h" #include "objbase.h" #include "ocidl.h" -#include "initguid.h" #include "comcat.h" #include "olectl.h" @@ -38,7 +37,6 @@ #define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks) #define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %d\n", cLocks) #define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr) -#define COUNTOF(x) (sizeof(x) / sizeof(x[0])) #define CHECK_EXPECTED_METHOD(method_name) \ do { \ @@ -905,7 +903,7 @@ static void test_MkParseDisplayName(void) hr = CreateBindCtx(0, &pbc); ok_ole_success(hr, CreateBindCtx); - for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++) + for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++) { eaten = 0xdeadbeef; pmk = (IMoniker *)0xdeadbeef; @@ -947,7 +945,7 @@ static void test_MkParseDisplayName(void) pmk = NULL; hr = MkParseDisplayName(pbc, wszDisplayName, &eaten, &pmk); ok_ole_success(hr, MkParseDisplayName); - ok(eaten == sizeof(wszDisplayName)/sizeof(WCHAR) - 1, + ok(eaten == ARRAY_SIZE(wszDisplayName) - 1, "Processed character count should have been 43 instead of %u\n", eaten); if (pmk) { @@ -969,7 +967,7 @@ static void test_MkParseDisplayName(void) pmk = NULL; hr = MkParseDisplayName(pbc, wszDisplayNameRunning, &eaten, &pmk); ok_ole_success(hr, MkParseDisplayName); - ok(eaten == sizeof(wszDisplayNameRunning)/sizeof(WCHAR) - 1, + ok(eaten == ARRAY_SIZE(wszDisplayNameRunning) - 1, "Processed character count should have been 15 instead of %u\n", eaten); if (pmk) { @@ -987,7 +985,7 @@ static void test_MkParseDisplayName(void) expected_display_name = wszDisplayNameProgId1; hr = MkParseDisplayName(pbc, wszDisplayNameProgId1, &eaten, &pmk); ok_ole_success(hr, MkParseDisplayName); - ok(eaten == sizeof(wszDisplayNameProgId1)/sizeof(WCHAR) - 1, + ok(eaten == ARRAY_SIZE(wszDisplayNameProgId1) - 1, "Processed character count should have been 8 instead of %u\n", eaten); if (pmk) { @@ -999,7 +997,7 @@ static void test_MkParseDisplayName(void) expected_display_name = wszDisplayNameProgId2; hr = MkParseDisplayName(pbc, wszDisplayNameProgId2, &eaten, &pmk); ok_ole_success(hr, MkParseDisplayName); - ok(eaten == sizeof(wszDisplayNameProgId2)/sizeof(WCHAR) - 1, + ok(eaten == ARRAY_SIZE(wszDisplayNameProgId2) - 1, "Processed character count should have been 8 instead of %u\n", eaten); if (pmk) { @@ -1021,7 +1019,8 @@ static void test_MkParseDisplayName(void) GetSystemDirectoryA(szDisplayNameFile, sizeof(szDisplayNameFile)); strcat(szDisplayNameFile, "\\kernel32.dll"); - len = MultiByteToWideChar(CP_ACP, 0, szDisplayNameFile, -1, wszDisplayNameFile, sizeof(wszDisplayNameFile)/sizeof(wszDisplayNameFile[0])); + len = MultiByteToWideChar(CP_ACP, 0, szDisplayNameFile, -1, wszDisplayNameFile, + ARRAY_SIZE(wszDisplayNameFile)); hr = MkParseDisplayName(pbc, wszDisplayNameFile, &eaten, &pmk); ok_ole_success(hr, MkParseDisplayName); ok(eaten == len - 1, "Processed character count should have been %d instead of %u\n", len - 1, eaten); @@ -1034,7 +1033,8 @@ static void test_MkParseDisplayName(void) hr = MkParseDisplayName(pbc, wszDisplayName, &eaten, &pmk); ok_ole_success(hr, MkParseDisplayName); - ok(eaten == sizeof(wszDisplayName)/sizeof(WCHAR) - 1, "Processed character count should have been 43 instead of %u\n", eaten); + ok(eaten == ARRAY_SIZE(wszDisplayName) - 1, + "Processed character count should have been 43 instead of %u\n", eaten); if (pmk) { @@ -1550,7 +1550,7 @@ static void test_file_monikers(void) trace("ACP is %u\n", GetACP()); - for (i = 0; i < COUNTOF(wszFile); ++i) + for (i = 0; i < ARRAY_SIZE(wszFile); ++i) { int j ; if (i == 2) diff --git a/modules/rostests/winetests/ole32/ole2.c b/modules/rostests/winetests/ole32/ole2.c index dd9257dff8..3b289f7e34 100644 --- a/modules/rostests/winetests/ole32/ole2.c +++ b/modules/rostests/winetests/ole32/ole2.c @@ -33,12 +33,6 @@ #include "wine/test.h" -#include "initguid.h" - -DEFINE_GUID(CLSID_Picture_Metafile,0x315,0,0,0xc0,0,0,0,0,0,0,0x46); -DEFINE_GUID(CLSID_Picture_Dib,0x316,0,0,0xc0,0,0,0,0,0,0,0x46); -DEFINE_GUID(CLSID_Picture_EnhMetafile,0x319,0,0,0xc0,0,0,0,0,0,0,0x46); - #define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr) #define DEFINE_EXPECT(func) \ @@ -261,6 +255,21 @@ static void create_mfpict(STGMEDIUM *med) med->pUnkForRelease = NULL; } +static void create_text(STGMEDIUM *med) +{ + HGLOBAL handle; + char *p; + + handle = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE, 5); + p = GlobalLock(handle); + strcpy(p, "test"); + GlobalUnlock(handle); + + med->tymed = TYMED_HGLOBAL; + U(med)->hGlobal = handle; + med->pUnkForRelease = NULL; +} + static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppv) { CHECK_EXPECTED_METHOD("OleObject_QueryInterface"); @@ -1494,6 +1503,12 @@ static HRESULT WINAPI DataObject_GetData( IDataObject *iface, FORMATETC *fmt_in, case CF_BITMAP: create_bitmap( med ); return S_OK; + case CF_ENHMETAFILE: + create_emf( med ); + return S_OK; + case CF_TEXT: + create_text( med ); + return S_OK; default: trace( "unhandled fmt %d\n", fmt->cfFormat ); } @@ -1732,7 +1747,7 @@ static void test_data_cache(void) { NULL, 0 } }; - GetSystemDirectoryA(szSystemDir, sizeof(szSystemDir)/sizeof(szSystemDir[0])); + GetSystemDirectoryA(szSystemDir, ARRAY_SIZE(szSystemDir)); expected_method_list = methods_cacheinitnew; @@ -1864,7 +1879,7 @@ static void test_data_cache(void) hr = IOleCache2_Cache(pOleCache, &fmtetc, 0, &dwConnection); ok_ole_success(hr, "IOleCache_Cache"); - MultiByteToWideChar(CP_ACP, 0, szSystemDir, -1, wszPath, sizeof(wszPath)/sizeof(wszPath[0])); + MultiByteToWideChar(CP_ACP, 0, szSystemDir, -1, wszPath, ARRAY_SIZE(wszPath)); memcpy(wszPath+lstrlenW(wszPath), wszShell32, sizeof(wszShell32)); fmtetc.cfFormat = CF_METAFILEPICT; @@ -2494,7 +2509,7 @@ static void test_data_cache_init(void) { &CLSID_Picture_EnhMetafile, 3, 1 } }; - for (i = 0; i < sizeof(data) / sizeof(data[0]); i++) + for (i = 0; i < ARRAY_SIZE(data); i++) { hr = CreateDataCache( NULL, data[i].clsid, &IID_IOleCache2, (void **)&cache ); ok( hr == S_OK, "got %08x\n", hr ); @@ -4080,6 +4095,8 @@ static void check_storage_contents(IStorage *stg, const struct storage_def *stg_ *enumerated_streams += 1; } + + IEnumSTATSTG_Release(enumstg); } static HRESULT stgmedium_cmp(const STGMEDIUM *med1, STGMEDIUM *med2) @@ -4545,7 +4562,7 @@ static void test_data_cache_contents(void) { &stg_def_9, &stg_def_9_saved }, }; - for (i = 0; i < sizeof(test_data)/sizeof(test_data[0]); i++) + for (i = 0; i < ARRAY_SIZE(test_data); i++) { if (winetest_debug > 1) trace("start testing storage def %d\n", i); @@ -4597,6 +4614,175 @@ todo_wine_if(!(test_data[i].in == &stg_def_0 || test_data[i].in == &stg_def_4 || } } +static void test_OleCreateStaticFromData(void) +{ + HRESULT hr; + IOleObject *ole_obj = NULL; + IStorage *storage; + ILockBytes *ilb; + IPersist *persist; + CLSID clsid; + STATSTG statstg; + int enumerated_streams, matched_streams; + STGMEDIUM stgmed; + static FORMATETC dib_fmt[] = + { + { CF_DIB, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, + { 0 } + }; + static FORMATETC emf_fmt[] = + { + { CF_ENHMETAFILE, NULL, DVASPECT_CONTENT, -1, TYMED_ENHMF }, + { 0 } + }; + static FORMATETC text_fmt[] = + { + { CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, + { 0 } + }; + static const struct expected_method methods_create_from_dib[] = + { + { "DataObject_EnumFormatEtc", TEST_TODO }, + { "DataObject_GetDataHere", 0 }, + { "DataObject_QueryGetData", 0, { CF_METAFILEPICT, NULL, DVASPECT_CONTENT, -1, TYMED_ISTORAGE } }, + { NULL } + }; + static const struct expected_method methods_createstatic_from_dib[] = + { + { "DataObject_GetData", 0, { CF_DIB, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } }, + { NULL } + }; + static const struct expected_method methods_createstatic_from_emf[] = + { + { "DataObject_GetData", 0, { CF_ENHMETAFILE, NULL, DVASPECT_CONTENT, -1, TYMED_ENHMF } }, + { NULL } + }; + static const struct expected_method methods_createstatic_from_text[] = + { + { "DataObject_GetData", 0, { CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL } }, + { NULL } + }; + static struct storage_def stg_def_dib = + { + &CLSID_Picture_Dib, 3, + {{ "\1Ole", -1, 0, 0, NULL, 0 }, + { "\1CompObj", -1, 0, 0, NULL, 0 }, + { "CONTENTS", -1, 0, 0, NULL, 0 }} + }; + static struct storage_def stg_def_emf = + { + &CLSID_Picture_EnhMetafile, 3, + {{ "\1Ole", -1, 0, 0, NULL, 0 }, + { "\1CompObj", -1, 0, 0, NULL, 0 }, + { "CONTENTS", -1, 0, 0, NULL, 0 }} + }; + + + hr = CreateILockBytesOnHGlobal(NULL, TRUE, &ilb); + ok(hr == S_OK, "CreateILockBytesOnHGlobal failed: 0x%08x.\n", hr); + hr = StgCreateDocfileOnILockBytes(ilb, STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_READWRITE, + 0, &storage); + ok(hr == S_OK, "StgCreateDocfileOnILockBytes failed: 0x%08x.\n", hr); + ILockBytes_Release(ilb); + + hr = OleCreateStaticFromData(&DataObject, &IID_IOleObject, OLERENDER_FORMAT, + dib_fmt, NULL, NULL, (void **)&ole_obj); + ok(hr == E_INVALIDARG, "OleCreateStaticFromData should fail: 0x%08x.\n", hr); + + hr = OleCreateStaticFromData(&DataObject, &IID_IOleObject, OLERENDER_FORMAT, + dib_fmt, NULL, storage, NULL); + ok(hr == E_INVALIDARG, "OleCreateStaticFromData should fail: 0x%08x.\n", hr); + + /* CF_DIB */ + g_dataobject_fmts = dib_fmt; + expected_method_list = methods_createstatic_from_dib; + hr = OleCreateStaticFromData(&DataObject, &IID_IOleObject, OLERENDER_FORMAT, + dib_fmt, NULL, storage, (void **)&ole_obj); + ok(hr == S_OK, "OleCreateStaticFromData failed: 0x%08x.\n", hr); + hr = IOleObject_QueryInterface(ole_obj, &IID_IPersist, (void **)&persist); + ok(hr == S_OK, "IOleObject_QueryInterface failed: 0x%08x.\n", hr); + hr = IPersist_GetClassID(persist, &clsid); + ok(hr == S_OK, "IPersist_GetClassID failed: 0x%08x.\n", hr); + ok(IsEqualCLSID(&clsid, &CLSID_Picture_Dib), "Got wrong clsid: %s, expected: %s.\n", + wine_dbgstr_guid(&clsid), wine_dbgstr_guid(&CLSID_Picture_Dib)); + hr = IStorage_Stat(storage, &statstg, STATFLAG_NONAME); + ok_ole_success(hr, "IStorage_Stat"); + ok(IsEqualCLSID(&CLSID_Picture_Dib, &statstg.clsid), "Wrong CLSID in storage.\n"); + enumerated_streams = matched_streams = -1; + get_stgmedium(CF_DIB, &stgmed); + get_stgdef(&stg_def_dib, CF_DIB, &stgmed, 2); + check_storage_contents(storage, &stg_def_dib, &enumerated_streams, &matched_streams); + ok(enumerated_streams == matched_streams, "enumerated %d != matched %d\n", + enumerated_streams, matched_streams); + ok(enumerated_streams == stg_def_dib.stream_count, "created %d != def streams %d\n", + enumerated_streams, stg_def_dib.stream_count); + ReleaseStgMedium(&stgmed); + IPersist_Release(persist); + IStorage_Release(storage); + IOleObject_Release(ole_obj); + + /* CF_ENHMETAFILE */ + hr = CreateILockBytesOnHGlobal(NULL, TRUE, &ilb); + ok(hr == S_OK, "CreateILockBytesOnHGlobal failed: 0x%08x.\n", hr); + hr = StgCreateDocfileOnILockBytes(ilb, STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_READWRITE, + 0, &storage); + ok(hr == S_OK, "StgCreateDocfileOnILockBytes failed: 0x%08x.\n", hr); + ILockBytes_Release(ilb); + g_dataobject_fmts = emf_fmt; + expected_method_list = methods_createstatic_from_emf; + hr = OleCreateStaticFromData(&DataObject, &IID_IOleObject, OLERENDER_FORMAT, + emf_fmt, NULL, storage, (void **)&ole_obj); + ok(hr == S_OK, "OleCreateStaticFromData failed: 0x%08x.\n", hr); + hr = IOleObject_QueryInterface(ole_obj, &IID_IPersist, (void **)&persist); + ok(hr == S_OK, "IOleObject_QueryInterface failed: 0x%08x.\n", hr); + hr = IPersist_GetClassID(persist, &clsid); + ok(hr == S_OK, "IPersist_GetClassID failed: 0x%08x.\n", hr); + ok(IsEqualCLSID(&clsid, &CLSID_Picture_EnhMetafile), "Got wrong clsid: %s, expected: %s.\n", + wine_dbgstr_guid(&clsid), wine_dbgstr_guid(&CLSID_Picture_EnhMetafile)); + hr = IStorage_Stat(storage, &statstg, STATFLAG_NONAME); + ok_ole_success(hr, "IStorage_Stat"); + ok(IsEqualCLSID(&CLSID_Picture_EnhMetafile, &statstg.clsid), "Wrong CLSID in storage.\n"); + enumerated_streams = matched_streams = -1; + get_stgmedium(CF_ENHMETAFILE, &stgmed); + get_stgdef(&stg_def_emf, CF_ENHMETAFILE, &stgmed, 2); + check_storage_contents(storage, &stg_def_emf, &enumerated_streams, &matched_streams); + ok(enumerated_streams == matched_streams, "enumerated %d != matched %d\n", + enumerated_streams, matched_streams); + ok(enumerated_streams == stg_def_emf.stream_count, "created %d != def streams %d\n", + enumerated_streams, stg_def_emf.stream_count); + ReleaseStgMedium(&stgmed); + IPersist_Release(persist); + IStorage_Release(storage); + IOleObject_Release(ole_obj); + + /* CF_TEXT */ + hr = CreateILockBytesOnHGlobal(NULL, TRUE, &ilb); + ok(hr == S_OK, "CreateILockBytesOnHGlobal failed: 0x%08x.\n", hr); + hr = StgCreateDocfileOnILockBytes(ilb, STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_READWRITE, + 0, &storage); + ok(hr == S_OK, "StgCreateDocfileOnILockBytes failed: 0x%08x.\n", hr); + ILockBytes_Release(ilb); + g_dataobject_fmts = text_fmt; + expected_method_list = methods_createstatic_from_text; + hr = OleCreateStaticFromData(&DataObject, &IID_IOleObject, OLERENDER_FORMAT, + text_fmt, NULL, storage, (void **)&ole_obj); + ok(hr == DV_E_CLIPFORMAT, "OleCreateStaticFromData should fail: 0x%08x.\n", hr); + IStorage_Release(storage); + + hr = CreateILockBytesOnHGlobal(NULL, TRUE, &ilb); + ok(hr == S_OK, "CreateILockBytesOnHGlobal failed: 0x%08x.\n", hr); + hr = StgCreateDocfileOnILockBytes(ilb, STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_READWRITE, + 0, &storage); + ok(hr == S_OK, "StgCreateDocfileOnILockBytes failed: 0x%08x.\n", hr); + ILockBytes_Release(ilb); + g_dataobject_fmts = dib_fmt; + expected_method_list = methods_create_from_dib; + hr = OleCreateFromData(&DataObject, &IID_IOleObject, OLERENDER_FORMAT, dib_fmt, NULL, + storage, (void **)&ole_obj); + todo_wine ok(hr == DV_E_FORMATETC, "OleCreateFromData should failed: 0x%08x.\n", hr); + IStorage_Release(storage); +} + START_TEST(ole2) { DWORD dwRegister; @@ -4647,6 +4833,7 @@ START_TEST(ole2) test_data_cache_save(); test_data_cache_save_data(); test_data_cache_contents(); + test_OleCreateStaticFromData(); CoUninitialize(); } diff --git a/modules/rostests/winetests/ole32/ole_server.c b/modules/rostests/winetests/ole32/ole_server.c index 77abda47aa..2f5a3ca5ea 100644 --- a/modules/rostests/winetests/ole32/ole_server.c +++ b/modules/rostests/winetests/ole32/ole_server.c @@ -30,9 +30,6 @@ #include <initguid.h> DEFINE_GUID(CLSID_WineTestObject, 0xdeadbeef,0xdead,0xbeef,0xde,0xad,0xbe,0xef,0xde,0xad,0xbe,0xef); -#ifndef CLSID_IdentityUnmarshal -DEFINE_GUID(CLSID_IdentityUnmarshal,0x0000001b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); -#endif DEFINE_GUID(CLSID_UnknownUnmarshal,0x4c1e39e1,0xe3e3,0x4296,0xaa,0x86,0xec,0x93,0x8d,0x89,0x6e,0x92); struct winetest_info @@ -69,7 +66,7 @@ static const char *debugstr_guid(const GUID *guid) if (!guid) return "(null)"; - for (i = 0; i < sizeof(guid_name)/sizeof(guid_name[0]); i++) + for (i = 0; i < ARRAY_SIZE(guid_name); i++) { if (IsEqualIID(guid, guid_name[i].guid)) return guid_name[i].name; diff --git a/modules/rostests/winetests/ole32/propvariant.c b/modules/rostests/winetests/ole32/propvariant.c index ade45fbd42..97c4eec4ca 100644 --- a/modules/rostests/winetests/ole32/propvariant.c +++ b/modules/rostests/winetests/ole32/propvariant.c @@ -189,7 +189,7 @@ static void test_validtypes(void) ok(U(propvar).uhVal.QuadPart == 0, "expected 0, got %#x/%#x\n", U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); - for (i = 0; i < sizeof(valid_types)/sizeof(valid_types[0]); i++) + for (i = 0; i < ARRAY_SIZE(valid_types); i++) { VARTYPE vt; diff --git a/modules/rostests/winetests/ole32/stg_prop.c b/modules/rostests/winetests/ole32/stg_prop.c index c6d7d3efe9..24ae03efc1 100644 --- a/modules/rostests/winetests/ole32/stg_prop.c +++ b/modules/rostests/winetests/ole32/stg_prop.c @@ -19,12 +19,6 @@ #define COBJMACROS #include "objbase.h" #include "wine/test.h" -#include "initguid.h" - -DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); -DEFINE_GUID(FMTID_SummaryInformation,0xF29F85E0,0x4FF9,0x1068,0xAB,0x91,0x08,0x00,0x2B,0x27,0xB3,0xD9); -DEFINE_GUID(FMTID_DocSummaryInformation,0xD5CDD502,0x2E9C,0x101B,0x93,0x97,0x08,0x00,0x2B,0x2C,0xF9,0xAE); -DEFINE_GUID(FMTID_UserDefinedProperties,0xD5CDD505,0x2E9C,0x101B,0x93,0x97,0x08,0x00,0x2B,0x2C,0xF9,0xAE); #ifndef PID_BEHAVIOR #define PID_BEHAVIOR 0x80000003 diff --git a/modules/rostests/winetests/ole32/storage32.c b/modules/rostests/winetests/ole32/storage32.c index 89ffc954f2..2467410da5 100644 --- a/modules/rostests/winetests/ole32/storage32.c +++ b/modules/rostests/winetests/ole32/storage32.c @@ -21,7 +21,9 @@ #include <stdio.h> #define COBJMACROS -#ifndef __REACTOS__ +#ifdef __REACTOS__ +#define CONST_VTABLE +#else #define NONAMELESSUNION #define NONAMELESSSTRUCT #endif @@ -222,7 +224,7 @@ static HRESULT WINAPI TestLockBytes_Stat(ILockBytes *iface, return S_OK; } -static /* const */ ILockBytesVtbl TestLockBytes_Vtbl = { +static const ILockBytesVtbl TestLockBytes_Vtbl = { TestLockBytes_QueryInterface, TestLockBytes_AddRef, TestLockBytes_Release, @@ -2086,9 +2088,9 @@ static void _test_file_access(LPCSTR file, const struct access_res *ares, DWORD { int i, j, idx = 0; - for (i = 0; i < sizeof(access_modes)/sizeof(access_modes[0]); i++) + for (i = 0; i < ARRAY_SIZE(access_modes); i++) { - for (j = 0; j < sizeof(share_modes)/sizeof(share_modes[0]); j++) + for (j = 0; j < ARRAY_SIZE(share_modes); j++) { DWORD lasterr; HANDLE hfile; @@ -3492,7 +3494,7 @@ static void test_locking(void) IStorage *stg; HRESULT hr; - for (i=0; i<sizeof(lock_tests)/sizeof(lock_tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(lock_tests); i++) { const struct lock_test *current = &lock_tests[i]; BOOL any_failure = FALSE; diff --git a/modules/rostests/winetests/ole32/usrmarshal.c b/modules/rostests/winetests/ole32/usrmarshal.c index 3919395800..bbe7fb5da7 100644 --- a/modules/rostests/winetests/ole32/usrmarshal.c +++ b/modules/rostests/winetests/ole32/usrmarshal.c @@ -1067,7 +1067,7 @@ static void test_marshal_SNB(void) ok(*(ULONG*)wiresnb->rgString == wiresnb->ulCntStr, "got %u\n", *(ULONG*)wiresnb->rgString); dataW = &wiresnb->rgString[2]; ok(!lstrcmpW(dataW, str1W), "marshalled string 0: %s\n", wine_dbgstr_w(dataW)); - dataW += sizeof(str1W)/sizeof(WCHAR); + dataW += ARRAY_SIZE(str1W); ok(!lstrcmpW(dataW, str2W), "marshalled string 1: %s\n", wine_dbgstr_w(dataW)); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
5 years, 12 months
1
0
0
0
[reactos] 01/01: [OLE32] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aeea29430187779d75939…
commit aeea29430187779d759395c7ace9e03b2e4ccb38 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:15:33 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:15:33 2019 +0100 [OLE32] Sync with Wine Staging 4.0. CORE-15682 --- dll/win32/ole32/classmoniker.c | 6 +- dll/win32/ole32/clipboard.c | 49 ++++-- dll/win32/ole32/compobj.c | 44 +++-- dll/win32/ole32/compobj_private.h | 2 +- dll/win32/ole32/datacache.c | 2 +- dll/win32/ole32/ftmarshal.c | 2 +- dll/win32/ole32/git.c | 16 +- dll/win32/ole32/marshal.c | 334 ++++++++++++++++++++++++++++---------- dll/win32/ole32/moniker.c | 2 +- dll/win32/ole32/ole2.c | 2 +- dll/win32/ole32/ole2impl.c | 99 ++++++++++- dll/win32/ole32/rpc.c | 10 +- dll/win32/ole32/stg_prop.c | 4 +- dll/win32/ole32/storage32.c | 17 +- dll/win32/ole32/usrmarshal.c | 4 +- media/doc/README.WINE | 2 +- 16 files changed, 438 insertions(+), 157 deletions(-) diff --git a/dll/win32/ole32/classmoniker.c b/dll/win32/ole32/classmoniker.c index ebad7947c6..30a24d23e5 100644 --- a/dll/win32/ole32/classmoniker.c +++ b/dll/win32/ole32/classmoniker.c @@ -536,14 +536,14 @@ static HRESULT WINAPI ClassMoniker_GetDisplayName(IMoniker* iface, *ppszDisplayName = CoTaskMemAlloc(sizeof(wszClsidPrefix) + (CHARS_IN_GUID-2) * sizeof(WCHAR)); - StringFromGUID2(&This->clsid, *ppszDisplayName+sizeof(wszClsidPrefix)/sizeof(WCHAR)-2, CHARS_IN_GUID); + StringFromGUID2(&This->clsid, *ppszDisplayName+ARRAY_SIZE(wszClsidPrefix)-2, CHARS_IN_GUID); /* note: this overwrites the opening curly bracket of the CLSID string generated above */ memcpy(*ppszDisplayName, wszClsidPrefix, sizeof(wszClsidPrefix)-sizeof(WCHAR)); /* note: this overwrites the closing curly bracket of the CLSID string generated above */ - (*ppszDisplayName)[sizeof(wszClsidPrefix)/sizeof(WCHAR)-2+CHARS_IN_GUID-2] = ':'; - (*ppszDisplayName)[sizeof(wszClsidPrefix)/sizeof(WCHAR)-2+CHARS_IN_GUID-1] = '\0'; + (*ppszDisplayName)[ARRAY_SIZE(wszClsidPrefix)-2+CHARS_IN_GUID-2] = ':'; + (*ppszDisplayName)[ARRAY_SIZE(wszClsidPrefix)-2+CHARS_IN_GUID-1] = '\0'; TRACE("string is %s\n", debugstr_w(*ppszDisplayName)); return S_OK; diff --git a/dll/win32/ole32/clipboard.c b/dll/win32/ole32/clipboard.c index 9448f5bc4a..f3e9a6bc56 100644 --- a/dll/win32/ole32/clipboard.c +++ b/dll/win32/ole32/clipboard.c @@ -1197,7 +1197,7 @@ static HRESULT get_priv_data(ole_priv_data **data) for(cf = 0; (cf = EnumClipboardFormats(cf)) != 0; count++) { WCHAR buf[256]; - if (GetClipboardFormatNameW(cf, buf, sizeof(buf) / sizeof(WCHAR))) + if (GetClipboardFormatNameW(cf, buf, ARRAY_SIZE(buf))) TRACE("cf %04x %s\n", cf, debugstr_w(buf)); else TRACE("cf %04x\n", cf); @@ -1296,6 +1296,14 @@ static HRESULT get_stgmed_for_storage(HGLOBAL h, STGMEDIUM *med) return hr; } + hr = StgIsStorageILockBytes(lbs); + if(hr!=S_OK) + { + ILockBytes_Release(lbs); + GlobalFree(dst); + return SUCCEEDED(hr) ? E_FAIL : hr; + } + hr = StgOpenStorageOnILockBytes(lbs, NULL, STGM_SHARE_EXCLUSIVE | STGM_READWRITE, NULL, 0, &med->u.pstg); ILockBytes_Release(lbs); if(FAILED(hr)) @@ -1402,12 +1410,19 @@ static HRESULT WINAPI snapshot_GetData(IDataObject *iface, FORMATETC *fmt, if(This->data) { hr = IDataObject_GetData(This->data, fmt, med); - CloseClipboard(); - return hr; + if(SUCCEEDED(hr)) + { + CloseClipboard(); + return hr; + } + } + if(fmt->lindex != -1) + { + hr = DV_E_FORMATETC; + goto end; } - h = GetClipboardData(fmt->cfFormat); - if(!h) + if(!IsClipboardFormatAvailable(fmt->cfFormat)) { hr = DV_E_FORMATETC; goto end; @@ -1425,17 +1440,31 @@ static HRESULT WINAPI snapshot_GetData(IDataObject *iface, FORMATETC *fmt, goto end; } mask = fmt->tymed & entry->fmtetc.tymed; - if(!mask) mask = fmt->tymed & (TYMED_ISTREAM | TYMED_HGLOBAL); + if(!mask && (entry->fmtetc.tymed & (TYMED_ISTREAM | TYMED_HGLOBAL | TYMED_ISTORAGE))) + mask = fmt->tymed & (TYMED_ISTREAM | TYMED_HGLOBAL | TYMED_ISTORAGE); } else /* non-Ole format */ - mask = fmt->tymed & TYMED_HGLOBAL; + mask = fmt->tymed & get_tymed_from_nonole_cf(fmt->cfFormat); - if(mask & TYMED_ISTORAGE) - hr = get_stgmed_for_storage(h, med); - else if(mask & TYMED_HGLOBAL) + if(!mask) + { + hr = DV_E_TYMED; + goto end; + } + + h = GetClipboardData(fmt->cfFormat); + if(!h) + { + hr = DV_E_FORMATETC; + goto end; + } + + if(mask & TYMED_HGLOBAL) hr = get_stgmed_for_global(h, med); else if(mask & TYMED_ISTREAM) hr = get_stgmed_for_stream(h, med); + else if(mask & TYMED_ISTORAGE) + hr = get_stgmed_for_storage(h, med); else if(mask & TYMED_ENHMF) hr = get_stgmed_for_emf((HENHMETAFILE)h, med); else if(mask & TYMED_GDI) diff --git a/dll/win32/ole32/compobj.c b/dll/win32/ole32/compobj.c index 2f4a69aa73..eae39335fb 100644 --- a/dll/win32/ole32/compobj.c +++ b/dll/win32/ole32/compobj.c @@ -60,6 +60,7 @@ #include "ctxtcall.h" #include "dde.h" #include "servprov.h" + #ifndef __REACTOS__ #include "initguid.h" #endif @@ -71,9 +72,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); -#undef ARRAYSIZE -#define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0])) - /**************************************************************************** * This section defines variables internal to the COM module. */ @@ -485,6 +483,8 @@ struct apartment_loaded_dll static const WCHAR wszAptWinClass[] = {'O','l','e','M','a','i','n','T','h','r','e','a','d','W','n','d','C','l','a','s','s',0}; +static ATOM apt_win_class; + /***************************************************************************** * This section contains OpenDllList implementation */ @@ -1412,12 +1412,8 @@ static HRESULT apartment_getclassobject(struct apartment *apt, LPCWSTR dllpath, return hr; } -/*********************************************************************** - * COM_RegReadPath [internal] - * - * Reads a registry value and expands it when necessary - */ -static DWORD COM_RegReadPath(const struct class_reg_data *regdata, WCHAR *dst, DWORD dstlen) +/* Returns expanded dll path from the registry or activation context. */ +static BOOL get_object_dll_path(const struct class_reg_data *regdata, WCHAR *dst, DWORD dstlen) { DWORD ret; @@ -1444,19 +1440,20 @@ static DWORD COM_RegReadPath(const struct class_reg_data *regdata, WCHAR *dst, D lstrcpynW(dst, src, dstlen); } } - return ret; + return !ret; } else { + static const WCHAR dllW[] = {'.','d','l','l',0}; ULONG_PTR cookie; WCHAR *nameW; *dst = 0; nameW = (WCHAR*)((BYTE*)regdata->u.actctx.section + regdata->u.actctx.data->name_offset); ActivateActCtx(regdata->u.actctx.hactctx, &cookie); - ret = SearchPathW(NULL, nameW, NULL, dstlen, dst, NULL); + ret = SearchPathW(NULL, nameW, dllW, dstlen, dst, NULL); DeactivateActCtx(0, cookie); - return !*dst; + return *dst != 0; } } @@ -1481,7 +1478,7 @@ static HRESULT apartment_hostobject(struct apartment *apt, TRACE("clsid %s, iid %s\n", debugstr_guid(¶ms->clsid), debugstr_guid(¶ms->iid)); - if (COM_RegReadPath(¶ms->regdata, dllpath, ARRAYSIZE(dllpath)) != ERROR_SUCCESS) + if (!get_object_dll_path(¶ms->regdata, dllpath, ARRAY_SIZE(dllpath))) { /* failure: CLSID is not found in registry */ WARN("class %s not registered inproc\n", debugstr_guid(¶ms->clsid)); @@ -1701,7 +1698,7 @@ static BOOL WINAPI register_class( INIT_ONCE *once, void *param, void **context wclass.lpfnWndProc = apartment_wndproc; wclass.hInstance = hProxyDll; wclass.lpszClassName = wszAptWinClass; - RegisterClassW(&wclass); + apt_win_class = RegisterClassW(&wclass); return TRUE; } @@ -2360,7 +2357,7 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax) HRESULT COM_OpenKeyForCLSID(REFCLSID clsid, LPCWSTR keyname, REGSAM access, HKEY *subkey) { static const WCHAR wszCLSIDSlash[] = {'C','L','S','I','D','\\',0}; - WCHAR path[CHARS_IN_GUID + ARRAYSIZE(wszCLSIDSlash) - 1]; + WCHAR path[CHARS_IN_GUID + ARRAY_SIZE(wszCLSIDSlash) - 1]; LONG res; HKEY key; @@ -2395,7 +2392,7 @@ HRESULT COM_OpenKeyForAppIdFromCLSID(REFCLSID clsid, REGSAM access, HKEY *subkey static const WCHAR szAppIdKey[] = { 'A','p','p','I','d','\\',0 }; DWORD res; WCHAR buf[CHARS_IN_GUID]; - WCHAR keyname[ARRAYSIZE(szAppIdKey) + CHARS_IN_GUID]; + WCHAR keyname[ARRAY_SIZE(szAppIdKey) + CHARS_IN_GUID]; DWORD size; HKEY hkey; DWORD type; @@ -2603,7 +2600,7 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid) { static const WCHAR wszInterface[] = {'I','n','t','e','r','f','a','c','e','\\',0}; static const WCHAR wszPSC[] = {'\\','P','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0}; - WCHAR path[ARRAYSIZE(wszInterface) - 1 + CHARS_IN_GUID - 1 + ARRAYSIZE(wszPSC)]; + WCHAR path[ARRAY_SIZE(wszInterface) - 1 + CHARS_IN_GUID - 1 + ARRAY_SIZE(wszPSC)]; APARTMENT *apt; struct registered_psclsid *registered_psclsid; ACTCTX_SECTION_KEYED_DATA data; @@ -2646,8 +2643,8 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid) /* Interface\\{string form of riid}\\ProxyStubClsid32 */ strcpyW(path, wszInterface); - StringFromGUID2(riid, path + ARRAYSIZE(wszInterface) - 1, CHARS_IN_GUID); - strcpyW(path + ARRAYSIZE(wszInterface) - 1 + CHARS_IN_GUID - 1, wszPSC); + StringFromGUID2(riid, path + ARRAY_SIZE(wszInterface) - 1, CHARS_IN_GUID); + strcpyW(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 || @@ -2975,7 +2972,7 @@ static HRESULT get_inproc_class_object(APARTMENT *apt, const struct class_reg_da else apartment_threaded = !apt->multi_threaded; - if (COM_RegReadPath(regdata, dllpath, ARRAYSIZE(dllpath)) != ERROR_SUCCESS) + if (!get_object_dll_path(regdata, dllpath, ARRAY_SIZE(dllpath))) { /* failure: CLSID is not found in registry */ WARN("class %s not registered inproc\n", debugstr_guid(rclsid)); @@ -3833,7 +3830,7 @@ HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew) if(IsEqualGUID(clsidNew, &CLSID_NULL)){ RegDeleteKeyW(hkey, wszTreatAs); }else{ - if(!StringFromGUID2(clsidNew, szClsidNew, ARRAYSIZE(szClsidNew))){ + if(!StringFromGUID2(clsidNew, szClsidNew, ARRAY_SIZE(szClsidNew))){ WARN("StringFromGUID2 failed\n"); res = E_FAIL; goto done; @@ -5091,7 +5088,7 @@ HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) regdata.u.hkey = hkey; regdata.hkey = TRUE; - if (COM_RegReadPath(®data, dllpath, ARRAYSIZE(dllpath)) == ERROR_SUCCESS) + 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)) @@ -5276,7 +5273,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID reserved) case DLL_PROCESS_DETACH: if (reserved) break; release_std_git(); - UnregisterClassW( wszAptWinClass, hProxyDll ); + if(apt_win_class) + UnregisterClassW( (const WCHAR*)MAKEINTATOM(apt_win_class), hProxyDll ); RPC_UnregisterAllChannelHooks(); COMPOBJ_DllList_Free(); DeleteCriticalSection(&csRegisteredClassList); diff --git a/dll/win32/ole32/compobj_private.h b/dll/win32/ole32/compobj_private.h index 212d328317..1e564a3de1 100644 --- a/dll/win32/ole32/compobj_private.h +++ b/dll/win32/ole32/compobj_private.h @@ -210,7 +210,7 @@ struct dispatch_params; void RPC_StartRemoting(struct apartment *apt) DECLSPEC_HIDDEN; HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid, - const OXID_INFO *oxid_info, + const OXID_INFO *oxid_info, const IID *iid, DWORD dest_context, void *dest_context_data, IRpcChannelBuffer **chan, APARTMENT *apt) DECLSPEC_HIDDEN; HRESULT RPC_CreateServerChannel(DWORD dest_context, void *dest_context_data, IRpcChannelBuffer **chan) DECLSPEC_HIDDEN; diff --git a/dll/win32/ole32/datacache.c b/dll/win32/ole32/datacache.c index b72b8ff2ef..3eff56908d 100644 --- a/dll/win32/ole32/datacache.c +++ b/dll/win32/ole32/datacache.c @@ -2667,7 +2667,7 @@ static HRESULT WINAPI DataCache_UpdateCache( IOleCache2 *iface, IDataObject *dat } else { - for (i = 0; i < sizeof(view_list) / sizeof(view_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(view_list); i++) { fmt.cfFormat = view_list[i]; fmt.tymed = tymed_from_cf( fmt.cfFormat ); diff --git a/dll/win32/ole32/ftmarshal.c b/dll/win32/ole32/ftmarshal.c index 3eb7f877aa..c36f5f6169 100644 --- a/dll/win32/ole32/ftmarshal.c +++ b/dll/win32/ole32/ftmarshal.c @@ -144,7 +144,7 @@ FTMarshalImpl_GetUnmarshalClass (LPMARSHAL iface, REFIID riid, void *pv, DWORD d if (dwDestContext == MSHCTX_INPROC || dwDestContext == MSHCTX_CROSSCTX) *pCid = CLSID_InProcFreeMarshaler; else - *pCid = CLSID_DfMarshal; + *pCid = CLSID_StdMarshal; return S_OK; } diff --git a/dll/win32/ole32/git.c b/dll/win32/ole32/git.c index f7a0460154..8683f3592a 100644 --- a/dll/win32/ole32/git.c +++ b/dll/win32/ole32/git.c @@ -122,9 +122,14 @@ StdGlobalInterfaceTable_QueryInterface(IGlobalInterfaceTable* iface, /* Do we implement that interface? */ if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IGlobalInterfaceTable, riid)) + { *ppvObject = iface; + } else + { + FIXME("(%s), not supported.\n", debugstr_guid(riid)); return E_NOINTERFACE; + } /* Now inc the refcount */ IGlobalInterfaceTable_AddRef(iface); @@ -314,13 +319,10 @@ static HRESULT WINAPI GITCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv) { - if (IsEqualIID(riid,&IID_IGlobalInterfaceTable)) { - IGlobalInterfaceTable *git = get_std_git(); - return IGlobalInterfaceTable_QueryInterface(git, riid, ppv); - } - - FIXME("(%s), not supported.\n",debugstr_guid(riid)); - return E_NOINTERFACE; + IGlobalInterfaceTable *git = get_std_git(); + HRESULT hr = IGlobalInterfaceTable_QueryInterface(git, riid, ppv); + IGlobalInterfaceTable_Release(git); + return hr; } static HRESULT WINAPI GITCF_LockServer(LPCLASSFACTORY iface, BOOL fLock) diff --git a/dll/win32/ole32/marshal.c b/dll/win32/ole32/marshal.c index 7c0f541359..b12082cc9f 100644 --- a/dll/win32/ole32/marshal.c +++ b/dll/win32/ole32/marshal.c @@ -40,8 +40,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); -extern const CLSID CLSID_DfMarshal; - /* number of refs given out for normal marshaling */ #define NORMALEXTREFS 5 @@ -362,12 +360,7 @@ static const IMultiQIVtbl ClientIdentity_Vtbl = ClientIdentity_QueryMultipleInterfaces }; -/* FIXME: remove these */ -static HRESULT WINAPI StdMarshalImpl_GetUnmarshalClass(LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags, CLSID* pCid); -static HRESULT WINAPI StdMarshalImpl_GetMarshalSizeMax(LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags, DWORD* pSize); -static HRESULT WINAPI StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void **ppv); -static HRESULT WINAPI StdMarshalImpl_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm); -static HRESULT WINAPI StdMarshalImpl_DisconnectObject(LPMARSHAL iface, DWORD dwReserved); +static HRESULT StdMarshalImpl_Construct(REFIID, DWORD, void*, void**); static HRESULT WINAPI Proxy_QueryInterface(IMarshal *iface, REFIID riid, void **ppvObject) { @@ -387,6 +380,33 @@ static ULONG WINAPI Proxy_Release(IMarshal *iface) return IMultiQI_Release(&This->IMultiQI_iface); } +static HRESULT WINAPI Proxy_GetUnmarshalClass( + IMarshal *iface, REFIID riid, void* pv, DWORD dwDestContext, + void* pvDestContext, DWORD mshlflags, CLSID* pCid) +{ + *pCid = CLSID_StdMarshal; + return S_OK; +} + +static HRESULT WINAPI Proxy_GetMarshalSizeMax( + IMarshal *iface, REFIID riid, void* pv, DWORD dwDestContext, + void* pvDestContext, DWORD mshlflags, DWORD* pSize) +{ + *pSize = FIELD_OFFSET(OBJREF, u_objref.u_standard.saResAddr.aStringArray); + return S_OK; +} + +static void fill_std_objref(OBJREF *objref, const GUID *iid, STDOBJREF *std) +{ + objref->signature = OBJREF_SIGNATURE; + objref->flags = OBJREF_STANDARD; + objref->iid = *iid; + if(std) + objref->u_objref.u_standard.std = *std; + memset(&objref->u_objref.u_standard.saResAddr, 0, + sizeof(objref->u_objref.u_standard.saResAddr)); +} + static HRESULT WINAPI Proxy_MarshalInterface( LPMARSHAL iface, IStream *pStm, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags) @@ -450,12 +470,16 @@ static HRESULT WINAPI Proxy_MarshalInterface( if (SUCCEEDED(hr)) { + OBJREF objref; + TRACE("writing stdobjref: flags = %04x cPublicRefs = %d oxid = %s oid = %s ipid = %s\n", stdobjref.flags, stdobjref.cPublicRefs, wine_dbgstr_longlong(stdobjref.oxid), wine_dbgstr_longlong(stdobjref.oid), debugstr_guid(&stdobjref.ipid)); - hr = IStream_Write(pStm, &stdobjref, sizeof(stdobjref), NULL); + fill_std_objref(&objref, riid, &stdobjref); + hr = IStream_Write(pStm, &objref, FIELD_OFFSET(OBJREF, + u_objref.u_standard.saResAddr.aStringArray), NULL); } } else @@ -481,7 +505,11 @@ static HRESULT WINAPI Proxy_MarshalInterface( 1, &iid, &qiresults); if (SUCCEEDED(hr)) { - hr = IStream_Write(pStm, &qiresults->std, sizeof(qiresults->std), NULL); + OBJREF objref; + + fill_std_objref(&objref, riid, &qiresults->std); + hr = IStream_Write(pStm, &objref, FIELD_OFFSET(OBJREF, + u_objref.u_standard.saResAddr.aStringArray), NULL); if (FAILED(hr)) { REMINTERFACEREF rif; @@ -501,17 +529,72 @@ static HRESULT WINAPI Proxy_MarshalInterface( return hr; } +static HRESULT WINAPI Proxy_UnmarshalInterface( + IMarshal *iface, IStream *pStm, REFIID riid, void **ppv) +{ + struct proxy_manager *This = impl_from_IMarshal( iface ); + IMarshal *marshal; + HRESULT hr; + + TRACE("(%p, %p, %s, %p)\n", This, pStm, wine_dbgstr_guid(riid), ppv); + + hr = StdMarshalImpl_Construct(&IID_IMarshal, This->dest_context, + This->dest_context_data, (void**)&marshal); + if(FAILED(hr)) + return hr; + + hr = IMarshal_UnmarshalInterface(marshal, pStm, riid, ppv); + IMarshal_Release(marshal); + return hr; +} + +static HRESULT WINAPI Proxy_ReleaseMarshalData(IMarshal *iface, IStream *pStm) +{ + struct proxy_manager *This = impl_from_IMarshal( iface ); + IMarshal *marshal; + HRESULT hr; + + TRACE("(%p, %p)\n", This, pStm); + + hr = StdMarshalImpl_Construct(&IID_IMarshal, This->dest_context, + This->dest_context_data, (void**)&marshal); + if(FAILED(hr)) + return hr; + + hr = IMarshal_ReleaseMarshalData(marshal, pStm); + IMarshal_Release(marshal); + return hr; +} + +static HRESULT WINAPI Proxy_DisconnectObject(IMarshal *iface, DWORD dwReserved) +{ + struct proxy_manager *This = impl_from_IMarshal( iface ); + IMarshal *marshal; + HRESULT hr; + + TRACE("(%p, %x)\n", This, dwReserved); + + hr = StdMarshalImpl_Construct(&IID_IMarshal, This->dest_context, + This->dest_context_data, (void**)&marshal); + if(FAILED(hr)) + return hr; + + hr = IMarshal_DisconnectObject(marshal, dwReserved); + IMarshal_Release(marshal); + return hr; +} + static const IMarshalVtbl ProxyMarshal_Vtbl = { Proxy_QueryInterface, Proxy_AddRef, Proxy_Release, - StdMarshalImpl_GetUnmarshalClass, - StdMarshalImpl_GetMarshalSizeMax, + Proxy_GetUnmarshalClass, + Proxy_GetMarshalSizeMax, Proxy_MarshalInterface, - StdMarshalImpl_UnmarshalInterface, - StdMarshalImpl_ReleaseMarshalData, - StdMarshalImpl_DisconnectObject + Proxy_UnmarshalInterface, + Proxy_ReleaseMarshalData, + Proxy_DisconnectObject }; static HRESULT WINAPI ProxyCliSec_QueryInterface(IClientSecurity *iface, REFIID riid, void **ppvObject) @@ -1204,7 +1287,7 @@ StdMarshalImpl_GetUnmarshalClass( IMarshal *iface, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags, CLSID* pCid) { - *pCid = CLSID_DfMarshal; + *pCid = CLSID_StdMarshal; return S_OK; } @@ -1213,7 +1296,7 @@ StdMarshalImpl_GetMarshalSizeMax( IMarshal *iface, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags, DWORD* pSize) { - *pSize = sizeof(STDOBJREF); + *pSize = FIELD_OFFSET(OBJREF, u_objref.u_standard.saResAddr.aStringArray); return S_OK; } @@ -1222,10 +1305,10 @@ StdMarshalImpl_MarshalInterface( IMarshal *iface, IStream *pStm,REFIID riid, void* pv, DWORD dest_context, void* dest_context_data, DWORD mshlflags) { - STDOBJREF stdobjref; ULONG res; HRESULT hres; APARTMENT *apt; + OBJREF objref; TRACE("(...,%s,...)\n", debugstr_guid(riid)); @@ -1238,7 +1321,9 @@ StdMarshalImpl_MarshalInterface( /* make sure this apartment can be reached from other threads / processes */ RPC_StartRemoting(apt); - hres = marshal_object(apt, &stdobjref, riid, pv, dest_context, dest_context_data, mshlflags); + fill_std_objref(&objref, riid, NULL); + hres = marshal_object(apt, &objref.u_objref.u_standard.std, riid, + pv, dest_context, dest_context_data, mshlflags); apartment_release(apt); if (hres != S_OK) { @@ -1246,7 +1331,8 @@ StdMarshalImpl_MarshalInterface( return hres; } - return IStream_Write(pStm, &stdobjref, sizeof(stdobjref), &res); + return IStream_Write(pStm, &objref, + FIELD_OFFSET(OBJREF, u_objref.u_standard.saResAddr.aStringArray), &res); } /* helper for StdMarshalImpl_UnmarshalInterface - does the unmarshaling with @@ -1290,7 +1376,7 @@ static HRESULT unmarshal_object(const STDOBJREF *stdobjref, APARTMENT *apt, { IRpcChannelBuffer *chanbuf; hr = RPC_CreateClientChannel(&stdobjref->oxid, &stdobjref->ipid, - &proxy_manager->oxid_info, + &proxy_manager->oxid_info, riid, proxy_manager->dest_context, proxy_manager->dest_context_data, &chanbuf, apt); @@ -1321,12 +1407,11 @@ static HRESULT unmarshal_object(const STDOBJREF *stdobjref, APARTMENT *apt, return hr; } -static HRESULT WINAPI -StdMarshalImpl_UnmarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, void **ppv) +static HRESULT std_unmarshal_interface(MSHCTX dest_context, void *dest_context_data, + IStream *pStm, REFIID riid, void **ppv) { - StdMarshalImpl *This = impl_from_StdMarshal(iface); struct stub_manager *stubmgr = NULL; - STDOBJREF stdobjref; + struct OR_STANDARD obj; ULONG res; HRESULT hres; APARTMENT *apt; @@ -1343,7 +1428,7 @@ StdMarshalImpl_UnmarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, v } /* read STDOBJREF from wire */ - hres = IStream_Read(pStm, &stdobjref, sizeof(stdobjref), &res); + hres = IStream_Read(pStm, &obj, FIELD_OFFSET(struct OR_STANDARD, saResAddr.aStringArray), &res); if (hres != S_OK) { apartment_release(apt); @@ -1357,8 +1442,14 @@ StdMarshalImpl_UnmarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, v return hres; } + if (obj.saResAddr.wNumEntries) + { + ERR("unsupported size of DUALSTRINGARRAY\n"); + return E_NOTIMPL; + } + /* check if we're marshalling back to ourselves */ - if ((oxid == stdobjref.oxid) && (stubmgr = get_stub_manager(apt, stdobjref.oid))) + if ((oxid == obj.std.oxid) && (stubmgr = get_stub_manager(apt, obj.std.oid))) { TRACE("Unmarshalling object marshalled in same apartment for iid %s, " "returning original object %p\n", debugstr_guid(riid), stubmgr->object); @@ -1366,8 +1457,8 @@ StdMarshalImpl_UnmarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, v hres = IUnknown_QueryInterface(stubmgr->object, riid, ppv); /* unref the ifstub. FIXME: only do this on success? */ - if (!stub_manager_is_table_marshaled(stubmgr, &stdobjref.ipid)) - stub_manager_ext_release(stubmgr, stdobjref.cPublicRefs, stdobjref.flags & SORFP_TABLEWEAK, FALSE); + if (!stub_manager_is_table_marshaled(stubmgr, &obj.std.ipid)) + stub_manager_ext_release(stubmgr, obj.std.cPublicRefs, obj.std.flags & SORFP_TABLEWEAK, FALSE); stub_manager_int_release(stubmgr); apartment_release(apt); @@ -1379,28 +1470,28 @@ StdMarshalImpl_UnmarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, v * ignore table marshaling and normal marshaling rules regarding number of * unmarshals, etc, but if you abuse these rules then your proxy could end * up returning RPC_E_DISCONNECTED. */ - if ((stub_apt = apartment_findfromoxid(stdobjref.oxid, TRUE))) + if ((stub_apt = apartment_findfromoxid(obj.std.oxid, TRUE))) { - if ((stubmgr = get_stub_manager(stub_apt, stdobjref.oid))) + if ((stubmgr = get_stub_manager(stub_apt, obj.std.oid))) { - if (!stub_manager_notify_unmarshal(stubmgr, &stdobjref.ipid)) + if (!stub_manager_notify_unmarshal(stubmgr, &obj.std.ipid)) hres = CO_E_OBJNOTCONNECTED; } else { WARN("Couldn't find object for OXID %s, OID %s, assuming disconnected\n", - wine_dbgstr_longlong(stdobjref.oxid), - wine_dbgstr_longlong(stdobjref.oid)); + wine_dbgstr_longlong(obj.std.oxid), + wine_dbgstr_longlong(obj.std.oid)); hres = CO_E_OBJNOTCONNECTED; } } else TRACE("Treating unmarshal from OXID %s as inter-process\n", - wine_dbgstr_longlong(stdobjref.oxid)); + wine_dbgstr_longlong(obj.std.oxid)); if (hres == S_OK) - hres = unmarshal_object(&stdobjref, apt, This->dest_context, - This->dest_context_data, riid, + hres = unmarshal_object(&obj.std, apt, dest_context, + dest_context_data, riid, stubmgr ? &stubmgr->oxid_info : NULL, ppv); if (stubmgr) stub_manager_int_release(stubmgr); @@ -1414,40 +1505,74 @@ StdMarshalImpl_UnmarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, v } static HRESULT WINAPI -StdMarshalImpl_ReleaseMarshalData(IMarshal *iface, IStream *pStm) +StdMarshalImpl_UnmarshalInterface(IMarshal *iface, IStream *pStm, REFIID riid, void **ppv) { - STDOBJREF stdobjref; + StdMarshalImpl *This = impl_from_StdMarshal(iface); + OBJREF objref; + HRESULT hr; + ULONG res; + + hr = IStream_Read(pStm, &objref, FIELD_OFFSET(OBJREF, u_objref), &res); + if (hr != S_OK || (res != FIELD_OFFSET(OBJREF, u_objref))) + { + ERR("Failed to read common OBJREF header, 0x%08x\n", hr); + return STG_E_READFAULT; + } + + if (objref.signature != OBJREF_SIGNATURE) + { + ERR("Bad OBJREF signature 0x%08x\n", objref.signature); + return RPC_E_INVALID_OBJREF; + } + + if (!(objref.flags & OBJREF_STANDARD)) + { + FIXME("unsupported objref.flags = %x\n", objref.flags); + return E_NOTIMPL; + } + + return std_unmarshal_interface(This->dest_context, + This->dest_context_data, pStm, riid, ppv); +} + +static HRESULT std_release_marshal_data(IStream *pStm) +{ + struct OR_STANDARD obj; ULONG res; HRESULT hres; struct stub_manager *stubmgr; APARTMENT *apt; - TRACE("iface=%p, pStm=%p\n", iface, pStm); - - hres = IStream_Read(pStm, &stdobjref, sizeof(stdobjref), &res); + hres = IStream_Read(pStm, &obj, FIELD_OFFSET(struct OR_STANDARD, saResAddr.aStringArray), &res); if (hres != S_OK) return STG_E_READFAULT; + if (obj.saResAddr.wNumEntries) + { + ERR("unsupported size of DUALSTRINGARRAY\n"); + return E_NOTIMPL; + } + TRACE("oxid = %s, oid = %s, ipid = %s\n", - wine_dbgstr_longlong(stdobjref.oxid), - wine_dbgstr_longlong(stdobjref.oid), - wine_dbgstr_guid(&stdobjref.ipid)); + wine_dbgstr_longlong(obj.std.oxid), + wine_dbgstr_longlong(obj.std.oid), + wine_dbgstr_guid(&obj.std.ipid)); - if (!(apt = apartment_findfromoxid(stdobjref.oxid, TRUE))) + if (!(apt = apartment_findfromoxid(obj.std.oxid, TRUE))) { WARN("Could not map OXID %s to apartment object\n", - wine_dbgstr_longlong(stdobjref.oxid)); + wine_dbgstr_longlong(obj.std.oxid)); return RPC_E_INVALID_OBJREF; } - if (!(stubmgr = get_stub_manager(apt, stdobjref.oid))) + if (!(stubmgr = get_stub_manager(apt, obj.std.oid))) { apartment_release(apt); ERR("could not map object ID to stub manager, oxid=%s, oid=%s\n", - wine_dbgstr_longlong(stdobjref.oxid), wine_dbgstr_longlong(stdobjref.oid)); + wine_dbgstr_longlong(obj.std.oxid), wine_dbgstr_longlong(obj.std.oid)); return RPC_E_INVALID_OBJREF; } - stub_manager_release_marshal_data(stubmgr, stdobjref.cPublicRefs, &stdobjref.ipid, stdobjref.flags & SORFP_TABLEWEAK); + stub_manager_release_marshal_data(stubmgr, obj.std.cPublicRefs, &obj.std.ipid, obj.std.flags & SORFP_TABLEWEAK); stub_manager_int_release(stubmgr); apartment_release(apt); @@ -1455,6 +1580,37 @@ StdMarshalImpl_ReleaseMarshalData(IMarshal *iface, IStream *pStm) return S_OK; } +static HRESULT WINAPI +StdMarshalImpl_ReleaseMarshalData(IMarshal *iface, IStream *pStm) +{ + OBJREF objref; + HRESULT hr; + ULONG res; + + TRACE("iface=%p, pStm=%p\n", iface, pStm); + + hr = IStream_Read(pStm, &objref, FIELD_OFFSET(OBJREF, u_objref), &res); + if (hr != S_OK || (res != FIELD_OFFSET(OBJREF, u_objref))) + { + ERR("Failed to read common OBJREF header, 0x%08x\n", hr); + return STG_E_READFAULT; + } + + if (objref.signature != OBJREF_SIGNATURE) + { + ERR("Bad OBJREF signature 0x%08x\n", objref.signature); + return RPC_E_INVALID_OBJREF; + } + + if (!(objref.flags & OBJREF_STANDARD)) + { + FIXME("unsupported objref.flags = %x\n", objref.flags); + return E_NOTIMPL; + } + + return std_release_marshal_data(pStm); +} + static HRESULT WINAPI StdMarshalImpl_DisconnectObject(IMarshal *iface, DWORD dwReserved) { @@ -1588,7 +1744,8 @@ static HRESULT get_unmarshaler_from_stream(IStream *stream, IMarshal **marshal, if (objref.flags & OBJREF_STANDARD) { TRACE("Using standard unmarshaling\n"); - hr = StdMarshalImpl_Construct(&IID_IMarshal, 0, NULL, (LPVOID*)marshal); + *marshal = NULL; + return S_FALSE; } else if (objref.flags & OBJREF_CUSTOM) { @@ -1647,29 +1804,25 @@ HRESULT WINAPI CoGetMarshalSizeMax(ULONG *pulSize, REFIID riid, IUnknown *pUnk, { HRESULT hr; LPMARSHAL pMarshal; - CLSID marshaler_clsid; + BOOL std_marshal = FALSE; - hr = get_marshaler(riid, pUnk, dwDestContext, pvDestContext, mshlFlags, &pMarshal); - if (hr != S_OK) - return hr; + if(!pUnk) + return E_POINTER; - hr = IMarshal_GetUnmarshalClass(pMarshal, riid, pUnk, dwDestContext, - pvDestContext, mshlFlags, &marshaler_clsid); + hr = IUnknown_QueryInterface(pUnk, &IID_IMarshal, (void**)&pMarshal); if (hr != S_OK) { - ERR("IMarshal::GetUnmarshalClass failed, 0x%08x\n", hr); - IMarshal_Release(pMarshal); - return hr; + std_marshal = TRUE; + hr = CoGetStandardMarshal(riid, pUnk, dwDestContext, pvDestContext, + mshlFlags, &pMarshal); } + if (hr != S_OK) + return hr; hr = IMarshal_GetMarshalSizeMax(pMarshal, riid, pUnk, dwDestContext, pvDestContext, mshlFlags, pulSize); - if (IsEqualCLSID(&marshaler_clsid, &CLSID_DfMarshal)) - /* add on the size of the common header */ - *pulSize += FIELD_OFFSET(OBJREF, u_objref); - else - /* custom marshaling: add on the size of the whole OBJREF structure - * like native does */ + if (!std_marshal) + /* add on the size of the whole OBJREF structure like native does */ *pulSize += sizeof(OBJREF); IMarshal_Release(pMarshal); @@ -1727,7 +1880,6 @@ HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, { HRESULT hr; CLSID marshaler_clsid; - OBJREF objref; LPMARSHAL pMarshal; TRACE("(%p, %s, %p, %x, %p, ", pStream, debugstr_guid(riid), pUnk, @@ -1738,9 +1890,6 @@ HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, if (!pUnk || !pStream) return E_INVALIDARG; - objref.signature = OBJREF_SIGNATURE; - objref.iid = *riid; - /* get the marshaler for the specified interface */ hr = get_marshaler(riid, pUnk, dwDestContext, pvDestContext, mshlFlags, &pMarshal); if (hr != S_OK) @@ -1758,22 +1907,17 @@ HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, } /* FIXME: implement handler marshaling too */ - if (IsEqualCLSID(&marshaler_clsid, &CLSID_DfMarshal)) + if (IsEqualCLSID(&marshaler_clsid, &CLSID_StdMarshal)) { TRACE("Using standard marshaling\n"); - objref.flags = OBJREF_STANDARD; - - /* write the common OBJREF header to the stream */ - hr = IStream_Write(pStream, &objref, FIELD_OFFSET(OBJREF, u_objref), NULL); - if (hr != S_OK) - { - ERR("Failed to write OBJREF header to stream, 0x%08x\n", hr); - goto cleanup; - } } else { + OBJREF objref; + TRACE("Using custom marshaling\n"); + objref.signature = OBJREF_SIGNATURE; + objref.iid = *riid; objref.flags = OBJREF_CUSTOM; objref.u_objref.u_custom.clsid = marshaler_clsid; objref.u_objref.u_custom.cbExtension = 0; @@ -1848,13 +1992,20 @@ HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv) return E_INVALIDARG; hr = get_unmarshaler_from_stream(pStream, &pMarshal, &iid); - if (hr != S_OK) - return hr; - - /* call the helper object to do the actual unmarshaling */ - hr = IMarshal_UnmarshalInterface(pMarshal, pStream, &iid, (LPVOID*)&object); - if (hr != S_OK) - ERR("IMarshal::UnmarshalInterface failed, 0x%08x\n", hr); + if (hr == S_FALSE) + { + hr = std_unmarshal_interface(0, NULL, pStream, &iid, (void**)&object); + if (hr != S_OK) + ERR("StdMarshal UnmarshalInterface failed, 0x%08x\n", hr); + } + else if (hr == S_OK) + { + /* call the helper object to do the actual unmarshaling */ + hr = IMarshal_UnmarshalInterface(pMarshal, pStream, &iid, (LPVOID*)&object); + IMarshal_Release(pMarshal); + if (hr != S_OK) + ERR("IMarshal::UnmarshalInterface failed, 0x%08x\n", hr); + } if (hr == S_OK) { @@ -1874,8 +2025,6 @@ HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv) } } - IMarshal_Release(pMarshal); - TRACE("completed with hr 0x%x\n", hr); return hr; @@ -1912,6 +2061,13 @@ HRESULT WINAPI CoReleaseMarshalData(IStream *pStream) TRACE("(%p)\n", pStream); hr = get_unmarshaler_from_stream(pStream, &pMarshal, NULL); + if (hr == S_FALSE) + { + hr = std_release_marshal_data(pStream); + if (hr != S_OK) + ERR("StdMarshal ReleaseMarshalData failed with error 0x%08x\n", hr); + return hr; + } if (hr != S_OK) return hr; diff --git a/dll/win32/ole32/moniker.c b/dll/win32/ole32/moniker.c index ffbaa61e50..c1312d1e1e 100644 --- a/dll/win32/ole32/moniker.c +++ b/dll/win32/ole32/moniker.c @@ -1152,7 +1152,7 @@ HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szDisplayName, *pchEaten = 0; *ppmk = NULL; - if (!strncmpiW(szDisplayName, wszClsidColon, sizeof(wszClsidColon)/sizeof(wszClsidColon[0]))) + if (!strncmpiW(szDisplayName, wszClsidColon, ARRAY_SIZE(wszClsidColon))) { hr = ClassMoniker_CreateFromDisplayName(pbc, szDisplayName, &chEaten, &moniker); if (FAILED(hr) && (hr != MK_E_SYNTAX)) diff --git a/dll/win32/ole32/ole2.c b/dll/win32/ole32/ole2.c index c7a9b272cb..2de9edbb80 100644 --- a/dll/win32/ole32/ole2.c +++ b/dll/win32/ole32/ole2.c @@ -967,7 +967,7 @@ static HRESULT WINAPI EnumOLEVERB_Next( LPWSTR pwszOLEVERB; LPWSTR pwszMenuFlags; LPWSTR pwszAttribs; - LONG res = RegEnumKeyW(This->hkeyVerb, This->index, wszSubKey, sizeof(wszSubKey)/sizeof(wszSubKey[0])); + LONG res = RegEnumKeyW(This->hkeyVerb, This->index, wszSubKey, ARRAY_SIZE(wszSubKey)); if (res == ERROR_NO_MORE_ITEMS) { hr = S_FALSE; diff --git a/dll/win32/ole32/ole2impl.c b/dll/win32/ole32/ole2impl.c index ccf31fa4f5..e3820b9ac2 100644 --- a/dll/win32/ole32/ole2impl.c +++ b/dll/win32/ole32/ole2impl.c @@ -135,7 +135,7 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf, BOOL if (other_fmts) { - for (i = 0; i < sizeof(fmt_id)/sizeof(fmt_id[0]); i++) + for (i = 0; i < ARRAY_SIZE(fmt_id); i++) { init_fmtetc(&fmt, fmt_id[i], TYMED_ISTORAGE); hr = IDataObject_QueryGetData(data, &fmt); @@ -232,9 +232,102 @@ HRESULT WINAPI OleCreateStaticFromData(IDataObject *data, REFIID iid, IOleClientSite *client_site, IStorage *stg, void **obj) { - FIXME("%p,%s,%08x,%p,%p,%p,%p: semi-stub\n", + HRESULT hr; + CLSID clsid; + IOleObject * ole_object = NULL; + IOleCache2 *ole_cache = NULL; + IPersistStorage *persist = NULL; + DWORD connection; + STGMEDIUM stgmedium; + LPOLESTR ole_typename; + + TRACE("(%p, %s, 0x%08x, %p, %p, %p, %p)\n", data, debugstr_guid(iid), renderopt, fmt, client_site, stg, obj); - return OleCreateFromData(data, iid, renderopt, fmt, client_site, stg, obj); + + if (!obj || !stg) + return E_INVALIDARG; + + if (renderopt != OLERENDER_FORMAT) + { + FIXME("semi-stub\n"); + return OleCreateFromData(data, iid, renderopt, fmt, client_site, stg, obj); + } + + if (!fmt) + return E_INVALIDARG; + + hr = IDataObject_GetData(data, fmt, &stgmedium); + if (FAILED(hr)) return hr; + + switch (fmt->cfFormat) + { + case CF_BITMAP: + case CF_DIB: + clsid = CLSID_Picture_Dib; + break; + case CF_ENHMETAFILE: + clsid = CLSID_Picture_EnhMetafile; + break; + case CF_METAFILEPICT: + clsid = CLSID_Picture_Metafile; + break; + default: + ReleaseStgMedium(&stgmedium); + return DV_E_CLIPFORMAT; + } + hr = OleCreateDefaultHandler(&clsid, NULL, &IID_IOleObject, (void **)&ole_object); + if (FAILED(hr)) goto end; + + if (client_site) + { + hr = IOleObject_SetClientSite(ole_object, client_site); + if (FAILED(hr)) goto end; + } + + hr = IOleObject_QueryInterface(ole_object, &IID_IOleCache2, (void **)&ole_cache); + if (FAILED(hr)) goto end; + + hr = IOleObject_QueryInterface(ole_object, &IID_IPersistStorage, (void **)&persist); + if (FAILED(hr)) goto end; + + hr = WriteClassStg(stg, &clsid); + if (FAILED(hr)) goto end; + + hr = IPersistStorage_InitNew(persist, stg); + if (FAILED(hr)) goto end; + + hr = IOleCache2_Cache(ole_cache, fmt, ADVF_PRIMEFIRST, &connection); + if (FAILED(hr)) goto end; + + hr = IOleCache2_SetData(ole_cache, fmt, &stgmedium, TRUE); + if (FAILED(hr)) goto end; + stgmedium.tymed = TYMED_NULL; + + hr = IOleObject_GetUserType(ole_object, USERCLASSTYPE_FULL, &ole_typename); + if(FAILED(hr)) + ole_typename = NULL; + hr = WriteFmtUserTypeStg(stg, fmt->cfFormat, ole_typename); + CoTaskMemFree(ole_typename); + if (FAILED(hr)) goto end; + + hr = IPersistStorage_Save(persist, stg, TRUE); + if (FAILED(hr)) goto end; + + hr = IPersistStorage_SaveCompleted(persist, NULL); + if (FAILED(hr)) goto end; + + hr = IOleObject_QueryInterface(ole_object, iid, obj); + +end: + if (stgmedium.tymed == TYMED_NULL) + ReleaseStgMedium(&stgmedium); + if (persist) + IPersistStorage_Release(persist); + if (ole_cache) + IOleCache2_Release(ole_cache); + if (ole_object) + IOleObject_Release(ole_object); + return hr; } /****************************************************************************** diff --git a/dll/win32/ole32/rpc.c b/dll/win32/ole32/rpc.c index a73d23ce68..bd4611d7d5 100644 --- a/dll/win32/ole32/rpc.c +++ b/dll/win32/ole32/rpc.c @@ -109,6 +109,7 @@ typedef struct OXID oxid; /* apartment in which the channel is valid */ DWORD server_pid; /* id of server process */ HANDLE event; /* cached event handle */ + IID iid; /* IID of the proxy this belongs to */ } ClientRpcChannelBuffer; struct dispatch_params @@ -650,7 +651,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, cif->Length = sizeof(RPC_CLIENT_INTERFACE); /* RPC interface ID = COM interface ID */ - cif->InterfaceId.SyntaxGUID = *riid; + cif->InterfaceId.SyntaxGUID = This->iid; /* COM objects always have a version of 0.0 */ cif->InterfaceId.SyntaxVersion.MajorVersion = 0; cif->InterfaceId.SyntaxVersion.MinorVersion = 0; @@ -1096,7 +1097,7 @@ static const IRpcChannelBufferVtbl ServerRpcChannelBufferVtbl = /* returns a channel buffer for proxies */ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid, - const OXID_INFO *oxid_info, + const OXID_INFO *oxid_info, const IID *iid, DWORD dest_context, void *dest_context_data, IRpcChannelBuffer **chan, APARTMENT *apt) { @@ -1155,6 +1156,7 @@ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid, apartment_getoxid(apt, &This->oxid); This->server_pid = oxid_info->dwPid; This->event = NULL; + This->iid = *iid; *chan = &This->super.IRpcChannelBuffer_iface; @@ -1658,7 +1660,7 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process) static const WCHAR embedding[] = { ' ', '-','E','m','b','e','d','d','i','n','g',0 }; HKEY key; HRESULT hres; - WCHAR command[MAX_PATH+sizeof(embedding)/sizeof(WCHAR)]; + WCHAR command[MAX_PATH+ARRAY_SIZE(embedding)]; DWORD size = (MAX_PATH+1) * sizeof(WCHAR); STARTUPINFOW sinfo; PROCESS_INFORMATION pinfo; @@ -1799,7 +1801,7 @@ static void get_localserver_pipe_name(WCHAR *pipefn, REFCLSID rclsid) { static const WCHAR wszPipeRef[] = {'\\','\\','.','\\','p','i','p','e','\\',0}; strcpyW(pipefn, wszPipeRef); - StringFromGUID2(rclsid, pipefn + sizeof(wszPipeRef)/sizeof(wszPipeRef[0]) - 1, CHARS_IN_GUID); + StringFromGUID2(rclsid, pipefn + ARRAY_SIZE(wszPipeRef) - 1, CHARS_IN_GUID); } /* FIXME: should call to rpcss instead */ diff --git a/dll/win32/ole32/stg_prop.c b/dll/win32/ole32/stg_prop.c index 1d5e03473d..4b968d6e9c 100644 --- a/dll/win32/ole32/stg_prop.c +++ b/dll/win32/ole32/stg_prop.c @@ -1058,11 +1058,13 @@ static HRESULT PropertyStorage_ReadProperty(PROPVARIANT *prop, const BYTE *data, UINT codepage, void* (__thiscall_wrapper *allocate)(void *this, ULONG size), void *allocate_data) { HRESULT hr = S_OK; + DWORD vt; assert(prop); assert(data); - StorageUtl_ReadDWord(data, 0, (DWORD *)&prop->vt); + StorageUtl_ReadDWord(data, 0, &vt); data += sizeof(DWORD); + prop->vt = vt; switch (prop->vt) { case VT_EMPTY: diff --git a/dll/win32/ole32/storage32.c b/dll/win32/ole32/storage32.c index 51f178be8e..a8bbd407dd 100644 --- a/dll/win32/ole32/storage32.c +++ b/dll/win32/ole32/storage32.c @@ -5057,7 +5057,7 @@ static HRESULT StorageImpl_LockOne(StorageImpl *This, ULONG start, ULONG end) if (SUCCEEDED(hr)) { - for (j=0; j<sizeof(This->locked_bytes)/sizeof(This->locked_bytes[0]); j++) + for (j = 0; j < ARRAY_SIZE(This->locked_bytes); j++) { if (This->locked_bytes[j] == 0) { @@ -5200,10 +5200,10 @@ static void StorageImpl_Destroy(StorageBaseImpl* iface) BlockChainStream_Destroy(This->rootBlockChain); BlockChainStream_Destroy(This->smallBlockDepotChain); - for (i=0; i<BLOCKCHAIN_CACHE_SIZE; i++) + for (i = 0; i < BLOCKCHAIN_CACHE_SIZE; i++) BlockChainStream_Destroy(This->blockChainCache[i]); - for (i=0; i<sizeof(This->locked_bytes)/sizeof(This->locked_bytes[0]); i++) + for (i = 0; i < ARRAY_SIZE(This->locked_bytes); i++) { ULARGE_INTEGER offset, cb; cb.QuadPart = 1; @@ -9369,8 +9369,7 @@ HRESULT WINAPI WriteFmtUserTypeStg( /* get the clipboard format name */ if( cf ) { - n = GetClipboardFormatNameW( cf, szwClipName, - sizeof(szwClipName)/sizeof(szwClipName[0]) ); + n = GetClipboardFormatNameW(cf, szwClipName, ARRAY_SIZE(szwClipName)); szwClipName[n]=0; } @@ -10035,8 +10034,8 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName static const WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0}; WCHAR bufferW[OLESTREAM_MAX_STR_LEN]; - BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF}; - BYTE pCompObjUnknown2[] = {0xF4, 0x39, 0xB2, 0x71}; + static const BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF}; + static const BYTE pCompObjUnknown2[] = {0xF4, 0x39, 0xB2, 0x71}; /* Initialize the CompObj structure */ memset(&IStorageCompObj, 0, sizeof(IStorageCompObj)); @@ -10134,7 +10133,7 @@ static void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, HRESULT hRes; IStream *pStream; static const WCHAR wstrStreamName[] = {2, 'O', 'l', 'e', 'P', 'r', 'e', 's', '0', '0', '0', 0}; - BYTE pOlePresStreamHeader [] = + static const BYTE pOlePresStreamHeader[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, @@ -10142,7 +10141,7 @@ static void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, 0x00, 0x00, 0x00, 0x00 }; - BYTE pOlePresStreamHeaderEmpty [] = + static const BYTE pOlePresStreamHeaderEmpty[] = { 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, diff --git a/dll/win32/ole32/usrmarshal.c b/dll/win32/ole32/usrmarshal.c index 3d1284a431..9f19b66d63 100644 --- a/dll/win32/ole32/usrmarshal.c +++ b/dll/win32/ole32/usrmarshal.c @@ -116,7 +116,7 @@ ULONG __RPC_USER CLIPFORMAT_UserSize(ULONG *pFlags, ULONG size, CLIPFORMAT *pCF) /* urg! this function is badly designed because it won't tell us how * much space is needed without doing a dummy run of storing the * name into a buffer */ - ret = GetClipboardFormatNameW(*pCF, format, sizeof(format)/sizeof(format[0])-1); + ret = GetClipboardFormatNameW(*pCF, format, ARRAY_SIZE(format)-1); if (!ret) RaiseException(DV_E_CLIPFORMAT, 0, 0, NULL); size += (ret + 1) * sizeof(WCHAR); @@ -161,7 +161,7 @@ unsigned char * __RPC_USER CLIPFORMAT_UserMarshal(ULONG *pFlags, unsigned char * *(DWORD *)pBuffer = *pCF; pBuffer += 4; - len = GetClipboardFormatNameW(*pCF, format, sizeof(format)/sizeof(format[0])-1); + len = GetClipboardFormatNameW(*pCF, format, ARRAY_SIZE(format)-1); if (!len) RaiseException(DV_E_CLIPFORMAT, 0, 0, NULL); len += 1; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 7b4141c99b..5313ce69e9 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -139,7 +139,7 @@ reactos/dll/win32/ntdsapi # Synced to WineStaging-3.9 reactos/dll/win32/objsel # Synced to WineStaging-3.3 reactos/dll/win32/odbc32 # Synced to WineStaging-4.0. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-4.0 -reactos/dll/win32/ole32 # Synced to WineStaging-3.9 +reactos/dll/win32/ole32 # Synced to WineStaging-4.0 reactos/dll/win32/oleacc # Synced to WineStaging-3.3 reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3 reactos/dll/win32/olecli32 # Synced to WineStaging-3.3
5 years, 12 months
1
0
0
0
[reactos] 01/01: [ODBCCP32_WINETEST] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4d2ae66cd17d021723cd5…
commit 4d2ae66cd17d021723cd5959e1cd889028aebfd9 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:15:00 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:15:00 2019 +0100 [ODBCCP32_WINETEST] Sync with Wine Staging 4.0. CORE-15682 --- modules/rostests/winetests/odbccp32/CMakeLists.txt | 2 +- modules/rostests/winetests/odbccp32/misc.c | 78 +++++++++++++++++++++- .../rostests/winetests/odbccp32/odbccp32.manifest | 18 +++++ modules/rostests/winetests/odbccp32/odbccp32.rc | 22 ++++++ 4 files changed, 116 insertions(+), 4 deletions(-) diff --git a/modules/rostests/winetests/odbccp32/CMakeLists.txt b/modules/rostests/winetests/odbccp32/CMakeLists.txt index 88b9e81824..71cdb05a2e 100644 --- a/modules/rostests/winetests/odbccp32/CMakeLists.txt +++ b/modules/rostests/winetests/odbccp32/CMakeLists.txt @@ -1,5 +1,5 @@ -add_executable(odbccp32_winetest misc.c testlist.c) +add_executable(odbccp32_winetest misc.c testlist.c odbccp32.rc) set_module_type(odbccp32_winetest win32cui) add_importlibs(odbccp32_winetest odbccp32 advapi32 msvcrt kernel32) add_rostests_file(TARGET odbccp32_winetest) diff --git a/modules/rostests/winetests/odbccp32/misc.c b/modules/rostests/winetests/odbccp32/misc.c index c12ff4961b..dc65bdf3f9 100644 --- a/modules/rostests/winetests/odbccp32/misc.c +++ b/modules/rostests/winetests/odbccp32/misc.c @@ -171,6 +171,9 @@ static void test_SQLWritePrivateProfileString(void) { HKEY hkey; + ret = SQLWritePrivateProfileString("wineodbc", "testing" , NULL, "odbc.ini"); + ok(ret, "SQLWritePrivateProfileString failed\n"); + reg_ret = RegOpenKeyExW(HKEY_CURRENT_USER, odbc_key, 0, KEY_READ, &hkey); ok(reg_ret == ERROR_SUCCESS, "RegOpenKeyExW failed\n"); if(reg_ret == ERROR_SUCCESS) @@ -618,11 +621,19 @@ static void test_SQLGetInstalledDrivers(void) { char buffer[1000], *p; WORD written, len; + BOOL ret, sql_ret; + DWORD error_code; int found = 0; - BOOL ret; - SQLInstallDriverEx("Wine test\0Driver=test.dll\0\0", NULL, buffer, - sizeof(buffer), &written, ODBC_INSTALL_COMPLETE, NULL); + ret = SQLInstallDriverEx("Wine test\0Driver=test.dll\0\0", NULL, buffer, + sizeof(buffer), &written, ODBC_INSTALL_COMPLETE, NULL); + ok(ret, "SQLInstallDriverEx failed: %d\n", ret); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + if (sql_ret && error_code == ODBC_ERROR_WRITING_SYSINFO_FAILED) + { + skip("not enough privileges\n"); + return; + } ret = SQLGetInstalledDrivers(NULL, sizeof(buffer), &written); ok(!ret, "got %d\n", ret); @@ -671,6 +682,65 @@ static void test_SQLGetInstalledDrivers(void) SQLRemoveDriver("Wine test", TRUE, NULL); } +static void test_SQLValidDSN(void) +{ + static const char *invalid = "[]{}(),;?*=!@\\"; + char str[10]; + int i; + BOOL ret; + + strcpy(str, "wine10"); + for(i = 0; i < strlen(invalid); i++) + { + str[4] = invalid[i]; + ret = SQLValidDSN(str); + ok(!ret, "got %d\n", ret); + } + + /* Too large */ + ret = SQLValidDSN("Wine123456789012345678901234567890"); + ok(!ret, "got %d\n", ret); + + /* Valid with a space */ + ret = SQLValidDSN("Wine Vinegar"); + ok(ret, "got %d\n", ret); + + /* Max DSN name value */ + ret = SQLValidDSN("12345678901234567890123456789012"); + ok(ret, "got %d\n", ret); +} + +static void test_SQLValidDSNW(void) +{ + static const WCHAR invalid[] = {'[',']','{','}','(',')',',',';','?','*','=','!','@','\\',0}; + static const WCHAR value[] = { 'w','i','n','e','1','0',0}; + static const WCHAR too_large[] = { 'W','i','n','e','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5', + '6','7','8','9','0','1','2','3','4','5','6','7','8','9','0', 0}; + static const WCHAR with_space[] = { 'W','i','n','e',' ','V','i','n','e','g','a','r', 0}; + static const WCHAR max_dsn[] = { '1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0', + '1','2','3','4','5','6','7','8','9','0','1','2', 0}; + WCHAR str[10]; + int i; + BOOL ret; + + lstrcpyW(str, value); + for(i = 0; i < lstrlenW(invalid); i++) + { + str[4] = invalid[i]; + ret = SQLValidDSNW(str); + ok(!ret, "got %d\n", ret); + } + + ret = SQLValidDSNW(too_large); + ok(!ret, "got %d\n", ret); + + ret = SQLValidDSNW(with_space); + ok(ret, "got %d\n", ret); + + ret = SQLValidDSNW(max_dsn); + ok(ret, "got %d\n", ret); +} + START_TEST(misc) { test_SQLConfigMode(); @@ -682,4 +752,6 @@ START_TEST(misc) test_SQLInstallDriverEx(); test_SQLInstallTranslatorEx(); test_SQLGetInstalledDrivers(); + test_SQLValidDSN(); + test_SQLValidDSNW(); } diff --git a/modules/rostests/winetests/odbccp32/odbccp32.manifest b/modules/rostests/winetests/odbccp32/odbccp32.manifest new file mode 100644 index 0000000000..cd879cc776 --- /dev/null +++ b/modules/rostests/winetests/odbccp32/odbccp32.manifest @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity + type="win32" + name="Wine.odbccp32.Test" + version="1.0.0.0" + processorArchitecture="*" + /> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> + <security> + <requestedPrivileges> + <requestedExecutionLevel + level="asInvoker" + /> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> diff --git a/modules/rostests/winetests/odbccp32/odbccp32.rc b/modules/rostests/winetests/odbccp32/odbccp32.rc new file mode 100644 index 0000000000..15299093f7 --- /dev/null +++ b/modules/rostests/winetests/odbccp32/odbccp32.rc @@ -0,0 +1,22 @@ +/* + * Copyright 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "winuser.h" + +/* @makedep: odbccp32.manifest */ +1 RT_MANIFEST odbccp32.manifest
5 years, 12 months
1
0
0
0
[reactos] 01/01: [ODBCCP32] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d34c33223c689806d7a0b…
commit d34c33223c689806d7a0b0c1843b4dd35167cf8d Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:14:20 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:14:20 2019 +0100 [ODBCCP32] Sync with Wine Staging 4.0. CORE-15682 --- dll/win32/odbccp32/odbccp32.c | 71 +++++++++++++++++++++++++++++-------------- media/doc/README.WINE | 2 +- 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/dll/win32/odbccp32/odbccp32.c b/dll/win32/odbccp32/odbccp32.c index 862237c677..ae2fe9c35c 100644 --- a/dll/win32/odbccp32/odbccp32.c +++ b/dll/win32/odbccp32/odbccp32.c @@ -29,7 +29,11 @@ #include "winbase.h" #include "winreg.h" #include "winnls.h" +#include "sqlext.h" #include "wine/unicode.h" +#ifdef __REACTOS__ +#undef TRACE_ON +#endif #include "wine/debug.h" #include "wine/heap.h" @@ -71,7 +75,7 @@ static const WCHAR odbc_error_invalid_keyword[] = {'I','n','v','a','l','i','d',' /* Push an error onto the error stack, taking care of ranges etc. */ static void push_error(int code, LPCWSTR msg) { - if (num_errors < sizeof error_code/sizeof error_code[0]) + if (num_errors < ARRAY_SIZE(error_code)) { error_code[num_errors] = code; error_msg[num_errors] = msg; @@ -259,19 +263,25 @@ static HMODULE load_config_driver(const WCHAR *driver) if ((ret = RegOpenKeyW(hkey, driver, &hkeydriver)) == ERROR_SUCCESS) { ret = RegGetValueW(hkeydriver, NULL, reg_driver, RRF_RT_REG_SZ, &type, NULL, &size); - if(ret == ERROR_MORE_DATA) + if(ret != ERROR_SUCCESS || type != REG_SZ) { - filename = HeapAlloc(GetProcessHeap(), 0, size); - if(!filename) - { - RegCloseKey(hkeydriver); - RegCloseKey(hkey); - push_error(ODBC_ERROR_OUT_OF_MEM, odbc_error_out_of_mem); + RegCloseKey(hkeydriver); + RegCloseKey(hkey); + push_error(ODBC_ERROR_INVALID_DSN, odbc_error_invalid_dsn); - return NULL; - } - ret = RegGetValueW(hkeydriver, NULL, driver, RRF_RT_REG_SZ, &type, filename, &size); + return NULL; + } + + filename = HeapAlloc(GetProcessHeap(), 0, size); + if(!filename) + { + RegCloseKey(hkeydriver); + RegCloseKey(hkey); + push_error(ODBC_ERROR_OUT_OF_MEM, odbc_error_out_of_mem); + + return NULL; } + ret = RegGetValueW(hkeydriver, NULL, reg_driver, RRF_RT_REG_SZ, &type, filename, &size); RegCloseKey(hkeydriver); } @@ -572,7 +582,10 @@ BOOL WINAPI SQLGetInstalledDrivers(char *buf, WORD size, WORD *sizeout) ret = SQLGetInstalledDriversW(wbuf, size, &written); if (!ret) + { + heap_free(wbuf); return FALSE; + } *sizeout = WideCharToMultiByte(CP_ACP, 0, wbuf, written, NULL, 0, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, wbuf, written, buf, size, NULL, NULL); @@ -1505,34 +1518,44 @@ BOOL WINAPI SQLSetConfigMode(UWORD wConfigMode) BOOL WINAPI SQLValidDSNW(LPCWSTR lpszDSN) { + static const WCHAR invalid[] = {'[',']','{','}','(',')',',',';','?','*','=','!','@','\\',0}; clear_errors(); - FIXME("%s\n", debugstr_w(lpszDSN)); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + TRACE("%s\n", debugstr_w(lpszDSN)); + + if(strlenW(lpszDSN) > SQL_MAX_DSN_LENGTH || strpbrkW(lpszDSN, invalid) != NULL) + { + return FALSE; + } + + return TRUE; } BOOL WINAPI SQLValidDSN(LPCSTR lpszDSN) { + static const char *invalid = "[]{}(),;?*=!@\\"; clear_errors(); - FIXME("%s\n", debugstr_a(lpszDSN)); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + TRACE("%s\n", debugstr_a(lpszDSN)); + + if(strlen(lpszDSN) > SQL_MAX_DSN_LENGTH || strpbrk(lpszDSN, invalid) != NULL) + { + return FALSE; + } + + return TRUE; } BOOL WINAPI SQLWriteDSNToIniW(LPCWSTR lpszDSN, LPCWSTR lpszDriver) { clear_errors(); FIXME("%s %s\n", debugstr_w(lpszDSN), debugstr_w(lpszDriver)); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + return TRUE; } BOOL WINAPI SQLWriteDSNToIni(LPCSTR lpszDSN, LPCSTR lpszDriver) { clear_errors(); FIXME("%s %s\n", debugstr_a(lpszDSN), debugstr_a(lpszDriver)); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + return TRUE; } BOOL WINAPI SQLWriteFileDSNW(LPCWSTR lpszFileName, LPCWSTR lpszAppName, @@ -1558,6 +1581,7 @@ BOOL WINAPI SQLWriteFileDSN(LPCSTR lpszFileName, LPCSTR lpszAppName, BOOL WINAPI SQLWritePrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry, LPCWSTR lpszString, LPCWSTR lpszFilename) { + static const WCHAR empty[] = {0}; LONG ret; HKEY hkey; @@ -1581,7 +1605,10 @@ BOOL WINAPI SQLWritePrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry if ((ret = RegCreateKeyW(hkeyfilename, lpszSection, &hkey_section)) == ERROR_SUCCESS) { - ret = RegSetValueExW(hkey_section, lpszEntry, 0, REG_SZ, (BYTE*)lpszString, (lstrlenW(lpszString)+1)*sizeof(WCHAR)); + if(lpszString) + ret = RegSetValueExW(hkey_section, lpszEntry, 0, REG_SZ, (BYTE*)lpszString, (lstrlenW(lpszString)+1)*sizeof(WCHAR)); + else + ret = RegSetValueExW(hkey_section, lpszEntry, 0, REG_SZ, (BYTE*)empty, sizeof(empty)); RegCloseKey(hkey_section); } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index ebe99bba75..7b4141c99b 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -138,7 +138,7 @@ reactos/dll/win32/npptools # Synced to WineStaging-3.3 reactos/dll/win32/ntdsapi # Synced to WineStaging-3.9 reactos/dll/win32/objsel # Synced to WineStaging-3.3 reactos/dll/win32/odbc32 # Synced to WineStaging-4.0. Depends on port of Linux ODBC. -reactos/dll/win32/odbccp32 # Synced to WineStaging-3.9 +reactos/dll/win32/odbccp32 # Synced to WineStaging-4.0 reactos/dll/win32/ole32 # Synced to WineStaging-3.9 reactos/dll/win32/oleacc # Synced to WineStaging-3.3 reactos/dll/win32/oleaut32 # Synced to WineStaging-3.3
5 years, 12 months
1
0
0
0
[reactos] 01/01: [ODBC32] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=04ef5f7a8514ed255aabf…
commit 04ef5f7a8514ed255aabfeed4338f31066bdde2b Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:13:48 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:13:48 2019 +0100 [ODBC32] Sync with Wine Staging 4.0. CORE-15682 --- dll/win32/odbc32/odbc32.spec | 234 ++++++++++++++++++------------------- dll/win32/odbc32/proxyodbc.c | 266 +++++++++++++++++++++++-------------------- media/doc/README.WINE | 2 +- 3 files changed, 263 insertions(+), 239 deletions(-) diff --git a/dll/win32/odbc32/odbc32.spec b/dll/win32/odbc32/odbc32.spec index ccb540b99d..1c92cdd0d1 100644 --- a/dll/win32/odbc32/odbc32.spec +++ b/dll/win32/odbc32/odbc32.spec @@ -1,81 +1,81 @@ - 1 stdcall SQLAllocConnect(long ptr) - 2 stdcall SQLAllocEnv(ptr) - 3 stdcall SQLAllocStmt(long ptr) - 4 stdcall SQLBindCol(long long long ptr long ptr) - 5 stdcall SQLCancel(long) - 6 stdcall SQLColAttributes(long long long ptr long ptr ptr) - 7 stdcall SQLConnect(long str long str long str long) - 8 stdcall SQLDescribeCol(long long str long ptr ptr ptr ptr ptr) - 9 stdcall SQLDisconnect(long) - 10 stdcall SQLError(long long long str ptr str long ptr) - 11 stdcall SQLExecDirect(long str long) - 12 stdcall SQLExecute(long) - 13 stdcall SQLFetch(long) - 14 stdcall SQLFreeConnect(long) - 15 stdcall SQLFreeEnv(long) - 16 stdcall SQLFreeStmt(long long ) - 17 stdcall SQLGetCursorName(long str long ptr) - 18 stdcall SQLNumResultCols(long ptr) - 19 stdcall SQLPrepare(long str long) - 20 stdcall SQLRowCount(long ptr) - 21 stdcall SQLSetCursorName(long str long) - 22 stdcall SQLSetParam(long long long long long long ptr ptr) - 23 stdcall SQLTransact(long long long) - 24 stdcall SQLAllocHandle(long long ptr) - 25 stdcall SQLBindParam(long long long long long long ptr ptr) - 26 stdcall SQLCloseCursor(long) - 27 stdcall SQLColAttribute(long long long ptr long ptr ptr) - 28 stdcall SQLCopyDesc(long long) - 29 stdcall SQLEndTran(long long long) - 30 stdcall SQLFetchScroll(long long long) - 31 stdcall SQLFreeHandle(long long) - 32 stdcall SQLGetConnectAttr(long long ptr long ptr) - 33 stdcall SQLGetDescField(long long long ptr long ptr) - 34 stdcall SQLGetDescRec(long long str long ptr ptr ptr ptr ptr ptr ptr) - 35 stdcall SQLGetDiagField(long long long long ptr long ptr) - 36 stdcall SQLGetDiagRec(long long long str ptr str long ptr) - 37 stdcall SQLGetEnvAttr(long long ptr long ptr) - 38 stdcall SQLGetStmtAttr(long long ptr long ptr) - 39 stdcall SQLSetConnectAttr(long long ptr long) - 40 stdcall SQLColumns(long str long str long str long str long) - 41 stdcall SQLDriverConnect(long long str long str long ptr long) - 42 stdcall SQLGetConnectOption(long long ptr) - 43 stdcall SQLGetData(long long long ptr long ptr) - 44 stdcall SQLGetFunctions(long long ptr) - 45 stdcall SQLGetInfo(long long ptr long ptr) - 46 stdcall SQLGetStmtOption(long long ptr) - 47 stdcall SQLGetTypeInfo(long long) - 48 stdcall SQLParamData(long ptr) - 49 stdcall SQLPutData(long ptr long) - 50 stdcall SQLSetConnectOption(long long long) - 51 stdcall SQLSetStmtOption(long long long) - 52 stdcall SQLSpecialColumns(long long str long str long str long long long) - 53 stdcall SQLStatistics(long str long str long str long long long) - 54 stdcall SQLTables(long str long str long str long str long) - 55 stdcall SQLBrowseConnect(long str long str long ptr) - 56 stdcall SQLColumnPrivileges(long str long str long str long str long) - 57 stdcall SQLDataSources(long long str long ptr str long ptr) - 58 stdcall SQLDescribeParam(long long ptr ptr ptr ptr) - 59 stdcall SQLExtendedFetch(long long long ptr ptr) - 60 stdcall SQLForeignKeys(long str long str long str long str long str long str long) - 61 stdcall SQLMoreResults(long) - 62 stdcall SQLNativeSql(long str long str long ptr) - 63 stdcall SQLNumParams(long ptr) - 64 stdcall SQLParamOptions(long long ptr) - 65 stdcall SQLPrimaryKeys(long str long str long str long) - 66 stdcall SQLProcedureColumns(long str long str long str long str long) - 67 stdcall SQLProcedures(long str long str long str long) - 68 stdcall SQLSetPos(long long long long) - 69 stdcall SQLSetScrollOptions(long long long long) - 70 stdcall SQLTablePrivileges(long str long str long str long) - 71 stdcall SQLDrivers(long long str long ptr str long ptr) - 72 stdcall SQLBindParameter(long long long long long long long ptr long ptr) - 73 stdcall SQLSetDescField(long long long ptr long) - 74 stdcall SQLSetDescRec(long long long long long long long ptr ptr ptr) - 75 stdcall SQLSetEnvAttr(long long ptr long) - 76 stdcall SQLSetStmtAttr(long long ptr long) - 77 stdcall SQLAllocHandleStd(long long ptr) - 78 stdcall SQLBulkOperations(long long) + 1 stdcall SQLAllocConnect(long ptr) ODBC32_SQLAllocConnect + 2 stdcall SQLAllocEnv(ptr) ODBC32_SQLAllocEnv + 3 stdcall SQLAllocStmt(long ptr) ODBC32_SQLAllocStmt + 4 stdcall SQLBindCol(long long long ptr long ptr) ODBC32_SQLBindCol + 5 stdcall SQLCancel(long) ODBC32_SQLCancel + 6 stdcall SQLColAttributes(long long long ptr long ptr ptr) ODBC32_SQLColAttributes + 7 stdcall SQLConnect(long str long str long str long) ODBC32_SQLConnect + 8 stdcall SQLDescribeCol(long long str long ptr ptr ptr ptr ptr) ODBC32_SQLDescribeCol + 9 stdcall SQLDisconnect(long) ODBC32_SQLDisconnect + 10 stdcall SQLError(long long long str ptr str long ptr) ODBC32_SQLError + 11 stdcall SQLExecDirect(long str long) ODBC32_SQLExecDirect + 12 stdcall SQLExecute(long) ODBC32_SQLExecute + 13 stdcall SQLFetch(long) ODBC32_SQLFetch + 14 stdcall SQLFreeConnect(long) ODBC32_SQLFreeConnect + 15 stdcall SQLFreeEnv(long) ODBC32_SQLFreeEnv + 16 stdcall SQLFreeStmt(long long ) ODBC32_SQLFreeStmt + 17 stdcall SQLGetCursorName(long str long ptr) ODBC32_SQLGetCursorName + 18 stdcall SQLNumResultCols(long ptr) ODBC32_SQLNumResultCols + 19 stdcall SQLPrepare(long str long) ODBC32_SQLPrepare + 20 stdcall SQLRowCount(long ptr) ODBC32_SQLRowCount + 21 stdcall SQLSetCursorName(long str long) ODBC32_SQLSetCursorName + 22 stdcall SQLSetParam(long long long long long long ptr ptr) ODBC32_SQLSetParam + 23 stdcall SQLTransact(long long long) ODBC32_SQLTransact + 24 stdcall SQLAllocHandle(long long ptr) ODBC32_SQLAllocHandle + 25 stdcall SQLBindParam(long long long long long long ptr ptr) ODBC32_SQLBindParam + 26 stdcall SQLCloseCursor(long) ODBC32_SQLCloseCursor + 27 stdcall SQLColAttribute(long long long ptr long ptr ptr) ODBC32_SQLColAttribute + 28 stdcall SQLCopyDesc(long long) ODBC32_SQLCopyDesc + 29 stdcall SQLEndTran(long long long) ODBC32_SQLEndTran + 30 stdcall SQLFetchScroll(long long long) ODBC32_SQLFetchScroll + 31 stdcall SQLFreeHandle(long long) ODBC32_SQLFreeHandle + 32 stdcall SQLGetConnectAttr(long long ptr long ptr) ODBC32_SQLGetConnectAttr + 33 stdcall SQLGetDescField(long long long ptr long ptr) ODBC32_SQLGetDescField + 34 stdcall SQLGetDescRec(long long str long ptr ptr ptr ptr ptr ptr ptr) ODBC32_SQLGetDescRec + 35 stdcall SQLGetDiagField(long long long long ptr long ptr) ODBC32_SQLGetDiagField + 36 stdcall SQLGetDiagRec(long long long str ptr str long ptr) ODBC32_SQLGetDiagRec + 37 stdcall SQLGetEnvAttr(long long ptr long ptr) ODBC32_SQLGetEnvAttr + 38 stdcall SQLGetStmtAttr(long long ptr long ptr) ODBC32_SQLGetStmtAttr + 39 stdcall SQLSetConnectAttr(long long ptr long) ODBC32_SQLSetConnectAttr + 40 stdcall SQLColumns(long str long str long str long str long) ODBC32_SQLColumns + 41 stdcall SQLDriverConnect(long long str long str long ptr long) ODBC32_SQLDriverConnect + 42 stdcall SQLGetConnectOption(long long ptr) ODBC32_SQLGetConnectOption + 43 stdcall SQLGetData(long long long ptr long ptr) ODBC32_SQLGetData + 44 stdcall SQLGetFunctions(long long ptr) ODBC32_SQLGetFunctions + 45 stdcall SQLGetInfo(long long ptr long ptr) ODBC32_SQLGetInfo + 46 stdcall SQLGetStmtOption(long long ptr) ODBC32_SQLGetStmtOption + 47 stdcall SQLGetTypeInfo(long long) ODBC32_SQLGetTypeInfo + 48 stdcall SQLParamData(long ptr) ODBC32_SQLParamData + 49 stdcall SQLPutData(long ptr long) ODBC32_SQLPutData + 50 stdcall SQLSetConnectOption(long long long) ODBC32_SQLSetConnectOption + 51 stdcall SQLSetStmtOption(long long long) ODBC32_SQLSetStmtOption + 52 stdcall SQLSpecialColumns(long long str long str long str long long long) ODBC32_SQLSpecialColumns + 53 stdcall SQLStatistics(long str long str long str long long long) ODBC32_SQLStatistics + 54 stdcall SQLTables(long str long str long str long str long) ODBC32_SQLTables + 55 stdcall SQLBrowseConnect(long str long str long ptr) ODBC32_SQLBrowseConnect + 56 stdcall SQLColumnPrivileges(long str long str long str long str long) ODBC32_SQLColumnPrivileges + 57 stdcall SQLDataSources(long long str long ptr str long ptr) ODBC32_SQLDataSources + 58 stdcall SQLDescribeParam(long long ptr ptr ptr ptr) ODBC32_SQLDescribeParam + 59 stdcall SQLExtendedFetch(long long long ptr ptr) ODBC32_SQLExtendedFetch + 60 stdcall SQLForeignKeys(long str long str long str long str long str long str long) ODBC32_SQLForeignKeys + 61 stdcall SQLMoreResults(long) ODBC32_SQLMoreResults + 62 stdcall SQLNativeSql(long str long str long ptr) ODBC32_SQLNativeSql + 63 stdcall SQLNumParams(long ptr) ODBC32_SQLNumParams + 64 stdcall SQLParamOptions(long long ptr) ODBC32_SQLParamOptions + 65 stdcall SQLPrimaryKeys(long str long str long str long) ODBC32_SQLPrimaryKeys + 66 stdcall SQLProcedureColumns(long str long str long str long str long) ODBC32_SQLProcedureColumns + 67 stdcall SQLProcedures(long str long str long str long) ODBC32_SQLProcedures + 68 stdcall SQLSetPos(long long long long) ODBC32_SQLSetPos + 69 stdcall SQLSetScrollOptions(long long long long) ODBC32_SQLSetScrollOptions + 70 stdcall SQLTablePrivileges(long str long str long str long) ODBC32_SQLTablePrivileges + 71 stdcall SQLDrivers(long long str long ptr str long ptr) ODBC32_SQLDrivers + 72 stdcall SQLBindParameter(long long long long long long long ptr long ptr) ODBC32_SQLBindParameter + 73 stdcall SQLSetDescField(long long long ptr long) ODBC32_SQLSetDescField + 74 stdcall SQLSetDescRec(long long long long long long long ptr ptr ptr) ODBC32_SQLSetDescRec + 75 stdcall SQLSetEnvAttr(long long ptr long) ODBC32_SQLSetEnvAttr + 76 stdcall SQLSetStmtAttr(long long ptr long) ODBC32_SQLSetStmtAttr + 77 stdcall SQLAllocHandleStd(long long ptr) ODBC32_SQLAllocHandleStd + 78 stdcall SQLBulkOperations(long long) ODBC32_SQLBulkOperations 79 stub CloseODBCPerfData 80 stub CollectODBCPerfData 81 stub CursorLibLockDbc @@ -86,43 +86,43 @@ 86 stub ODBSetTryWaitValue 89 stub ODBCSharedPerfMon 90 stub ODBCSharedVSFlag -106 stdcall SQLColAttributesW(long long long ptr long ptr ptr) -107 stdcall SQLConnectW(long wstr long wstr long wstr long) -108 stdcall SQLDescribeColW(long long wstr long ptr ptr ptr ptr ptr) -110 stdcall SQLErrorW(long long long wstr ptr wstr long ptr) -111 stdcall SQLExecDirectW(long wstr long) -117 stdcall SQLGetCursorNameW(long wstr long ptr) -119 stdcall SQLPrepareW(long wstr long) -121 stdcall SQLSetCursorNameW(long wstr long) -127 stdcall SQLColAttributeW(long long long ptr long ptr ptr) -132 stdcall SQLGetConnectAttrW(long long ptr long ptr) -133 stdcall SQLGetDescFieldW(long long long ptr long ptr) -134 stdcall SQLGetDescRecW(long long wstr long ptr ptr ptr ptr ptr ptr ptr) -135 stdcall SQLGetDiagFieldW(long long long long ptr long ptr) -136 stdcall SQLGetDiagRecW(long long long wstr ptr wstr long ptr) -138 stdcall SQLGetStmtAttrW(long long ptr long ptr) -139 stdcall SQLSetConnectAttrW(long long ptr long) -140 stdcall SQLColumnsW(long wstr long wstr long wstr long wstr long) -141 stdcall SQLDriverConnectW(long long wstr long wstr long ptr long) -142 stdcall SQLGetConnectOptionW(long long ptr) -145 stdcall SQLGetInfoW(long long ptr long ptr) -147 stdcall SQLGetTypeInfoW(long long) -150 stdcall SQLSetConnectOptionW(long long long) -152 stdcall SQLSpecialColumnsW(long long wstr long wstr long wstr long long long) -153 stdcall SQLStatisticsW(long wstr long wstr long wstr long long long) -154 stdcall SQLTablesW(long wstr long wstr long wstr long wstr long) -155 stdcall SQLBrowseConnectW(long wstr long wstr long ptr) -156 stdcall SQLColumnPrivilegesW(long wstr long wstr long wstr long wstr long) -157 stdcall SQLDataSourcesW(long long wstr long ptr wstr long ptr) -160 stdcall SQLForeignKeysW(long wstr long wstr long wstr long wstr long wstr long wstr long) -162 stdcall SQLNativeSqlW(long wstr long wstr long ptr) -165 stdcall SQLPrimaryKeysW(long wstr long wstr long wstr long) -166 stdcall SQLProcedureColumnsW(long wstr long wstr long wstr long wstr long) -167 stdcall SQLProceduresW(long wstr long wstr long wstr long) -170 stdcall SQLTablePrivilegesW(long wstr long wstr long wstr long) -171 stdcall SQLDriversW(long long wstr long ptr wstr long ptr) -173 stdcall SQLSetDescFieldW(long long long ptr long) -176 stdcall SQLSetStmtAttrW(long long ptr long) +106 stdcall SQLColAttributesW(long long long ptr long ptr ptr) ODBC32_SQLColAttributesW +107 stdcall SQLConnectW(long wstr long wstr long wstr long) ODBC32_SQLConnectW +108 stdcall SQLDescribeColW(long long wstr long ptr ptr ptr ptr ptr) ODBC32_SQLDescribeColW +110 stdcall SQLErrorW(long long long wstr ptr wstr long ptr) ODBC32_SQLErrorW +111 stdcall SQLExecDirectW(long wstr long) ODBC32_SQLExecDirectW +117 stdcall SQLGetCursorNameW(long wstr long ptr) ODBC32_SQLGetCursorNameW +119 stdcall SQLPrepareW(long wstr long) ODBC32_SQLPrepareW +121 stdcall SQLSetCursorNameW(long wstr long) ODBC32_SQLSetCursorNameW +127 stdcall SQLColAttributeW(long long long ptr long ptr ptr) ODBC32_SQLColAttributeW +132 stdcall SQLGetConnectAttrW(long long ptr long ptr) ODBC32_SQLGetConnectAttrW +133 stdcall SQLGetDescFieldW(long long long ptr long ptr) ODBC32_SQLGetDescFieldW +134 stdcall SQLGetDescRecW(long long wstr long ptr ptr ptr ptr ptr ptr ptr) ODBC32_SQLGetDescRecW +135 stdcall SQLGetDiagFieldW(long long long long ptr long ptr) ODBC32_SQLGetDiagFieldW +136 stdcall SQLGetDiagRecW(long long long wstr ptr wstr long ptr) ODBC32_SQLGetDiagRecW +138 stdcall SQLGetStmtAttrW(long long ptr long ptr) ODBC32_SQLGetStmtAttrW +139 stdcall SQLSetConnectAttrW(long long ptr long) ODBC32_SQLSetConnectAttrW +140 stdcall SQLColumnsW(long wstr long wstr long wstr long wstr long) ODBC32_SQLColumnsW +141 stdcall SQLDriverConnectW(long long wstr long wstr long ptr long) ODBC32_SQLDriverConnectW +142 stdcall SQLGetConnectOptionW(long long ptr) ODBC32_SQLGetConnectOptionW +145 stdcall SQLGetInfoW(long long ptr long ptr) ODBC32_SQLGetInfoW +147 stdcall SQLGetTypeInfoW(long long) ODBC32_SQLGetTypeInfoW +150 stdcall SQLSetConnectOptionW(long long long) ODBC32_SQLSetConnectOptionW +152 stdcall SQLSpecialColumnsW(long long wstr long wstr long wstr long long long) ODBC32_SQLSpecialColumnsW +153 stdcall SQLStatisticsW(long wstr long wstr long wstr long long long) ODBC32_SQLStatisticsW +154 stdcall SQLTablesW(long wstr long wstr long wstr long wstr long) ODBC32_SQLTablesW +155 stdcall SQLBrowseConnectW(long wstr long wstr long ptr) ODBC32_SQLBrowseConnectW +156 stdcall SQLColumnPrivilegesW(long wstr long wstr long wstr long wstr long) ODBC32_SQLColumnPrivilegesW +157 stdcall SQLDataSourcesW(long long wstr long ptr wstr long ptr) ODBC32_SQLDataSourcesW +160 stdcall SQLForeignKeysW(long wstr long wstr long wstr long wstr long wstr long wstr long) ODBC32_SQLForeignKeysW +162 stdcall SQLNativeSqlW(long wstr long wstr long ptr) ODBC32_SQLNativeSqlW +165 stdcall SQLPrimaryKeysW(long wstr long wstr long wstr long) ODBC32_SQLPrimaryKeysW +166 stdcall SQLProcedureColumnsW(long wstr long wstr long wstr long wstr long) ODBC32_SQLProcedureColumnsW +167 stdcall SQLProceduresW(long wstr long wstr long wstr long) ODBC32_SQLProceduresW +170 stdcall SQLTablePrivilegesW(long wstr long wstr long wstr long) ODBC32_SQLTablePrivilegesW +171 stdcall SQLDriversW(long long wstr long ptr wstr long ptr) ODBC32_SQLDriversW +173 stdcall SQLSetDescFieldW(long long long ptr long) ODBC32_SQLSetDescFieldW +176 stdcall SQLSetStmtAttrW(long long ptr long) ODBC32_SQLSetStmtAttrW 206 stub SQLColAttributesA 207 stub SQLConnectA 208 stub SQLDescribeColA @@ -136,7 +136,7 @@ 233 stub SQLGetDescFieldA 234 stub SQLGetDescRecA 235 stub SQLGetDiagFieldA -236 stub SQLGetDiagRecA +236 stdcall SQLGetDiagRecA(long long long ptr ptr ptr long ptr) ODBC32_SQLGetDiagRecA 238 stub SQLGetStmtAttrA 239 stub SQLSetConnectAttrA 240 stub SQLColumnsA @@ -150,7 +150,7 @@ 254 stub SQLTablesA 255 stub SQLBrowseConnectA 256 stub SQLColumnPrivilegesA -257 stdcall SQLDataSourcesA(long long str long ptr str long ptr) +257 stdcall SQLDataSourcesA(long long str long ptr str long ptr) ODBC32_SQLDataSourcesA 260 stub SQLForeignKeysA 262 stub SQLNativeSqlA 265 stub SQLPrimaryKeysA diff --git a/dll/win32/odbc32/proxyodbc.c b/dll/win32/odbc32/proxyodbc.c index 7e6368eb93..c9aaefd955 100644 --- a/dll/win32/odbc32/proxyodbc.c +++ b/dll/win32/odbc32/proxyodbc.c @@ -174,6 +174,8 @@ static SQLRETURN (*pSQLTablePrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR static SQLRETURN (*pSQLTables)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLTablesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLTransact)(SQLHENV,SQLHDBC,SQLUSMALLINT); +static SQLRETURN (*pSQLGetDiagRecA)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*, + SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); #define ERROR_FREE 0 #define ERROR_SQLERROR 1 @@ -182,6 +184,13 @@ static SQLRETURN (*pSQLTransact)(SQLHENV,SQLHDBC,SQLUSMALLINT); static void *dmHandle; static int nErrorType; +SQLRETURN WINAPI ODBC32_SQLAllocEnv(SQLHENV *); +SQLRETURN WINAPI ODBC32_SQLFreeEnv(SQLHENV); +SQLRETURN WINAPI ODBC32_SQLDataSources(SQLHENV, SQLUSMALLINT, SQLCHAR *, SQLSMALLINT, + SQLSMALLINT *, SQLCHAR *, SQLSMALLINT, SQLSMALLINT *); +SQLRETURN WINAPI ODBC32_SQLDrivers(SQLHENV, SQLUSMALLINT, SQLCHAR *, SQLSMALLINT, SQLSMALLINT *, + SQLCHAR *, SQLSMALLINT, SQLSMALLINT *); + /*********************************************************************** * ODBC_ReplicateODBCInstToRegistry * @@ -225,7 +234,7 @@ static void ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv) success = TRUE; dirn = SQL_FETCH_FIRST; - while ((sql_ret = SQLDrivers (hEnv, dirn, (SQLCHAR*)desc, sizeof(desc), + while ((sql_ret = ODBC32_SQLDrivers (hEnv, dirn, (SQLCHAR*)desc, sizeof(desc), &sizedesc, NULL, 0, NULL)) == SQL_SUCCESS || sql_ret == SQL_SUCCESS_WITH_INFO) { @@ -352,7 +361,7 @@ static void ODBC_ReplicateODBCToRegistry (BOOL is_user, SQLHENV hEnv) { success = TRUE; dirn = is_user ? SQL_FETCH_FIRST_USER : SQL_FETCH_FIRST_SYSTEM; - while ((sql_ret = SQLDataSources (hEnv, dirn, + while ((sql_ret = ODBC32_SQLDataSources (hEnv, dirn, (SQLCHAR*)dsn, sizeof(dsn), &sizedsn, (SQLCHAR*)desc, sizeof(desc), &sizedesc)) == SQL_SUCCESS || sql_ret == SQL_SUCCESS_WITH_INFO) @@ -452,13 +461,13 @@ static void ODBC_ReplicateToRegistry (void) SQLRETURN sql_ret; SQLHENV hEnv; - if ((sql_ret = SQLAllocEnv (&hEnv)) == SQL_SUCCESS) + if ((sql_ret = ODBC32_SQLAllocEnv (&hEnv)) == SQL_SUCCESS) { ODBC_ReplicateODBCInstToRegistry (hEnv); ODBC_ReplicateODBCToRegistry (FALSE /* system dsns */, hEnv); ODBC_ReplicateODBCToRegistry (TRUE /* user dsns */, hEnv); - if ((sql_ret = SQLFreeEnv (hEnv)) != SQL_SUCCESS) + if ((sql_ret = ODBC32_SQLFreeEnv (hEnv)) != SQL_SUCCESS) { TRACE ("Error %d freeing the SQL environment.\n", (int)sql_ret); } @@ -617,6 +626,7 @@ static BOOL ODBC_LoadDMFunctions(void) LOAD_FUNC(SQLGetDiagField); LOAD_FUNC(SQLGetDiagFieldW); LOAD_FUNC(SQLGetDiagRec); + LOAD_FUNC(SQLGetDiagRecA); LOAD_FUNC(SQLGetDiagRecW); LOAD_FUNC(SQLGetEnvAttr); LOAD_FUNC(SQLGetFunctions); @@ -678,7 +688,7 @@ static BOOL ODBC_LoadDMFunctions(void) /************************************************************************* * SQLAllocConnect [ODBC32.001] */ -SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle) +SQLRETURN WINAPI ODBC32_SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle) { SQLRETURN ret; TRACE("(EnvironmentHandle %p)\n",EnvironmentHandle); @@ -699,7 +709,7 @@ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionH /************************************************************************* * SQLAllocEnv [ODBC32.002] */ -SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) +SQLRETURN WINAPI ODBC32_SQLAllocEnv(SQLHENV *EnvironmentHandle) { SQLRETURN ret; TRACE("\n"); @@ -720,7 +730,7 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) /************************************************************************* * SQLAllocHandle [ODBC32.024] */ -SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) +SQLRETURN WINAPI ODBC32_SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) { SQLRETURN ret; TRACE("(Type %d, Handle %p)\n", HandleType, InputHandle); @@ -752,7 +762,7 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S /************************************************************************* * SQLAllocStmt [ODBC32.003] */ -SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) +SQLRETURN WINAPI ODBC32_SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) { SQLRETURN ret; @@ -774,7 +784,7 @@ SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandl /************************************************************************* * SQLAllocHandleStd [ODBC32.077] */ -SQLRETURN WINAPI SQLAllocHandleStd( SQLSMALLINT HandleType, +SQLRETURN WINAPI ODBC32_SQLAllocHandleStd( SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) { TRACE("ProxyODBC: SQLAllocHandleStd.\n"); @@ -803,7 +813,7 @@ SQLRETURN WINAPI SQLAllocHandleStd( SQLSMALLINT HandleType, /************************************************************************* * SQLBindCol [ODBC32.004] */ -SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) @@ -824,7 +834,7 @@ SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, /************************************************************************* * SQLBindParam [ODBC32.025] */ -SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, @@ -842,7 +852,7 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, /************************************************************************* * SQLCancel [ODBC32.005] */ -SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) +SQLRETURN WINAPI ODBC32_SQLCancel(SQLHSTMT StatementHandle) { TRACE("\n"); @@ -854,7 +864,7 @@ SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) /************************************************************************* * SQLCloseCursor [ODBC32.026] */ -SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle) +SQLRETURN WINAPI ODBC32_SQLCloseCursor(SQLHSTMT StatementHandle) { SQLRETURN ret; TRACE("(Handle %p)\n", StatementHandle); @@ -870,7 +880,7 @@ SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle) /************************************************************************* * SQLColAttribute [ODBC32.027] */ -SQLRETURN WINAPI SQLColAttribute (SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLColAttribute (SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLLEN *NumericAttribute) @@ -886,7 +896,7 @@ SQLRETURN WINAPI SQLColAttribute (SQLHSTMT StatementHandle, /************************************************************************* * SQLColumns [ODBC32.040] */ -SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, @@ -903,7 +913,7 @@ SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle, /************************************************************************* * SQLConnect [ODBC32.007] */ -SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, +SQLRETURN WINAPI ODBC32_SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSMALLINT NameLength1, SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication, SQLSMALLINT NameLength3) @@ -924,7 +934,7 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, /************************************************************************* * SQLCopyDesc [ODBC32.028] */ -SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle) +SQLRETURN WINAPI ODBC32_SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle) { TRACE("\n"); @@ -936,7 +946,7 @@ SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandl /************************************************************************* * SQLDataSources [ODBC32.057] */ -SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle, +SQLRETURN WINAPI ODBC32_SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName, SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, SQLSMALLINT BufferLength2, @@ -964,7 +974,7 @@ SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle, return ret; } -SQLRETURN WINAPI SQLDataSourcesA(SQLHENV EnvironmentHandle, +SQLRETURN WINAPI ODBC32_SQLDataSourcesA(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName, SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, SQLSMALLINT BufferLength2, @@ -994,7 +1004,7 @@ SQLRETURN WINAPI SQLDataSourcesA(SQLHENV EnvironmentHandle, /************************************************************************* * SQLDescribeCol [ODBC32.008] */ -SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, SQLULEN *ColumnSize, @@ -1011,7 +1021,7 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, /************************************************************************* * SQLDisconnect [ODBC32.009] */ -SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) +SQLRETURN WINAPI ODBC32_SQLDisconnect(SQLHDBC ConnectionHandle) { SQLRETURN ret; TRACE("(Handle %p)\n", ConnectionHandle); @@ -1027,7 +1037,7 @@ SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) /************************************************************************* * SQLEndTran [ODBC32.029] */ -SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType) +SQLRETURN WINAPI ODBC32_SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType) { TRACE("\n"); @@ -1039,7 +1049,7 @@ SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLIN /************************************************************************* * SQLError [ODBC32.010] */ -SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, +SQLRETURN WINAPI ODBC32_SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, SQLSMALLINT BufferLength, @@ -1066,7 +1076,7 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, /************************************************************************* * SQLExecDirect [ODBC32.011] */ -SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) +SQLRETURN WINAPI ODBC32_SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) { TRACE("\n"); @@ -1078,7 +1088,7 @@ SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, /************************************************************************* * SQLExecute [ODBC32.012] */ -SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) +SQLRETURN WINAPI ODBC32_SQLExecute(SQLHSTMT StatementHandle) { TRACE("\n"); @@ -1090,7 +1100,7 @@ SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) /************************************************************************* * SQLFetch [ODBC32.013] */ -SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) +SQLRETURN WINAPI ODBC32_SQLFetch(SQLHSTMT StatementHandle) { TRACE("\n"); @@ -1102,7 +1112,7 @@ SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) /************************************************************************* * SQLFetchScroll [ODBC32.030] */ -SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset) +SQLRETURN WINAPI ODBC32_SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset) { TRACE("\n"); @@ -1114,7 +1124,7 @@ SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrien /************************************************************************* * SQLFreeConnect [ODBC32.014] */ -SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) +SQLRETURN WINAPI ODBC32_SQLFreeConnect(SQLHDBC ConnectionHandle) { SQLRETURN ret; TRACE("(Handle %p)\n", ConnectionHandle); @@ -1130,7 +1140,7 @@ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) /************************************************************************* * SQLFreeEnv [ODBC32.015] */ -SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) +SQLRETURN WINAPI ODBC32_SQLFreeEnv(SQLHENV EnvironmentHandle) { SQLRETURN ret; TRACE("(EnvironmentHandle %p)\n",EnvironmentHandle); @@ -1146,7 +1156,7 @@ SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) /************************************************************************* * SQLFreeHandle [ODBC32.031] */ -SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) +SQLRETURN WINAPI ODBC32_SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) { SQLRETURN ret; TRACE("(Type %d, Handle %p)\n", HandleType, Handle); @@ -1162,7 +1172,7 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) /************************************************************************* * SQLFreeStmt [ODBC32.016] */ -SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) +SQLRETURN WINAPI ODBC32_SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) { SQLRETURN ret; TRACE("(Handle %p, Option %d)\n", StatementHandle, Option); @@ -1178,7 +1188,7 @@ SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) /************************************************************************* * SQLGetConnectAttr [ODBC32.032] */ -SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, +SQLRETURN WINAPI ODBC32_SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { @@ -1193,7 +1203,7 @@ SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, /************************************************************************* * SQLGetConnectOption [ODBC32.042] */ -SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) +SQLRETURN WINAPI ODBC32_SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) { TRACE("\n"); @@ -1205,7 +1215,7 @@ SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Opti /************************************************************************* * SQLGetCursorName [ODBC32.017] */ -SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT BufferLength, SQLSMALLINT *NameLength) { @@ -1219,7 +1229,7 @@ SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle, /************************************************************************* * SQLGetData [ODBC32.043] */ -SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) @@ -1235,7 +1245,7 @@ SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle, /************************************************************************* * SQLGetDescField [ODBC32.033] */ -SQLRETURN WINAPI SQLGetDescField(SQLHDESC DescriptorHandle, +SQLRETURN WINAPI ODBC32_SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) @@ -1251,7 +1261,7 @@ SQLRETURN WINAPI SQLGetDescField(SQLHDESC DescriptorHandle, /************************************************************************* * SQLGetDescRec [ODBC32.034] */ -SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle, +SQLRETURN WINAPI ODBC32_SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR *Name, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, SQLSMALLINT *SubType, @@ -1269,7 +1279,7 @@ SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle, /************************************************************************* * SQLGetDiagField [ODBC32.035] */ -SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, +SQLRETURN WINAPI ODBC32_SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) @@ -1285,7 +1295,7 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, /************************************************************************* * SQLGetDiagRec [ODBC32.036] */ -SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, +SQLRETURN WINAPI ODBC32_SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) @@ -1301,7 +1311,7 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, /************************************************************************* * SQLGetEnvAttr [ODBC32.037] */ -SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, +SQLRETURN WINAPI ODBC32_SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { @@ -1315,7 +1325,7 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, /************************************************************************* * SQLGetFunctions [ODBC32.044] */ -SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) +SQLRETURN WINAPI ODBC32_SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) { TRACE("\n"); @@ -1327,7 +1337,7 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function /************************************************************************* * SQLGetInfo [ODBC32.045] */ -SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, +SQLRETURN WINAPI ODBC32_SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) { @@ -1341,7 +1351,7 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, /************************************************************************* * SQLGetStmtAttr [ODBC32.038] */ -SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { @@ -1355,7 +1365,7 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, /************************************************************************* * SQLGetStmtOption [ODBC32.046] */ -SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value) +SQLRETURN WINAPI ODBC32_SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value) { TRACE("\n"); @@ -1367,7 +1377,7 @@ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, /************************************************************************* * SQLGetTypeInfo [ODBC32.047] */ -SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) +SQLRETURN WINAPI ODBC32_SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) { TRACE("\n"); @@ -1379,7 +1389,7 @@ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) /************************************************************************* * SQLNumResultCols [ODBC32.018] */ -SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) +SQLRETURN WINAPI ODBC32_SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) { TRACE("\n"); @@ -1391,7 +1401,7 @@ SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnC /************************************************************************* * SQLParamData [ODBC32.048] */ -SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) +SQLRETURN WINAPI ODBC32_SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) { TRACE("\n"); @@ -1403,7 +1413,7 @@ SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) /************************************************************************* * SQLPrepare [ODBC32.019] */ -SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) +SQLRETURN WINAPI ODBC32_SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) { TRACE("\n"); @@ -1415,7 +1425,7 @@ SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQ /************************************************************************* * SQLPutData [ODBC32.049] */ -SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind) +SQLRETURN WINAPI ODBC32_SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind) { TRACE("\n"); @@ -1427,7 +1437,7 @@ SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN St /************************************************************************* * SQLRowCount [ODBC32.020] */ -SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) +SQLRETURN WINAPI ODBC32_SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) { TRACE("\n"); @@ -1439,7 +1449,7 @@ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) /************************************************************************* * SQLSetConnectAttr [ODBC32.039] */ -SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, +SQLRETURN WINAPI ODBC32_SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { TRACE("\n"); @@ -1452,7 +1462,7 @@ SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut /************************************************************************* * SQLSetConnectOption [ODBC32.050] */ -SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) +SQLRETURN WINAPI ODBC32_SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) { TRACE("\n"); @@ -1464,7 +1474,7 @@ SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Opti /************************************************************************* * SQLSetCursorName [ODBC32.021] */ -SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength) +SQLRETURN WINAPI ODBC32_SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength) { TRACE("\n"); @@ -1476,7 +1486,7 @@ SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, /************************************************************************* * SQLSetDescField [ODBC32.073] */ -SQLRETURN WINAPI SQLSetDescField(SQLHDESC DescriptorHandle, +SQLRETURN WINAPI ODBC32_SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength) { @@ -1490,7 +1500,7 @@ SQLRETURN WINAPI SQLSetDescField(SQLHDESC DescriptorHandle, /************************************************************************* * SQLSetDescRec [ODBC32.074] */ -SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, +SQLRETURN WINAPI ODBC32_SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, @@ -1508,7 +1518,7 @@ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, /************************************************************************* * SQLSetEnvAttr [ODBC32.075] */ -SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, +SQLRETURN WINAPI ODBC32_SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { @@ -1522,7 +1532,7 @@ SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, /************************************************************************* * SQLSetParam [ODBC32.022] */ -SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, @@ -1539,7 +1549,7 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, /************************************************************************* * SQLSetStmtAttr [ODBC32.076] */ -SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { @@ -1553,7 +1563,7 @@ SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, /************************************************************************* * SQLSetStmtOption [ODBC32.051] */ -SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value) +SQLRETURN WINAPI ODBC32_SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value) { TRACE("\n"); @@ -1565,7 +1575,7 @@ SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, /************************************************************************* * SQLSpecialColumns [ODBC32.052] */ -SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, @@ -1582,7 +1592,7 @@ SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle, /************************************************************************* * SQLStatistics [ODBC32.053] */ -SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, @@ -1599,7 +1609,7 @@ SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle, /************************************************************************* * SQLTables [ODBC32.054] */ -SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, @@ -1616,7 +1626,7 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, /************************************************************************* * SQLTransact [ODBC32.023] */ -SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, +SQLRETURN WINAPI ODBC32_SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType) { TRACE("\n"); @@ -1629,7 +1639,7 @@ SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle /************************************************************************* * SQLBrowseConnect [ODBC32.055] */ -SQLRETURN WINAPI SQLBrowseConnect( +SQLRETURN WINAPI ODBC32_SQLBrowseConnect( SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, @@ -1647,7 +1657,7 @@ SQLRETURN WINAPI SQLBrowseConnect( /************************************************************************* * SQLBulkOperations [ODBC32.078] */ -SQLRETURN WINAPI SQLBulkOperations( +SQLRETURN WINAPI ODBC32_SQLBulkOperations( SQLHSTMT StatementHandle, SQLSMALLINT Operation) { @@ -1661,7 +1671,7 @@ SQLRETURN WINAPI SQLBulkOperations( /************************************************************************* * SQLColAttributes [ODBC32.006] */ -SQLRETURN WINAPI SQLColAttributes( +SQLRETURN WINAPI ODBC32_SQLColAttributes( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, @@ -1680,7 +1690,7 @@ SQLRETURN WINAPI SQLColAttributes( /************************************************************************* * SQLColumnPrivileges [ODBC32.056] */ -SQLRETURN WINAPI SQLColumnPrivileges( +SQLRETURN WINAPI ODBC32_SQLColumnPrivileges( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1702,7 +1712,7 @@ SQLRETURN WINAPI SQLColumnPrivileges( /************************************************************************* * SQLDescribeParam [ODBC32.058] */ -SQLRETURN WINAPI SQLDescribeParam( +SQLRETURN WINAPI ODBC32_SQLDescribeParam( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, @@ -1720,7 +1730,7 @@ SQLRETURN WINAPI SQLDescribeParam( /************************************************************************* * SQLExtendedFetch [ODBC32.059] */ -SQLRETURN WINAPI SQLExtendedFetch( +SQLRETURN WINAPI ODBC32_SQLExtendedFetch( SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, @@ -1737,7 +1747,7 @@ SQLRETURN WINAPI SQLExtendedFetch( /************************************************************************* * SQLForeignKeys [ODBC32.060] */ -SQLRETURN WINAPI SQLForeignKeys( +SQLRETURN WINAPI ODBC32_SQLForeignKeys( SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, @@ -1764,7 +1774,7 @@ SQLRETURN WINAPI SQLForeignKeys( /************************************************************************* * SQLMoreResults [ODBC32.061] */ -SQLRETURN WINAPI SQLMoreResults(SQLHSTMT hstmt) +SQLRETURN WINAPI ODBC32_SQLMoreResults(SQLHSTMT hstmt) { TRACE("\n"); @@ -1776,7 +1786,7 @@ SQLRETURN WINAPI SQLMoreResults(SQLHSTMT hstmt) /************************************************************************* * SQLNativeSql [ODBC32.062] */ -SQLRETURN WINAPI SQLNativeSql( +SQLRETURN WINAPI ODBC32_SQLNativeSql( SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, @@ -1794,7 +1804,7 @@ SQLRETURN WINAPI SQLNativeSql( /************************************************************************* * SQLNumParams [ODBC32.063] */ -SQLRETURN WINAPI SQLNumParams( +SQLRETURN WINAPI ODBC32_SQLNumParams( SQLHSTMT hstmt, SQLSMALLINT *pcpar) { @@ -1808,7 +1818,7 @@ SQLRETURN WINAPI SQLNumParams( /************************************************************************* * SQLParamOptions [ODBC32.064] */ -SQLRETURN WINAPI SQLParamOptions( +SQLRETURN WINAPI ODBC32_SQLParamOptions( SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow) @@ -1823,7 +1833,7 @@ SQLRETURN WINAPI SQLParamOptions( /************************************************************************* * SQLPrimaryKeys [ODBC32.065] */ -SQLRETURN WINAPI SQLPrimaryKeys( +SQLRETURN WINAPI ODBC32_SQLPrimaryKeys( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1843,7 +1853,7 @@ SQLRETURN WINAPI SQLPrimaryKeys( /************************************************************************* * SQLProcedureColumns [ODBC32.066] */ -SQLRETURN WINAPI SQLProcedureColumns( +SQLRETURN WINAPI ODBC32_SQLProcedureColumns( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1865,7 +1875,7 @@ SQLRETURN WINAPI SQLProcedureColumns( /************************************************************************* * SQLProcedures [ODBC32.067] */ -SQLRETURN WINAPI SQLProcedures( +SQLRETURN WINAPI ODBC32_SQLProcedures( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1885,7 +1895,7 @@ SQLRETURN WINAPI SQLProcedures( /************************************************************************* * SQLSetPos [ODBC32.068] */ -SQLRETURN WINAPI SQLSetPos( +SQLRETURN WINAPI ODBC32_SQLSetPos( SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, @@ -1901,7 +1911,7 @@ SQLRETURN WINAPI SQLSetPos( /************************************************************************* * SQLTablePrivileges [ODBC32.070] */ -SQLRETURN WINAPI SQLTablePrivileges( +SQLRETURN WINAPI ODBC32_SQLTablePrivileges( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1921,7 +1931,7 @@ SQLRETURN WINAPI SQLTablePrivileges( /************************************************************************* * SQLDrivers [ODBC32.071] */ -SQLRETURN WINAPI SQLDrivers( +SQLRETURN WINAPI ODBC32_SQLDrivers( SQLHENV henv, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc, @@ -1950,7 +1960,7 @@ SQLRETURN WINAPI SQLDrivers( /************************************************************************* * SQLBindParameter [ODBC32.072] */ -SQLRETURN WINAPI SQLBindParameter( +SQLRETURN WINAPI ODBC32_SQLBindParameter( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, @@ -1973,7 +1983,7 @@ SQLRETURN WINAPI SQLBindParameter( /************************************************************************* * SQLDriverConnect [ODBC32.041] */ -SQLRETURN WINAPI SQLDriverConnect( +SQLRETURN WINAPI ODBC32_SQLDriverConnect( SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *conn_str_in, @@ -1999,7 +2009,7 @@ SQLRETURN WINAPI SQLDriverConnect( /************************************************************************* * SQLSetScrollOptions [ODBC32.069] */ -SQLRETURN WINAPI SQLSetScrollOptions( +SQLRETURN WINAPI ODBC32_SQLSetScrollOptions( SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset, @@ -2035,7 +2045,7 @@ static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) }; unsigned int i; - for (i = 0; i < sizeof(attrList) / sizeof(SQLUSMALLINT); i++) { + for (i = 0; i < ARRAY_SIZE(attrList); i++) { if (attrList[i] == fDescType) return TRUE; } return FALSE; @@ -2044,7 +2054,7 @@ static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) /************************************************************************* * SQLColAttributesW [ODBC32.106] */ -SQLRETURN WINAPI SQLColAttributesW( +SQLRETURN WINAPI ODBC32_SQLColAttributesW( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, @@ -2078,7 +2088,7 @@ SQLRETURN WINAPI SQLColAttributesW( /************************************************************************* * SQLConnectW [ODBC32.107] */ -SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, +SQLRETURN WINAPI ODBC32_SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMALLINT NameLength1, WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication, SQLSMALLINT NameLength3) @@ -2098,7 +2108,7 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, /************************************************************************* * SQLDescribeColW [ODBC32.108] */ -SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, WCHAR *ColumnName, SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, SQLULEN *ColumnSize, @@ -2127,7 +2137,7 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, /************************************************************************* * SQLErrorW [ODBC32.110] */ -SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, +SQLRETURN WINAPI ODBC32_SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, SQLSMALLINT BufferLength, @@ -2143,7 +2153,7 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, /************************************************************************* * SQLExecDirectW [ODBC32.111] */ -SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) { TRACE("\n"); @@ -2155,7 +2165,7 @@ SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, /************************************************************************* * SQLGetCursorNameW [ODBC32.117] */ -SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT BufferLength, SQLSMALLINT *NameLength) { @@ -2168,7 +2178,7 @@ SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, /************************************************************************* * SQLPrepareW [ODBC32.119] */ -SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) { TRACE("\n"); @@ -2180,7 +2190,7 @@ SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, /************************************************************************* * SQLSetCursorNameW [ODBC32.121] */ -SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength) +SQLRETURN WINAPI ODBC32_SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength) { TRACE("\n"); @@ -2191,7 +2201,7 @@ SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, /************************************************************************* * SQLColAttributeW [ODBC32.127] */ -SQLRETURN WINAPI SQLColAttributeW (SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLColAttributeW (SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLLEN *NumericAttribute) @@ -2223,7 +2233,7 @@ SQLRETURN WINAPI SQLColAttributeW (SQLHSTMT StatementHandle, /************************************************************************* * SQLGetConnectAttrW [ODBC32.132] */ -SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, +SQLRETURN WINAPI ODBC32_SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { @@ -2237,7 +2247,7 @@ SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, /************************************************************************* * SQLGetDescFieldW [ODBC32.133] */ -SQLRETURN WINAPI SQLGetDescFieldW(SQLHDESC DescriptorHandle, +SQLRETURN WINAPI ODBC32_SQLGetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) @@ -2252,7 +2262,7 @@ SQLRETURN WINAPI SQLGetDescFieldW(SQLHDESC DescriptorHandle, /************************************************************************* * SQLGetDescRecW [ODBC32.134] */ -SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle, +SQLRETURN WINAPI ODBC32_SQLGetDescRecW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, WCHAR *Name, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, SQLSMALLINT *SubType, @@ -2269,7 +2279,7 @@ SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle, /************************************************************************* * SQLGetDiagFieldW [ODBC32.135] */ -SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, +SQLRETURN WINAPI ODBC32_SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) @@ -2284,7 +2294,7 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, /************************************************************************* * SQLGetDiagRecW [ODBC32.136] */ -SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, +SQLRETURN WINAPI ODBC32_SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) @@ -2299,7 +2309,7 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, /************************************************************************* * SQLGetStmtAttrW [ODBC32.138] */ -SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { @@ -2327,7 +2337,7 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, /************************************************************************* * SQLSetConnectAttrW [ODBC32.139] */ -SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, +SQLRETURN WINAPI ODBC32_SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { TRACE("\n"); @@ -2339,7 +2349,7 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu /************************************************************************* * SQLColumnsW [ODBC32.140] */ -SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSMALLINT NameLength1, WCHAR *SchemaName, SQLSMALLINT NameLength2, WCHAR *TableName, SQLSMALLINT NameLength3, @@ -2355,7 +2365,7 @@ SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, /************************************************************************* * SQLDriverConnectW [ODBC32.141] */ -SQLRETURN WINAPI SQLDriverConnectW( +SQLRETURN WINAPI ODBC32_SQLDriverConnectW( SQLHDBC hdbc, SQLHWND hwnd, WCHAR *conn_str_in, @@ -2376,7 +2386,7 @@ SQLRETURN WINAPI SQLDriverConnectW( /************************************************************************* * SQLGetConnectOptionW [ODBC32.142] */ -SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) +SQLRETURN WINAPI ODBC32_SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) { TRACE("\n"); @@ -2387,7 +2397,7 @@ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt /************************************************************************* * SQLGetInfoW [ODBC32.145] */ -SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, +SQLRETURN WINAPI ODBC32_SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) { @@ -2408,7 +2418,7 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, /************************************************************************* * SQLGetTypeInfoW [ODBC32.147] */ -SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) +SQLRETURN WINAPI ODBC32_SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) { TRACE("\n"); @@ -2419,7 +2429,7 @@ SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) /************************************************************************* * SQLSetConnectOptionW [ODBC32.150] */ -SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) +SQLRETURN WINAPI ODBC32_SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) { TRACE("\n"); @@ -2430,7 +2440,7 @@ SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt /************************************************************************* * SQLSpecialColumnsW [ODBC32.152] */ -SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, @@ -2445,7 +2455,7 @@ SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle, /************************************************************************* * SQLStatisticsW [ODBC32.153] */ -SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3, @@ -2461,7 +2471,7 @@ SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, /************************************************************************* * SQLTablesW [ODBC32.154] */ -SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3, @@ -2477,7 +2487,7 @@ SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle, /************************************************************************* * SQLBrowseConnectW [ODBC32.155] */ -SQLRETURN WINAPI SQLBrowseConnectW( +SQLRETURN WINAPI ODBC32_SQLBrowseConnectW( SQLHDBC hdbc, SQLWCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, @@ -2495,7 +2505,7 @@ SQLRETURN WINAPI SQLBrowseConnectW( /************************************************************************* * SQLColumnPrivilegesW [ODBC32.156] */ -SQLRETURN WINAPI SQLColumnPrivilegesW( +SQLRETURN WINAPI ODBC32_SQLColumnPrivilegesW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -2516,7 +2526,7 @@ SQLRETURN WINAPI SQLColumnPrivilegesW( /************************************************************************* * SQLDataSourcesW [ODBC32.157] */ -SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle, +SQLRETURN WINAPI ODBC32_SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, WCHAR *ServerName, SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, WCHAR *Description, SQLSMALLINT BufferLength2, @@ -2547,7 +2557,7 @@ SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle, /************************************************************************* * SQLForeignKeysW [ODBC32.160] */ -SQLRETURN WINAPI SQLForeignKeysW( +SQLRETURN WINAPI ODBC32_SQLForeignKeysW( SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, @@ -2573,7 +2583,7 @@ SQLRETURN WINAPI SQLForeignKeysW( /************************************************************************* * SQLNativeSqlW [ODBC32.162] */ -SQLRETURN WINAPI SQLNativeSqlW( +SQLRETURN WINAPI ODBC32_SQLNativeSqlW( SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, @@ -2590,7 +2600,7 @@ SQLRETURN WINAPI SQLNativeSqlW( /************************************************************************* * SQLPrimaryKeysW [ODBC32.165] */ -SQLRETURN WINAPI SQLPrimaryKeysW( +SQLRETURN WINAPI ODBC32_SQLPrimaryKeysW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -2609,7 +2619,7 @@ SQLRETURN WINAPI SQLPrimaryKeysW( /************************************************************************* * SQLProcedureColumnsW [ODBC32.166] */ -SQLRETURN WINAPI SQLProcedureColumnsW( +SQLRETURN WINAPI ODBC32_SQLProcedureColumnsW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -2630,7 +2640,7 @@ SQLRETURN WINAPI SQLProcedureColumnsW( /************************************************************************* * SQLProceduresW [ODBC32.167] */ -SQLRETURN WINAPI SQLProceduresW( +SQLRETURN WINAPI ODBC32_SQLProceduresW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -2649,7 +2659,7 @@ SQLRETURN WINAPI SQLProceduresW( /************************************************************************* * SQLTablePrivilegesW [ODBC32.170] */ -SQLRETURN WINAPI SQLTablePrivilegesW( +SQLRETURN WINAPI ODBC32_SQLTablePrivilegesW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -2668,7 +2678,7 @@ SQLRETURN WINAPI SQLTablePrivilegesW( /************************************************************************* * SQLDriversW [ODBC32.171] */ -SQLRETURN WINAPI SQLDriversW( +SQLRETURN WINAPI ODBC32_SQLDriversW( SQLHENV henv, SQLUSMALLINT fDirection, SQLWCHAR *szDriverDesc, @@ -2696,7 +2706,7 @@ SQLRETURN WINAPI SQLDriversW( /************************************************************************* * SQLSetDescFieldW [ODBC32.173] */ -SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, +SQLRETURN WINAPI ODBC32_SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength) { @@ -2709,7 +2719,7 @@ SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, /************************************************************************* * SQLSetStmtAttrW [ODBC32.176] */ -SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, +SQLRETURN WINAPI ODBC32_SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { @@ -2728,5 +2738,19 @@ SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, return iResult; } +/************************************************************************* + * 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) +{ + TRACE("\n"); + + 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 */ diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 0fb8d24785..ebe99bba75 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -137,7 +137,7 @@ reactos/dll/win32/netapi32 # Forked at Wine-1.3.34 reactos/dll/win32/npptools # Synced to WineStaging-3.3 reactos/dll/win32/ntdsapi # Synced to WineStaging-3.9 reactos/dll/win32/objsel # Synced to WineStaging-3.3 -reactos/dll/win32/odbc32 # Synced to WineStaging-3.3. Depends on port of Linux ODBC. +reactos/dll/win32/odbc32 # Synced to WineStaging-4.0. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-3.9 reactos/dll/win32/ole32 # Synced to WineStaging-3.9 reactos/dll/win32/oleacc # Synced to WineStaging-3.3
5 years, 12 months
1
0
0
0
[reactos] 01/01: [NTDSAPI_WINETEST] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d46c9a5a055f42eb42eb4…
commit d46c9a5a055f42eb42eb438ce1b0e0d6927953a0 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:13:20 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:13:20 2019 +0100 [NTDSAPI_WINETEST] Sync with Wine Staging 4.0. CORE-15682 --- modules/rostests/winetests/ntdsapi/ntdsapi.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/rostests/winetests/ntdsapi/ntdsapi.c b/modules/rostests/winetests/ntdsapi/ntdsapi.c index 3d95d1bd0e..b6dc1856a4 100644 --- a/modules/rostests/winetests/ntdsapi/ntdsapi.c +++ b/modules/rostests/winetests/ntdsapi/ntdsapi.c @@ -45,39 +45,39 @@ static void test_DsMakeSpn(void) spn[0] = '\0'; - spn_length = sizeof(spn)/sizeof(spn[0]); + spn_length = ARRAY_SIZE(spn); ret = DsMakeSpnW(NULL, NULL, NULL, 0, NULL, &spn_length, spn); ok(ret == ERROR_INVALID_PARAMETER, "DsMakeSpnW should have failed with ERROR_INVALID_PARAMETER instead of %d\n", ret); - spn_length = sizeof(spn)/sizeof(spn[0]); + spn_length = ARRAY_SIZE(spn); ret = DsMakeSpnW(NULL, wszServiceHost, NULL, 0, NULL, &spn_length, spn); ok(ret == ERROR_INVALID_PARAMETER, "DsMakeSpnW should have failed with ERROR_INVALID_PARAMETER instead of %d\n", ret); - spn_length = sizeof(spn)/sizeof(spn[0]); + spn_length = ARRAY_SIZE(spn); ret = DsMakeSpnW(wszServiceClass, wszServiceHost, NULL, 0, NULL, &spn_length, spn); ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); ok(!lstrcmpW(spn, wszSpn1), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); ok(spn_length == lstrlenW(wszSpn1) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn1) + 1, spn_length); - spn_length = sizeof(spn)/sizeof(spn[0]); + spn_length = ARRAY_SIZE(spn); ret = DsMakeSpnW(wszServiceClass, wszServiceHost, wszInstanceName, 0, NULL, &spn_length, spn); ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); ok(!lstrcmpW(spn, wszSpn2), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); ok(spn_length == lstrlenW(wszSpn2) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn2) + 1, spn_length); - spn_length = sizeof(spn)/sizeof(spn[0]); + spn_length = ARRAY_SIZE(spn); ret = DsMakeSpnW(wszServiceClass, wszServiceHost, wszInstanceName, 555, NULL, &spn_length, spn); ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); ok(!lstrcmpW(spn, wszSpn3), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); ok(spn_length == lstrlenW(wszSpn3) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn3) + 1, spn_length); - spn_length = sizeof(spn)/sizeof(spn[0]); + spn_length = ARRAY_SIZE(spn); ret = DsMakeSpnW(wszServiceClass, wszServiceHost, wszInstanceName, 555, wszReferrer, &spn_length, spn); ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); ok(!lstrcmpW(spn, wszSpn4), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); ok(spn_length == lstrlenW(wszSpn4) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn4) + 1, spn_length); - spn_length = sizeof(spn)/sizeof(spn[0]); + spn_length = ARRAY_SIZE(spn); ret = DsMakeSpnW(wszServiceClass, wszServiceHost, NULL, 555, wszReferrer, &spn_length, spn); ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); ok(!lstrcmpW(spn, wszSpn5), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); @@ -106,7 +106,7 @@ static void test_DsClientMakeSpnForTargetServer(void) ok( ret == ERROR_BUFFER_OVERFLOW, "got %u\n", ret ); ok( len == lstrlenW(resultW) + 1, "got %u\n", len ); - len = sizeof(buf)/sizeof(buf[0]); + len = ARRAY_SIZE(buf); buf[0] = 0; ret = DsClientMakeSpnForTargetServerW( classW, hostW, &len, buf ); ok( ret == ERROR_SUCCESS, "got %u\n", ret );
5 years, 12 months
1
0
0
0
[reactos] 01/01: [NETAPI32_WINETEST] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=08e76d60874bd12844c2f…
commit 08e76d60874bd12844c2f0084e54fab51dbe1fa0 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:12:45 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:12:45 2019 +0100 [NETAPI32_WINETEST] Sync with Wine Staging 4.0. CORE-15682 --- modules/rostests/winetests/netapi32/access.c | 8 ++++---- modules/rostests/winetests/netapi32/wksta.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/rostests/winetests/netapi32/access.c b/modules/rostests/winetests/netapi32/access.c index f095d77320..a284b65401 100644 --- a/modules/rostests/winetests/netapi32/access.c +++ b/modules/rostests/winetests/netapi32/access.c @@ -74,7 +74,7 @@ static BOOL init_access_tests(void) BOOL rc; user_name[0] = 0; - dwSize = sizeof(user_name)/sizeof(WCHAR); + dwSize = ARRAY_SIZE(user_name); rc=GetUserNameW(user_name, &dwSize); if (rc==FALSE && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) { @@ -84,7 +84,7 @@ static BOOL init_access_tests(void) ok(rc, "User Name Retrieved\n"); computer_name[0] = 0; - dwSize = sizeof(computer_name)/sizeof(WCHAR); + dwSize = ARRAY_SIZE(computer_name); ok(GetComputerNameW(computer_name, &dwSize), "Computer Name Retrieved\n"); return TRUE; } @@ -521,7 +521,7 @@ static void test_DavGetHTTPFromUNCPath(void) ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); ok( size == 12, "got %u\n", size ); - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(tests); i++) { buf[0] = 0; size = tests[i].size; @@ -685,7 +685,7 @@ static void test_DavGetUNCFromHTTPPath(void) ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); ok( size == 25, "got %u\n", size ); - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(tests); i++) { buf[0] = 0; size = tests[i].size; diff --git a/modules/rostests/winetests/netapi32/wksta.c b/modules/rostests/winetests/netapi32/wksta.c index 418a1ad626..ba4a7f9aa0 100644 --- a/modules/rostests/winetests/netapi32/wksta.c +++ b/modules/rostests/winetests/netapi32/wksta.c @@ -50,7 +50,7 @@ static BOOL init_wksta_tests(void) BOOL rc; user_name[0] = 0; - dwSize = sizeof(user_name)/sizeof(user_name[0]); + dwSize = ARRAY_SIZE(user_name); rc=GetUserNameW(user_name, &dwSize); if (rc==FALSE && GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) { win_skip("GetUserNameW is not implemented\n"); @@ -59,7 +59,7 @@ static BOOL init_wksta_tests(void) ok(rc, "User Name Retrieved\n"); computer_name[0] = 0; - dwSize = sizeof(computer_name)/sizeof(computer_name[0]); + dwSize = ARRAY_SIZE(computer_name); ok(GetComputerNameW(computer_name, &dwSize), "Computer Name Retrieved\n"); return TRUE; }
5 years, 12 months
1
0
0
0
[reactos] 01/01: [MSXML3_WINETEST] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=98fa9b2cfcc8368aedc96…
commit 98fa9b2cfcc8368aedc961b756ba179ee51269a8 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:12:12 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:12:12 2019 +0100 [MSXML3_WINETEST] Sync with Wine Staging 4.0. CORE-15682 --- modules/rostests/winetests/msxml3/domdoc.c | 232 ++++++++++++++++++++++++-- modules/rostests/winetests/msxml3/httpreq.c | 85 +++++++++- modules/rostests/winetests/msxml3/saxreader.c | 32 ++-- modules/rostests/winetests/msxml3/schema.c | 2 +- modules/rostests/winetests/msxml3/xmlview.c | 2 +- 5 files changed, 320 insertions(+), 33 deletions(-) diff --git a/modules/rostests/winetests/msxml3/domdoc.c b/modules/rostests/winetests/msxml3/domdoc.c index 57bc88df48..9fd83dda7d 100644 --- a/modules/rostests/winetests/msxml3/domdoc.c +++ b/modules/rostests/winetests/msxml3/domdoc.c @@ -102,7 +102,7 @@ static void get_class_support_data(struct msxmlsupported_data_t *table) HRESULT hr; int i; - for (i = 0; i < sizeof(table->ifaces)/sizeof(table->ifaces[0]) && table->ifaces[i] != NULL; i++) + for (i = 0; i < ARRAY_SIZE(table->ifaces) && table->ifaces[i] != NULL; i++) { hr = CoCreateInstance(table->clsid, NULL, CLSCTX_INPROC_SERVER, table->ifaces[i], (void**)&unk); if (hr == S_OK) IUnknown_Release(unk); @@ -124,7 +124,7 @@ static BOOL is_clsid_supported(const GUID *clsid, REFIID riid) { int i; - for (i = 0; i < sizeof(table->ifaces)/sizeof(table->ifaces[0]) && table->ifaces[i] != NULL; i++) + for (i = 0; i < ARRAY_SIZE(table->ifaces) && table->ifaces[i] != NULL; i++) if (table->ifaces[i] == riid) return table->supported[i]; } @@ -1243,7 +1243,7 @@ static int alloced_bstrs_count; static BSTR _bstr_(const char *str) { - assert(alloced_bstrs_count < sizeof(alloced_bstrs)/sizeof(alloced_bstrs[0])); + assert(alloced_bstrs_count < ARRAY_SIZE(alloced_bstrs)); alloced_bstrs[alloced_bstrs_count] = alloc_str_from_narrow(str); return alloced_bstrs[alloced_bstrs_count++]; } @@ -10869,13 +10869,13 @@ static void test_mxnamespacemanager_override(void) &IID_IMXNamespaceManager, (void**)&nsmgr); EXPECT_HR(hr, S_OK); - len = sizeof(buffW)/sizeof(WCHAR); + len = ARRAY_SIZE(buffW); buffW[0] = 0; hr = IMXNamespaceManager_getDeclaredPrefix(nsmgr, 0, buffW, &len); EXPECT_HR(hr, S_OK); ok(!lstrcmpW(buffW, _bstr_("xml")), "got prefix %s\n", wine_dbgstr_w(buffW)); - len = sizeof(buffW)/sizeof(WCHAR); + len = ARRAY_SIZE(buffW); buffW[0] = 0; hr = IMXNamespaceManager_getDeclaredPrefix(nsmgr, 1, buffW, &len); EXPECT_HR(hr, E_FAIL); @@ -10894,7 +10894,7 @@ static void test_mxnamespacemanager_override(void) hr = IMXNamespaceManager_declarePrefix(nsmgr, NULL, _bstr_("ns0 uri")); EXPECT_HR(hr, S_OK); - len = sizeof(buffW)/sizeof(WCHAR); + len = ARRAY_SIZE(buffW); buffW[0] = 0; hr = IMXNamespaceManager_getURI(nsmgr, _bstr_(""), NULL, buffW, &len); EXPECT_HR(hr, S_OK); @@ -10903,19 +10903,19 @@ static void test_mxnamespacemanager_override(void) hr = IMXNamespaceManager_declarePrefix(nsmgr, _bstr_("ns0"), _bstr_("ns0 uri")); EXPECT_HR(hr, S_OK); - len = sizeof(buffW)/sizeof(WCHAR); + len = ARRAY_SIZE(buffW); buffW[0] = 0; hr = IMXNamespaceManager_getDeclaredPrefix(nsmgr, 0, buffW, &len); EXPECT_HR(hr, S_OK); ok(!lstrcmpW(buffW, _bstr_("xml")), "got prefix %s\n", wine_dbgstr_w(buffW)); - len = sizeof(buffW)/sizeof(WCHAR); + len = ARRAY_SIZE(buffW); buffW[0] = 0; hr = IMXNamespaceManager_getDeclaredPrefix(nsmgr, 1, buffW, &len); EXPECT_HR(hr, S_OK); ok(!lstrcmpW(buffW, _bstr_("ns0")), "got prefix %s\n", wine_dbgstr_w(buffW)); - len = sizeof(buffW)/sizeof(WCHAR); + len = ARRAY_SIZE(buffW); buffW[0] = 0; hr = IMXNamespaceManager_getDeclaredPrefix(nsmgr, 2, buffW, &len); EXPECT_HR(hr, S_OK); @@ -10925,7 +10925,7 @@ static void test_mxnamespacemanager_override(void) hr = IMXNamespaceManager_declarePrefix(nsmgr, _bstr_("ns1"), _bstr_("ns1 uri")); EXPECT_HR(hr, S_OK); - len = sizeof(buffW)/sizeof(WCHAR); + len = ARRAY_SIZE(buffW); buffW[0] = 0; hr = IMXNamespaceManager_getDeclaredPrefix(nsmgr, 1, buffW, &len); EXPECT_HR(hr, S_OK); @@ -10946,13 +10946,13 @@ static void test_mxnamespacemanager_override(void) hr = IMXNamespaceManager_declarePrefix(nsmgr, NULL, _bstr_("ns0 uri override")); EXPECT_HR(hr, S_FALSE); - len = sizeof(buffW)/sizeof(WCHAR); + len = ARRAY_SIZE(buffW); buffW[0] = 0; hr = IMXNamespaceManager_getURI(nsmgr, _bstr_(""), NULL, buffW, &len); EXPECT_HR(hr, S_OK); ok(!lstrcmpW(buffW, _bstr_("ns0 uri override")), "got uri %s\n", wine_dbgstr_w(buffW)); - len = sizeof(buffW)/sizeof(WCHAR); + len = ARRAY_SIZE(buffW); buffW[0] = 0; hr = IMXNamespaceManager_getDeclaredPrefix(nsmgr, 3, buffW, &len); EXPECT_HR(hr, S_OK); @@ -12827,6 +12827,212 @@ static void test_transformNodeToObject(void) free_bstrs(); } +static void test_normalize_attribute_values(void) +{ + IXMLDOMDocument2 *doc; + VARIANT var; + HRESULT hr; + + if (!is_clsid_supported(&CLSID_DOMDocument60, &IID_IXMLDOMDocument2)) + { + win_skip("NormalizeAttributeValues is not supported.\n"); + return; + } + + doc = create_document_version(60, &IID_IXMLDOMDocument2); + + V_VT(&var) = VT_I2; + V_I2(&var) = 10; + hr = IXMLDOMDocument2_getProperty(doc, _bstr_("NormalizeAttributeValues"), &var); +todo_wine { + ok(hr == S_OK, "Failed to get property value, hr %#x.\n", hr); + ok(V_VT(&var) == VT_BOOL, "Unexpected property value type, vt %d.\n", V_VT(&var)); + ok(V_BOOL(&var) == VARIANT_FALSE, "Unexpected property value.\n"); +} + V_VT(&var) = VT_BOOL; + V_BOOL(&var) = VARIANT_TRUE; + hr = IXMLDOMDocument2_setProperty(doc, _bstr_("NormalizeAttributeValues"), var); + ok(hr == S_OK, "Failed to set property, hr %#x.\n", hr); + + V_VT(&var) = VT_I2; + V_I2(&var) = 10; + hr = IXMLDOMDocument2_getProperty(doc, _bstr_("NormalizeAttributeValues"), &var); +todo_wine { + ok(hr == S_OK, "Failed to get property value, hr %#x.\n", hr); + ok(V_VT(&var) == VT_BOOL, "Unexpected property value type, vt %d.\n", V_VT(&var)); + ok(V_BOOL(&var) == VARIANT_TRUE, "Unexpected property value.\n"); +} + IXMLDOMDocument2_Release(doc); +} + +typedef struct _namespace_as_attribute_t { + const GUID *guid; + const char *clsid; + const char *xmlns_uri; +} namespace_as_attribute_t; + +static const namespace_as_attribute_t namespace_as_attribute_test_data[] = { + { &CLSID_DOMDocument, "CLSID_DOMDocument", "" }, + { &CLSID_DOMDocument2, "CLSID_DOMDocument2", "" }, + { &CLSID_DOMDocument26, "CLSID_DOMDocument26", "" }, + { &CLSID_DOMDocument30, "CLSID_DOMDocument30", "" }, + { &CLSID_DOMDocument40, "CLSID_DOMDocument40", "" }, + { &CLSID_DOMDocument60, "CLSID_DOMDocument60", "
http://www.w3.org/2000/xmlns/
" }, + { 0 } +}; + +static void test_namespaces_as_attributes(void) +{ + const namespace_as_attribute_t *entry = namespace_as_attribute_test_data; + struct test { + const char *xml; + int explen; + const char *names[3]; + const char *prefixes[3]; + const char *basenames[3]; + const char *uris[3]; + const char *texts[3]; + }; + static const struct test tests[] = { + { + "<a ns:b=\"b attr\" d=\"d attr\" xmlns:ns=\"nshref\" />", 3, + { "ns:b", "d", "xmlns:ns" }, /* nodeName */ + { "ns", NULL, "xmlns" }, /* prefix */ + { "b", "d", "ns" }, /* baseName */ + { "nshref", NULL, "" }, /* namespaceURI */ + { "b attr", "d attr", "nshref" }, /* text */ + }, + /* property only */ + { + "<a d=\"d attr\" />", 1, + { "d" }, /* nodeName */ + { NULL }, /* prefix */ + { "d" }, /* baseName */ + { NULL }, /* namespaceURI */ + { "d attr" }, /* text */ + }, + /* namespace only */ + { + "<a xmlns:ns=\"nshref\" />", 1, + { "xmlns:ns" }, /* nodeName */ + { "xmlns" }, /* prefix */ + { "ns" }, /* baseName */ + { "" }, /* namespaceURI */ + { "nshref" }, /* text */ + }, + /* no properties or namespaces */ + { + "<a />", 0, + }, + + { NULL } + }; + const struct test *test; + IXMLDOMNamedNodeMap *map; + IXMLDOMNode *node, *item; + IXMLDOMDocument *doc; + VARIANT_BOOL b; + LONG len, i; + HRESULT hr; + BSTR str; + + while (entry->guid) + { + if (!is_clsid_supported(entry->guid, &IID_IXMLDOMDocument2)) + { + entry++; + continue; + } + + test = tests; + while (test->xml) { + hr = CoCreateInstance(entry->guid, NULL, CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument2, (void **)&doc); + ok(SUCCEEDED(hr), "Failed to create document %s, hr %#x.\n", wine_dbgstr_guid(entry->guid), hr); + + hr = IXMLDOMDocument_loadXML(doc, _bstr_(test->xml), &b); + ok(hr == S_OK, "Failed to load xml, hr %#x.\n", hr); + + node = NULL; + hr = IXMLDOMDocument_selectSingleNode(doc, _bstr_("a"), &node); + ok(SUCCEEDED(hr), "Failed to select a node, hr %#x.\n", hr); + + hr = IXMLDOMNode_get_attributes(node, &map); + ok(SUCCEEDED(hr), "Failed to get attributes, hr %#x.\n", hr); + + len = -1; + hr = IXMLDOMNamedNodeMap_get_length(map, &len); + ok(SUCCEEDED(hr), "Failed to get map length, hr %#x.\n", hr); + ok(len == test->explen, "got %d\n", len); + + item = NULL; + hr = IXMLDOMNamedNodeMap_get_item(map, test->explen+1, &item); + ok(hr == S_FALSE, "Failed to get item, hr %#x.\n", hr); + ok(!item, "Item should be NULL\n"); + + for (i = 0; i < len; i++) + { + item = NULL; + hr = IXMLDOMNamedNodeMap_get_item(map, i, &item); + ok(SUCCEEDED(hr), "Failed to get item, hr %#x.\n", hr); + + str = NULL; + hr = IXMLDOMNode_get_nodeName(item, &str); + ok(SUCCEEDED(hr), "Failed to get node name, hr %#x.\n", hr); + ok(!lstrcmpW(str, _bstr_(test->names[i])), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + str = NULL; + hr = IXMLDOMNode_get_prefix(item, &str); + if (test->prefixes[i]) + { + ok(hr == S_OK, "Failed to get node name, hr %#x.\n", hr); + ok(!lstrcmpW(str, _bstr_(test->prefixes[i])), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + } + else + ok(hr == S_FALSE, "Failed to get node name, hr %#x.\n", hr); + + str = NULL; + hr = IXMLDOMNode_get_baseName(item, &str); + ok(SUCCEEDED(hr), "Failed to get base name, hr %#x.\n", hr); + ok(!lstrcmpW(str, _bstr_(test->basenames[i])), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + str = NULL; + hr = IXMLDOMNode_get_namespaceURI(item, &str); + if (test->uris[i]) + { + ok(hr == S_OK, "Failed to get node name, hr %#x.\n", hr); + if (test->prefixes[i] && !strcmp(test->prefixes[i], "xmlns")) + ok(!lstrcmpW(str, _bstr_(entry->xmlns_uri)), "got %s\n", wine_dbgstr_w(str)); + else + ok(!lstrcmpW(str, _bstr_(test->uris[i])), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + } + else + ok(hr == S_FALSE, "Failed to get node name, hr %#x.\n", hr); + + str = NULL; + hr = IXMLDOMNode_get_text(item, &str); + ok(SUCCEEDED(hr), "Failed to get node text, hr %#x.\n", hr); + ok(!lstrcmpW(str, _bstr_(test->texts[i])), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + IXMLDOMNode_Release(item); + } + + IXMLDOMNamedNodeMap_Release(map); + IXMLDOMNode_Release(node); + IXMLDOMDocument_Release(doc); + + test++; + } + + entry++; + } + free_bstrs(); +} + START_TEST(domdoc) { HRESULT hr; @@ -12910,6 +13116,8 @@ START_TEST(domdoc) test_url(); test_merging_text(); test_transformNodeToObject(); + test_normalize_attribute_values(); + test_namespaces_as_attributes(); test_xsltemplate(); test_xsltext(); diff --git a/modules/rostests/winetests/msxml3/httpreq.c b/modules/rostests/winetests/msxml3/httpreq.c index 4f51ef9faf..ae0a95a2f1 100644 --- a/modules/rostests/winetests/msxml3/httpreq.c +++ b/modules/rostests/winetests/msxml3/httpreq.c @@ -50,6 +50,9 @@ static void _expect_ref(IUnknown* obj, ULONG ref, int line) ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc); } +static const char xmltestA[] = "
http://test.winehq.org/tests/xmltest.xml
"; +static const CHAR xmltestbodyA[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<a>TEST</a>\n"; + DEFINE_GUID(SID_SContainerDispatch, 0xb722be00, 0x4e68, 0x101b, 0xa2, 0xbc, 0x00, 0xaa, 0x00, 0x40, 0x47, 0x70); DEFINE_GUID(SID_UnknownSID, 0x75dd09cb, 0x6c40, 0x11d5, 0x85, 0x43, 0x00, 0xc0, 0x4f, 0xa0, 0xfb, 0xa3); @@ -91,6 +94,13 @@ DEFINE_EXPECT(collection_get_length); static int g_unexpectedcall, g_expectedcall; +static int strcmp_wa(const WCHAR *strw, const char *stra) +{ + WCHAR buf[512]; + MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, ARRAY_SIZE(buf)); + return lstrcmpW(strw, buf); +} + static BSTR alloc_str_from_narrow(const char *str) { int len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); @@ -107,7 +117,7 @@ static BSTR _bstr_(const char *str) if(!str) return NULL; - assert(alloced_bstrs_count < sizeof(alloced_bstrs)/sizeof(alloced_bstrs[0])); + assert(alloced_bstrs_count < ARRAY_SIZE(alloced_bstrs)); alloced_bstrs[alloced_bstrs_count] = alloc_str_from_narrow(str); return alloced_bstrs[alloced_bstrs_count++]; } @@ -1431,14 +1441,26 @@ static void _test_open(unsigned line, IXMLHttpRequest *xhr, const char *method, ok_(__FILE__,line)(hr == exhres, "open(%s %s) failed: %08x, expected %08x\n", method, url, hr, exhres); } +#define test_server_open(a,b,c,d) _test_server_open(__LINE__,a,b,c,d) +static void _test_server_open(unsigned line, IServerXMLHTTPRequest *xhr, const char *method, const char *url, HRESULT exhres) +{ + VARIANT empty, vfalse; + HRESULT hr; + + V_VT(&empty) = VT_EMPTY; + V_VT(&vfalse) = VT_BOOL; + V_BOOL(&vfalse) = VARIANT_FALSE; + + hr = IServerXMLHTTPRequest_open(xhr, _bstr_(method), _bstr_(url), vfalse, empty, empty); + ok_(__FILE__,line)(hr == exhres, "open(%s %s) failed: %08x, expected %08x\n", method, url, hr, exhres); +} + static void test_XMLHTTP(void) { static const char bodyA[] = "mode=Test"; static const char urlA[] = "
http://test.winehq.org/tests/post.php
"; - static const char xmltestA[] = "
http://test.winehq.org/tests/xmltest.xml
"; static const char referertesturl[] = "
http://test.winehq.org/tests/referer.php
"; static const WCHAR wszExpectedResponse[] = {'F','A','I','L','E','D',0}; - static const CHAR xmltestbodyA[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<a>TEST</a>\n"; static const WCHAR norefererW[] = {'n','o',' ','r','e','f','e','r','e','r',' ','s','e','t',0}; IXMLHttpRequest *xhr; @@ -1765,6 +1787,62 @@ static void test_XMLHTTP(void) SysFreeString(str); IXMLHttpRequest_Release(xhr); + + /* invalid host */ + xhr = create_xhr(); + + test_open(xhr, "GET", "
http://invalid.host.test.winehq.org/test/path
", S_OK); + + V_VT(&varbody) = VT_EMPTY; + hr = IXMLHttpRequest_send(xhr, varbody); + todo_wine + ok(hr == INET_E_RESOURCE_NOT_FOUND, "send to invalid host returned %#x.\n", hr); + + IXMLHttpRequest_Release(xhr); + free_bstrs(); +} + +static void test_server_xhr(void) +{ + IServerXMLHTTPRequest *xhr; + BSTR response; + VARIANT body; + HRESULT hr; + + /* GET request */ + xhr = create_server_xhr(); + + test_server_open(xhr, "GET", xmltestA, S_OK); + + V_VT(&body) = VT_EMPTY; + + hr = IServerXMLHTTPRequest_send(xhr, body); + if (hr == INET_E_RESOURCE_NOT_FOUND) + { + skip("No connection could be made with test.winehq.org\n"); + IServerXMLHTTPRequest_Release(xhr); + return; + } + ok(hr == S_OK, "send failed: %08x\n", hr); + + hr = IServerXMLHTTPRequest_get_responseText(xhr, &response); + ok(hr == S_OK, "get_responseText failed: %08x\n", hr); + ok(!strcmp_wa(response, xmltestbodyA), "got %s\n", wine_dbgstr_w(response)); + SysFreeString(response); + + IServerXMLHTTPRequest_Release(xhr); + + /* invalid host */ + xhr = create_server_xhr(); + + test_server_open(xhr, "GET", "
http://invalid.host.test.winehq.org/test/path
", S_OK); + + V_VT(&body) = VT_EMPTY; + hr = IServerXMLHTTPRequest_send(xhr, body); + todo_wine + ok(hr == WININET_E_NAME_NOT_RESOLVED, "send to invalid host returned %#x.\n", hr); + + IServerXMLHTTPRequest_Release(xhr); free_bstrs(); } @@ -1847,6 +1925,7 @@ START_TEST(httpreq) IXMLHttpRequest_Release(xhr); test_XMLHTTP(); + test_server_xhr(); test_safe_httpreq(); test_supporterrorinfo(); diff --git a/modules/rostests/winetests/msxml3/saxreader.c b/modules/rostests/winetests/msxml3/saxreader.c index 3ed332edb6..eeef5b64c1 100644 --- a/modules/rostests/winetests/msxml3/saxreader.c +++ b/modules/rostests/winetests/msxml3/saxreader.c @@ -90,7 +90,7 @@ static int alloced_bstrs_count; static BSTR _bstr_(const char *str) { - assert(alloced_bstrs_count < sizeof(alloced_bstrs)/sizeof(alloced_bstrs[0])); + assert(alloced_bstrs_count < ARRAY_SIZE(alloced_bstrs)); alloced_bstrs[alloced_bstrs_count] = alloc_str_from_narrow(str); return alloced_bstrs[alloced_bstrs_count++]; } @@ -144,7 +144,7 @@ static void test_saxstr(const char *file, unsigned line, BSTR str, const char *e /* exit earlier on length mismatch */ if (lenexp != len) return; - MultiByteToWideChar(CP_ACP, 0, expected, -1, buf, sizeof(buf)/sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, expected, -1, buf, ARRAY_SIZE(buf)); cmp = memcmp(str, buf, lenexp*sizeof(WCHAR)); if (cmp && todo) @@ -2952,7 +2952,7 @@ static void test_mxwriter_handlers(void) EXPECT_REF(writer, 1); - for (i = 0; i < sizeof(riids)/sizeof(REFIID); i++) + for (i = 0; i < ARRAY_SIZE(riids); i++) { IUnknown *handler; IMXWriter *writer2; @@ -3976,7 +3976,7 @@ static void test_mxwriter_characters(void) hr = ISAXContentHandler_characters(content, chardataW, 0); EXPECT_HR(hr, S_OK); - hr = ISAXContentHandler_characters(content, chardataW, sizeof(chardataW)/sizeof(WCHAR) - 1); + hr = ISAXContentHandler_characters(content, chardataW, ARRAY_SIZE(chardataW) - 1); EXPECT_HR(hr, S_OK); V_VT(&dest) = VT_EMPTY; @@ -4166,7 +4166,7 @@ static void test_mxwriter_stream(void) IStream *stream; LARGE_INTEGER pos; ULARGE_INTEGER pos2; - DWORD test_count = sizeof(mxwriter_stream_tests)/sizeof(mxwriter_stream_tests[0]); + DWORD test_count = ARRAY_SIZE(mxwriter_stream_tests); for(current_stream_test_index = 0; current_stream_test_index < test_count; ++current_stream_test_index) { const mxwriter_stream_test *test = mxwriter_stream_tests+current_stream_test_index; @@ -4640,7 +4640,7 @@ static void test_mxwriter_comment(void) ok(!lstrcmpW(_bstr_("<!---->\r\n"), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest); - hr = ISAXLexicalHandler_comment(lexical, commentW, sizeof(commentW)/sizeof(WCHAR)-1); + hr = ISAXLexicalHandler_comment(lexical, commentW, ARRAY_SIZE(commentW) - 1); EXPECT_HR(hr, S_OK); V_VT(&dest) = VT_EMPTY; @@ -4865,16 +4865,16 @@ static void test_mxwriter_dtd(void) hr = IVBSAXLexicalHandler_startDTD(vblexical, NULL, NULL, NULL); EXPECT_HR(hr, E_POINTER); - hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, pubW, sizeof(pubW)/sizeof(WCHAR), NULL, 0); + hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, pubW, ARRAY_SIZE(pubW), NULL, 0); EXPECT_HR(hr, E_INVALIDARG); - hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, NULL, 0, sysW, sizeof(sysW)/sizeof(WCHAR)); + hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, NULL, 0, sysW, ARRAY_SIZE(sysW)); EXPECT_HR(hr, E_INVALIDARG); - hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, pubW, sizeof(pubW)/sizeof(WCHAR), sysW, sizeof(sysW)/sizeof(WCHAR)); + hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, pubW, ARRAY_SIZE(pubW), sysW, ARRAY_SIZE(sysW)); EXPECT_HR(hr, E_INVALIDARG); - hr = ISAXLexicalHandler_startDTD(lexical, nameW, sizeof(nameW)/sizeof(WCHAR), NULL, 0, NULL, 0); + hr = ISAXLexicalHandler_startDTD(lexical, nameW, ARRAY_SIZE(nameW), NULL, 0, NULL, 0); EXPECT_HR(hr, S_OK); V_VT(&dest) = VT_EMPTY; @@ -4885,11 +4885,11 @@ static void test_mxwriter_dtd(void) VariantClear(&dest); /* system id is required if public is present */ - hr = ISAXLexicalHandler_startDTD(lexical, nameW, sizeof(nameW)/sizeof(WCHAR), pubW, sizeof(pubW)/sizeof(WCHAR), NULL, 0); + hr = ISAXLexicalHandler_startDTD(lexical, nameW, ARRAY_SIZE(nameW), pubW, ARRAY_SIZE(pubW), NULL, 0); EXPECT_HR(hr, E_INVALIDARG); - hr = ISAXLexicalHandler_startDTD(lexical, nameW, sizeof(nameW)/sizeof(WCHAR), - pubW, sizeof(pubW)/sizeof(WCHAR), sysW, sizeof(sysW)/sizeof(WCHAR)); + hr = ISAXLexicalHandler_startDTD(lexical, nameW, ARRAY_SIZE(nameW), + pubW, ARRAY_SIZE(pubW), sysW, ARRAY_SIZE(sysW)); EXPECT_HR(hr, S_OK); V_VT(&dest) = VT_EMPTY; @@ -4926,10 +4926,10 @@ static void test_mxwriter_dtd(void) hr = IVBSAXDeclHandler_elementDecl(vbdecl, NULL, NULL); EXPECT_HR(hr, E_POINTER); - hr = ISAXDeclHandler_elementDecl(decl, nameW, sizeof(nameW)/sizeof(WCHAR), NULL, 0); + hr = ISAXDeclHandler_elementDecl(decl, nameW, ARRAY_SIZE(nameW), NULL, 0); EXPECT_HR(hr, E_INVALIDARG); - hr = ISAXDeclHandler_elementDecl(decl, nameW, sizeof(nameW)/sizeof(WCHAR), contentW, sizeof(contentW)/sizeof(WCHAR)); + hr = ISAXDeclHandler_elementDecl(decl, nameW, ARRAY_SIZE(nameW), contentW, ARRAY_SIZE(contentW)); EXPECT_HR(hr, S_OK); V_VT(&dest) = VT_EMPTY; @@ -4944,7 +4944,7 @@ static void test_mxwriter_dtd(void) hr = IMXWriter_put_output(writer, dest); EXPECT_HR(hr, S_OK); - hr = ISAXDeclHandler_elementDecl(decl, nameW, sizeof(nameW)/sizeof(WCHAR), contentW, 0); + hr = ISAXDeclHandler_elementDecl(decl, nameW, ARRAY_SIZE(nameW), contentW, 0); EXPECT_HR(hr, S_OK); V_VT(&dest) = VT_EMPTY; diff --git a/modules/rostests/winetests/msxml3/schema.c b/modules/rostests/winetests/msxml3/schema.c index 799365b5c6..a62314dd26 100644 --- a/modules/rostests/winetests/msxml3/schema.c +++ b/modules/rostests/winetests/msxml3/schema.c @@ -461,7 +461,7 @@ static BSTR alloc_str_from_narrow(const char *str) static BSTR _bstr_(const char *str) { - assert(alloced_bstrs_count < sizeof(alloced_bstrs)/sizeof(alloced_bstrs[0])); + assert(alloced_bstrs_count < ARRAY_SIZE(alloced_bstrs)); alloced_bstrs[alloced_bstrs_count] = alloc_str_from_narrow(str); return alloced_bstrs[alloced_bstrs_count++]; } diff --git a/modules/rostests/winetests/msxml3/xmlview.c b/modules/rostests/winetests/msxml3/xmlview.c index dc8ab7d200..53eefcb7e0 100644 --- a/modules/rostests/winetests/msxml3/xmlview.c +++ b/modules/rostests/winetests/msxml3/xmlview.c @@ -206,7 +206,7 @@ static void test_Load(void) BSTR source; lstrcpyW(buf, res); - GetModuleFileNameW(NULL, buf+lstrlenW(buf), (sizeof(buf)-sizeof(res))/sizeof(WCHAR)); + GetModuleFileNameW(NULL, buf+lstrlenW(buf), ARRAY_SIZE(buf)-ARRAY_SIZE(res)); lstrcatW(buf, xmlview_xmlW); if(!pCreateURLMoniker) {
5 years, 12 months
1
0
0
0
[reactos] 01/01: [PSDK] Update winerror.h. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c59bb1450f94a9bf516a…
commit 2c59bb1450f94a9bf516ac22116035f4e6a936b6 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Tue Jan 29 13:11:30 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Tue Jan 29 13:11:30 2019 +0100 [PSDK] Update winerror.h. CORE-15682 --- sdk/include/psdk/winerror.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/include/psdk/winerror.h b/sdk/include/psdk/winerror.h index c1ce98d1d3..776c48b01f 100644 --- a/sdk/include/psdk/winerror.h +++ b/sdk/include/psdk/winerror.h @@ -3268,6 +3268,8 @@ #define SCARD_W_CACHE_ITEM_STALE _HRESULT_TYPEDEF_(0x80100071L) #define SCARD_W_CACHE_ITEM_TOO_BIG _HRESULT_TYPEDEF_(0x80100072L) +#define WININET_E_NAME_NOT_RESOLVED _HRESULT_TYPEDEF_(0x80072ee7) + #define WINCODEC_ERR_WRONGSTATE _HRESULT_TYPEDEF_(0x88982f04) #define WINCODEC_ERR_VALUEOUTOFRANGE _HRESULT_TYPEDEF_(0x88982f05) #define WINCODEC_ERR_UNKNOWNIMAGEFORMAT _HRESULT_TYPEDEF_(0x88982f07)
5 years, 12 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
30
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
Results per page:
10
25
50
100
200