ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2017
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
526 discussions
Start a n
N
ew thread
[akhaldi] 74831: [OLEAUT32] Sync with Wine Staging 2.9. CORE-13362 6e7179e oleaut32: Make OleLoadPicture load DIBs using WIC decoder. 1762f89 oleaut32: Use VariantChangeTypeEx to convert to VT_BOOL...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:34:09 2017 New Revision: 74831 URL:
http://svn.reactos.org/svn/reactos?rev=74831&view=rev
Log: [OLEAUT32] Sync with Wine Staging 2.9. CORE-13362 6e7179e oleaut32: Make OleLoadPicture load DIBs using WIC decoder. 1762f89 oleaut32: Use VariantChangeTypeEx to convert to VT_BOOL. c260de0 oleaut32: Remove dead code. efc86ec oleaut32: Fix parse error when converting non-ascii string to VT_DATE. f506ffc oleaut32: Use VariantInit() rather than open coding it. c082edb oleaut32: Remove redundant call to VariantClear(). 7fb4809 oleaut32: Implement GetAltMonthNames(). d90fcb4 oleaut32: Fix OleLoadPictureEx spec file entry. Modified: trunk/reactos/dll/win32/oleaut32/oleaut.c trunk/reactos/dll/win32/oleaut32/oleaut32.spec trunk/reactos/dll/win32/oleaut32/olepicture.c trunk/reactos/dll/win32/oleaut32/variant.c trunk/reactos/dll/win32/oleaut32/vartype.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/oleaut32/oleaut.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut.…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] Sat Jun 3 22:34:09 2017 @@ -918,3 +918,112 @@ /* FIXME: make an extended conversation from HICON to HCURSOR */ return CopyCursor(hIcon); } + +/*********************************************************************** + * GetAltMonthNames (OLEAUT32.@) + */ +HRESULT WINAPI GetAltMonthNames(LCID lcid, LPOLESTR **str) +{ + static const WCHAR ar_month1W[] = {0x645,0x62d,0x631,0x645,0}; + static const WCHAR ar_month2W[] = {0x635,0x641,0x631,0}; + static const WCHAR ar_month3W[] = {0x631,0x628,0x64a,0x639,' ',0x627,0x644,0x627,0x648,0x644,0}; + static const WCHAR ar_month4W[] = {0x631,0x628,0x64a,0x639,' ',0x627,0x644,0x62b,0x627,0x646,0x64a,0}; + static const WCHAR ar_month5W[] = {0x62c,0x645,0x627,0x62f,0x649,' ',0x627,0x644,0x627,0x648,0x644,0x649,0}; + static const WCHAR ar_month6W[] = {0x62c,0x645,0x627,0x62f,0x649,' ',0x627,0x644,0x62b,0x627,0x646,0x64a,0x629,0}; + static const WCHAR ar_month7W[] = {0x631,0x62c,0x628,0}; + static const WCHAR ar_month8W[] = {0x634,0x639,0x628,0x627,0x646,0}; + static const WCHAR ar_month9W[] = {0x631,0x645,0x636,0x627,0x646,0}; + static const WCHAR ar_month10W[] = {0x634,0x648,0x627,0x643,0}; + static const WCHAR ar_month11W[] = {0x630,0x648,' ',0x627,0x644,0x642,0x639,0x62f,0x629,0}; + static const WCHAR ar_month12W[] = {0x630,0x648,' ',0x627,0x644,0x62d,0x62c,0x629,0}; + + static const WCHAR *arabic_hijri[] = + { + ar_month1W, + ar_month2W, + ar_month3W, + ar_month4W, + ar_month5W, + ar_month6W, + ar_month7W, + ar_month8W, + ar_month9W, + ar_month10W, + ar_month11W, + ar_month12W, + NULL + }; + + static const WCHAR pl_month1W[] = {'s','t','y','c','z','n','i','a',0}; + static const WCHAR pl_month2W[] = {'l','u','t','e','g','o',0}; + static const WCHAR pl_month3W[] = {'m','a','r','c','a',0}; + static const WCHAR pl_month4W[] = {'k','w','i','e','t','n','i','a',0}; + static const WCHAR pl_month5W[] = {'m','a','j','a',0}; + static const WCHAR pl_month6W[] = {'c','z','e','r','w','c','a',0}; + static const WCHAR pl_month7W[] = {'l','i','p','c','a',0}; + static const WCHAR pl_month8W[] = {'s','i','e','r','p','n','i','a',0}; + static const WCHAR pl_month9W[] = {'w','r','z','e',0x15b,'n','i','a',0}; + static const WCHAR pl_month10W[] = {'p','a',0x17a,'d','z','i','e','r','n','i','k','a',0}; + static const WCHAR pl_month11W[] = {'l','i','s','t','o','p','a','d','a',0}; + static const WCHAR pl_month12W[] = {'g','r','u','d','n','i','a',0}; + + static const WCHAR *polish_genitive_names[] = + { + pl_month1W, + pl_month2W, + pl_month3W, + pl_month4W, + pl_month5W, + pl_month6W, + pl_month7W, + pl_month8W, + pl_month9W, + pl_month10W, + pl_month11W, + pl_month12W, + NULL + }; + + static const WCHAR ru_month1W[] = {0x44f,0x43d,0x432,0x430,0x440,0x44f,0}; + static const WCHAR ru_month2W[] = {0x444,0x435,0x432,0x440,0x430,0x43b,0x44f,0}; + static const WCHAR ru_month3W[] = {0x43c,0x430,0x440,0x442,0x430,0}; + static const WCHAR ru_month4W[] = {0x430,0x43f,0x440,0x435,0x43b,0x44f,0}; + static const WCHAR ru_month5W[] = {0x43c,0x430,0x44f,0}; + static const WCHAR ru_month6W[] = {0x438,0x44e,0x43d,0x44f,0}; + static const WCHAR ru_month7W[] = {0x438,0x44e,0x43b,0x44f,0}; + static const WCHAR ru_month8W[] = {0x430,0x432,0x433,0x443,0x441,0x442,0x430,0}; + static const WCHAR ru_month9W[] = {0x441,0x435,0x43d,0x442,0x44f,0x431,0x440,0x44f,0}; + static const WCHAR ru_month10W[] = {0x43e,0x43a,0x442,0x44f,0x431,0x440,0x44f,0}; + static const WCHAR ru_month11W[] = {0x43d,0x43e,0x44f,0x431,0x440,0x44f,0}; + static const WCHAR ru_month12W[] = {0x434,0x435,0x43a,0x430,0x431,0x440,0x44f,0}; + + static const WCHAR *russian_genitive_names[] = + { + ru_month1W, + ru_month2W, + ru_month3W, + ru_month4W, + ru_month5W, + ru_month6W, + ru_month7W, + ru_month8W, + ru_month9W, + ru_month10W, + ru_month11W, + ru_month12W, + NULL + }; + + TRACE("%#x, %p\n", lcid, str); + + if (PRIMARYLANGID(LANGIDFROMLCID(lcid)) == LANG_ARABIC) + *str = (LPOLESTR *)arabic_hijri; + else if (PRIMARYLANGID(LANGIDFROMLCID(lcid)) == LANG_POLISH) + *str = (LPOLESTR *)polish_genitive_names; + else if (PRIMARYLANGID(LANGIDFROMLCID(lcid)) == LANG_RUSSIAN) + *str = (LPOLESTR *)russian_genitive_names; + else + *str = NULL; + + return S_OK; +} Modified: trunk/reactos/dll/win32/oleaut32/oleaut32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut3…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/oleaut32.spec [iso-8859-1] Sat Jun 3 22:34:09 2017 @@ -323,7 +323,7 @@ 329 stdcall VarCyMulI8(int64 int64 ptr) 330 stdcall VarDateFromUdate(ptr long ptr) 331 stdcall VarUdateFromDate(double long ptr) -332 stub GetAltMonthNames +332 stdcall GetAltMonthNames(long ptr) 333 stdcall VarI8FromUI1(long long) 334 stdcall VarI8FromI2(long long) 335 stdcall VarI8FromR4(float long) @@ -361,7 +361,7 @@ 377 stdcall VarI1FromUI8(int64 ptr) 378 stdcall VarUI2FromI8(int64 ptr) 379 stdcall VarUI2FromUI8(int64 ptr) -401 stdcall OleLoadPictureEx(ptr long long long long long long ptr) +401 stdcall OleLoadPictureEx(ptr long long ptr long long long ptr) 402 stub OleLoadPictureFileEx 411 stdcall SafeArrayCreateVector(long long long) 412 stdcall SafeArrayCopyData(ptr ptr) Modified: trunk/reactos/dll/win32/oleaut32/olepicture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olepict…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] Sat Jun 3 22:34:09 2017 @@ -976,25 +976,6 @@ OLEPictureImpl *This = impl_from_IPersistStream(iface); FIXME("(%p),stub!\n",This); return E_NOTIMPL; -} - -static HRESULT OLEPictureImpl_LoadDIB(OLEPictureImpl *This, BYTE *xbuf, ULONG xread) -{ - BITMAPFILEHEADER *bfh = (BITMAPFILEHEADER*)xbuf; - BITMAPINFO *bi = (BITMAPINFO*)(bfh+1); - void *bits; - BITMAP bmp; - - This->desc.u.bmp.hbitmap = CreateDIBSection(0, bi, DIB_RGB_COLORS, &bits, NULL, 0); - if (This->desc.u.bmp.hbitmap == 0) - return E_FAIL; - - GetObjectA(This->desc.u.bmp.hbitmap, sizeof(bmp), &bmp); - memcpy(bits, xbuf + bfh->bfOffBits, bmp.bmHeight * bmp.bmWidthBytes); - - This->desc.picType = PICTYPE_BITMAP; - OLEPictureImpl_SetBitmap(This); - return S_OK; } static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSource *src) @@ -1477,7 +1458,7 @@ hr = OLEPictureImpl_LoadWICDecoder(This, &CLSID_WICJpegDecoder, xbuf, xread); break; case BITMAP_FORMAT_BMP: /* Bitmap */ - hr = OLEPictureImpl_LoadDIB(This, xbuf, xread); + hr = OLEPictureImpl_LoadWICDecoder(This, &CLSID_WICBmpDecoder, xbuf, xread); break; case BITMAP_FORMAT_PNG: /* PNG */ hr = OLEPictureImpl_LoadWICDecoder(This, &CLSID_WICPngDecoder, xbuf, xread); Modified: trunk/reactos/dll/win32/oleaut32/variant.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/variant…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/variant.c [iso-8859-1] Sat Jun 3 22:34:09 2017 @@ -2487,18 +2487,11 @@ { VARTYPE leftvt,rightvt,resultvt; HRESULT hres; - static WCHAR str_true[32]; - static WCHAR str_false[32]; static const WCHAR sz_empty[] = {'\0'}; leftvt = V_VT(left); rightvt = V_VT(right); TRACE("%s,%s,%p)\n", debugstr_variant(left), debugstr_variant(right), out); - - if (!str_true[0]) { - VARIANT_GetLocalisedText(LOCALE_USER_DEFAULT, IDS_FALSE, str_false); - VARIANT_GetLocalisedText(LOCALE_USER_DEFAULT, IDS_TRUE, str_true); - } /* when both left and right are NULL the result is NULL */ if (leftvt == VT_NULL && rightvt == VT_NULL) @@ -2580,38 +2573,18 @@ /* Convert left side variant to string */ if (leftvt != VT_BSTR) { - if (leftvt == VT_BOOL) - { - /* Bools are handled as localized True/False strings instead of 0/-1 as in MSDN */ - V_VT(&bstrvar_left) = VT_BSTR; - if (V_BOOL(left)) - V_BSTR(&bstrvar_left) = SysAllocString(str_true); - else - V_BSTR(&bstrvar_left) = SysAllocString(str_false); - } /* Fill with empty string for later concat with right side */ - else if (leftvt == VT_NULL) + if (leftvt == VT_NULL) { V_VT(&bstrvar_left) = VT_BSTR; V_BSTR(&bstrvar_left) = SysAllocString(sz_empty); } else { - hres = VariantChangeTypeEx(&bstrvar_left,left,0,0,VT_BSTR); + hres = VariantChangeTypeEx(&bstrvar_left,left,0,VARIANT_ALPHABOOL|VARIANT_LOCALBOOL,VT_BSTR); if (hres != S_OK) { VariantClear(&bstrvar_left); VariantClear(&bstrvar_right); - if (leftvt == VT_NULL && (rightvt == VT_EMPTY || - rightvt == VT_NULL || rightvt == VT_I2 || - rightvt == VT_I4 || rightvt == VT_R4 || - rightvt == VT_R8 || rightvt == VT_CY || - rightvt == VT_DATE || rightvt == VT_BSTR || - rightvt == VT_BOOL || rightvt == VT_DECIMAL || - rightvt == VT_I1 || rightvt == VT_UI1 || - rightvt == VT_UI2 || rightvt == VT_UI4 || - rightvt == VT_I8 || rightvt == VT_UI8 || - rightvt == VT_INT || rightvt == VT_UINT)) - return DISP_E_BADVARTYPE; return hres; } } @@ -2620,38 +2593,18 @@ /* convert right side variant to string */ if (rightvt != VT_BSTR) { - if (rightvt == VT_BOOL) - { - /* Bools are handled as localized True/False strings instead of 0/-1 as in MSDN */ - V_VT(&bstrvar_right) = VT_BSTR; - if (V_BOOL(right)) - V_BSTR(&bstrvar_right) = SysAllocString(str_true); - else - V_BSTR(&bstrvar_right) = SysAllocString(str_false); - } /* Fill with empty string for later concat with right side */ - else if (rightvt == VT_NULL) + if (rightvt == VT_NULL) { V_VT(&bstrvar_right) = VT_BSTR; V_BSTR(&bstrvar_right) = SysAllocString(sz_empty); } else { - hres = VariantChangeTypeEx(&bstrvar_right,right,0,0,VT_BSTR); + hres = VariantChangeTypeEx(&bstrvar_right,right,0,VARIANT_ALPHABOOL|VARIANT_LOCALBOOL,VT_BSTR); if (hres != S_OK) { VariantClear(&bstrvar_left); VariantClear(&bstrvar_right); - if (rightvt == VT_NULL && (leftvt == VT_EMPTY || - leftvt == VT_NULL || leftvt == VT_I2 || - leftvt == VT_I4 || leftvt == VT_R4 || - leftvt == VT_R8 || leftvt == VT_CY || - leftvt == VT_DATE || leftvt == VT_BSTR || - leftvt == VT_BOOL || leftvt == VT_DECIMAL || - leftvt == VT_I1 || leftvt == VT_UI1 || - leftvt == VT_UI2 || leftvt == VT_UI4 || - leftvt == VT_I8 || leftvt == VT_UI8 || - leftvt == VT_INT || leftvt == VT_UINT)) - return DISP_E_BADVARTYPE; return hres; } } Modified: trunk/reactos/dll/win32/oleaut32/vartype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/vartype…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/vartype.c [iso-8859-1] Sat Jun 3 22:34:09 2017 @@ -119,15 +119,12 @@ if (SUCCEEDED(hRet)) { /* Convert the property to the requested type */ - V_VT(&dstVar) = VT_EMPTY; + VariantInit(&dstVar); hRet = VariantChangeTypeEx(&dstVar, &srcVar, lcid, dwFlags, vt); VariantClear(&srcVar); if (SUCCEEDED(hRet)) - { VARIANT_CopyData(&dstVar, vt, pOut); - VariantClear(&srcVar); - } } else hRet = DISP_E_TYPEMISMATCH; @@ -7669,7 +7666,7 @@ dp.dwCount++; strIn--; } - else if (isalpha(*strIn)) + else if (isalphaW(*strIn)) { BOOL bFound = FALSE; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:34:09 2017 @@ -141,7 +141,7 @@ reactos/dll/win32/odbccp32 # Synced to WineStaging-2.9 reactos/dll/win32/ole32 # Synced to WineStaging-2.9 reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11 -reactos/dll/win32/oleaut32 # Synced to WineStaging-2.2 +reactos/dll/win32/oleaut32 # Synced to WineStaging-2.9 reactos/dll/win32/olecli32 # Synced to WineStaging-1.9.11 reactos/dll/win32/oledlg # Synced to WineStaging-1.9.23 reactos/dll/win32/olepro32 # Synced to WineStaging-1.9.11
7 years, 6 months
1
0
0
0
[akhaldi] 74830: [OLE32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:33:48 2017 New Revision: 74830 URL:
http://svn.reactos.org/svn/reactos?rev=74830&view=rev
Log: [OLE32_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/ole32/clipboard.c trunk/rostests/winetests/ole32/compobj.c trunk/rostests/winetests/ole32/ole2.c Modified: trunk/rostests/winetests/ole32/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/clipboard…
============================================================================== --- trunk/rostests/winetests/ole32/clipboard.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/clipboard.c [iso-8859-1] Sat Jun 3 22:33:48 2017 @@ -251,6 +251,10 @@ trace("getdata: %s\n", dump_fmtetc(pformatetc)); DataObjectImpl_GetData_calls++; + + ok(pmedium->tymed == 0, "pmedium->tymed = %u\n", pmedium->tymed); + ok(U(*pmedium).hGlobal == NULL, "pmedium->hGlobal = %p\n", U(*pmedium).hGlobal); + ok(pmedium->pUnkForRelease == NULL, "pmedium->pUnkForRelease = %p\n", pmedium->pUnkForRelease); if(pformatetc->lindex != -1) return DV_E_FORMATETC; @@ -1189,9 +1193,21 @@ IDataObject_Release(get1); IDataObject_Release(src2); + + /* Show that OleUninitialize() doesn't release the + dataobject's ref, and thus the object is leaked. */ + old_refs = count_refs(src); + ok(old_refs == 1, "%d\n", old_refs); + + OleSetClipboard(src); + refs = count_refs(src); + ok(refs > old_refs, "%d %d\n", refs, old_refs); + + OleUninitialize(); + refs = count_refs(src); + ok(refs == 2, "%d\n", refs); + IDataObject_Release(src); - - OleUninitialize(); } static void test_flushed_getdata(void) Modified: trunk/rostests/winetests/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/compobj.c…
============================================================================== --- trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] Sat Jun 3 22:33:48 2017 @@ -105,6 +105,7 @@ 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}; @@ -363,11 +364,13 @@ CoTaskMemFree(progid); /* classes without default progid, progid list is not used */ + progid = (void *)0xdeadbeef; hr = ProgIDFromCLSID(&IID_Testiface5, &progid); - ok(hr == REGDB_E_CLASSNOTREG, "got 0x%08x\n", hr); - + ok(hr == REGDB_E_CLASSNOTREG && progid == NULL, "got 0x%08x, progid %p\n", hr, progid); + + progid = (void *)0xdeadbeef; hr = ProgIDFromCLSID(&IID_Testiface6, &progid); - ok(hr == REGDB_E_CLASSNOTREG, "got 0x%08x\n", hr); + ok(hr == REGDB_E_CLASSNOTREG && progid == NULL, "got 0x%08x, progid %p\n", hr, progid); pDeactivateActCtx(0, cookie); pReleaseActCtx(handle); @@ -3563,6 +3566,32 @@ hr = CoRevokeClassObject(cookie); ok(hr == S_OK, "got 0x%08x\n", hr); + + CoUninitialize(); +} + +static void test_GlobalOptions(void) +{ + IGlobalOptions *global_options; + HRESULT hres; + + CoInitialize(NULL); + + hres = CoCreateInstance(&CLSID_GlobalOptions, NULL, CLSCTX_INPROC_SERVER, + &IID_IGlobalOptions, (void**)&global_options); + ok(hres == S_OK || broken(hres == E_NOINTERFACE), "CoCreateInstance(CLSID_GlobalOptions) failed: %08x\n", hres); + if(FAILED(hres)) + { + win_skip("CLSID_GlobalOptions not available\n"); + CoUninitialize(); + return; + } + + IGlobalOptions_Release(global_options); + + hres = CoCreateInstance(&CLSID_GlobalOptions, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER, + &IID_IGlobalOptions, (void**)&global_options); + ok(hres == E_INVALIDARG, "CoCreateInstance(CLSID_GlobalOptions) failed: %08x\n", hres); CoUninitialize(); } @@ -3638,4 +3667,5 @@ test_CoGetCurrentLogicalThreadId(); test_IInitializeSpy(); test_CoGetInstanceFromFile(); -} + test_GlobalOptions(); +} Modified: trunk/rostests/winetests/ole32/ole2.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/ole2.c?re…
============================================================================== --- trunk/rostests/winetests/ole32/ole2.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/ole2.c [iso-8859-1] Sat Jun 3 22:33:48 2017 @@ -1528,6 +1528,39 @@ }; static IUnknown unknown = { &UnknownVtbl }; + +static void check_enum_cache(IOleCache2 *cache, STATDATA *expect, int num) +{ + IEnumSTATDATA *enum_stat; + STATDATA stat; + HRESULT hr; + + hr = IOleCache2_EnumCache( cache, &enum_stat ); + ok( hr == S_OK, "got %08x\n", hr ); + + while (IEnumSTATDATA_Next(enum_stat, 1, &stat, NULL) == S_OK) + { + ok( stat.formatetc.cfFormat == expect->formatetc.cfFormat, "got %d expect %d\n", + stat.formatetc.cfFormat, expect->formatetc.cfFormat ); + ok( !stat.formatetc.ptd == !expect->formatetc.ptd, "got %p expect %p\n", + stat.formatetc.ptd, expect->formatetc.ptd ); + ok( stat.formatetc.dwAspect == expect->formatetc.dwAspect, "got %d expect %d\n", + stat.formatetc.dwAspect, expect->formatetc.dwAspect ); + ok( stat.formatetc.lindex == expect->formatetc.lindex, "got %d expect %d\n", + stat.formatetc.lindex, expect->formatetc.lindex ); + ok( stat.formatetc.tymed == expect->formatetc.tymed, "got %d expect %d\n", + stat.formatetc.tymed, expect->formatetc.tymed ); + ok( stat.advf == expect->advf, "got %d expect %d\n", stat.advf, expect->advf ); + ok( stat.pAdvSink == 0, "got %p\n", stat.pAdvSink ); + ok( stat.dwConnection == expect->dwConnection, "got %d expect %d\n", stat.dwConnection, expect->dwConnection ); + num--; + expect++; + } + + ok( num == 0, "incorrect number. num %d\n", num ); + + IEnumSTATDATA_Release( enum_stat ); +} static void test_data_cache(void) { @@ -1967,6 +2000,18 @@ return stg; } +static HGLOBAL create_dib( void ) +{ + HGLOBAL h; + void *ptr; + + h = GlobalAlloc( GMEM_MOVEABLE, sizeof(dib) - sizeof(BITMAPFILEHEADER) ); + ptr = GlobalLock( h ); + memcpy( ptr, dib + sizeof(BITMAPFILEHEADER), sizeof(dib) - sizeof(BITMAPFILEHEADER) ); + GlobalUnlock( h ); + return h; +} + static void test_data_cache_dib_contents_stream(int num) { HRESULT hr; @@ -1975,10 +2020,18 @@ IDataObject *data; IViewObject2 *view; IStorage *stg; + IOleCache2 *cache; FORMATETC fmt = {CF_DIB, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; STGMEDIUM med; CLSID cls; SIZEL sz; + BYTE *ptr; + BITMAPINFOHEADER expect_info; + STATDATA enum_expect[] = + { + {{ CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0, NULL, 1 }, + {{ CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0, NULL, 1 }, + }; hr = CreateDataCache( NULL, &CLSID_Picture_Metafile, &IID_IUnknown, (void **)&unk ); ok( SUCCEEDED(hr), "got %08x\n", hr ); @@ -1988,6 +2041,8 @@ ok( SUCCEEDED(hr), "got %08x\n", hr ); hr = IUnknown_QueryInterface( unk, &IID_IViewObject2, (void **)&view ); ok( SUCCEEDED(hr), "got %08x\n", hr ); + hr = IUnknown_QueryInterface( unk, &IID_IOleCache2, (void **)&cache ); + ok( SUCCEEDED(hr), "got %08x\n", hr ); stg = create_storage( num ); @@ -2001,11 +2056,26 @@ hr = IDataObject_GetData( data, &fmt, &med ); ok( SUCCEEDED(hr), "got %08x\n", hr ); - if (SUCCEEDED(hr)) - { - ok( med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed ); - ReleaseStgMedium( &med ); + ok( med.tymed == TYMED_HGLOBAL, "got %x\n", med.tymed ); + ok( GlobalSize( U(med).hGlobal ) >= sizeof(dib) - sizeof(BITMAPFILEHEADER), + "got %lu\n", GlobalSize( U(med).hGlobal ) ); + ptr = GlobalLock( U(med).hGlobal ); + + expect_info = *(BITMAPINFOHEADER *)(dib + sizeof(BITMAPFILEHEADER)); + if (expect_info.biXPelsPerMeter == 0 || expect_info.biYPelsPerMeter == 0) + { + HDC hdc = GetDC( 0 ); + expect_info.biXPelsPerMeter = MulDiv( GetDeviceCaps( hdc, LOGPIXELSX ), 10000, 254 ); + expect_info.biYPelsPerMeter = MulDiv( GetDeviceCaps( hdc, LOGPIXELSY ), 10000, 254 ); + ReleaseDC( 0, hdc ); } + ok( !memcmp( ptr, &expect_info, sizeof(expect_info) ), "mismatch\n" ); + ok( !memcmp( ptr + sizeof(expect_info), dib + sizeof(BITMAPFILEHEADER) + sizeof(expect_info), + sizeof(dib) - sizeof(BITMAPFILEHEADER) - sizeof(expect_info) ), "mismatch\n" ); + GlobalUnlock( U(med).hGlobal ); + ReleaseStgMedium( &med ); + + check_enum_cache( cache, enum_expect, 2 ); hr = IViewObject2_GetExtent( view, DVASPECT_CONTENT, -1, NULL, &sz ); ok( SUCCEEDED(hr), "got %08x\n", hr ); @@ -2025,10 +2095,168 @@ ReleaseDC( 0, hdc ); } + IOleCache2_Release( cache ); IViewObject2_Release( view ); IDataObject_Release( data ); IPersistStorage_Release( persist ); IUnknown_Release( unk ); +} + +static void check_bitmap_size( HBITMAP h, int cx, int cy ) +{ + BITMAP bm; + + GetObjectW( h, sizeof(bm), &bm ); + ok( bm.bmWidth == cx, "got %d expect %d\n", bm.bmWidth, cx ); + ok( bm.bmHeight == cy, "got %d expect %d\n", bm.bmHeight, cy ); +} + +static void check_dib_size( HGLOBAL h, int cx, int cy ) +{ + BITMAPINFO *info; + + info = GlobalLock( h ); + ok( info->bmiHeader.biWidth == cx, "got %d expect %d\n", info->bmiHeader.biWidth, cx ); + ok( info->bmiHeader.biHeight == cy, "got %d expect %d\n", info->bmiHeader.biHeight, cy ); + GlobalUnlock( h ); +} + +static void test_data_cache_bitmap(void) +{ + HRESULT hr; + IOleCache2 *cache; + IDataObject *data; + FORMATETC fmt; + DWORD conn; + STGMEDIUM med; + STATDATA expect[] = + { + {{ CF_DIB, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, 0, NULL, 0 }, + {{ CF_BITMAP, 0, DVASPECT_CONTENT, -1, TYMED_GDI }, 0, NULL, 0 }, + {{ CF_METAFILEPICT, 0, DVASPECT_CONTENT, -1, TYMED_MFPICT }, 0, NULL, 0 }, + {{ CF_ENHMETAFILE, 0, DVASPECT_CONTENT, -1, TYMED_ENHMF }, 0, NULL, 0 } + }; + + hr = CreateDataCache( NULL, &CLSID_NULL, &IID_IOleCache2, (void **)&cache ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* create a dib entry which will also create a bitmap entry too */ + fmt.cfFormat = CF_DIB; + fmt.ptd = NULL; + fmt.dwAspect = DVASPECT_CONTENT; + fmt.lindex = -1; + fmt.tymed = TYMED_HGLOBAL; + + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( hr == S_OK, "got %08x\n", hr ); + expect[0].dwConnection = conn; + expect[1].dwConnection = conn; + + check_enum_cache( cache, expect, 2 ); + + /* now try to add a bitmap */ + fmt.cfFormat = CF_BITMAP; + fmt.tymed = TYMED_GDI; + + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( hr == CACHE_S_SAMECACHE, "got %08x\n", hr ); + + /* metafile */ + fmt.cfFormat = CF_METAFILEPICT; + fmt.tymed = TYMED_MFPICT; + + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( hr == S_OK, "got %08x\n", hr ); + expect[2].dwConnection = conn; + + check_enum_cache( cache, expect, 3); + + /* enhmetafile */ + fmt.cfFormat = CF_ENHMETAFILE; + fmt.tymed = TYMED_ENHMF; + + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( hr == S_OK, "got %08x\n", hr ); + expect[3].dwConnection = conn; + + check_enum_cache( cache, expect, 4 ); + + /* uncache everything */ + hr = IOleCache2_Uncache( cache, expect[3].dwConnection ); + ok( hr == S_OK, "got %08x\n", hr ); + hr = IOleCache2_Uncache( cache, expect[2].dwConnection ); + ok( hr == S_OK, "got %08x\n", hr ); + hr = IOleCache2_Uncache( cache, expect[0].dwConnection ); + ok( hr == S_OK, "got %08x\n", hr ); + hr = IOleCache2_Uncache( cache, expect[0].dwConnection ); + ok( hr == OLE_E_NOCONNECTION, "got %08x\n", hr ); + + check_enum_cache( cache, expect, 0 ); + + /* just create a bitmap entry which again adds both dib and bitmap */ + fmt.cfFormat = CF_BITMAP; + fmt.tymed = TYMED_GDI; + + hr = IOleCache2_Cache( cache, &fmt, 0, &conn ); + ok( hr == S_OK, "got %08x\n", hr ); + + expect[0].dwConnection = conn; + expect[1].dwConnection = conn; + + check_enum_cache( cache, expect, 2 ); + + /* Try setting a 1x1 bitmap */ + hr = IOleCache2_QueryInterface( cache, &IID_IDataObject, (void **) &data ); + ok( hr == S_OK, "got %08x\n", hr ); + + med.tymed = TYMED_GDI; + U(med).hBitmap = CreateBitmap( 1, 1, 1, 1, NULL ); + med.pUnkForRelease = NULL; + + hr = IOleCache2_SetData( cache, &fmt, &med, TRUE ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = IDataObject_GetData( data, &fmt, &med ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( med.tymed == TYMED_GDI, "got %d\n", med.tymed ); + check_bitmap_size( U(med).hBitmap, 1, 1 ); + ReleaseStgMedium( &med ); + + fmt.cfFormat = CF_DIB; + fmt.tymed = TYMED_HGLOBAL; + hr = IDataObject_GetData( data, &fmt, &med ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( med.tymed == TYMED_HGLOBAL, "got %d\n", med.tymed ); + check_dib_size( U(med).hGlobal, 1, 1 ); + ReleaseStgMedium( &med ); + + /* Now set a 2x1 dib */ + fmt.cfFormat = CF_DIB; + fmt.tymed = TYMED_HGLOBAL; + med.tymed = TYMED_HGLOBAL; + U(med).hGlobal = create_dib(); + + hr = IOleCache2_SetData( cache, &fmt, &med, TRUE ); + ok( hr == S_OK, "got %08x\n", hr ); + + fmt.cfFormat = CF_BITMAP; + fmt.tymed = TYMED_GDI; + hr = IDataObject_GetData( data, &fmt, &med ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( med.tymed == TYMED_GDI, "got %d\n", med.tymed ); + check_bitmap_size( U(med).hBitmap, 2, 1 ); + ReleaseStgMedium( &med ); + + fmt.cfFormat = CF_DIB; + fmt.tymed = TYMED_HGLOBAL; + hr = IDataObject_GetData( data, &fmt, &med ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( med.tymed == TYMED_HGLOBAL, "got %d\n", med.tymed ); + check_dib_size( U(med).hGlobal, 2, 1 ); + ReleaseStgMedium( &med ); + + IDataObject_Release( data ); + IOleCache2_Release( cache ); } static void test_default_handler(void) @@ -2783,6 +3011,7 @@ test_data_cache(); test_data_cache_dib_contents_stream( 0 ); test_data_cache_dib_contents_stream( 1 ); + test_data_cache_bitmap(); test_default_handler(); test_runnable(); test_OleRun();
7 years, 6 months
1
0
0
0
[akhaldi] 74829: [OLE32] Sync with Wine Staging 2.9. CORE-13362 9cc976a ole32: Fix compilation with recent versions of gcc. 2e36326 ole32: Synthesize dibs or bitmaps as appropriate. e27708f ole32: ...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:33:33 2017 New Revision: 74829 URL:
http://svn.reactos.org/svn/reactos?rev=74829&view=rev
Log: [OLE32] Sync with Wine Staging 2.9. CORE-13362 9cc976a ole32: Fix compilation with recent versions of gcc. 2e36326 ole32: Synthesize dibs or bitmaps as appropriate. e27708f ole32: Create CF_DIB and CF_BITMAP entries when either is cached. 20a8f1a ole32: Implement IOleCache_EnumCache(). f9b0f60 ole32: Check the cache entry's stgmedium for the unloaded state. 8fc1a4c ole32: OleUninitialize() does not release the reference to the clipboard's source dataobject. 1d2860e ole32: Fix up the dib's resolution on loading. e7bb4ba ole32: Don't cache the BITMAPFILEHEADER. fc49d98 ole32: Set the advise flags in CreateEntry(). 77d1eba ole32: Use the helper function to copy the clipboard's FORMATETC. 9ee30d7 ole32: Use the helper function to copy the datacache's FORMATETC. 11db491 ole32: Add a helper to copy FORMATETC structures. b399baf ole32: Add CoRegisterSurrogate/Ex stubs. 87dba2b ole32: Zero STGMEDIUM before calling IDataObject::GetData. c7e6fe6 ole32: Added GlobalOptions object stub implementation. fd09c37 ole32: Use generic class factory for StdComponentCategoriesMgr object. 076c782 ole32: Use generic class factory for pointer moniker. 961c3dc ole32: Use generic class factory for class moniker. 947c9ba ole32: Use generic class factory for composite moniker. b05fd46 ole32: Use generic class factory for anti moniker. dee6463 ole32: Use generic class factory for item moniker. cf7883f ole32: Added generic class factory implementation and use it for file moniker. Modified: trunk/reactos/dll/win32/ole32/antimoniker.c trunk/reactos/dll/win32/ole32/classmoniker.c trunk/reactos/dll/win32/ole32/clipboard.c trunk/reactos/dll/win32/ole32/comcat.c trunk/reactos/dll/win32/ole32/compobj.c trunk/reactos/dll/win32/ole32/compobj_private.h trunk/reactos/dll/win32/ole32/compositemoniker.c trunk/reactos/dll/win32/ole32/datacache.c trunk/reactos/dll/win32/ole32/filemoniker.c trunk/reactos/dll/win32/ole32/itemmoniker.c trunk/reactos/dll/win32/ole32/moniker.h trunk/reactos/dll/win32/ole32/ole32.spec trunk/reactos/dll/win32/ole32/oleobj.c trunk/reactos/dll/win32/ole32/oleproxy.c trunk/reactos/dll/win32/ole32/pointermoniker.c trunk/reactos/dll/win32/ole32/storage32.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/ole32/antimoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/antimonike…
============================================================================== --- trunk/reactos/dll/win32/ole32/antimoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/antimoniker.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -616,30 +616,8 @@ (void**)ppmk); } -static HRESULT WINAPI AntiMonikerCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) -{ - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) - { - *ppv = iface; - IClassFactory_AddRef(iface); - return S_OK; - } - return E_NOINTERFACE; -} - -static ULONG WINAPI AntiMonikerCF_AddRef(LPCLASSFACTORY iface) -{ - return 2; /* non-heap based object */ -} - -static ULONG WINAPI AntiMonikerCF_Release(LPCLASSFACTORY iface) -{ - return 1; /* non-heap based object */ -} - -static HRESULT WINAPI AntiMonikerCF_CreateInstance(LPCLASSFACTORY iface, - LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv) +HRESULT WINAPI AntiMoniker_CreateInstance(IClassFactory *iface, + IUnknown *pUnk, REFIID riid, void **ppv) { IMoniker *pMoniker; HRESULT hr; @@ -662,24 +640,3 @@ return hr; } - -static HRESULT WINAPI AntiMonikerCF_LockServer(LPCLASSFACTORY iface, BOOL fLock) -{ - FIXME("(%d), stub!\n",fLock); - return S_OK; -} - -static const IClassFactoryVtbl AntiMonikerCFVtbl = -{ - AntiMonikerCF_QueryInterface, - AntiMonikerCF_AddRef, - AntiMonikerCF_Release, - AntiMonikerCF_CreateInstance, - AntiMonikerCF_LockServer -}; -static const IClassFactoryVtbl *AntiMonikerCF = &AntiMonikerCFVtbl; - -HRESULT AntiMonikerCF_Create(REFIID riid, LPVOID *ppv) -{ - return IClassFactory_QueryInterface((IClassFactory *)&AntiMonikerCF, riid, ppv); -} Modified: trunk/reactos/dll/win32/ole32/classmoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/classmonik…
============================================================================== --- trunk/reactos/dll/win32/ole32/classmoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/classmoniker.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -791,30 +791,8 @@ return hr; } -static HRESULT WINAPI ClassMonikerCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) -{ - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) - { - *ppv = iface; - IClassFactory_AddRef(iface); - return S_OK; - } - return E_NOINTERFACE; -} - -static ULONG WINAPI ClassMonikerCF_AddRef(LPCLASSFACTORY iface) -{ - return 2; /* non-heap based object */ -} - -static ULONG WINAPI ClassMonikerCF_Release(LPCLASSFACTORY iface) -{ - return 1; /* non-heap based object */ -} - -static HRESULT WINAPI ClassMonikerCF_CreateInstance(LPCLASSFACTORY iface, - LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv) +HRESULT WINAPI ClassMoniker_CreateInstance(IClassFactory *iface, + IUnknown *pUnk, REFIID riid, void **ppv) { HRESULT hr; IMoniker *pmk; @@ -834,25 +812,3 @@ return hr; } - -static HRESULT WINAPI ClassMonikerCF_LockServer(LPCLASSFACTORY iface, BOOL fLock) -{ - FIXME("(%d), stub!\n",fLock); - return S_OK; -} - -static const IClassFactoryVtbl ClassMonikerCFVtbl = -{ - ClassMonikerCF_QueryInterface, - ClassMonikerCF_AddRef, - ClassMonikerCF_Release, - ClassMonikerCF_CreateInstance, - ClassMonikerCF_LockServer -}; - -static IClassFactory ClassMonikerCF = { &ClassMonikerCFVtbl }; - -HRESULT ClassMonikerCF_Create(REFIID riid, LPVOID *ppv) -{ - return IClassFactory_QueryInterface(&ClassMonikerCF, riid, ppv); -} Modified: trunk/reactos/dll/win32/ole32/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/clipboard.…
============================================================================== --- trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/clipboard.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -311,14 +311,8 @@ for(i = 0; i < cfetch; i++) { - rgelt[i] = This->data->entries[This->pos++].fmtetc; - if(rgelt[i].ptd) - { - DVTARGETDEVICE *target = rgelt[i].ptd; - rgelt[i].ptd = CoTaskMemAlloc(target->tdSize); - if(!rgelt[i].ptd) return E_OUTOFMEMORY; - memcpy(rgelt[i].ptd, target, target->tdSize); - } + hres = copy_formatetc(rgelt + i, &This->data->entries[This->pos++].fmtetc); + if(FAILED(hres)) return hres; } } else @@ -722,7 +716,7 @@ hr = IDataObject_GetDataHere(data, &stg_fmt, &med); if(FAILED(hr)) { - med.u.pstg = NULL; + memset(&med, 0, sizeof(med)); hr = IDataObject_GetData(data, &stg_fmt, &med); if(FAILED(hr)) goto end; @@ -770,7 +764,7 @@ LARGE_INTEGER offs; ULARGE_INTEGER pos; - med.u.pstm = NULL; + memset(&med, 0, sizeof(med)); hr = IDataObject_GetData(data, &stm_fmt, &med); if(FAILED(hr)) goto error; @@ -807,9 +801,7 @@ mem_fmt = *fmt; mem_fmt.tymed = TYMED_HGLOBAL; -#ifdef __REACTOS__ - med.pUnkForRelease = NULL; -#endif + memset(&med, 0, sizeof(med)); hr = IDataObject_GetData(data, &mem_fmt, &med); if(FAILED(hr)) return hr; @@ -837,6 +829,7 @@ mem_fmt = *fmt; mem_fmt.tymed = TYMED_ENHMF; + memset(&med, 0, sizeof(med)); hr = IDataObject_GetData(data, &mem_fmt, &med); if(FAILED(hr)) return hr; @@ -864,6 +857,7 @@ mem_fmt = *fmt; mem_fmt.tymed = TYMED_MFPICT; + memset(&med, 0, sizeof(med)); hr = IDataObject_GetData(data, &mem_fmt, &med); if(FAILED(hr)) return hr; @@ -893,6 +887,7 @@ mem_fmt = *fmt; mem_fmt.tymed = TYMED_GDI; + memset(&med, 0, sizeof(med)); hr = IDataObject_GetData(data, &mem_fmt, &med); if(FAILED(hr)) return hr; @@ -1378,6 +1373,8 @@ if ( !fmt || !med ) return E_INVALIDARG; + memset(med, 0, sizeof(*med)); + if ( !OpenClipboard(NULL)) return CLIPBRD_E_CANT_OPEN; if(!This->data) @@ -1770,35 +1767,6 @@ } } -/*********************************************************************** - * OLEClipbrd_UnInitialize() - * Un-Initializes the OLE clipboard - */ -void OLEClipbrd_UnInitialize(void) -{ - ole_clipbrd *clipbrd = theOleClipboard; - - TRACE("()\n"); - - if ( clipbrd ) - { - static const WCHAR ole32W[] = {'o','l','e','3','2',0}; - HINSTANCE hinst = GetModuleHandleW(ole32W); - - if ( clipbrd->window ) - { - DestroyWindow(clipbrd->window); - UnregisterClassW( clipbrd_wndclass, hinst ); - } - - IStream_Release(clipbrd->marshal_data); - if (clipbrd->src_data) IDataObject_Release(clipbrd->src_data); - HeapFree(GetProcessHeap(), 0, clipbrd->cached_enum); - HeapFree(GetProcessHeap(), 0, clipbrd); - theOleClipboard = NULL; - } -} - /********************************************************************* * set_clipboard_formats * @@ -1996,6 +1964,41 @@ hr = set_clipboard_formats(clipbrd, data); } return hr; +} + +/*********************************************************************** + * OLEClipbrd_UnInitialize() + * Un-Initializes the OLE clipboard + */ +void OLEClipbrd_UnInitialize(void) +{ + ole_clipbrd *clipbrd = theOleClipboard; + + TRACE("()\n"); + + if ( clipbrd ) + { + static const WCHAR ole32W[] = {'o','l','e','3','2',0}; + HINSTANCE hinst = GetModuleHandleW(ole32W); + + /* OleUninitialize() does not release the reference to the dataobject, so + take an additional reference here. This reference is then leaked. */ + if (clipbrd->src_data) + { + IDataObject_AddRef(clipbrd->src_data); + set_src_dataobject(clipbrd, NULL); + } + + if ( clipbrd->window ) + { + DestroyWindow(clipbrd->window); + UnregisterClassW( clipbrd_wndclass, hinst ); + } + + IStream_Release(clipbrd->marshal_data); + HeapFree(GetProcessHeap(), 0, clipbrd); + theOleClipboard = NULL; + } } /*********************************************************************** Modified: trunk/reactos/dll/win32/ole32/comcat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/comcat.c?r…
============================================================================== --- trunk/reactos/dll/win32/ole32/comcat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/comcat.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -684,53 +684,7 @@ COMCAT_ICatInformation_EnumReqCategoriesOfClass }; -/********************************************************************** - * COMCAT_IClassFactory_QueryInterface (also IUnknown) - */ -static HRESULT WINAPI COMCAT_IClassFactory_QueryInterface( - LPCLASSFACTORY iface, - REFIID riid, - LPVOID *ppvObj) -{ - TRACE("%s\n",debugstr_guid(riid)); - - if (ppvObj == NULL) return E_POINTER; - - if (IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_IClassFactory)) - { - *ppvObj = iface; - IClassFactory_AddRef(iface); - return S_OK; - } - - return E_NOINTERFACE; -} - -/********************************************************************** - * COMCAT_IClassFactory_AddRef (also IUnknown) - */ -static ULONG WINAPI COMCAT_IClassFactory_AddRef(LPCLASSFACTORY iface) -{ - return 2; /* non-heap based object */ -} - -/********************************************************************** - * COMCAT_IClassFactory_Release (also IUnknown) - */ -static ULONG WINAPI COMCAT_IClassFactory_Release(LPCLASSFACTORY iface) -{ - return 1; /* non-heap based object */ -} - -/********************************************************************** - * COMCAT_IClassFactory_CreateInstance - */ -static HRESULT WINAPI COMCAT_IClassFactory_CreateInstance( - LPCLASSFACTORY iface, - LPUNKNOWN pUnkOuter, - REFIID riid, - LPVOID *ppvObj) +HRESULT WINAPI ComCat_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppvObj) { HRESULT res; TRACE("%s\n",debugstr_guid(riid)); @@ -746,36 +700,6 @@ } return CLASS_E_CLASSNOTAVAILABLE; -} - -/********************************************************************** - * COMCAT_IClassFactory_LockServer - */ -static HRESULT WINAPI COMCAT_IClassFactory_LockServer( - LPCLASSFACTORY iface, - BOOL fLock) -{ - FIXME("(%d), stub!\n",fLock); - return S_OK; -} - -/********************************************************************** - * static ClassFactory instance - */ -static const IClassFactoryVtbl ComCatCFVtbl = -{ - COMCAT_IClassFactory_QueryInterface, - COMCAT_IClassFactory_AddRef, - COMCAT_IClassFactory_Release, - COMCAT_IClassFactory_CreateInstance, - COMCAT_IClassFactory_LockServer -}; - -static const IClassFactoryVtbl *ComCatCF = &ComCatCFVtbl; - -HRESULT ComCatCF_Create(REFIID riid, LPVOID *ppv) -{ - return IClassFactory_QueryInterface((IClassFactory *)&ComCatCF, riid, ppv); } /********************************************************************** Modified: trunk/reactos/dll/win32/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj.c?…
============================================================================== --- trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -2974,6 +2974,8 @@ if (release_apt) apartment_release(apt); return FTMarshalCF_Create(iid, ppv); } + if (IsEqualCLSID(rclsid, &CLSID_GlobalOptions)) + return IClassFactory_QueryInterface(&GlobalOptionsCF, iid, ppv); } if (CLSCTX_INPROC & dwClsContext) @@ -5051,6 +5053,122 @@ } /*********************************************************************** + * CoRegisterSurrogate [OLE32.@] + */ +HRESULT WINAPI CoRegisterSurrogate(ISurrogate *surrogate) +{ + FIXME("(%p): stub\n", surrogate); + + return E_NOTIMPL; +} + +/*********************************************************************** + * CoRegisterSurrogateEx [OLE32.@] + */ +HRESULT WINAPI CoRegisterSurrogateEx(REFGUID guid, void *reserved) +{ + FIXME("(%s %p): stub\n", debugstr_guid(guid), reserved); + + return E_NOTIMPL; +} + +typedef struct { + IGlobalOptions IGlobalOptions_iface; + LONG ref; +} GlobalOptions; + +static inline GlobalOptions *impl_from_IGlobalOptions(IGlobalOptions *iface) +{ + return CONTAINING_RECORD(iface, GlobalOptions, IGlobalOptions_iface); +} + +static HRESULT WINAPI GlobalOptions_QueryInterface(IGlobalOptions *iface, REFIID riid, void **ppv) +{ + GlobalOptions *This = impl_from_IGlobalOptions(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + + if (IsEqualGUID(&IID_IGlobalOptions, riid) || IsEqualGUID(&IID_IUnknown, riid)) + { + *ppv = iface; + } + else + { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI GlobalOptions_AddRef(IGlobalOptions *iface) +{ + GlobalOptions *This = impl_from_IGlobalOptions(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI GlobalOptions_Release(IGlobalOptions *iface) +{ + GlobalOptions *This = impl_from_IGlobalOptions(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if (!ref) + heap_free(This); + + return ref; +} + +static HRESULT WINAPI GlobalOptions_Set(IGlobalOptions *iface, GLOBALOPT_PROPERTIES property, ULONG_PTR value) +{ + GlobalOptions *This = impl_from_IGlobalOptions(iface); + FIXME("(%p)->(%u %lx)\n", This, property, value); + return S_OK; +} + +static HRESULT WINAPI GlobalOptions_Query(IGlobalOptions *iface, GLOBALOPT_PROPERTIES property, ULONG_PTR *value) +{ + GlobalOptions *This = impl_from_IGlobalOptions(iface); + FIXME("(%p)->(%u %p)\n", This, property, value); + return E_NOTIMPL; +} + +static const IGlobalOptionsVtbl GlobalOptionsVtbl = { + GlobalOptions_QueryInterface, + GlobalOptions_AddRef, + GlobalOptions_Release, + GlobalOptions_Set, + GlobalOptions_Query +}; + +HRESULT WINAPI GlobalOptions_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) +{ + GlobalOptions *global_options; + HRESULT hres; + + TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv); + + if (outer) + return E_INVALIDARG; + + global_options = heap_alloc(sizeof(*global_options)); + if (!global_options) + return E_OUTOFMEMORY; + global_options->IGlobalOptions_iface.lpVtbl = &GlobalOptionsVtbl; + global_options->ref = 1; + + hres = IGlobalOptions_QueryInterface(&global_options->IGlobalOptions_iface, riid, ppv); + IGlobalOptions_Release(&global_options->IGlobalOptions_iface); + return hres; +} + +/*********************************************************************** * DllMain (OLE32.@) */ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID reserved) Modified: trunk/reactos/dll/win32/ole32/compobj_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj_pr…
============================================================================== --- trunk/reactos/dll/win32/ole32/compobj_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compobj_private.h [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -286,6 +286,10 @@ extern HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; extern HRESULT HandlerCF_Create(REFCLSID rclsid, REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; +extern HRESULT WINAPI GlobalOptions_CreateInstance(IClassFactory *iface, IUnknown *pUnk, + REFIID riid, void **ppv) DECLSPEC_HIDDEN; +extern IClassFactory GlobalOptionsCF DECLSPEC_HIDDEN; + /* Exported non-interface Data Advise Holder functions */ HRESULT DataAdviseHolder_OnConnect(IDataAdviseHolder *iface, IDataObject *pDelegate) DECLSPEC_HIDDEN; void DataAdviseHolder_OnDisconnect(IDataAdviseHolder *iface) DECLSPEC_HIDDEN; @@ -319,4 +323,19 @@ return HeapFree(GetProcessHeap(), 0, mem); } +static inline HRESULT copy_formatetc(FORMATETC *dst, const FORMATETC *src) +{ + *dst = *src; + if (src->ptd) + { + dst->ptd = CoTaskMemAlloc( src->ptd->tdSize ); + if (!dst->ptd) return E_OUTOFMEMORY; + memcpy( dst->ptd, src->ptd, src->ptd->tdSize ); + } + return S_OK; +} + +extern HRESULT EnumSTATDATA_Construct(IUnknown *holder, ULONG index, DWORD array_len, STATDATA *data, + BOOL copy, IEnumSTATDATA **ppenum) DECLSPEC_HIDDEN; + #endif /* __WINE_OLE_COMPOBJ_H */ Modified: trunk/reactos/dll/win32/ole32/compositemoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compositem…
============================================================================== --- trunk/reactos/dll/win32/ole32/compositemoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compositemoniker.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -1976,30 +1976,8 @@ return E_NOTIMPL; } -static HRESULT WINAPI CompositeMonikerCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) -{ - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) - { - *ppv = iface; - IClassFactory_AddRef(iface); - return S_OK; - } - return E_NOINTERFACE; -} - -static ULONG WINAPI CompositeMonikerCF_AddRef(LPCLASSFACTORY iface) -{ - return 2; /* non-heap based object */ -} - -static ULONG WINAPI CompositeMonikerCF_Release(LPCLASSFACTORY iface) -{ - return 1; /* non-heap based object */ -} - -static HRESULT WINAPI CompositeMonikerCF_CreateInstance(LPCLASSFACTORY iface, - LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv) +HRESULT WINAPI CompositeMoniker_CreateInstance(IClassFactory *iface, + IUnknown *pUnk, REFIID riid, void **ppv) { IMoniker* pMoniker; HRESULT hr; @@ -2021,24 +1999,3 @@ return hr; } - -static HRESULT WINAPI CompositeMonikerCF_LockServer(LPCLASSFACTORY iface, BOOL fLock) -{ - FIXME("(%d), stub!\n",fLock); - return S_OK; -} - -static const IClassFactoryVtbl CompositeMonikerCFVtbl = -{ - CompositeMonikerCF_QueryInterface, - CompositeMonikerCF_AddRef, - CompositeMonikerCF_Release, - CompositeMonikerCF_CreateInstance, - CompositeMonikerCF_LockServer -}; -static const IClassFactoryVtbl *CompositeMonikerCF = &CompositeMonikerCFVtbl; - -HRESULT CompositeMonikerCF_Create(REFIID riid, LPVOID *ppv) -{ - return IClassFactory_QueryInterface((IClassFactory *)&CompositeMonikerCF, riid, ppv); -} Modified: trunk/reactos/dll/win32/ole32/datacache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/datacache.…
============================================================================== --- trunk/reactos/dll/win32/ole32/datacache.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/datacache.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -209,12 +209,41 @@ formatetc->lindex, formatetc->tymed); } +/*********************************************************************** + * bitmap_info_size + * + * Return the size of the bitmap info structure including color table. + */ +int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) +{ + unsigned int colors, size, masks = 0; + + if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) + { + const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info; + colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0; + return sizeof(BITMAPCOREHEADER) + colors * + ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD)); + } + else /* assume BITMAPINFOHEADER */ + { + colors = info->bmiHeader.biClrUsed; + if (colors > 256) /* buffer overflow otherwise */ + colors = 256; + if (!colors && (info->bmiHeader.biBitCount <= 8)) + colors = 1 << info->bmiHeader.biBitCount; + if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3; + size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) ); + return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD)); + } +} + static void DataCacheEntry_Destroy(DataCache *cache, DataCacheEntry *cache_entry) { list_remove(&cache_entry->entry); if (cache_entry->stream) IStream_Release(cache_entry->stream); - HeapFree(GetProcessHeap(), 0, cache_entry->fmtetc.ptd); + CoTaskMemFree(cache_entry->fmtetc.ptd); ReleaseStgMedium(&cache_entry->stgmedium); if(cache_entry->sink_id) IDataObject_DUnadvise(cache->running_object, cache_entry->sink_id); @@ -253,13 +282,21 @@ static DataCacheEntry *DataCache_GetEntryForFormatEtc(DataCache *This, const FORMATETC *formatetc) { DataCacheEntry *cache_entry; + FORMATETC fmt = *formatetc; + + if (fmt.cfFormat == CF_BITMAP) + { + fmt.cfFormat = CF_DIB; + fmt.tymed = TYMED_HGLOBAL; + } + LIST_FOR_EACH_ENTRY(cache_entry, &This->cache_list, DataCacheEntry, entry) { /* FIXME: also compare DVTARGETDEVICEs */ - if ((!cache_entry->fmtetc.cfFormat || !formatetc->cfFormat || (formatetc->cfFormat == cache_entry->fmtetc.cfFormat)) && - (formatetc->dwAspect == cache_entry->fmtetc.dwAspect) && - (formatetc->lindex == cache_entry->fmtetc.lindex) && - (!cache_entry->fmtetc.tymed || !formatetc->tymed || (formatetc->tymed == cache_entry->fmtetc.tymed))) + if ((!cache_entry->fmtetc.cfFormat || !fmt.cfFormat || (fmt.cfFormat == cache_entry->fmtetc.cfFormat)) && + (fmt.dwAspect == cache_entry->fmtetc.dwAspect) && + (fmt.lindex == cache_entry->fmtetc.lindex) && + (!cache_entry->fmtetc.tymed || !fmt.tymed || (fmt.tymed == cache_entry->fmtetc.tymed))) return cache_entry; } return NULL; @@ -285,7 +322,30 @@ } } -static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DataCacheEntry **cache_entry, BOOL load) +static BOOL init_cache_entry(DataCacheEntry *entry, const FORMATETC *fmt, DWORD advf, + DWORD id) +{ + HRESULT hr; + + hr = copy_formatetc(&entry->fmtetc, fmt); + if (FAILED(hr)) return FALSE; + + entry->data_cf = 0; + entry->stgmedium.tymed = TYMED_NULL; + entry->stgmedium.pUnkForRelease = NULL; + entry->stream = NULL; + entry->stream_type = no_stream; + entry->id = id; + entry->dirty = TRUE; + entry->stream_number = -1; + entry->sink_id = 0; + entry->advise_flags = advf; + + return TRUE; +} + +static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DWORD advf, + DataCacheEntry **cache_entry, BOOL load) { HRESULT hr; @@ -299,24 +359,17 @@ if (!*cache_entry) return E_OUTOFMEMORY; - (*cache_entry)->fmtetc = *formatetc; - if (formatetc->ptd) - { - (*cache_entry)->fmtetc.ptd = HeapAlloc(GetProcessHeap(), 0, formatetc->ptd->tdSize); - memcpy((*cache_entry)->fmtetc.ptd, formatetc->ptd, formatetc->ptd->tdSize); - } - (*cache_entry)->data_cf = 0; - (*cache_entry)->stgmedium.tymed = TYMED_NULL; - (*cache_entry)->stgmedium.pUnkForRelease = NULL; - (*cache_entry)->stream = NULL; - (*cache_entry)->stream_type = no_stream; - (*cache_entry)->id = This->last_cache_id++; - (*cache_entry)->dirty = TRUE; - (*cache_entry)->stream_number = -1; - (*cache_entry)->sink_id = 0; - (*cache_entry)->advise_flags = 0; + if (!init_cache_entry(*cache_entry, formatetc, advf, This->last_cache_id)) + goto fail; + list_add_tail(&This->cache_list, &(*cache_entry)->entry); + This->last_cache_id++; + return hr; + +fail: + HeapFree(GetProcessHeap(), 0, *cache_entry); + return E_OUTOFMEMORY; } /************************************************************************ @@ -573,7 +626,9 @@ STATSTG stat; void *dib; HGLOBAL hglobal; - ULONG read; + ULONG read, info_size, bi_size; + BITMAPFILEHEADER file; + BITMAPINFOHEADER *info; if (cache_entry->stream_type != contents_stream) { @@ -583,25 +638,72 @@ hr = IStream_Stat( stm, &stat, STATFLAG_NONAME ); if (FAILED( hr )) return hr; + + if (stat.cbSize.QuadPart < sizeof(file) + sizeof(DWORD)) return E_FAIL; + hr = IStream_Read( stm, &file, sizeof(file), &read ); + if (hr != S_OK || read != sizeof(file)) return E_FAIL; + stat.cbSize.QuadPart -= sizeof(file); hglobal = GlobalAlloc( GMEM_MOVEABLE, stat.cbSize.u.LowPart ); if (!hglobal) return E_OUTOFMEMORY; dib = GlobalLock( hglobal ); - hr = IStream_Read( stm, dib, stat.cbSize.u.LowPart, &read ); + hr = IStream_Read( stm, dib, sizeof(DWORD), &read ); + if (hr != S_OK || read != sizeof(DWORD)) goto fail; + bi_size = *(DWORD *)dib; + if (stat.cbSize.QuadPart < bi_size) goto fail; + + hr = IStream_Read( stm, (char *)dib + sizeof(DWORD), bi_size - sizeof(DWORD), &read ); + if (hr != S_OK || read != bi_size - sizeof(DWORD)) goto fail; + + info_size = bitmap_info_size( dib, DIB_RGB_COLORS ); + if (stat.cbSize.QuadPart < info_size) goto fail; + if (info_size > bi_size) + { + hr = IStream_Read( stm, (char *)dib + bi_size, info_size - bi_size, &read ); + if (hr != S_OK || read != info_size - bi_size) goto fail; + } + stat.cbSize.QuadPart -= info_size; + + if (file.bfOffBits) + { + LARGE_INTEGER skip; + + skip.QuadPart = file.bfOffBits - sizeof(file) - info_size; + if (stat.cbSize.QuadPart < skip.QuadPart) goto fail; + hr = IStream_Seek( stm, skip, STREAM_SEEK_CUR, NULL ); + if (hr != S_OK) goto fail; + stat.cbSize.QuadPart -= skip.QuadPart; + } + + hr = IStream_Read( stm, (char *)dib + info_size, stat.cbSize.u.LowPart, &read ); + if (hr != S_OK || read != stat.cbSize.QuadPart) goto fail; + + if (bi_size >= sizeof(*info)) + { + info = (BITMAPINFOHEADER *)dib; + if (info->biXPelsPerMeter == 0 || info->biYPelsPerMeter == 0) + { + HDC hdc = GetDC( 0 ); + info->biXPelsPerMeter = MulDiv( GetDeviceCaps( hdc, LOGPIXELSX ), 10000, 254 ); + info->biYPelsPerMeter = MulDiv( GetDeviceCaps( hdc, LOGPIXELSY ), 10000, 254 ); + ReleaseDC( 0, hdc ); + } + } + GlobalUnlock( hglobal ); - - if (hr != S_OK || read != stat.cbSize.u.LowPart) - { - GlobalFree( hglobal ); - return E_FAIL; - } cache_entry->data_cf = cache_entry->fmtetc.cfFormat; cache_entry->stgmedium.tymed = TYMED_HGLOBAL; cache_entry->stgmedium.u.hGlobal = hglobal; return S_OK; + +fail: + GlobalUnlock( hglobal ); + GlobalFree( hglobal ); + return E_FAIL; + } /************************************************************************ @@ -792,11 +894,56 @@ return S_OK; } +static HGLOBAL synthesize_dib( HBITMAP bm ) +{ + HDC hdc = GetDC( 0 ); + BITMAPINFOHEADER header; + BITMAPINFO *bmi; + HGLOBAL ret = 0; + DWORD header_size; + + memset( &header, 0, sizeof(header) ); + header.biSize = sizeof(header); + if (!GetDIBits( hdc, bm, 0, 0, NULL, (BITMAPINFO *)&header, DIB_RGB_COLORS )) goto done; + + header_size = bitmap_info_size( (BITMAPINFO *)&header, DIB_RGB_COLORS ); + if (!(ret = GlobalAlloc( GMEM_MOVEABLE, header_size + header.biSizeImage ))) goto done; + bmi = GlobalLock( ret ); + memset( bmi, 0, header_size ); + memcpy( bmi, &header, header.biSize ); + GetDIBits( hdc, bm, 0, abs(header.biHeight), (char *)bmi + header_size, bmi, DIB_RGB_COLORS ); + GlobalUnlock( ret ); + +done: + ReleaseDC( 0, hdc ); + return ret; +} + +static HBITMAP synthesize_bitmap( HGLOBAL dib ) +{ + HBITMAP ret = 0; + BITMAPINFO *bmi; + HDC hdc = GetDC( 0 ); + + if ((bmi = GlobalLock( dib ))) + { + /* FIXME: validate data size */ + ret = CreateDIBitmap( hdc, &bmi->bmiHeader, CBM_INIT, + (char *)bmi + bitmap_info_size( bmi, DIB_RGB_COLORS ), + bmi, DIB_RGB_COLORS ); + GlobalUnlock( dib ); + } + ReleaseDC( 0, hdc ); + return ret; +} + static HRESULT DataCacheEntry_SetData(DataCacheEntry *cache_entry, const FORMATETC *formatetc, - const STGMEDIUM *stgmedium, + STGMEDIUM *stgmedium, BOOL fRelease) { + STGMEDIUM dib_copy; + if ((!cache_entry->fmtetc.cfFormat && !formatetc->cfFormat) || (cache_entry->fmtetc.tymed == TYMED_NULL && formatetc->tymed == TYMED_NULL) || stgmedium->tymed == TYMED_NULL) @@ -808,6 +955,17 @@ cache_entry->dirty = TRUE; ReleaseStgMedium(&cache_entry->stgmedium); cache_entry->data_cf = cache_entry->fmtetc.cfFormat ? cache_entry->fmtetc.cfFormat : formatetc->cfFormat; + + if (formatetc->cfFormat == CF_BITMAP) + { + dib_copy.tymed = TYMED_HGLOBAL; + dib_copy.u.hGlobal = synthesize_dib( stgmedium->u.hBitmap ); + dib_copy.pUnkForRelease = NULL; + if (fRelease) ReleaseStgMedium(stgmedium); + stgmedium = &dib_copy; + fRelease = TRUE; + } + if (fRelease) { cache_entry->stgmedium = *stgmedium; @@ -818,9 +976,9 @@ &cache_entry->stgmedium, stgmedium); } -static HRESULT DataCacheEntry_GetData(DataCacheEntry *cache_entry, STGMEDIUM *stgmedium) -{ - if (stgmedium->tymed == TYMED_NULL && cache_entry->stream) +static HRESULT DataCacheEntry_GetData(DataCacheEntry *cache_entry, FORMATETC *fmt, STGMEDIUM *stgmedium) +{ + if (cache_entry->stgmedium.tymed == TYMED_NULL && cache_entry->stream) { HRESULT hr = DataCacheEntry_LoadData(cache_entry); if (FAILED(hr)) @@ -828,6 +986,14 @@ } if (cache_entry->stgmedium.tymed == TYMED_NULL) return OLE_E_BLANK; + + if (fmt->cfFormat == CF_BITMAP) + { + stgmedium->tymed = TYMED_GDI; + stgmedium->u.hBitmap = synthesize_bitmap( cache_entry->stgmedium.u.hGlobal ); + stgmedium->pUnkForRelease = NULL; + return S_OK; + } return copy_stg_medium(cache_entry->data_cf, stgmedium, &cache_entry->stgmedium); } @@ -1000,7 +1166,7 @@ if (!cache_entry) return OLE_E_BLANK; - return DataCacheEntry_GetData(cache_entry, pmedium); + return DataCacheEntry_GetData(cache_entry, pformatetcIn, pmedium); } static HRESULT WINAPI DataCache_GetDataHere( @@ -1245,7 +1411,7 @@ cache_entry = DataCache_GetEntryForFormatEtc( This, fmt ); if (!cache_entry) - hr = DataCache_CreateEntry( This, fmt, &cache_entry, TRUE ); + hr = DataCache_CreateEntry( This, fmt, 0, &cache_entry, TRUE ); if (SUCCEEDED( hr )) { DataCacheEntry_DiscardData( cache_entry ); @@ -1641,16 +1807,14 @@ } case CF_DIB: { - BITMAPFILEHEADER *file_head; BITMAPINFO *info; BYTE *bits; if ((cache_entry->stgmedium.tymed != TYMED_HGLOBAL) || - !((file_head = GlobalLock( cache_entry->stgmedium.u.hGlobal )))) + !((info = GlobalLock( cache_entry->stgmedium.u.hGlobal )))) continue; - info = (BITMAPINFO *)(file_head + 1); - bits = (BYTE *) file_head + file_head->bfOffBits; + bits = (BYTE *) info + bitmap_info_size( info, DIB_RGB_COLORS ); StretchDIBits( hdcDraw, lprcBounds->left, lprcBounds->top, lprcBounds->right - lprcBounds->left, lprcBounds->bottom - lprcBounds->top, 0, 0, info->bmiHeader.biWidth, info->bmiHeader.biHeight, @@ -1861,16 +2025,13 @@ } case CF_DIB: { - BITMAPFILEHEADER *file_head; BITMAPINFOHEADER *info; LONG x_pels_m, y_pels_m; if ((cache_entry->stgmedium.tymed != TYMED_HGLOBAL) || - !((file_head = GlobalLock( cache_entry->stgmedium.u.hGlobal )))) + !((info = GlobalLock( cache_entry->stgmedium.u.hGlobal )))) continue; - - info = (BITMAPINFOHEADER *)(file_head + 1); x_pels_m = info->biXPelsPerMeter; y_pels_m = info->biYPelsPerMeter; @@ -1975,6 +2136,7 @@ DataCache *This = impl_from_IOleCache2(iface); DataCacheEntry *cache_entry; HRESULT hr; + FORMATETC fmt_cpy; TRACE("(%p, 0x%x, %p)\n", pformatetc, advf, pdwConnection); @@ -1983,9 +2145,16 @@ TRACE("pformatetc = %s\n", debugstr_formatetc(pformatetc)); + fmt_cpy = *pformatetc; /* No need for a deep copy */ + if (fmt_cpy.cfFormat == CF_BITMAP && fmt_cpy.tymed == TYMED_GDI) + { + fmt_cpy.cfFormat = CF_DIB; + fmt_cpy.tymed = TYMED_HGLOBAL; + } + *pdwConnection = 0; - cache_entry = DataCache_GetEntryForFormatEtc(This, pformatetc); + cache_entry = DataCache_GetEntryForFormatEtc(This, &fmt_cpy); if (cache_entry) { TRACE("found an existing cache entry\n"); @@ -1993,12 +2162,11 @@ return CACHE_S_SAMECACHE; } - hr = DataCache_CreateEntry(This, pformatetc, &cache_entry, FALSE); + hr = DataCache_CreateEntry(This, &fmt_cpy, advf, &cache_entry, FALSE); if (SUCCEEDED(hr)) { *pdwConnection = cache_entry->id; - cache_entry->advise_flags = advf; setup_sink(This, cache_entry); } @@ -2026,12 +2194,58 @@ return OLE_E_NOCONNECTION; } -static HRESULT WINAPI DataCache_EnumCache( - IOleCache2* iface, - IEnumSTATDATA** ppenumSTATDATA) -{ - FIXME("stub\n"); - return E_NOTIMPL; +static HRESULT WINAPI DataCache_EnumCache(IOleCache2 *iface, + IEnumSTATDATA **enum_stat) +{ + DataCache *This = impl_from_IOleCache2( iface ); + DataCacheEntry *cache_entry; + int i = 0, count = 0; + STATDATA *data; + HRESULT hr; + + TRACE( "(%p, %p)\n", This, enum_stat ); + + LIST_FOR_EACH_ENTRY( cache_entry, &This->cache_list, DataCacheEntry, entry ) + { + count++; + if (cache_entry->fmtetc.cfFormat == CF_DIB) + count++; + } + + data = CoTaskMemAlloc( count * sizeof(*data) ); + if (!data) return E_OUTOFMEMORY; + + LIST_FOR_EACH_ENTRY( cache_entry, &This->cache_list, DataCacheEntry, entry ) + { + if (i == count) goto fail; + hr = copy_formatetc( &data[i].formatetc, &cache_entry->fmtetc ); + if (FAILED(hr)) goto fail; + data[i].advf = cache_entry->advise_flags; + data[i].pAdvSink = NULL; + data[i].dwConnection = cache_entry->id; + i++; + + if (cache_entry->fmtetc.cfFormat == CF_DIB) + { + if (i == count) goto fail; + hr = copy_formatetc( &data[i].formatetc, &cache_entry->fmtetc ); + if (FAILED(hr)) goto fail; + data[i].formatetc.cfFormat = CF_BITMAP; + data[i].formatetc.tymed = TYMED_GDI; + data[i].advf = cache_entry->advise_flags; + data[i].pAdvSink = NULL; + data[i].dwConnection = cache_entry->id; + i++; + } + } + + hr = EnumSTATDATA_Construct( NULL, 0, i, data, FALSE, enum_stat ); + if (SUCCEEDED(hr)) return hr; + +fail: + while (i--) CoTaskMemFree( data[i].formatetc.ptd ); + CoTaskMemFree( data ); + return hr; } static HRESULT WINAPI DataCache_InitCache( Modified: trunk/reactos/dll/win32/ole32/filemoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/filemonike…
============================================================================== --- trunk/reactos/dll/win32/ole32/filemoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/filemoniker.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -1525,31 +1525,7 @@ } -static HRESULT WINAPI FileMonikerCF_QueryInterface(LPCLASSFACTORY iface, - REFIID riid, LPVOID *ppv) -{ - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) - { - *ppv = iface; - IClassFactory_AddRef(iface); - return S_OK; - } - return E_NOINTERFACE; -} - -static ULONG WINAPI FileMonikerCF_AddRef(LPCLASSFACTORY iface) -{ - return 2; /* non-heap based object */ -} - -static ULONG WINAPI FileMonikerCF_Release(LPCLASSFACTORY iface) -{ - return 1; /* non-heap based object */ -} - -static HRESULT WINAPI FileMonikerCF_CreateInstance(LPCLASSFACTORY iface, - LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv) +HRESULT WINAPI FileMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv) { FileMonikerImpl* newFileMoniker; HRESULT hr; @@ -1575,24 +1551,3 @@ return hr; } - -static HRESULT WINAPI FileMonikerCF_LockServer(LPCLASSFACTORY iface, BOOL fLock) -{ - FIXME("(%d), stub!\n",fLock); - return S_OK; -} - -static const IClassFactoryVtbl FileMonikerCFVtbl = -{ - FileMonikerCF_QueryInterface, - FileMonikerCF_AddRef, - FileMonikerCF_Release, - FileMonikerCF_CreateInstance, - FileMonikerCF_LockServer -}; -static const IClassFactoryVtbl *FileMonikerCF = &FileMonikerCFVtbl; - -HRESULT FileMonikerCF_Create(REFIID riid, LPVOID *ppv) -{ - return IClassFactory_QueryInterface((IClassFactory *)&FileMonikerCF, riid, ppv); -} Modified: trunk/reactos/dll/win32/ole32/itemmoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/itemmonike…
============================================================================== --- trunk/reactos/dll/win32/ole32/itemmoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/itemmoniker.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -933,39 +933,16 @@ hr = ItemMonikerImpl_Construct(newItemMoniker,lpszDelim,lpszItem); if (FAILED(hr)){ - HeapFree(GetProcessHeap(),0,newItemMoniker); - return hr; + return hr; } return ItemMonikerImpl_QueryInterface(&newItemMoniker->IMoniker_iface,&IID_IMoniker, (void**)ppmk); } -static HRESULT WINAPI ItemMonikerCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) -{ - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) - { - *ppv = iface; - IClassFactory_AddRef(iface); - return S_OK; - } - return E_NOINTERFACE; -} - -static ULONG WINAPI ItemMonikerCF_AddRef(LPCLASSFACTORY iface) -{ - return 2; /* non-heap based object */ -} - -static ULONG WINAPI ItemMonikerCF_Release(LPCLASSFACTORY iface) -{ - return 1; /* non-heap based object */ -} - -static HRESULT WINAPI ItemMonikerCF_CreateInstance(LPCLASSFACTORY iface, - LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv) +HRESULT WINAPI ItemMoniker_CreateInstance(IClassFactory *iface, + IUnknown *pUnk, REFIID riid, void **ppv) { ItemMonikerImpl* newItemMoniker; HRESULT hr; @@ -991,24 +968,3 @@ return hr; } - -static HRESULT WINAPI ItemMonikerCF_LockServer(LPCLASSFACTORY iface, BOOL fLock) -{ - FIXME("(%d), stub!\n",fLock); - return S_OK; -} - -static const IClassFactoryVtbl ItemMonikerCFVtbl = -{ - ItemMonikerCF_QueryInterface, - ItemMonikerCF_AddRef, - ItemMonikerCF_Release, - ItemMonikerCF_CreateInstance, - ItemMonikerCF_LockServer -}; -static const IClassFactoryVtbl *ItemMonikerCF = &ItemMonikerCFVtbl; - -HRESULT ItemMonikerCF_Create(REFIID riid, LPVOID *ppv) -{ - return IClassFactory_QueryInterface((IClassFactory *)&ItemMonikerCF, riid, ppv); -} Modified: trunk/reactos/dll/win32/ole32/moniker.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/moniker.h?…
============================================================================== --- trunk/reactos/dll/win32/ole32/moniker.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/moniker.h [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -30,13 +30,13 @@ DEFINE_OLEGUID( CLSID_ClassMoniker, 0x31a, 0, 0 ); DEFINE_OLEGUID( CLSID_PointerMoniker, 0x306, 0, 0 ); -HRESULT FileMonikerCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; -HRESULT ItemMonikerCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; -HRESULT AntiMonikerCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; -HRESULT CompositeMonikerCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; -HRESULT ClassMonikerCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; -HRESULT PointerMonikerCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; -HRESULT ComCatCF_Create(REFIID riid, LPVOID *ppv) DECLSPEC_HIDDEN; +HRESULT WINAPI FileMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv); +HRESULT WINAPI ItemMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv); +HRESULT WINAPI AntiMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv); +HRESULT WINAPI CompositeMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv); +HRESULT WINAPI ClassMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv); +HRESULT WINAPI PointerMoniker_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv); +HRESULT WINAPI ComCat_CreateInstance(IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv); /* This function decomposes a String path to a String Table containing all the elements ("\" or "subDirectory" or "Directory" or "FileName") of the path */ int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/ole32/ole32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole32.spec…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole32.spec [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -87,8 +87,8 @@ @ stdcall CoRegisterMallocSpy (ptr) @ stdcall CoRegisterMessageFilter(ptr ptr) @ stdcall CoRegisterPSClsid(ptr ptr) -@ stub CoRegisterSurrogate -@ stub CoRegisterSurrogateEx +@ stdcall CoRegisterSurrogate(ptr) +@ stdcall CoRegisterSurrogateEx(ptr ptr) @ stdcall CoReleaseMarshalData(ptr) @ stdcall CoReleaseServerProcess() @ stdcall CoResumeClassObjects() Modified: trunk/reactos/dll/win32/ole32/oleobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/oleobj.c?r…
============================================================================== --- trunk/reactos/dll/win32/ole32/oleobj.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/oleobj.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -42,22 +42,20 @@ static HRESULT copy_statdata(STATDATA *dst, const STATDATA *src) { - *dst = *src; - if(src->formatetc.ptd) - { - dst->formatetc.ptd = CoTaskMemAlloc(src->formatetc.ptd->tdSize); - if(!dst->formatetc.ptd) return E_OUTOFMEMORY; - memcpy(dst->formatetc.ptd, src->formatetc.ptd, src->formatetc.ptd->tdSize); - } - if(dst->pAdvSink) IAdviseSink_AddRef(dst->pAdvSink); + HRESULT hr; + + hr = copy_formatetc( &dst->formatetc, &src->formatetc ); + if (FAILED(hr)) return hr; + dst->advf = src->advf; + dst->pAdvSink = src->pAdvSink; + if (dst->pAdvSink) IAdviseSink_AddRef( dst->pAdvSink ); + dst->dwConnection = src->dwConnection; return S_OK; } /************************************************************************** * EnumSTATDATA Implementation */ - -static HRESULT EnumSTATDATA_Construct(IUnknown *holder, ULONG index, DWORD array_len, STATDATA *data, IEnumSTATDATA **ppenum); typedef struct { @@ -106,7 +104,7 @@ for(i = 0; i < This->num_of_elems; i++) release_statdata(This->statdata + i); HeapFree(GetProcessHeap(), 0, This->statdata); - IUnknown_Release(This->holder); + if (This->holder) IUnknown_Release(This->holder); HeapFree(GetProcessHeap(), 0, This); } return refs; @@ -170,7 +168,8 @@ { EnumSTATDATA *This = impl_from_IEnumSTATDATA(iface); - return EnumSTATDATA_Construct(This->holder, This->index, This->num_of_elems, This->statdata, ppenum); + return EnumSTATDATA_Construct(This->holder, This->index, This->num_of_elems, This->statdata, + TRUE, ppenum); } static const IEnumSTATDATAVtbl EnumSTATDATA_VTable = @@ -184,8 +183,8 @@ EnumSTATDATA_Clone }; -static HRESULT EnumSTATDATA_Construct(IUnknown *holder, ULONG index, DWORD array_len, STATDATA *data, - IEnumSTATDATA **ppenum) +HRESULT EnumSTATDATA_Construct(IUnknown *holder, ULONG index, DWORD array_len, STATDATA *data, + BOOL copy, IEnumSTATDATA **ppenum) { EnumSTATDATA *This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); DWORD i, count; @@ -196,25 +195,33 @@ This->ref = 1; This->index = index; - This->statdata = HeapAlloc(GetProcessHeap(), 0, array_len * sizeof(*This->statdata)); - if(!This->statdata) - { - HeapFree(GetProcessHeap(), 0, This); - return E_OUTOFMEMORY; - } - - for(i = 0, count = 0; i < array_len; i++) - { - if(data[i].pAdvSink) + if (copy) + { + This->statdata = HeapAlloc(GetProcessHeap(), 0, array_len * sizeof(*This->statdata)); + if(!This->statdata) { - copy_statdata(This->statdata + count, data + i); - count++; + HeapFree(GetProcessHeap(), 0, This); + return E_OUTOFMEMORY; } + + for(i = 0, count = 0; i < array_len; i++) + { + if(data[i].pAdvSink) + { + copy_statdata(This->statdata + count, data + i); + count++; + } + } + } + else + { + This->statdata = data; + count = array_len; } This->num_of_elems = count; This->holder = holder; - IUnknown_AddRef(holder); + if (holder) IUnknown_AddRef(holder); *ppenum = &This->IEnumSTATDATA_iface; return S_OK; } @@ -389,7 +396,7 @@ TRACE("(%p)->(%p)\n", This, enum_advise); IOleAdviseHolder_QueryInterface(iface, &IID_IUnknown, (void**)&unk); - hr = EnumSTATDATA_Construct(unk, 0, This->max_cons, This->connections, enum_advise); + hr = EnumSTATDATA_Construct(unk, 0, This->max_cons, This->connections, TRUE, enum_advise); IUnknown_Release(unk); return hr; } @@ -723,7 +730,7 @@ TRACE("(%p)->(%p)\n", This, enum_advise); IDataAdviseHolder_QueryInterface(iface, &IID_IUnknown, (void**)&unk); - hr = EnumSTATDATA_Construct(unk, 0, This->maxCons, This->connections, enum_advise); + hr = EnumSTATDATA_Construct(unk, 0, This->maxCons, This->connections, TRUE, enum_advise); IUnknown_Release(unk); return hr; } Modified: trunk/reactos/dll/win32/ole32/oleproxy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/oleproxy.c…
============================================================================== --- trunk/reactos/dll/win32/ole32/oleproxy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/oleproxy.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -21,6 +21,126 @@ #include "precomp.h" +WINE_DEFAULT_DEBUG_CHANNEL(ole); + +static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) +{ + TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); + + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) + { + *ppv = iface; + return S_OK; + } + + *ppv = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock) +{ + TRACE("(%x)\n", fLock); + return S_OK; +} + +static const IClassFactoryVtbl FileMonikerCFVtbl = +{ + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + FileMoniker_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory FileMonikerCF = { &FileMonikerCFVtbl }; + +static const IClassFactoryVtbl ItemMonikerCFVtbl = +{ + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + ItemMoniker_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory ItemMonikerCF = { &ItemMonikerCFVtbl }; + +static const IClassFactoryVtbl AntiMonikerCFVtbl = +{ + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + AntiMoniker_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory AntiMonikerCF = { &AntiMonikerCFVtbl }; + +static const IClassFactoryVtbl CompositeMonikerCFVtbl = +{ + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + CompositeMoniker_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory CompositeMonikerCF = { &CompositeMonikerCFVtbl }; + +static const IClassFactoryVtbl ClassMonikerCFVtbl = +{ + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + ClassMoniker_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory ClassMonikerCF = { &ClassMonikerCFVtbl }; + +static const IClassFactoryVtbl PointerMonikerCFVtbl = +{ + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + PointerMoniker_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory PointerMonikerCF = { &PointerMonikerCFVtbl }; + +static const IClassFactoryVtbl ComCatCFVtbl = +{ + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + ComCat_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory ComCatCF = { &ComCatCFVtbl }; + +static const IClassFactoryVtbl GlobalOptionsCFVtbl = +{ + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + GlobalOptions_CreateInstance, + ClassFactory_LockServer +}; + +IClassFactory GlobalOptionsCF = { &GlobalOptionsCFVtbl }; + /*********************************************************************** * DllGetClassObject [OLE32.@] */ @@ -38,19 +158,19 @@ if (IsEqualIID(rclsid,&CLSID_StdGlobalInterfaceTable) && (IsEqualIID(iid,&IID_IClassFactory) || IsEqualIID(iid,&IID_IUnknown))) return StdGlobalInterfaceTable_GetFactory(ppv); if (IsEqualCLSID(rclsid, &CLSID_FileMoniker)) - return FileMonikerCF_Create(iid, ppv); + return IClassFactory_QueryInterface(&FileMonikerCF, iid, ppv); if (IsEqualCLSID(rclsid, &CLSID_ItemMoniker)) - return ItemMonikerCF_Create(iid, ppv); + return IClassFactory_QueryInterface(&ItemMonikerCF, iid, ppv); if (IsEqualCLSID(rclsid, &CLSID_AntiMoniker)) - return AntiMonikerCF_Create(iid, ppv); + return IClassFactory_QueryInterface(&AntiMonikerCF, iid, ppv); if (IsEqualCLSID(rclsid, &CLSID_CompositeMoniker)) - return CompositeMonikerCF_Create(iid, ppv); + return IClassFactory_QueryInterface(&CompositeMonikerCF, iid, ppv); if (IsEqualCLSID(rclsid, &CLSID_ClassMoniker)) - return ClassMonikerCF_Create(iid, ppv); + return IClassFactory_QueryInterface(&ClassMonikerCF, iid, ppv); if (IsEqualCLSID(rclsid, &CLSID_PointerMoniker)) - return PointerMonikerCF_Create(iid, ppv); + return IClassFactory_QueryInterface(&PointerMonikerCF, iid, ppv); if (IsEqualGUID(rclsid, &CLSID_StdComponentCategoriesMgr)) - return ComCatCF_Create(iid, ppv); + return IClassFactory_QueryInterface(&ComCatCF, iid, ppv); hr = OLE32_DllGetClassObject(rclsid, iid, ppv); if (SUCCEEDED(hr)) Modified: trunk/reactos/dll/win32/ole32/pointermoniker.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/pointermon…
============================================================================== --- trunk/reactos/dll/win32/ole32/pointermoniker.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/pointermoniker.c [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -575,31 +575,8 @@ return S_OK; } -static HRESULT WINAPI PointerMonikerCF_QueryInterface(LPCLASSFACTORY iface, - REFIID riid, LPVOID *ppv) -{ - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) - { - *ppv = iface; - IClassFactory_AddRef(iface); - return S_OK; - } - return E_NOINTERFACE; -} - -static ULONG WINAPI PointerMonikerCF_AddRef(LPCLASSFACTORY iface) -{ - return 2; /* non-heap based object */ -} - -static ULONG WINAPI PointerMonikerCF_Release(LPCLASSFACTORY iface) -{ - return 1; /* non-heap based object */ -} - -static HRESULT WINAPI PointerMonikerCF_CreateInstance(LPCLASSFACTORY iface, - LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv) +HRESULT WINAPI PointerMoniker_CreateInstance(IClassFactory *iface, + IUnknown *pUnk, REFIID riid, void **ppv) { IMoniker *pMoniker; HRESULT hr; @@ -622,24 +599,3 @@ return hr; } - -static HRESULT WINAPI PointerMonikerCF_LockServer(LPCLASSFACTORY iface, BOOL fLock) -{ - FIXME("(%d), stub!\n",fLock); - return S_OK; -} - -static const IClassFactoryVtbl PointerMonikerCFVtbl = -{ - PointerMonikerCF_QueryInterface, - PointerMonikerCF_AddRef, - PointerMonikerCF_Release, - PointerMonikerCF_CreateInstance, - PointerMonikerCF_LockServer -}; -static const IClassFactoryVtbl *PointerMonikerCF = &PointerMonikerCFVtbl; - -HRESULT PointerMonikerCF_Create(REFIID riid, LPVOID *ppv) -{ - return IClassFactory_QueryInterface((IClassFactory *)&PointerMonikerCF, riid, ppv); -} Modified: trunk/reactos/dll/win32/ole32/storage32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.…
============================================================================== --- trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -517,6 +517,9 @@ /****************************************************************************** * Endian conversion macros */ +#undef htole32 +#undef htole16 + #ifdef WORDS_BIGENDIAN #define htole32(x) RtlUlongByteSwap(x) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:33:33 2017 @@ -139,7 +139,7 @@ reactos/dll/win32/objsel # Synced to WineStaging-1.9.11 reactos/dll/win32/odbc32 # Synced to WineStaging-2.9. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-2.9 -reactos/dll/win32/ole32 # Synced to WineStaging-2.2 +reactos/dll/win32/ole32 # Synced to WineStaging-2.9 reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11 reactos/dll/win32/oleaut32 # Synced to WineStaging-2.2 reactos/dll/win32/olecli32 # Synced to WineStaging-1.9.11
7 years, 6 months
1
0
0
0
[akhaldi] 74828: [ODBCCP32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:33:08 2017 New Revision: 74828 URL:
http://svn.reactos.org/svn/reactos?rev=74828&view=rev
Log: [ODBCCP32_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/odbccp32/misc.c Modified: trunk/rostests/winetests/odbccp32/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/odbccp32/misc.c…
============================================================================== --- trunk/rostests/winetests/odbccp32/misc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/odbccp32/misc.c [iso-8859-1] Sat Jun 3 22:33:08 2017 @@ -412,6 +412,199 @@ } } +static void test_SQLInstallDriverEx(void) +{ + char path[MAX_PATH]; + char syspath[MAX_PATH]; + WORD size = 0; + BOOL ret, sql_ret; + DWORD cnt, error_code = 0; + HKEY hkey; + LONG res; + char error[1000]; + + GetSystemDirectoryA(syspath, MAX_PATH); + + ret = SQLConfigDriver(NULL, ODBC_CONFIG_DRIVER, "WINE ODBC Driver", "CPTimeout=59", error, sizeof(error), NULL); + ok(!ret, "SQLConfigDriver returned %d\n", ret); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(sql_ret && error_code == ODBC_ERROR_COMPONENT_NOT_FOUND, "SQLConfigDriver returned %d, %u\n", sql_ret, error_code); + + ret = SQLInstallDriverEx("WINE ODBC Driver\0Driver=sample.dll\0Setup=sample.dll\0\0", NULL, + path, MAX_PATH, &size, ODBC_INSTALL_COMPLETE, NULL); + ok(ret, "SQLInstallDriverEx failed\n"); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + if (sql_ret && error_code == ODBC_ERROR_WRITING_SYSINFO_FAILED) + { + win_skip("not enough privileges\n"); + return; + } + ok(sql_ret == SQL_NO_DATA || (sql_ret && error_code == SQL_SUCCESS), "SQLInstallDriverEx failed %d, %u\n", sql_ret, error_code); + ok(!strcmp(path, syspath), "invalid path %s\n", path); + +if (0) /* Crashes on XP. */ +{ + sql_ret = 0; + ret = SQLConfigDriver(NULL, ODBC_CONFIG_DRIVER, "WINE ODBC Driver", NULL, error, sizeof(error), NULL); + ok(!ret, "SQLConfigDriver failed '%s'\n",error); +} + + ret = SQLConfigDriver(NULL, ODBC_CONFIG_DRIVER, "WINE ODBC Driver", "CPTimeout=59\0NoWrite=60\0", error, sizeof(error), NULL); + ok(ret, "SQLConfigDriver failed\n"); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(sql_ret == SQL_NO_DATA || (sql_ret && error_code == SQL_SUCCESS), "SQLConfigDriver failed %d, %u\n", sql_ret, error_code); + + ret = SQLInstallDriverEx("WINE ODBC Driver Path\0Driver=sample.dll\0Setup=sample.dll\0\0", "c:\\temp", path, MAX_PATH, &size, ODBC_INSTALL_COMPLETE, NULL); + ok(ret, "SQLInstallDriverEx failed\n"); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(sql_ret == SQL_NO_DATA || (sql_ret && error_code == SQL_SUCCESS), "SQLInstallDriverEx failed %d, %u\n", sql_ret, error_code); + ok(!strcmp(path, "c:\\temp"), "invalid path %s\n", path); + + ret = SQLConfigDriver(NULL, ODBC_CONFIG_DRIVER, "WINE ODBC Driver Path", "empty", error, sizeof(error), NULL); + ok(!ret, "SQLConfigDriver successful\n"); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(sql_ret && error_code == ODBC_ERROR_INVALID_KEYWORD_VALUE, "SQLConfigDriver failed %d, %u\n", sql_ret, error_code); + + ret = SQLConfigDriver(NULL, ODBC_CONFIG_DRIVER, "WINE ODBC Driver Path", "NoWrite=60;xxxx=555", error, sizeof(error), NULL); + ok(ret, "SQLConfigDriver failed\n"); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(sql_ret == SQL_NO_DATA || (sql_ret && error_code == SQL_SUCCESS), "SQLConfigDriver failed %d, %u\n", sql_ret, error_code); + + if (ret) + { + DWORD type = 0xdeadbeef, size = MAX_PATH; + + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBCINST.INI\\WINE ODBC Driver", 0, KEY_READ, &hkey); + ok(res == ERROR_SUCCESS, "RegOpenKeyExW failed\n"); + if (res == ERROR_SUCCESS) + { + char driverpath[MAX_PATH]; + + strcpy(driverpath, syspath); + strcat(driverpath, "\\sample.dll"); + + memset(path, 0, sizeof(path)); + res = RegQueryValueExA(hkey, "Driver", NULL, &type, (BYTE *)path, &size); + ok(res == ERROR_SUCCESS, "got %d\n", res); + ok(type == REG_SZ, "got %u\n", type); + ok(size == strlen(driverpath) + 1, "got %u\n", size); + ok(!strcmp(path, driverpath), "invalid path %s\n", path); + + res = RegQueryValueExA(hkey, "CPTimeout", NULL, &type, (BYTE *)&path, &size); + ok(res == ERROR_SUCCESS, "got %d\n", res); + ok(type == REG_SZ, "got %u\n", type); + ok(size == strlen("59") + 1, "got %u\n", size); + ok(!strcmp(path, "59"), "invalid value %s\n", path); + + res = RegQueryValueExA(hkey, "NoWrite", NULL, &type, (BYTE *)&path, &size); + ok(res == ERROR_FILE_NOT_FOUND, "got %d\n", res); + + RegCloseKey(hkey); + } + + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBCINST.INI\\WINE ODBC Driver Path", 0, KEY_READ, &hkey); + ok(res == ERROR_SUCCESS, "RegOpenKeyExW failed\n"); + if (res == ERROR_SUCCESS) + { + size = sizeof(path); + res = RegQueryValueExA(hkey, "NoWrite", NULL, &type, (BYTE *)&path, &size); + ok(res == ERROR_SUCCESS, "got %d\n", res); + ok(type == REG_SZ, "got %u\n", type); + ok(size == strlen("60;xxxx=555") + 1, "got %u\n", size); + ok(!strcmp(path, "60;xxxx=555"), "invalid value %s\n", path); + + res = RegQueryValueExA(hkey, "CPTimeout", NULL, &type, (BYTE *)&path, &size); + ok(res == ERROR_FILE_NOT_FOUND, "got %d\n", res); + RegCloseKey(hkey); + } + } + + cnt = 100; + ret = SQLRemoveDriver("WINE ODBC Driver", FALSE, &cnt); + ok(ret, "SQLRemoveDriver failed\n"); + ok(cnt == 0, "SQLRemoveDriver failed %d\n", cnt); + + cnt = 100; + ret = SQLRemoveDriver("WINE ODBC Driver Path", FALSE, &cnt); + ok(ret, "SQLRemoveDriver failed\n"); + ok(cnt == 0, "SQLRemoveDriver failed %d\n", cnt); +} + +void test_SQLInstallTranslatorEx(void) +{ + char path[MAX_PATH]; + char syspath[MAX_PATH]; + WORD size = 0; + BOOL ret, sql_ret; + DWORD cnt, error_code = 0; + HKEY hkey; + LONG res; + + GetSystemDirectoryA(syspath, MAX_PATH); + + ret = SQLInstallTranslatorEx("WINE ODBC Translator\0Translator=sample.dll\0Setup=sample.dll\0", + NULL, path, MAX_PATH, &size, ODBC_INSTALL_COMPLETE, NULL); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + if (sql_ret && error_code == ODBC_ERROR_WRITING_SYSINFO_FAILED) + { + win_skip("not enough privileges\n"); + return; + } + ok(sql_ret && error_code == SQL_SUCCESS, "SQLInstallDriverEx failed %d, %u\n", sql_ret, error_code); + ok(!strcmp(path, syspath), "invalid path %s\n", path); + ok(size == strlen(path), "invalid length %d\n", size); + + ret = SQLInstallTranslatorEx("WINE ODBC Translator Path\0Translator=sample.dll\0Setup=sample.dll\0", + "c:\\temp", path, MAX_PATH, &size, ODBC_INSTALL_COMPLETE, NULL); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(sql_ret && error_code == SQL_SUCCESS, "SQLInstallTranslatorEx failed %d, %u\n", sql_ret, error_code); + ok(!strcmp(path, "c:\\temp"), "invalid path %s\n", path); + ok(size == strlen(path), "invalid length %d\n", size); + + if(ret) + { + res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\ODBC\\ODBCINST.INI\\WINE ODBC Translator", 0, + KEY_READ, &hkey); + ok(res == ERROR_SUCCESS, "RegOpenKeyExW failed\n"); + if (res == ERROR_SUCCESS) + { + DWORD type = 0xdeadbeef, size = MAX_PATH; + char driverpath[MAX_PATH]; + + strcpy(driverpath, syspath); + strcat(driverpath, "\\sample.dll"); + + memset(path, 0, sizeof(path)); + res = RegQueryValueExA(hkey, "Translator", NULL, &type, (BYTE *)path, &size); + ok(res == ERROR_SUCCESS, "RegGetValueA failed\n"); + ok(type == REG_SZ, "got %u\n", type); + ok(size == strlen(driverpath) + 1, "got %u\n", size); + ok(!strcmp(path, driverpath), "invalid path %s\n", path); + + RegCloseKey(hkey); + } + } + + cnt = 100; + ret = SQLRemoveTranslator("WINE ODBC Translator", &cnt); + ok(ret, "SQLRemoveTranslator failed\n"); + ok(cnt == 0, "SQLRemoveTranslator failed %d\n", cnt); + + cnt = 100; + ret = SQLRemoveTranslator("WINE ODBC Translator Path", &cnt); + ok(ret, "SQLRemoveTranslator failed\n"); + ok(cnt == 0, "SQLRemoveTranslator failed %d\n", cnt); + + cnt = 100; + ret = SQLRemoveTranslator("WINE ODBC Translator NonExist", &cnt); + ok(!ret, "SQLRemoveTranslator succeeded\n"); + ok(cnt == 100, "SQLRemoveTranslator succeeded %d\n", cnt); + sql_ret = SQLInstallerErrorW(1, &error_code, NULL, 0, NULL); + ok(sql_ret && error_code == ODBC_ERROR_COMPONENT_NOT_FOUND, + "SQLInstallTranslatorEx failed %d, %u\n", sql_ret, error_code); + +} + START_TEST(misc) { test_SQLConfigMode(); @@ -420,4 +613,6 @@ test_SQLWritePrivateProfileString(); test_SQLGetPrivateProfileString(); test_SQLGetPrivateProfileStringW(); -} + test_SQLInstallDriverEx(); + test_SQLInstallTranslatorEx(); +}
7 years, 6 months
1
0
0
0
[akhaldi] 74827: [ODBCCP32] Sync with Wine Staging 2.9. CORE-13362 c92189c odbccp32: Handle ODBC_CONFIG_DRIVER request in SQLConfigDriver/W. 3b5a870 odbccp32: Look in LOCAL_MACHINE for the driver. ...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:32:52 2017 New Revision: 74827 URL:
http://svn.reactos.org/svn/reactos?rev=74827&view=rev
Log: [ODBCCP32] Sync with Wine Staging 2.9. CORE-13362 c92189c odbccp32: Handle ODBC_CONFIG_DRIVER request in SQLConfigDriver/W. 3b5a870 odbccp32: Look in LOCAL_MACHINE for the driver. 764ee72 odbccp32: Implement SQLConfigDriver/W. e7afcb9 odbccp32: Implement SQLRemoveTranslator/W. d687fc8 odbccp32: Implement SQLInstallTranslator. 3136bed odbccp32: Implement SQLRemoveDriver/SQLRemoveDriverW. 27482bc odbccp32: Implement SQLInstallDriverEx. 093d870 odbccp32: Fix some spec file entries. 65b6cf1 odbccp32: Add a __WINE_ALLOC_SIZE attribute to heap_alloc(). Modified: trunk/reactos/dll/win32/odbccp32/odbccp32.c trunk/reactos/dll/win32/odbccp32/odbccp32.spec trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/odbccp32/odbccp32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbccp32/odbccp3…
============================================================================== --- trunk/reactos/dll/win32/odbccp32/odbccp32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/odbccp32/odbccp32.c [iso-8859-1] Sat Jun 3 22:32:52 2017 @@ -30,7 +30,7 @@ #include <windef.h> #include <winbase.h> #include <winreg.h> -#include <winnls.h> +#include <wine/unicode.h> #include <wine/debug.h> #include <odbcinst.h> @@ -40,6 +40,9 @@ /* Registry key names */ static const WCHAR drivers_key[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','O','D','B','C','I','N','S','T','.','I','N','I','\\','O','D','B','C',' ','D','r','i','v','e','r','s',0}; static const WCHAR odbcW[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C',0}; +static const WCHAR odbcini[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','O','D','B','C','I','N','S','T','.','I','N','I','\\',0}; +static const WCHAR odbcdrivers[] = {'O','D','B','C',' ','D','r','i','v','e','r','s',0}; +static const WCHAR odbctranslators[] = {'O','D','B','C',' ','T','r','a','n','s','l','a','t','o','r','s',0}; /* This config mode is known to be process-wide. * MSDN documentation suggests that the value is hidden somewhere in the registry but I haven't found it yet. @@ -60,6 +63,10 @@ static const WCHAR odbc_error_out_of_mem[] = {'O','u','t',' ','o','f',' ','m','e','m','o','r','y',0}; static const WCHAR odbc_error_invalid_param_sequence[] = {'I','n','v','a','l','i','d',' ','p','a','r','a','m','e','t','e','r',' ','s','e','q','u','e','n','c','e',0}; static const WCHAR odbc_error_invalid_param_string[] = {'I','n','v','a','l','i','d',' ','p','a','r','a','m','e','t','e','r',' ','s','t','r','i','n','g',0}; +static const WCHAR odbc_error_invalid_dsn[] = {'I','n','v','a','l','i','d',' ','D','S','N',0}; +static const WCHAR odbc_error_load_lib_failed[] = {'L','o','a','d',' ','L','i','b','r','a','r','y',' ','F','a','i','l','e','d',0}; +static const WCHAR odbc_error_request_failed[] = {'R','e','q','u','e','s','t',' ','F','a','i','l','e','d',0}; +static const WCHAR odbc_error_invalid_keyword[] = {'I','n','v','a','l','i','d',' ','k','e','y','w','o','r','d',' ','v','a','l','u','e',0}; /* Push an error onto the error stack, taking care of ranges etc. */ static void push_error(int code, LPCWSTR msg) @@ -78,9 +85,9 @@ num_errors = 0; } -static inline void * heap_alloc(size_t len) -{ - return HeapAlloc(GetProcessHeap(), 0, len); +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) +{ + return HeapAlloc(GetProcessHeap(), 0, size); } static inline BOOL heap_free(void *mem) @@ -246,22 +253,200 @@ return TRUE; } -BOOL WINAPI SQLConfigDriverW(HWND hwndParent, WORD fRequest, LPCWSTR lpszDriver, - LPCWSTR lpszArgs, LPWSTR lpszMsg, WORD cbMsgMax, WORD *pcbMsgOut) -{ - clear_errors(); - FIXME("(%p %d %s %s %p %d %p)\n", hwndParent, fRequest, debugstr_w(lpszDriver), - debugstr_w(lpszArgs), lpszMsg, cbMsgMax, pcbMsgOut); - return TRUE; -} - -BOOL WINAPI SQLConfigDriver(HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, - LPCSTR lpszArgs, LPSTR lpszMsg, WORD cbMsgMax, WORD *pcbMsgOut) -{ - clear_errors(); - FIXME("(%p %d %s %s %p %d %p)\n", hwndParent, fRequest, debugstr_a(lpszDriver), - debugstr_a(lpszArgs), lpszMsg, cbMsgMax, pcbMsgOut); - return TRUE; +static HMODULE load_config_driver(const WCHAR *driver) +{ + static WCHAR reg_driver[] = {'d','r','i','v','e','r',0}; + long ret; + HMODULE hmod; + WCHAR *filename = NULL; + DWORD size = 0, type; + HKEY hkey; + + if ((ret = RegOpenKeyW(HKEY_LOCAL_MACHINE, odbcini, &hkey)) == ERROR_SUCCESS) + { + HKEY hkeydriver; + + 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) + { + 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, driver, RRF_RT_REG_SZ, &type, filename, &size); + } + + RegCloseKey(hkeydriver); + } + + RegCloseKey(hkey); + } + + if(ret != ERROR_SUCCESS) + { + HeapFree(GetProcessHeap(), 0, filename); + push_error(ODBC_ERROR_INVALID_DSN, odbc_error_invalid_dsn); + return NULL; + } + + hmod = LoadLibraryW(filename); + HeapFree(GetProcessHeap(), 0, filename); + + if(!hmod) + push_error(ODBC_ERROR_LOAD_LIB_FAILED, odbc_error_load_lib_failed); + + return hmod; +} + +static BOOL write_config_value(const WCHAR *driver, const WCHAR *args) +{ + long ret; + HKEY hkey, hkeydriver; + WCHAR *name = NULL; + + if(!args) + return FALSE; + + if((ret = RegOpenKeyW(HKEY_LOCAL_MACHINE, odbcini, &hkey)) == ERROR_SUCCESS) + { + if((ret = RegOpenKeyW(hkey, driver, &hkeydriver)) == ERROR_SUCCESS) + { + WCHAR *divider, *value; + + name = heap_alloc( (strlenW(args) + 1) * sizeof(WCHAR)); + if(!name) + { + push_error(ODBC_ERROR_OUT_OF_MEM, odbc_error_out_of_mem); + goto fail; + } + lstrcpyW(name, args); + + divider = strchrW(name,'='); + if(!divider) + { + push_error(ODBC_ERROR_INVALID_KEYWORD_VALUE, odbc_error_invalid_keyword); + goto fail; + } + + value = divider + 1; + *divider = '\0'; + + TRACE("Write pair: %s = %s\n", debugstr_w(name), debugstr_w(value)); + if(RegSetValueExW(hkeydriver, name, 0, REG_SZ, (BYTE*)value, + (strlenW(value)+1) * sizeof(WCHAR)) != ERROR_SUCCESS) + ERR("Failed to write registry installed key\n"); + heap_free(name); + + RegCloseKey(hkeydriver); + } + + RegCloseKey(hkey); + } + + if(ret != ERROR_SUCCESS) + push_error(ODBC_ERROR_COMPONENT_NOT_FOUND, odbc_error_component_not_found); + + return ret == ERROR_SUCCESS; + +fail: + RegCloseKey(hkeydriver); + RegCloseKey(hkey); + heap_free(name); + + return FALSE; +} + +BOOL WINAPI SQLConfigDriverW(HWND hwnd, WORD request, LPCWSTR driver, + LPCWSTR args, LPWSTR msg, WORD msgmax, WORD *msgout) +{ + BOOL (WINAPI *pConfigDriverW)(HWND hwnd, WORD request, const WCHAR *driver, const WCHAR *args, const WCHAR *msg, WORD msgmax, WORD *msgout); + HMODULE hmod; + BOOL funcret = FALSE; + + clear_errors(); + TRACE("(%p %d %s %s %p %d %p)\n", hwnd, request, debugstr_w(driver), + debugstr_w(args), msg, msgmax, msgout); + + if(request == ODBC_CONFIG_DRIVER) + { + return write_config_value(driver, args); + } + + hmod = load_config_driver(driver); + if(!hmod) + return FALSE; + + pConfigDriverW = (void*)GetProcAddress(hmod, "ConfigDriverW"); + if(pConfigDriverW) + funcret = pConfigDriverW(hwnd, request, driver, args, msg, msgmax, msgout); + + if(!funcret) + push_error(ODBC_ERROR_REQUEST_FAILED, odbc_error_request_failed); + + FreeLibrary(hmod); + + return funcret; +} + +BOOL WINAPI SQLConfigDriver(HWND hwnd, WORD request, LPCSTR driver, + LPCSTR args, LPSTR msg, WORD msgmax, WORD *msgout) +{ + BOOL (WINAPI *pConfigDriverA)(HWND hwnd, WORD request, const char *driver, const char *args, const char *msg, WORD msgmax, WORD *msgout); + HMODULE hmod; + WCHAR *driverW; + BOOL funcret = FALSE; + + clear_errors(); + TRACE("(%p %d %s %s %p %d %p)\n", hwnd, request, debugstr_a(driver), + debugstr_a(args), msg, msgmax, msgout); + + driverW = heap_strdupAtoW(driver); + if(!driverW) + { + push_error(ODBC_ERROR_OUT_OF_MEM, odbc_error_out_of_mem); + return FALSE; + } + if(request == ODBC_CONFIG_DRIVER) + { + BOOL ret = FALSE; + WCHAR *argsW = heap_strdupAtoW(args); + if(argsW) + { + ret = write_config_value(driverW, argsW); + HeapFree(GetProcessHeap(), 0, argsW); + } + else + { + push_error(ODBC_ERROR_OUT_OF_MEM, odbc_error_out_of_mem); + } + + HeapFree(GetProcessHeap(), 0, driverW); + + return ret; + } + + hmod = load_config_driver(driverW); + HeapFree(GetProcessHeap(), 0, driverW); + if(!hmod) + return FALSE; + + pConfigDriverA = (void*)GetProcAddress(hmod, "ConfigDriver"); + if(pConfigDriverA) + funcret = pConfigDriverA(hwnd, request, driver, args, msg, msgmax, msgout); + + if(!funcret) + push_error(ODBC_ERROR_REQUEST_FAILED, odbc_error_request_failed); + + FreeLibrary(hmod); + + return funcret; } BOOL WINAPI SQLCreateDataSourceW(HWND hwnd, LPCWSTR lpszDS) @@ -628,12 +813,117 @@ pcbPathOut, ODBC_INSTALL_COMPLETE, &usage); } +static void write_registry_values(const WCHAR *regkey, const WCHAR *driver, const WCHAR *path_in, WCHAR *path, + DWORD *usage_count) +{ + static const WCHAR installed[] = {'I','n','s','t','a','l','l','e','d',0}; + static const WCHAR slash[] = {'\\', 0}; + static const WCHAR driverW[] = {'D','r','i','v','e','r',0}; + static const WCHAR setupW[] = {'S','e','t','u','p',0}; + static const WCHAR translator[] = {'T','r','a','n','s','l','a','t','o','r',0}; + HKEY hkey, hkeydriver; + + if (RegCreateKeyW(HKEY_LOCAL_MACHINE, odbcini, &hkey) == ERROR_SUCCESS) + { + if (RegCreateKeyW(hkey, regkey, &hkeydriver) == ERROR_SUCCESS) + { + if(RegSetValueExW(hkeydriver, driver, 0, REG_SZ, (BYTE*)installed, sizeof(installed)) != ERROR_SUCCESS) + ERR("Failed to write registry installed key\n"); + + RegCloseKey(hkeydriver); + } + + if (RegCreateKeyW(hkey, driver, &hkeydriver) == ERROR_SUCCESS) + { + WCHAR entry[1024]; + const WCHAR *p; + DWORD usagecount = 0; + DWORD type, size; + + /* Skip name entry */ + p = driver; + p += lstrlenW(p) + 1; + + if (!path_in) + GetSystemDirectoryW(path, MAX_PATH); + else + lstrcpyW(path, path_in); + + /* Store Usage */ + size = sizeof(usagecount); + RegGetValueA(hkeydriver, NULL, "UsageCount", RRF_RT_DWORD, &type, &usagecount, &size); + TRACE("Usage count %d\n", usagecount); + + for (; *p; p += lstrlenW(p) + 1) + { + WCHAR *divider = strchrW(p,'='); + + if (divider) + { + WCHAR *value; + int len; + + /* Write pair values to the registry. */ + lstrcpynW(entry, p, divider - p + 1); + + divider++; + TRACE("Writing pair %s,%s\n", debugstr_w(entry), debugstr_w(divider)); + + /* Driver, Setup, Translator entries use the system path unless a path is specified. */ + if(lstrcmpiW(driverW, entry) == 0 || lstrcmpiW(setupW, entry) == 0 || + lstrcmpiW(translator, entry) == 0) + { + len = lstrlenW(path) + lstrlenW(slash) + lstrlenW(divider) + 1; + value = heap_alloc(len * sizeof(WCHAR)); + if(!value) + { + ERR("Out of memory\n"); + return; + } + + lstrcpyW(value, path); + lstrcatW(value, slash); + lstrcatW(value, divider); + } + else + { + len = lstrlenW(divider) + 1; + value = heap_alloc(len * sizeof(WCHAR)); + lstrcpyW(value, divider); + } + + if (RegSetValueExW(hkeydriver, entry, 0, REG_SZ, (BYTE*)value, + (lstrlenW(value)+1)*sizeof(WCHAR)) != ERROR_SUCCESS) + ERR("Failed to write registry data %s %s\n", debugstr_w(entry), debugstr_w(value)); + heap_free(value); + } + else + { + ERR("No pair found. %s\n", debugstr_w(p)); + break; + } + } + + /* Set Usage Count */ + usagecount++; + if (RegSetValueExA(hkeydriver, "UsageCount", 0, REG_DWORD, (BYTE*)&usagecount, sizeof(usagecount)) != ERROR_SUCCESS) + ERR("Failed to write registry UsageCount key\n"); + + if (usage_count) + *usage_count = usagecount; + + RegCloseKey(hkeydriver); + } + + RegCloseKey(hkey); + } +} + BOOL WINAPI SQLInstallDriverExW(LPCWSTR lpszDriver, LPCWSTR lpszPathIn, LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount) { UINT len; - LPCWSTR p; WCHAR path[MAX_PATH]; clear_errors(); @@ -641,15 +931,12 @@ debugstr_w(lpszPathIn), lpszPathOut, cbPathOutMax, pcbPathOut, fRequest, lpdwUsageCount); - for (p = lpszDriver; *p; p += lstrlenW(p) + 1) - TRACE("%s\n", debugstr_w(p)); - - len = GetSystemDirectoryW(path, MAX_PATH); + write_registry_values(odbcdrivers, lpszDriver, lpszPathIn, path, lpdwUsageCount); + + len = lstrlenW(path); if (pcbPathOut) *pcbPathOut = len; - - len = GetSystemDirectoryW(path, MAX_PATH); if (lpszPathOut && cbPathOutMax > len) { @@ -663,7 +950,6 @@ LPSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount) { - LPCSTR p; LPWSTR driver, pathin; WCHAR pathout[MAX_PATH]; BOOL ret; @@ -673,9 +959,6 @@ TRACE("%s %s %p %d %p %d %p\n", debugstr_a(lpszDriver), debugstr_a(lpszPathIn), lpszPathOut, cbPathOutMax, pcbPathOut, fRequest, lpdwUsageCount); - - for (p = lpszDriver; *p; p += lstrlenA(p) + 1) - TRACE("%s\n", debugstr_a(p)); driver = SQLInstall_strdup_multi(lpszDriver); pathin = SQLInstall_strdup(lpszPathIn); @@ -879,7 +1162,6 @@ WORD fRequest, LPDWORD lpdwUsageCount) { UINT len; - LPCWSTR p; WCHAR path[MAX_PATH]; clear_errors(); @@ -887,10 +1169,9 @@ debugstr_w(lpszPathIn), lpszPathOut, cbPathOutMax, pcbPathOut, fRequest, lpdwUsageCount); - for (p = lpszTranslator; *p; p += lstrlenW(p) + 1) - TRACE("%s\n", debugstr_w(p)); - - len = GetSystemDirectoryW(path, MAX_PATH); + write_registry_values(odbctranslators, lpszTranslator, lpszPathIn, path, lpdwUsageCount); + + len = lstrlenW(path); if (pcbPathOut) *pcbPathOut = len; @@ -1035,22 +1316,76 @@ return FALSE; } -BOOL WINAPI SQLRemoveDriverW(LPCWSTR lpszDriver, BOOL fRemoveDSN, - LPDWORD lpdwUsageCount) -{ - clear_errors(); - FIXME("%s %d %p\n", debugstr_w(lpszDriver), fRemoveDSN, lpdwUsageCount); - if (lpdwUsageCount) *lpdwUsageCount = 1; +BOOL WINAPI SQLRemoveDriverW(LPCWSTR drivername, BOOL remove_dsn, LPDWORD usage_count) +{ + HKEY hkey; + DWORD usagecount = 1; + + clear_errors(); + TRACE("%s %d %p\n", debugstr_w(drivername), remove_dsn, usage_count); + + if (RegOpenKeyW(HKEY_LOCAL_MACHINE, odbcini, &hkey) == ERROR_SUCCESS) + { + HKEY hkeydriver; + + if (RegOpenKeyW(hkey, drivername, &hkeydriver) == ERROR_SUCCESS) + { + DWORD size, type; + DWORD count; + + size = sizeof(usagecount); + RegGetValueA(hkeydriver, NULL, "UsageCount", RRF_RT_DWORD, &type, &usagecount, &size); + TRACE("Usage count %d\n", usagecount); + count = usagecount - 1; + if (count) + { + if (RegSetValueExA(hkeydriver, "UsageCount", 0, REG_DWORD, (BYTE*)&count, sizeof(count)) != ERROR_SUCCESS) + ERR("Failed to write registry UsageCount key\n"); + } + + RegCloseKey(hkeydriver); + } + + if (usagecount) + usagecount--; + + if (!usagecount) + { + if (RegDeleteKeyW(hkey, drivername) != ERROR_SUCCESS) + ERR("Failed to delete registry key: %s\n", debugstr_w(drivername)); + + if (RegOpenKeyW(hkey, odbcdrivers, &hkeydriver) == ERROR_SUCCESS) + { + if(RegDeleteValueW(hkeydriver, drivername) != ERROR_SUCCESS) + ERR("Failed to delete registry value: %s\n", debugstr_w(drivername)); + RegCloseKey(hkeydriver); + } + } + + RegCloseKey(hkey); + } + + if (usage_count) + *usage_count = usagecount; + return TRUE; } BOOL WINAPI SQLRemoveDriver(LPCSTR lpszDriver, BOOL fRemoveDSN, LPDWORD lpdwUsageCount) { - clear_errors(); - FIXME("%s %d %p\n", debugstr_a(lpszDriver), fRemoveDSN, lpdwUsageCount); - if (lpdwUsageCount) *lpdwUsageCount = 1; - return TRUE; + WCHAR *driver; + BOOL ret; + + clear_errors(); + TRACE("%s %d %p\n", debugstr_a(lpszDriver), fRemoveDSN, lpdwUsageCount); + + driver = SQLInstall_strdup(lpszDriver); + + ret = SQLRemoveDriverW(driver, fRemoveDSN, lpdwUsageCount); + + HeapFree(GetProcessHeap(), 0, driver); + return ret; } BOOL WINAPI SQLRemoveDriverManager(LPDWORD pdwUsageCount) @@ -1077,20 +1412,84 @@ return FALSE; } -BOOL WINAPI SQLRemoveTranslatorW(LPCWSTR lpszTranslator, LPDWORD lpdwUsageCount) -{ - clear_errors(); - FIXME("%s %p\n", debugstr_w(lpszTranslator), lpdwUsageCount); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; +BOOL WINAPI SQLRemoveTranslatorW(const WCHAR *translator, DWORD *usage_count) +{ + HKEY hkey; + DWORD usagecount = 1; + BOOL ret = TRUE; + + clear_errors(); + TRACE("%s %p\n", debugstr_w(translator), usage_count); + + if (RegOpenKeyW(HKEY_LOCAL_MACHINE, odbcini, &hkey) == ERROR_SUCCESS) + { + HKEY hkeydriver; + + if (RegOpenKeyW(hkey, translator, &hkeydriver) == ERROR_SUCCESS) + { + DWORD size, type; + DWORD count; + + size = sizeof(usagecount); + RegGetValueA(hkeydriver, NULL, "UsageCount", RRF_RT_DWORD, &type, &usagecount, &size); + TRACE("Usage count %d\n", usagecount); + count = usagecount - 1; + if (count) + { + if (RegSetValueExA(hkeydriver, "UsageCount", 0, REG_DWORD, (BYTE*)&count, sizeof(count)) != ERROR_SUCCESS) + ERR("Failed to write registry UsageCount key\n"); + } + + RegCloseKey(hkeydriver); + } + + if (usagecount) + usagecount--; + + if (!usagecount) + { + if(RegDeleteKeyW(hkey, translator) != ERROR_SUCCESS) + { + push_error(ODBC_ERROR_COMPONENT_NOT_FOUND, odbc_error_component_not_found); + WARN("Failed to delete registry key: %s\n", debugstr_w(translator)); + ret = FALSE; + } + + if (ret && RegOpenKeyW(hkey, odbctranslators, &hkeydriver) == ERROR_SUCCESS) + { + if(RegDeleteValueW(hkeydriver, translator) != ERROR_SUCCESS) + { + push_error(ODBC_ERROR_COMPONENT_NOT_FOUND, odbc_error_component_not_found); + WARN("Failed to delete registry key: %s\n", debugstr_w(translator)); + ret = FALSE; + } + + RegCloseKey(hkeydriver); + } + } + + RegCloseKey(hkey); + } + + if (ret && usage_count) + *usage_count = usagecount; + + return ret; } BOOL WINAPI SQLRemoveTranslator(LPCSTR lpszTranslator, LPDWORD lpdwUsageCount) { - clear_errors(); - FIXME("%s %p\n", debugstr_a(lpszTranslator), lpdwUsageCount); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + WCHAR *translator; + BOOL ret; + + clear_errors(); + TRACE("%s %p\n", debugstr_a(lpszTranslator), lpdwUsageCount); + + translator = SQLInstall_strdup(lpszTranslator); + ret = SQLRemoveTranslatorW(translator, lpdwUsageCount); + + HeapFree(GetProcessHeap(), 0, translator); + return ret; } BOOL WINAPI SQLSetConfigMode(UWORD wConfigMode) Modified: trunk/reactos/dll/win32/odbccp32/odbccp32.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbccp32/odbccp3…
============================================================================== --- trunk/reactos/dll/win32/odbccp32/odbccp32.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/odbccp32/odbccp32.spec [iso-8859-1] Sat Jun 3 22:32:52 2017 @@ -19,7 +19,7 @@ 20 stdcall SQLRemoveDriver(str long ptr) 21 stdcall SQLConfigDriver(ptr long str str ptr long ptr) 22 stdcall SQLInstallerError(long ptr ptr long ptr) -23 stdcall SQLPostInstallerError(long ptr) +23 stdcall SQLPostInstallerError(long str) 24 stdcall SQLReadFileDSN(str str str ptr long ptr) 25 stdcall SQLWriteFileDSN(str str str str) 26 stdcall SQLInstallDriverEx(str str str long ptr long ptr) @@ -47,7 +47,7 @@ 220 stdcall SQLRemoveDriverW(wstr long ptr) 221 stdcall SQLConfigDriverW(ptr long wstr wstr ptr long ptr) 222 stdcall SQLInstallerErrorW(long ptr ptr long ptr) -223 stdcall SQLPostInstallerErrorW(long ptr) +223 stdcall SQLPostInstallerErrorW(long wstr) 224 stdcall SQLReadFileDSNW(wstr wstr wstr ptr long ptr) 225 stdcall SQLWriteFileDSNW(wstr wstr wstr wstr) 226 stdcall SQLInstallDriverExW(wstr wstr wstr long ptr long ptr) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:32:52 2017 @@ -138,7 +138,7 @@ reactos/dll/win32/ntdsapi # Synced to WineStaging-1.9.11 reactos/dll/win32/objsel # Synced to WineStaging-1.9.11 reactos/dll/win32/odbc32 # Synced to WineStaging-2.9. Depends on port of Linux ODBC. -reactos/dll/win32/odbccp32 # Synced to WineStaging-1.9.11 +reactos/dll/win32/odbccp32 # Synced to WineStaging-2.9 reactos/dll/win32/ole32 # Synced to WineStaging-2.2 reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11 reactos/dll/win32/oleaut32 # Synced to WineStaging-2.2
7 years, 6 months
1
0
0
0
[akhaldi] 74826: [PSDK] Update sql.h and sqlucode.h. CORE-13362 [ODBC32] Sync with Wine Staging 2.9. CORE-13362 0dd43e9 odbc32: Made ODBC function signatures 64-bit compliant.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:32:33 2017 New Revision: 74826 URL:
http://svn.reactos.org/svn/reactos?rev=74826&view=rev
Log: [PSDK] Update sql.h and sqlucode.h. CORE-13362 [ODBC32] Sync with Wine Staging 2.9. CORE-13362 0dd43e9 odbc32: Made ODBC function signatures 64-bit compliant. Modified: trunk/reactos/dll/win32/odbc32/proxyodbc.c trunk/reactos/media/doc/README.WINE trunk/reactos/sdk/include/psdk/sql.h trunk/reactos/sdk/include/psdk/sqlucode.h Modified: trunk/reactos/dll/win32/odbc32/proxyodbc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbc32/proxyodbc…
============================================================================== --- trunk/reactos/dll/win32/odbc32/proxyodbc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/odbc32/proxyodbc.c [iso-8859-1] Sat Jun 3 22:32:33 2017 @@ -61,18 +61,18 @@ static SQLRETURN (*pSQLAllocHandle)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*); static SQLRETURN (*pSQLAllocHandleStd)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*); static SQLRETURN (*pSQLAllocStmt)(SQLHDBC,SQLHSTMT*); -static SQLRETURN (*pSQLBindCol)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLLEN*); -static SQLRETURN (*pSQLBindParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLUINTEGER,SQLSMALLINT,SQLPOINTER,SQLINTEGER*); -static SQLRETURN (*pSQLBindParameter)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLUINTEGER,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*); +static SQLRETURN (*pSQLBindCol)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); +static SQLRETURN (*pSQLBindParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*); +static SQLRETURN (*pSQLBindParameter)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); static SQLRETURN (*pSQLBrowseConnect)(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); static SQLRETURN (*pSQLBrowseConnectW)(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); static SQLRETURN (*pSQLBulkOperations)(SQLHSTMT,SQLSMALLINT); static SQLRETURN (*pSQLCancel)(SQLHSTMT); static SQLRETURN (*pSQLCloseCursor)(SQLHSTMT); -static SQLRETURN (*pSQLColAttribute)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER); -static SQLRETURN (*pSQLColAttributeW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER); -static SQLRETURN (*pSQLColAttributes)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLINTEGER*); -static SQLRETURN (*pSQLColAttributesW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER); +static SQLRETURN (*pSQLColAttribute)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); +static SQLRETURN (*pSQLColAttributeW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); +static SQLRETURN (*pSQLColAttributes)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); +static SQLRETURN (*pSQLColAttributesW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); static SQLRETURN (*pSQLColumnPrivileges)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLColumnPrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLColumns)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); @@ -83,9 +83,9 @@ static SQLRETURN (*pSQLDataSources)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); static SQLRETURN (*pSQLDataSourcesA)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); static SQLRETURN (*pSQLDataSourcesW)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); -static SQLRETURN (*pSQLDescribeCol)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLUINTEGER*,SQLSMALLINT*,SQLSMALLINT*); +static SQLRETURN (*pSQLDescribeCol)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*); static SQLRETURN (*pSQLDescribeColW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*); -static SQLRETURN (*pSQLDescribeParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT*,SQLUINTEGER*,SQLSMALLINT*,SQLSMALLINT*); +static SQLRETURN (*pSQLDescribeParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*); static SQLRETURN (*pSQLDisconnect)(SQLHDBC); static SQLRETURN (*pSQLDriverConnect)(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT); static SQLRETURN (*pSQLDriverConnectW)(SQLHDBC,SQLHWND,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT); @@ -97,9 +97,9 @@ static SQLRETURN (*pSQLExecDirect)(SQLHSTMT,SQLCHAR*,SQLINTEGER); static SQLRETURN (*pSQLExecDirectW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER); static SQLRETURN (*pSQLExecute)(SQLHSTMT); -static SQLRETURN (*pSQLExtendedFetch)(SQLHSTMT,SQLUSMALLINT,SQLINTEGER,SQLUINTEGER*,SQLUSMALLINT*); +static SQLRETURN (*pSQLExtendedFetch)(SQLHSTMT,SQLUSMALLINT,SQLLEN,SQLULEN*,SQLUSMALLINT*); static SQLRETURN (*pSQLFetch)(SQLHSTMT); -static SQLRETURN (*pSQLFetchScroll)(SQLHSTMT,SQLSMALLINT,SQLINTEGER); +static SQLRETURN (*pSQLFetchScroll)(SQLHSTMT,SQLSMALLINT,SQLLEN); static SQLRETURN (*pSQLForeignKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLForeignKeysW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLFreeConnect)(SQLHDBC); @@ -112,10 +112,10 @@ static SQLRETURN (*pSQLGetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLPOINTER); static SQLRETURN (*pSQLGetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); static SQLRETURN (*pSQLGetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); -static SQLRETURN (*pSQLGetData)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*); +static SQLRETURN (*pSQLGetData)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); static SQLRETURN (*pSQLGetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*); static SQLRETURN (*pSQLGetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*); -static SQLRETURN (*pSQLGetDescRec)(SQLHDESC,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLINTEGER*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*); +static SQLRETURN (*pSQLGetDescRec)(SQLHDESC,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*); static SQLRETURN (*pSQLGetDescRecW)(SQLHDESC,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*); static SQLRETURN (*pSQLGetDiagField)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); static SQLRETURN (*pSQLGetDiagFieldW)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); @@ -136,7 +136,7 @@ static SQLRETURN (*pSQLNumParams)(SQLHSTMT,SQLSMALLINT*); static SQLRETURN (*pSQLNumResultCols)(SQLHSTMT,SQLSMALLINT*); static SQLRETURN (*pSQLParamData)(SQLHSTMT,SQLPOINTER*); -static SQLRETURN (*pSQLParamOptions)(SQLHSTMT,SQLUINTEGER,SQLUINTEGER*); +static SQLRETURN (*pSQLParamOptions)(SQLHSTMT,SQLULEN,SQLULEN*); static SQLRETURN (*pSQLPrepare)(SQLHSTMT,SQLCHAR*,SQLINTEGER); static SQLRETURN (*pSQLPrepareW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER); static SQLRETURN (*pSQLPrimaryKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); @@ -145,24 +145,24 @@ static SQLRETURN (*pSQLProcedureColumnsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLProcedures)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLProceduresW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); -static SQLRETURN (*pSQLPutData)(SQLHSTMT,SQLPOINTER,SQLINTEGER); -static SQLRETURN (*pSQLRowCount)(SQLHSTMT,SQLINTEGER*); +static SQLRETURN (*pSQLPutData)(SQLHSTMT,SQLPOINTER,SQLLEN); +static SQLRETURN (*pSQLRowCount)(SQLHSTMT,SQLLEN*); static SQLRETURN (*pSQLSetConnectAttr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER); static SQLRETURN (*pSQLSetConnectAttrW)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER); -static SQLRETURN (*pSQLSetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLUINTEGER); +static SQLRETURN (*pSQLSetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLULEN); static SQLRETURN (*pSQLSetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLULEN); static SQLRETURN (*pSQLSetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLSetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT); static SQLRETURN (*pSQLSetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER); static SQLRETURN (*pSQLSetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER); -static SQLRETURN (*pSQLSetDescRec)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLINTEGER,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER*,SQLINTEGER*); +static SQLRETURN (*pSQLSetDescRec)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLLEN,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN*,SQLLEN*); static SQLRETURN (*pSQLSetEnvAttr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER); -static SQLRETURN (*pSQLSetParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLUINTEGER,SQLSMALLINT,SQLPOINTER,SQLINTEGER*); -static SQLRETURN (*pSQLSetPos)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLUSMALLINT); -static SQLRETURN (*pSQLSetScrollOptions)(SQLHSTMT,SQLUSMALLINT,SQLINTEGER,SQLUSMALLINT); +static SQLRETURN (*pSQLSetParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*); +static SQLRETURN (*pSQLSetPos)(SQLHSTMT,SQLSETPOSIROW,SQLUSMALLINT,SQLUSMALLINT); +static SQLRETURN (*pSQLSetScrollOptions)(SQLHSTMT,SQLUSMALLINT,SQLLEN,SQLUSMALLINT); static SQLRETURN (*pSQLSetStmtAttr)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER); static SQLRETURN (*pSQLSetStmtAttrW)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER); -static SQLRETURN (*pSQLSetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLUINTEGER); +static SQLRETURN (*pSQLSetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLULEN); static SQLRETURN (*pSQLSpecialColumns)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); static SQLRETURN (*pSQLSpecialColumnsW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); static SQLRETURN (*pSQLStatistics)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); @@ -871,7 +871,7 @@ SQLRETURN WINAPI SQLColAttribute (SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute) + SQLSMALLINT *StringLength, SQLLEN *NumericAttribute) { TRACE("\n"); @@ -1666,7 +1666,7 @@ SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, - SQLLEN *pfDesc) + SQLLEN *pfDesc) { TRACE("\n"); @@ -1704,7 +1704,7 @@ SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, - SQLULEN *pcbParamDef, + SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable) { @@ -1721,8 +1721,8 @@ SQLRETURN WINAPI SQLExtendedFetch( SQLHSTMT hstmt, SQLUSMALLINT fFetchType, - SQLINTEGER irow, - SQLUINTEGER *pcrow, + SQLLEN irow, + SQLULEN *pcrow, SQLUSMALLINT *rgfRowStatus) { TRACE("\n"); @@ -1808,8 +1808,8 @@ */ SQLRETURN WINAPI SQLParamOptions( SQLHSTMT hstmt, - SQLUINTEGER crow, - SQLUINTEGER *pirow) + SQLULEN crow, + SQLULEN *pirow) { TRACE("\n"); @@ -1885,7 +1885,7 @@ */ SQLRETURN WINAPI SQLSetPos( SQLHSTMT hstmt, - SQLUSMALLINT irow, + SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock) { @@ -1954,11 +1954,11 @@ SQLSMALLINT fParamType, SQLSMALLINT fCType, SQLSMALLINT fSqlType, - SQLULEN cbColDef, + SQLULEN cbColDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, - SQLLEN cbValueMax, - SQLLEN *pcbValue) + SQLLEN cbValueMax, + SQLLEN *pcbValue) { TRACE("\n"); @@ -2000,7 +2000,7 @@ SQLRETURN WINAPI SQLSetScrollOptions( SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, - SQLLEN crow_keyset, + SQLLEN crow_keyset, SQLUSMALLINT crow_rowset ) { TRACE("\n"); @@ -2049,7 +2049,7 @@ SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, - SQLLEN *pfDesc) + SQLLEN *pfDesc) { SQLRETURN iResult; @@ -2192,7 +2192,7 @@ SQLRETURN WINAPI SQLColAttributeW (SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute) + SQLSMALLINT *StringLength, SQLLEN *NumericAttribute) { SQLRETURN iResult; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:32:33 2017 @@ -137,7 +137,7 @@ reactos/dll/win32/npptools # Synced to WineStaging-1.9.11 reactos/dll/win32/ntdsapi # Synced to WineStaging-1.9.11 reactos/dll/win32/objsel # Synced to WineStaging-1.9.11 -reactos/dll/win32/odbc32 # Synced to WineStaging-2.2. Depends on port of Linux ODBC. +reactos/dll/win32/odbc32 # Synced to WineStaging-2.9. Depends on port of Linux ODBC. reactos/dll/win32/odbccp32 # Synced to WineStaging-1.9.11 reactos/dll/win32/ole32 # Synced to WineStaging-2.2 reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11 Modified: trunk/reactos/sdk/include/psdk/sql.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/sql.h?rev…
============================================================================== --- trunk/reactos/sdk/include/psdk/sql.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/sql.h [iso-8859-1] Sat Jun 3 22:32:33 2017 @@ -378,7 +378,7 @@ SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT,SQLHANDLE,SQLHANDLE*); SQLRETURN SQL_API SQLBindParam(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*); SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT); -SQLRETURN SQL_API SQLColAttribute(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER); +SQLRETURN SQL_API SQLColAttribute(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); SQLRETURN SQL_API SQLCopyDesc(SQLHDESC,SQLHDESC); SQLRETURN SQL_API SQLEndTran(SQLSMALLINT,SQLHANDLE,SQLSMALLINT); SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT,SQLSMALLINT,SQLLEN); Modified: trunk/reactos/sdk/include/psdk/sqlucode.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/sqlucode.…
============================================================================== --- trunk/reactos/sdk/include/psdk/sqlucode.h [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/sqlucode.h [iso-8859-1] Sat Jun 3 22:32:33 2017 @@ -18,8 +18,8 @@ #ifndef RC_INVOKED SQLRETURN SQL_API SQLBrowseConnectA(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); SQLRETURN SQL_API SQLBrowseConnectW(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); -SQLRETURN SQL_API SQLColAttributeA(SQLHSTMT,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER); -SQLRETURN SQL_API SQLColAttributeW(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLPOINTER); +SQLRETURN SQL_API SQLColAttributeA(SQLHSTMT,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); +SQLRETURN SQL_API SQLColAttributeW(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); SQLRETURN SQL_API SQLColAttributesA(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); SQLRETURN SQL_API SQLColAttributesW(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); SQLRETURN SQL_API SQLColumnPrivilegesA( SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT ,SQLCHAR*,SQLSMALLINT );
7 years, 6 months
1
0
0
0
[akhaldi] 74825: [NTPRINT_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:32:11 2017 New Revision: 74825 URL:
http://svn.reactos.org/svn/reactos?rev=74825&view=rev
Log: [NTPRINT_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/ntprint/ntprint.c Modified: trunk/rostests/winetests/ntprint/ntprint.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntprint/ntprint…
============================================================================== --- trunk/rostests/winetests/ntprint/ntprint.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntprint/ntprint.c [iso-8859-1] Sat Jun 3 22:32:11 2017 @@ -32,7 +32,7 @@ /* ##### */ static HMODULE hdll; -static HANDLE (WINAPI *pPSetupCreateMonitorInfo)(LPVOID, LPVOID, LPVOID); +static HANDLE (WINAPI *pPSetupCreateMonitorInfo)(DWORD, const WCHAR *); static VOID (WINAPI *pPSetupDestroyMonitorInfo)(HANDLE); static BOOL (WINAPI *pPSetupEnumMonitor)(HANDLE, DWORD, LPWSTR, LPDWORD); @@ -66,10 +66,12 @@ static void test_PSetupCreateMonitorInfo(VOID) { HANDLE mi; - BYTE buffer[1024] ; - - SetLastError(0xdeadbeef); - mi = pPSetupCreateMonitorInfo(NULL, NULL, NULL); + WCHAR buffer[1024] = {'\\','\\'}; + UINT len = sizeof(buffer) / sizeof(buffer[0]) - 2; + GetComputerNameW(buffer + 2, &len); + + SetLastError(0xdeadbeef); + mi = pPSetupCreateMonitorInfo(0, NULL); if (!mi && (GetLastError() == RPC_S_SERVER_UNAVAILABLE)) { win_skip("The service 'Spooler' is required for many tests\n"); return; @@ -77,13 +79,18 @@ ok( mi != NULL, "got %p with %u (expected '!= NULL')\n", mi, GetLastError()); if (mi) pPSetupDestroyMonitorInfo(mi); - - memset(buffer, 0, sizeof(buffer)); - SetLastError(0xdeadbeef); - mi = pPSetupCreateMonitorInfo(buffer, NULL, NULL); + SetLastError(0xdeadbeef); + mi = pPSetupCreateMonitorInfo(0, buffer); ok( mi != NULL, "got %p with %u (expected '!= NULL')\n", mi, GetLastError()); if (mi) pPSetupDestroyMonitorInfo(mi); + SetLastError(0xdeadbeef); + mi = pPSetupCreateMonitorInfo(0, buffer + 1); + todo_wine { + ok( mi == NULL, "got %p\n", mi ); + ok( GetLastError() == ERROR_INVALID_NAME, "got %d\n", GetLastError() ); + } + if (mi) pPSetupDestroyMonitorInfo(mi); } /* ########################### */ @@ -99,7 +106,7 @@ trace("returned with %u\n", GetLastError()); SetLastError(0xdeadbeef); - mi = pPSetupCreateMonitorInfo(NULL, NULL, NULL); + mi = pPSetupCreateMonitorInfo(0, NULL); if (!mi && (GetLastError() == RPC_S_SERVER_UNAVAILABLE)) { win_skip("The service 'Spooler' is required for many tests\n"); return; @@ -134,7 +141,7 @@ DWORD index=0; SetLastError(0xdeadbeef); - mi = pPSetupCreateMonitorInfo(NULL, NULL, NULL); + mi = pPSetupCreateMonitorInfo(0, NULL); if (!mi) { skip("PSetupCreateMonitorInfo\n"); return;
7 years, 6 months
1
0
0
0
[akhaldi] 74824: [NETAPI32_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:31:54 2017 New Revision: 74824 URL:
http://svn.reactos.org/svn/reactos?rev=74824&view=rev
Log: [NETAPI32_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/netapi32/access.c Modified: trunk/rostests/winetests/netapi32/access.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/netapi32/access…
============================================================================== --- trunk/rostests/winetests/netapi32/access.c [iso-8859-1] (original) +++ trunk/rostests/winetests/netapi32/access.c [iso-8859-1] Sat Jun 3 22:31:54 2017 @@ -66,6 +66,7 @@ static NET_API_STATUS (WINAPI *pNetLocalGroupGetInfo)(LPCWSTR,LPCWSTR,DWORD,LPBYTE*); static NET_API_STATUS (WINAPI *pNetLocalGroupGetMembers)(LPCWSTR,LPCWSTR,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD,PDWORD_PTR); static DWORD (WINAPI *pDavGetHTTPFromUNCPath)(LPCWSTR,LPWSTR,LPDWORD); +static DWORD (WINAPI *pDavGetUNCFromHTTPPath)(LPCWSTR,LPWSTR,LPDWORD); static BOOL init_access_tests(void) { @@ -550,6 +551,156 @@ } } +static void test_DavGetUNCFromHTTPPath(void) +{ + static const WCHAR path[] = + {0}; + static const WCHAR path2[] = + {'h','t','t','p',':','/','/','s','e','r','v','e','r','/','p','a','t','h',0}; + static const WCHAR path3[] = + {'h','t','t','p','s',':','/','/','h','o','s','t','/','p','a','t','h',0}; + static const WCHAR path4[] = + {'\\','\\','s','e','r','v','e','r',0}; + static const WCHAR path5[] = + {'\\','\\','s','e','r','v','e','r','\\','p','a','t','h',0}; + static const WCHAR path6[] = + {'\\','\\','h','t','t','p',':','/','/','s','e','r','v','e','r','/','p','a','t','h',0}; + static const WCHAR path7[] = + {'h','t','t','p',':','/','/',0}; + static const WCHAR path8[] = + {'h','t','t','p',':',0}; + static const WCHAR path9[] = + {'h','t','t','p',0}; + static const WCHAR path10[] = + {'h','t','t','p',':','s','e','r','v','e','r',0}; + static const WCHAR path11[] = + {'h','t','t','p',':','/','/','s','e','r','v','e','r',':','8','0',0}; + static const WCHAR path12[] = + {'h','t','t','p',':','/','/','s','e','r','v','e','r',':','8','1',0}; + static const WCHAR path13[] = + {'h','t','t','p','s',':','/','/','s','e','r','v','e','r',':','8','0',0}; + static const WCHAR path14[] = + {'H','T','T','P',':','/','/','s','e','r','v','e','r','/','p','a','t','h',0}; + static const WCHAR path15[] = + {'h','t','t','p',':','/','/','s','e','r','v','e','r',':','6','5','5','3','7',0}; + static const WCHAR path16[] = + {'h','t','t','p',':','/','/','s','e','r','v','e','r','/','p','a','t','h','/',0}; + static const WCHAR path17[] = + {'h','t','t','p',':','/','/','s','e','r','v','e','r','/','p','a','t','h','/','/',0}; + static const WCHAR path18[] = + {'h','t','t','p',':','/','/','s','e','r','v','e','r',':','/','p','a','t','h',0}; + static const WCHAR path19[] = + {'h','t','t','p',':','/','/','s','e','r','v','e','r',0}; + static const WCHAR path20[] = + {'h','t','t','p','s',':','/','/','s','e','r','v','e','r',':','4','4','3',0}; + static const WCHAR path21[] = + {'h','t','t','p','s',':','/','/','s','e','r','v','e','r',':','8','0',0}; + static const WCHAR result[] = + {'\\','\\','s','e','r','v','e','r','\\','D','a','v','W','W','W','R','o','o','t','\\','p','a','t','h',0}; + static const WCHAR result2[] = + {'\\','\\','h','o','s','t','@','S','S','L','\\','D','a','v','W','W','W','R','o','o','t','\\', + 'p','a','t','h',0}; + static const WCHAR result3[] = + {'\\','\\','s','e','r','v','e','r','\\','D','a','v','W','W','W','R','o','o','t',0}; + static const WCHAR result4[] = + {'\\','\\','s','e','r','v','e','r','@','8','1','\\','D','a','v','W','W','W','R','o','o','t',0}; + static const WCHAR result5[] = + {'\\','\\','s','e','r','v','e','r','@','S','S','L','@','8','0','\\','D','a','v','W','W','W','R','o','o','t',0}; + static const WCHAR result6[] = + {'\\','\\','s','e','r','v','e','r','@','6','5','5','3','7','\\','D','a','v','W','W','W','R','o','o','t',0}; + static const WCHAR result7[] = + {'\\','\\','s','e','r','v','e','r','@','\\','D','a','v','W','W','W','R','o','o','t','\\','p','a','t','h',0}; + static const WCHAR result8[] = + {'\\','\\','s','e','r','v','e','r','@','S','S','L','\\','D','a','v','W','W','W','R','o','o','t',0}; + static const WCHAR result9[] = + {'\\','\\','s','e','r','v','e','r','@','S','S','L','@','8','0','\\','D','a','v','W','W','W','R','o','o','t',0}; + static const struct + { + const WCHAR *path; + DWORD size; + DWORD ret; + const WCHAR *ret_path; + DWORD ret_size; + } + tests[] = + { + { path, MAX_PATH, ERROR_INVALID_PARAMETER, NULL, MAX_PATH }, + { path2, MAX_PATH, ERROR_SUCCESS, result, 25 }, + { path3, MAX_PATH, ERROR_SUCCESS, result2, 27 }, + { path4, MAX_PATH, ERROR_INVALID_PARAMETER, NULL, MAX_PATH }, + { path5, MAX_PATH, ERROR_INVALID_PARAMETER, NULL, MAX_PATH }, + { path6, MAX_PATH, ERROR_INVALID_PARAMETER, NULL, MAX_PATH }, + { path7, MAX_PATH, ERROR_BAD_NET_NAME, NULL, MAX_PATH }, + { path8, MAX_PATH, ERROR_INVALID_PARAMETER, NULL, MAX_PATH }, + { path9, MAX_PATH, ERROR_INVALID_PARAMETER, NULL, MAX_PATH }, + { path10, MAX_PATH, ERROR_INVALID_PARAMETER, NULL, MAX_PATH }, + { path11, MAX_PATH, ERROR_SUCCESS, result3, 20 }, + { path12, MAX_PATH, ERROR_SUCCESS, result4, 23 }, + { path13, MAX_PATH, ERROR_SUCCESS, result5, 27 }, + { path14, MAX_PATH, ERROR_SUCCESS, result, 25 }, + { path15, MAX_PATH, ERROR_SUCCESS, result6, 26 }, + { path16, MAX_PATH, ERROR_SUCCESS, result, 25 }, + { path17, MAX_PATH, ERROR_BAD_NET_NAME, NULL, MAX_PATH }, + { path18, MAX_PATH, ERROR_SUCCESS, result7, 26 }, + { path19, MAX_PATH, ERROR_SUCCESS, result3, 20 }, + { path20, MAX_PATH, ERROR_SUCCESS, result8, 24 }, + { path21, MAX_PATH, ERROR_SUCCESS, result9, 27 }, + }; + WCHAR buf[MAX_PATH]; + DWORD i, ret, size; + + if (!pDavGetUNCFromHTTPPath) + { + win_skip( "DavGetUNCFromHTTPPath is missing\n" ); + return; + } + + if (0) { /* crash */ + ret = pDavGetUNCFromHTTPPath( NULL, NULL, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + } + ret = pDavGetUNCFromHTTPPath( path, buf, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + size = 0; + ret = pDavGetUNCFromHTTPPath( path, NULL, &size ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + buf[0] = 0; + size = 0; + ret = pDavGetUNCFromHTTPPath( path, buf, &size ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + + if (0) { /* crash */ + ret = pDavGetUNCFromHTTPPath( path2, buf, NULL ); + ok( ret == ERROR_INVALID_PARAMETER, "got %u\n", ret ); + } + size = 0; + ret = pDavGetUNCFromHTTPPath( path2, NULL, &size ); + ok( ret == ERROR_INSUFFICIENT_BUFFER, "got %u\n", ret ); + + buf[0] = 0; + size = 0; + ret = pDavGetUNCFromHTTPPath( path2, buf, &size ); + 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++) + { + buf[0] = 0; + size = tests[i].size; + ret = pDavGetUNCFromHTTPPath( tests[i].path, buf, &size ); + ok( ret == tests[i].ret, "%u: expected %u got %u\n", i, tests[i].ret, ret ); + if (tests[i].ret_path) + { + ok( !lstrcmpW( buf, tests[i].ret_path ), "%u: expected %s got %s\n", + i, wine_dbgstr_w(tests[i].ret_path), wine_dbgstr_w(buf) ); + } + ok( size == tests[i].ret_size, "%u: expected %u got %u\n", i, tests[i].ret_size, size ); + } +} + + START_TEST(access) { HMODULE hnetapi32=LoadLibraryA("netapi32.dll"); @@ -564,6 +715,7 @@ pNetLocalGroupGetInfo=(void*)GetProcAddress(hnetapi32, "NetLocalGroupGetInfo"); pNetLocalGroupGetMembers=(void*)GetProcAddress(hnetapi32, "NetLocalGroupGetMembers"); pDavGetHTTPFromUNCPath = (void*)GetProcAddress(hnetapi32, "DavGetHTTPFromUNCPath"); + pDavGetUNCFromHTTPPath = (void*)GetProcAddress(hnetapi32, "DavGetUNCFromHTTPPath"); /* These functions were introduced with NT. It's safe to assume that * if one is not available, none are. @@ -583,5 +735,6 @@ } test_DavGetHTTPFromUNCPath(); + test_DavGetUNCFromHTTPPath(); FreeLibrary(hnetapi32); }
7 years, 6 months
1
0
0
0
[akhaldi] 74823: [MSXML3_WINETEST] Sync with Wine Staging 2.9. CORE-13362
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:31:39 2017 New Revision: 74823 URL:
http://svn.reactos.org/svn/reactos?rev=74823&view=rev
Log: [MSXML3_WINETEST] Sync with Wine Staging 2.9. CORE-13362 Modified: trunk/rostests/winetests/msxml3/domdoc.c trunk/rostests/winetests/msxml3/saxreader.c trunk/rostests/winetests/msxml3/xmlview.c Modified: trunk/rostests/winetests/msxml3/domdoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/domdoc.c…
============================================================================== --- trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] Sat Jun 3 22:31:39 2017 @@ -43,7 +43,8 @@ #include <msxml2did.h> #include <dispex.h> #include <objsafe.h> -//#include "initguid.h" +#include <initguid.h> +#include <asptlb.h> /* undef the #define in msxml2 so that we can access all versions */ #undef CLSID_DOMDocument @@ -353,6 +354,305 @@ }; static IStream savestream = { &StreamVtbl }; + +static HRESULT WINAPI response_QI(IResponse *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(&IID_IResponse, riid) || + IsEqualIID(&IID_IDispatch, riid) || + IsEqualIID(&IID_IUnknown, riid)) + { + *obj = iface; + return S_OK; + } + + if (!IsEqualIID(&IID_IStream, riid) && !IsEqualIID(&IID_ISequentialStream, riid)) + ok(0, "unexpected call\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI response_AddRef(IResponse *iface) +{ + return 2; +} + +static ULONG WINAPI response_Release(IResponse *iface) +{ + return 1; +} + +static HRESULT WINAPI response_GetTypeInfoCount(IResponse *iface, UINT *count) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_GetTypeInfo(IResponse *iface, UINT ti, LCID lcid, ITypeInfo **tinfo) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_GetIDsOfNames(IResponse *iface, REFIID riid, LPOLESTR *names, + UINT cnames, LCID lcid, DISPID *rgDispId) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_Invoke(IResponse *iface, DISPID dispid, REFIID riid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *ei, UINT *argerr) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_Buffer(IResponse *iface, VARIANT_BOOL *fIsBuffering) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_put_Buffer(IResponse *iface, VARIANT_BOOL fIsBuffering) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_ContentType(IResponse *iface, BSTR *pbstrContentTypeRet) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_put_ContentType(IResponse *iface, BSTR bstrContentType) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_Expires(IResponse *iface, VARIANT *pvarExpiresMinutesRet) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_put_Expires(IResponse *iface, LONG lExpiresMinutes) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_ExpiresAbsolute(IResponse *iface, VARIANT *pvarExpiresRet) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_put_ExpiresAbsolute(IResponse *iface, DATE dtExpires) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_Cookies(IResponse *iface, IRequestDictionary **ppCookies) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_Status(IResponse *iface, BSTR *pbstrStatusRet) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_put_Status(IResponse *iface, BSTR bstrStatus) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_Add(IResponse *iface, BSTR bstrHeaderValue, BSTR bstrHeaderName) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_AddHeader(IResponse *iface, BSTR bstrHeaderName, BSTR bstrHeaderValue) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_AppendToLog(IResponse *iface, BSTR bstrLogEntry) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_BinaryWrite(IResponse *iface, VARIANT input) +{ + HRESULT hr; + LONG bound; + UINT dim; + + ok(V_VT(&input) == (VT_ARRAY | VT_UI1), "got wrong input type %x\n", V_VT(&input)); + + dim = SafeArrayGetDim(V_ARRAY(&input)); + ok(dim == 1, "got wrong array dimensions %u\n", dim); + + bound = 1; + hr = SafeArrayGetLBound(V_ARRAY(&input), 1, &bound); + ok(hr == S_OK, "got %#x\n", hr); + ok(bound == 0, "wrong array low bound %d\n", bound); + + bound = 0; + hr = SafeArrayGetUBound(V_ARRAY(&input), 1, &bound); + ok(hr == S_OK, "got %#x\n", hr); + ok(bound > 0, "wrong array high bound %d\n", bound); + + return E_NOTIMPL; +} + +static HRESULT WINAPI response_Clear(IResponse *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_End(IResponse *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_Flush(IResponse *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_Redirect(IResponse *iface, BSTR bstrURL) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_Write(IResponse *iface, VARIANT varText) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_WriteBlock(IResponse *iface, short iBlockNumber) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_IsClientConnected(IResponse *iface, VARIANT_BOOL *pfIsClientConnected) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_CharSet(IResponse *iface, BSTR *pbstrCharSetRet) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_put_CharSet(IResponse *iface, BSTR bstrCharSet) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_Pics(IResponse *iface, BSTR bstrHeaderValue) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_CacheControl(IResponse *iface, BSTR *pbstrCacheControl) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_put_CacheControl(IResponse *iface, BSTR bstrCacheControl) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_CodePage(IResponse *iface, LONG *plvar) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_put_CodePage(IResponse *iface, LONG codepage) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_get_LCID(IResponse *iface, LONG *lcid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI response_put_LCID(IResponse *iface, LONG lcid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IResponseVtbl testresponsevtbl = +{ + response_QI, + response_AddRef, + response_Release, + response_GetTypeInfoCount, + response_GetTypeInfo, + response_GetIDsOfNames, + response_Invoke, + response_get_Buffer, + response_put_Buffer, + response_get_ContentType, + response_put_ContentType, + response_get_Expires, + response_put_Expires, + response_get_ExpiresAbsolute, + response_put_ExpiresAbsolute, + response_get_Cookies, + response_get_Status, + response_put_Status, + response_Add, + response_AddHeader, + response_AppendToLog, + response_BinaryWrite, + response_Clear, + response_End, + response_Flush, + response_Redirect, + response_Write, + response_WriteBlock, + response_IsClientConnected, + response_get_CharSet, + response_put_CharSet, + response_Pics, + response_get_CacheControl, + response_put_CacheControl, + response_get_CodePage, + response_put_CodePage, + response_get_LCID, + response_put_LCID, +}; + +static IResponse testresponse = { &testresponsevtbl }; #define EXPECT_CHILDREN(node) _expect_children((IXMLDOMNode*)node, __LINE__) static void _expect_children(IXMLDOMNode *node, int line) @@ -1250,7 +1550,7 @@ ok( b == VARIANT_FALSE, "succeeded in loading XML string\n"); SysFreeString( str ); - str = (BSTR)0x1; + str = (void *)0xdeadbeef; hr = IXMLDOMDocument_get_url(doc, &str); ok(hr == S_FALSE, "got 0x%08x\n", hr); ok(str == NULL, "got %p\n", str); @@ -1329,7 +1629,7 @@ r = IXMLDOMDocument_get_nodeName( doc, NULL ); ok ( r == E_INVALIDARG, "get_nodeName (NULL) wrong code\n"); - str = (BSTR)0xdeadbeef; + str = (void *)0xdeadbeef; r = IXMLDOMDocument_get_baseName( doc, &str ); ok ( r == S_FALSE, "got 0x%08x\n", r); ok (str == NULL, "got %p\n", str); @@ -1451,25 +1751,25 @@ ok(r == E_INVALIDARG, "ret %08x\n", r ); /* test substringData - Invalid offset */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; r = IXMLDOMText_substringData(nodetext, -1, 4, &str); ok(r == E_INVALIDARG, "ret %08x\n", r ); ok( str == NULL, "incorrect string\n"); /* test substringData - Invalid offset */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; r = IXMLDOMText_substringData(nodetext, 30, 0, &str); ok(r == S_FALSE, "ret %08x\n", r ); ok( str == NULL, "incorrect string\n"); /* test substringData - Invalid size */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; r = IXMLDOMText_substringData(nodetext, 0, -1, &str); ok(r == E_INVALIDARG, "ret %08x\n", r ); ok( str == NULL, "incorrect string\n"); /* test substringData - Invalid size */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; r = IXMLDOMText_substringData(nodetext, 2, 0, &str); ok(r == S_FALSE, "ret %08x\n", r ); ok( str == NULL, "incorrect string\n"); @@ -1724,7 +2024,7 @@ /* empty comment */ r = IXMLDOMDocument_createComment(doc, _bstr_(""), &node_comment); ok( r == S_OK, "returns %08x\n", r ); - str = (BSTR)0x1; + str = NULL; r = IXMLDOMComment_get_data(node_comment, &str); ok( r == S_OK, "returns %08x\n", r ); ok( str && SysStringLen(str) == 0, "expected empty string data\n"); @@ -1733,7 +2033,7 @@ r = IXMLDOMDocument_createComment(doc, NULL, &node_comment); ok( r == S_OK, "returns %08x\n", r ); - str = (BSTR)0x1; + str = NULL; r = IXMLDOMComment_get_data(node_comment, &str); ok( r == S_OK, "returns %08x\n", r ); ok( str && (SysStringLen(str) == 0), "expected empty string data\n"); @@ -1756,7 +2056,7 @@ ok(nodeChild == NULL, "pLastChild not NULL\n"); /* baseName */ - str = (BSTR)0xdeadbeef; + str = (void *)0xdeadbeef; r = IXMLDOMComment_get_baseName(node_comment, &str); ok(r == S_FALSE, "ret %08x\n", r ); ok(str == NULL, "Expected NULL\n"); @@ -1803,7 +2103,7 @@ SysFreeString(str); /* test baseName */ - str = (BSTR)0x1; + str = NULL; r = IXMLDOMProcessingInstruction_get_baseName(nodePI, &str); ok(r == S_OK, "ret %08x\n", r ); ok( !lstrcmpW( str, _bstr_("xml") ), "incorrect nodeName string\n"); @@ -1847,12 +2147,15 @@ free_bstrs(); } -static void test_persiststreaminit(void) -{ +static void test_persiststream(void) +{ + IPersistStreamInit *streaminit; + IPersistStream *stream; IXMLDOMDocument *doc; - IPersistStreamInit *streaminit; ULARGE_INTEGER size; + IPersist *persist; HRESULT hr; + CLSID clsid; doc = create_document(&IID_IXMLDOMDocument); @@ -1865,6 +2168,26 @@ hr = IPersistStreamInit_GetSizeMax(streaminit, &size); ok(hr == E_NOTIMPL, "got 0x%08x\n", hr); + hr = IXMLDOMDocument_QueryInterface(doc, &IID_IPersistStream, (void **)&stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok((IUnknown *)stream == (IUnknown *)streaminit, "got %p, %p\n", stream, streaminit); + + hr = IPersistStream_QueryInterface(stream, &IID_IPersist, (void **)&persist); + ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + + hr = IXMLDOMDocument_QueryInterface(doc, &IID_IPersist, (void **)&persist); + ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + + hr = IPersistStreamInit_GetClassID(streaminit, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + memset(&clsid, 0, sizeof(clsid)); + hr = IPersistStreamInit_GetClassID(streaminit, &clsid); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsEqualGUID(&clsid, &CLSID_DOMDocument2), "wrong clsid %s\n", wine_dbgstr_guid(&clsid)); + + IPersistStream_Release(stream); + IPersistStreamInit_Release(streaminit); IXMLDOMDocument_Release(doc); } @@ -2109,7 +2432,7 @@ ok( r == S_OK, "getNamedItem returned wrong code\n"); ok( type == NODE_TEXT, "node not text\n"); - str = (BSTR) 1; + str = (void *)0xdeadbeef; r = IXMLDOMNode_get_baseName( next, &str ); ok( r == S_FALSE, "get_baseName returned wrong code\n"); ok( str == NULL, "basename was wrong\n"); @@ -5173,25 +5496,25 @@ ok(hr == E_INVALIDARG, "ret %08x\n", hr ); /* test substringData - Invalid offset */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; hr = IXMLDOMComment_substringData(pComment, -1, 4, &str); ok(hr == E_INVALIDARG, "ret %08x\n", hr ); ok( str == NULL, "incorrect string\n"); /* test substringData - Invalid offset */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; hr = IXMLDOMComment_substringData(pComment, 30, 0, &str); ok(hr == S_FALSE, "ret %08x\n", hr ); ok( str == NULL, "incorrect string\n"); /* test substringData - Invalid size */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; hr = IXMLDOMComment_substringData(pComment, 0, -1, &str); ok(hr == E_INVALIDARG, "ret %08x\n", hr ); ok( str == NULL, "incorrect string\n"); /* test substringData - Invalid size */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; hr = IXMLDOMComment_substringData(pComment, 2, 0, &str); ok(hr == S_FALSE, "ret %08x\n", hr ); ok( str == NULL, "incorrect string\n"); @@ -5611,25 +5934,25 @@ ok(hr == E_INVALIDARG, "ret %08x\n", hr ); /* test substringData - Invalid offset */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; hr = IXMLDOMCDATASection_substringData(pCDataSec, -1, 4, &str); ok(hr == E_INVALIDARG, "ret %08x\n", hr ); ok( str == NULL, "incorrect string\n"); /* test substringData - Invalid offset */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; hr = IXMLDOMCDATASection_substringData(pCDataSec, 30, 0, &str); ok(hr == S_FALSE, "ret %08x\n", hr ); ok( str == NULL, "incorrect string\n"); /* test substringData - Invalid size */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; hr = IXMLDOMCDATASection_substringData(pCDataSec, 0, -1, &str); ok(hr == E_INVALIDARG, "ret %08x\n", hr ); ok( str == NULL, "incorrect string\n"); /* test substringData - Invalid size */ - str = (BSTR)&szElement; + str = (void *)0xdeadbeef; hr = IXMLDOMCDATASection_substringData(pCDataSec, 2, 0, &str); ok(hr == S_FALSE, "ret %08x\n", hr ); ok( str == NULL, "incorrect string\n"); @@ -6351,7 +6674,7 @@ EXPECT_HR(hr, S_OK); ok(b == VARIANT_TRUE, "got %d\n", b); - str = (BSTR)0xdeadbeef; + str = (void *)0xdeadbeef; hr = IXMLDOMDocument_get_namespaceURI(doc, &str); EXPECT_HR(hr, S_FALSE); ok(str == NULL, "got %p\n", str); @@ -8511,14 +8834,15 @@ static void test_xsltemplate(void) { + IXMLDOMDocument *doc, *doc2, *doc3; IXSLTemplate *template; IXSLProcessor *processor; - IXMLDOMDocument *doc, *doc2; IStream *stream; VARIANT_BOOL b; HRESULT hr; ULONG ref1, ref2; VARIANT v; + BSTR str; if (!is_clsid_supported(&CLSID_XSLTemplate, &IID_IXSLTemplate)) return; template = create_xsltemplate(&IID_IXSLTemplate); @@ -8598,6 +8922,16 @@ hr = IXSLProcessor_put_output(processor, v); ok(hr == S_OK, "got 0x%08x\n", hr); + V_VT(&v) = VT_UNKNOWN; + V_UNKNOWN(&v) = NULL; + hr = IXSLProcessor_put_output(processor, v); + ok(hr == S_OK, "got 0x%08x\n", hr); + + V_VT(&v) = VT_UNKNOWN; + V_DISPATCH(&v) = NULL; + hr = IXSLProcessor_put_output(processor, v); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); EXPECT_REF(stream, 1); @@ -8634,7 +8968,7 @@ /* no output interface set, check output */ doc2 = create_document(&IID_IXMLDOMDocument); - b = VARIANT_TRUE; + b = VARIANT_FALSE; hr = IXMLDOMDocument_loadXML( doc2, _bstr_("<a>test</a>"), &b ); ok(hr == S_OK, "got 0x%08x\n", hr); ok( b == VARIANT_TRUE, "got %d\n", b); @@ -8652,10 +8986,62 @@ ok(hr == S_OK, "got 0x%08x\n", hr); ok(V_VT(&v) == VT_BSTR, "got type %d\n", V_VT(&v)); ok(*V_BSTR(&v) == 0, "got %s\n", wine_dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + + /* transform to document */ + b = VARIANT_FALSE; + hr = IXMLDOMDocument_loadXML(doc2, _bstr_(szTransformXML), &b); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(b == VARIANT_TRUE, "got %d\n", b); + + V_VT(&v) = VT_UNKNOWN; + V_UNKNOWN(&v) = (IUnknown*)doc2; + hr = IXSLProcessor_put_input(processor, v); + ok(hr == S_OK, "got 0x%08x\n", hr); + + doc3 = create_document(&IID_IXMLDOMDocument); + V_VT(&v) = VT_UNKNOWN; + V_UNKNOWN(&v) = (IUnknown *)doc3; + hr = IXSLProcessor_put_output(processor, v); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXMLDOMDocument_get_xml(doc3, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!*str, "Expected empty document\n"); + SysFreeString(str); + + hr = IXSLProcessor_transform(processor, &b); + ok(hr == S_OK, "got 0x%08x\n", hr); + + V_VT(&v) = VT_EMPTY; + hr = IXSLProcessor_get_output(processor, &v); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(V_VT(&v) == VT_UNKNOWN, "got type %d\n", V_VT(&v)); + VariantClear(&v); + + hr = IXMLDOMDocument_get_xml(doc3, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!!*str, "Expected document\n"); + SysFreeString(str); + + /* transform to IResponse */ + V_VT(&v) = VT_EMPTY; + hr = IXSLProcessor_put_output(processor, v); + ok(hr == S_OK, "got 0x%08x\n", hr); + + V_VT(&v) = VT_UNKNOWN; + V_UNKNOWN(&v) = (IUnknown *)&testresponse; + hr = IXSLProcessor_put_output(processor, v); + ok(hr == S_OK, "got 0x%08x\n", hr); + + b = VARIANT_FALSE; + hr = IXSLProcessor_transform(processor, &b); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(b == VARIANT_TRUE, "got %x\n", b); + + IXSLProcessor_Release(processor); IXMLDOMDocument_Release(doc2); - VariantClear(&v); - - IXSLProcessor_Release(processor); + IXMLDOMDocument_Release(doc3); /* drop reference */ hr = IXSLTemplate_putref_stylesheet(template, NULL); @@ -9889,7 +10275,7 @@ ok(hr == S_FALSE, "got 0x%08x\n", hr); ok(b == VARIANT_FALSE, "got %d\n", b); - bstr1 = (BSTR)0x1; + bstr1 = (void *)0xdeadbeef; hr = IXMLDOMDocument_get_url(doc, &bstr1); ok(hr == S_FALSE, "got 0x%08x\n", hr); ok(bstr1 == NULL, "got %p\n", bstr1); @@ -11738,6 +12124,7 @@ break; } default: + get_data = NULL; break; } @@ -12137,7 +12524,7 @@ hr = IXMLDOMDocument_get_url(doc, NULL); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); - s = (BSTR)0x1; + s = (void *)0xdeadbeef; hr = IXMLDOMDocument_get_url(doc, &s); ok(hr == S_FALSE, "got 0x%08x\n", hr); ok(s == NULL, "got %s\n", wine_dbgstr_w(s)); @@ -12227,7 +12614,7 @@ } test_domdoc(); - test_persiststreaminit(); + test_persiststream(); test_domnode(); test_refs(); test_create(); Modified: trunk/rostests/winetests/msxml3/saxreader.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/saxreade…
============================================================================== --- trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] Sat Jun 3 22:31:39 2017 @@ -1912,6 +1912,8 @@ { *ppvObject = NULL; + ok(!IsEqualGUID(riid, &IID_IPersistStream), "Did not expect QI for IPersistStream\n"); + if(IsEqualGUID(riid, &IID_IStream) || IsEqualGUID(riid, &IID_IUnknown)) *ppvObject = iface; else @@ -2222,6 +2224,16 @@ ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "content test 1: from safe array", FALSE); SafeArrayDestroy(sa); + + V_VT(&var) = VT_UNKNOWN; + V_UNKNOWN(&var) = NULL; + hr = ISAXXMLReader_parse(reader, var); + ok(hr == E_INVALIDARG, "got %#x\n", hr); + + V_VT(&var) = VT_DISPATCH; + V_DISPATCH(&var) = NULL; + hr = ISAXXMLReader_parse(reader, var); + ok(hr == E_INVALIDARG, "got %#x\n", hr); stream = create_test_stream(testXML, -1); V_VT(&var) = VT_UNKNOWN; Modified: trunk/rostests/winetests/msxml3/xmlview.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/xmlview.…
============================================================================== --- trunk/rostests/winetests/msxml3/xmlview.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/xmlview.c [iso-8859-1] Sat Jun 3 22:31:39 2017 @@ -137,6 +137,7 @@ ok(hr == S_OK, "got 0x%08x\n", hr); if(!memcmp(state, completeW, sizeof(completeW))) loaded = TRUE; + SysFreeString(state); } return S_OK;
7 years, 6 months
1
0
0
0
[akhaldi] 74822: [MSXML3] Sync with Wine Staging 2.9. CORE-13362 d7d5d93 msxml3: Improve error handling (Coverity). cebed39 msxml3: Added support for setting IResponse as xsl processor output. ea9b...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jun 3 22:31:11 2017 New Revision: 74822 URL:
http://svn.reactos.org/svn/reactos?rev=74822&view=rev
Log: [MSXML3] Sync with Wine Staging 2.9. CORE-13362 d7d5d93 msxml3: Improve error handling (Coverity). cebed39 msxml3: Added support for setting IResponse as xsl processor output. ea9b797 msxml3: Support IPersistStream* as IXSLProcessor output. ba018b5 msxml3/saxreader: Handle NULL interface input in parse(). 8bc68f3 msxml3: Don't QI for IPersistStream in internal_parse. 135e98a msxml3: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions. Modified: trunk/reactos/dll/win32/msxml3/msxml_private.h trunk/reactos/dll/win32/msxml3/node.c trunk/reactos/dll/win32/msxml3/saxreader.c trunk/reactos/dll/win32/msxml3/stylesheet.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msxml3/msxml_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/msxml_pri…
============================================================================== --- trunk/reactos/dll/win32/msxml3/msxml_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/msxml_private.h [iso-8859-1] Sat Jun 3 22:31:11 2017 @@ -164,24 +164,24 @@ /* memory allocation functions */ -static inline void *heap_alloc(size_t len) -{ - return HeapAlloc(GetProcessHeap(), 0, len); -} - -static inline void *heap_alloc_zero(size_t len) -{ - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); -} - -static inline void *heap_realloc(void *mem, size_t len) -{ - return HeapReAlloc(GetProcessHeap(), 0, mem, len); -} - -static inline void *heap_realloc_zero(void *mem, size_t len) -{ - return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len); +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) +{ + return HeapAlloc(GetProcessHeap(), 0, size); +} + +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size) +{ + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); +} + +static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t size) +{ + return HeapReAlloc(GetProcessHeap(), 0, mem, size); +} + +static inline void* __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t size) +{ + return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, size); } static inline BOOL heap_free(void *mem) @@ -358,7 +358,8 @@ extern HRESULT node_select_nodes(const xmlnode*,BSTR,IXMLDOMNodeList**) DECLSPEC_HIDDEN; extern HRESULT node_select_singlenode(const xmlnode*,BSTR,IXMLDOMNode**) DECLSPEC_HIDDEN; extern HRESULT node_transform_node(const xmlnode*,IXMLDOMNode*,BSTR*) DECLSPEC_HIDDEN; -extern HRESULT node_transform_node_params(const xmlnode*,IXMLDOMNode*,BSTR*,IStream*,const struct xslprocessor_params*) DECLSPEC_HIDDEN; +extern HRESULT node_transform_node_params(const xmlnode*,IXMLDOMNode*,BSTR*,ISequentialStream*, + const struct xslprocessor_params*) DECLSPEC_HIDDEN; extern HRESULT node_create_supporterrorinfo(const tid_t*,void**) DECLSPEC_HIDDEN; extern HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/msxml3/node.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/node.c?re…
============================================================================== --- trunk/reactos/dll/win32/msxml3/node.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/node.c [iso-8859-1] Sat Jun 3 22:31:11 2017 @@ -1016,7 +1016,7 @@ static int XMLCALL transform_to_stream_write(void *context, const char *buffer, int len) { DWORD written; - HRESULT hr = IStream_Write((IStream*)context, buffer, len, &written); + HRESULT hr = ISequentialStream_Write((ISequentialStream *)context, buffer, len, &written); return hr == S_OK ? written : -1; } @@ -1261,7 +1261,7 @@ return *str ? hr : E_OUTOFMEMORY; } -static HRESULT node_transform_write_to_stream(xsltStylesheetPtr style, xmlDocPtr result, IStream *stream) +static HRESULT node_transform_write_to_stream(xsltStylesheetPtr style, xmlDocPtr result, ISequentialStream *stream) { static const xmlChar *utf16 = (const xmlChar*)"UTF-16"; xmlOutputBufferPtr output; @@ -1297,7 +1297,7 @@ #endif HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *p, - IStream *stream, const struct xslprocessor_params *params) + ISequentialStream *stream, const struct xslprocessor_params *params) { #ifdef SONAME_LIBXSLT xsltStylesheetPtr xsltSS; Modified: trunk/reactos/dll/win32/msxml3/saxreader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/saxreader…
============================================================================== --- trunk/reactos/dll/win32/msxml3/saxreader.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/saxreader.c [iso-8859-1] Sat Jun 3 22:31:11 2017 @@ -2639,9 +2639,11 @@ } case VT_UNKNOWN: case VT_DISPATCH: { - IPersistStream *persistStream; ISequentialStream *stream = NULL; IXMLDOMDocument *xmlDoc; + + if (!V_UNKNOWN(&varInput)) + return E_INVALIDARG; if(IUnknown_QueryInterface(V_UNKNOWN(&varInput), &IID_IXMLDOMDocument, (void**)&xmlDoc) == S_OK) @@ -2656,34 +2658,11 @@ break; } - if(IUnknown_QueryInterface(V_UNKNOWN(&varInput), - &IID_IPersistStream, (void**)&persistStream) == S_OK) - { - IStream *stream_copy; - - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream_copy); - if(hr != S_OK) - { - IPersistStream_Release(persistStream); - return hr; - } - - hr = IPersistStream_Save(persistStream, stream_copy, TRUE); - IPersistStream_Release(persistStream); - if(hr == S_OK) - IStream_QueryInterface(stream_copy, &IID_ISequentialStream, (void**)&stream); - - IStream_Release(stream_copy); - } - /* try base interface first */ - if(!stream) - { - IUnknown_QueryInterface(V_UNKNOWN(&varInput), &IID_ISequentialStream, (void**)&stream); - if (!stream) - /* this should never happen if IStream is implemented properly, but just in case */ - IUnknown_QueryInterface(V_UNKNOWN(&varInput), &IID_IStream, (void**)&stream); - } + IUnknown_QueryInterface(V_UNKNOWN(&varInput), &IID_ISequentialStream, (void**)&stream); + if (!stream) + /* this should never happen if IStream is implemented properly, but just in case */ + IUnknown_QueryInterface(V_UNKNOWN(&varInput), &IID_IStream, (void**)&stream); if(stream) { Modified: trunk/reactos/dll/win32/msxml3/stylesheet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/styleshee…
============================================================================== --- trunk/reactos/dll/win32/msxml3/stylesheet.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/stylesheet.c [iso-8859-1] Sat Jun 3 22:31:11 2017 @@ -20,6 +20,9 @@ #include "precomp.h" +#include <initguid.h> +#include <asptlb.h> + typedef struct { DispatchEx dispex; @@ -29,6 +32,14 @@ IXMLDOMNode *node; } xsltemplate; +enum output_type +{ + PROCESSOR_OUTPUT_NOT_SET, + PROCESSOR_OUTPUT_STREAM, /* IStream or ISequentialStream */ + PROCESSOR_OUTPUT_PERSISTSTREAM, /* IPersistStream or IPersistStreamInit */ + PROCESSOR_OUTPUT_RESPONSE, /* IResponse */ +}; + typedef struct { DispatchEx dispex; @@ -38,8 +49,15 @@ xsltemplate *stylesheet; IXMLDOMNode *input; - IStream *output; - BSTR outstr; + union + { + IUnknown *unk; + ISequentialStream *stream; + IPersistStream *persiststream; + IResponse *response; + } output; + enum output_type output_type; + BSTR outstr; struct xslprocessor_params params; } xslprocessor; @@ -298,7 +316,8 @@ struct xslprocessor_par *par, *par2; if (This->input) IXMLDOMNode_Release(This->input); - if (This->output) IStream_Release(This->output); + if (This->output.unk) + IUnknown_Release(This->output.unk); SysFreeString(This->outstr); LIST_FOR_EACH_ENTRY_SAFE(par, par2, &This->params.list, struct xslprocessor_par, entry) @@ -437,34 +456,57 @@ static HRESULT WINAPI xslprocessor_put_output( IXSLProcessor *iface, - VARIANT output) -{ - xslprocessor *This = impl_from_IXSLProcessor( iface ); - IStream *stream; - HRESULT hr; - - TRACE("(%p)->(%s)\n", This, debugstr_variant(&output)); - - switch (V_VT(&output)) - { - case VT_EMPTY: - stream = NULL; - hr = S_OK; + VARIANT var) +{ + xslprocessor *This = impl_from_IXSLProcessor( iface ); + enum output_type output_type = PROCESSOR_OUTPUT_NOT_SET; + IUnknown *output = NULL; + HRESULT hr = S_OK; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&var)); + + switch (V_VT(&var)) + { + case VT_EMPTY: break; - case VT_UNKNOWN: - hr = IUnknown_QueryInterface(V_UNKNOWN(&output), &IID_IStream, (void**)&stream); + case VT_UNKNOWN: + case VT_DISPATCH: + if (!V_UNKNOWN(&var)) + break; + + output_type = PROCESSOR_OUTPUT_STREAM; + hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IStream, (void **)&output); if (FAILED(hr)) - WARN("failed to get IStream from output, 0x%08x\n", hr); + hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_ISequentialStream, (void **)&output); + if (FAILED(hr)) + { + output_type = PROCESSOR_OUTPUT_RESPONSE; + hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IResponse, (void **)&output); + } + if (FAILED(hr)) + { + output_type = PROCESSOR_OUTPUT_PERSISTSTREAM; + hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IPersistStream, (void **)&output); + } + if (FAILED(hr)) + hr = IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IPersistStreamInit, (void **)&output); + if (FAILED(hr)) + { + output_type = PROCESSOR_OUTPUT_NOT_SET; + WARN("failed to get output interface, 0x%08x\n", hr); + } break; - default: - FIXME("output type %d not handled\n", V_VT(&output)); + default: + FIXME("output type %d not handled\n", V_VT(&var)); hr = E_FAIL; } if (hr == S_OK) { - if (This->output) IStream_Release(This->output); - This->output = stream; + if (This->output.unk) + IUnknown_Release(This->output.unk); + This->output.unk = output; + This->output_type = output_type; } return hr; @@ -480,11 +522,11 @@ if (!output) return E_INVALIDARG; - if (This->output) + if (This->output.unk) { V_VT(output) = VT_UNKNOWN; - V_UNKNOWN(output) = (IUnknown*)This->output; - IStream_AddRef(This->output); + V_UNKNOWN(output) = This->output.unk; + IUnknown_AddRef(This->output.unk); } else if (This->outstr) { @@ -503,14 +545,89 @@ { #ifdef HAVE_LIBXML2 xslprocessor *This = impl_from_IXSLProcessor( iface ); + ISequentialStream *stream = NULL; HRESULT hr; TRACE("(%p)->(%p)\n", This, ret); - if (!ret) return E_INVALIDARG; + if (!ret) + return E_INVALIDARG; + + if (This->output_type == PROCESSOR_OUTPUT_STREAM) + { + stream = This->output.stream; + ISequentialStream_AddRef(stream); + } + else if (This->output_type == PROCESSOR_OUTPUT_PERSISTSTREAM || + This->output_type == PROCESSOR_OUTPUT_RESPONSE) + { + if (FAILED(hr = CreateStreamOnHGlobal(NULL, TRUE, (IStream **)&stream))) + return hr; + } SysFreeString(This->outstr); - hr = node_transform_node_params(get_node_obj(This->input), This->stylesheet->node, &This->outstr, This->output, &This->params); + + hr = node_transform_node_params(get_node_obj(This->input), This->stylesheet->node, + &This->outstr, stream, &This->params); + if (SUCCEEDED(hr)) + { + IStream *src = (IStream *)stream; + + switch (This->output_type) + { + case PROCESSOR_OUTPUT_PERSISTSTREAM: + { + LARGE_INTEGER zero; + + /* for IPersistStream* output seekable stream is used */ + zero.QuadPart = 0; + IStream_Seek(src, zero, STREAM_SEEK_SET, NULL); + hr = IPersistStream_Load(This->output.persiststream, src); + break; + } + case PROCESSOR_OUTPUT_RESPONSE: + { + SAFEARRAYBOUND bound; + SAFEARRAY *array; + HGLOBAL hglobal; + VARIANT bin; + DWORD size; + void *dest; + + if (FAILED(hr = GetHGlobalFromStream(src, &hglobal))) + break; + size = GlobalSize(hglobal); + + bound.lLbound = 0; + bound.cElements = size; + if (!(array = SafeArrayCreate(VT_UI1, 1, &bound))) + break; + + V_VT(&bin) = VT_ARRAY | VT_UI1; + V_ARRAY(&bin) = array; + + hr = SafeArrayAccessData(array, &dest); + if (hr == S_OK) + { + void *data = GlobalLock(hglobal); + memcpy(dest, data, size); + GlobalUnlock(hglobal); + SafeArrayUnaccessData(array); + + IResponse_BinaryWrite(This->output.response, bin); + } + + VariantClear(&bin); + break; + } + default: + ; + } + } + + if (stream) + ISequentialStream_Release(stream); + *ret = hr == S_OK ? VARIANT_TRUE : VARIANT_FALSE; return hr; #else @@ -689,7 +806,8 @@ This->IXSLProcessor_iface.lpVtbl = &XSLProcessorVtbl; This->ref = 1; This->input = NULL; - This->output = NULL; + This->output.unk = NULL; + This->output_type = PROCESSOR_OUTPUT_NOT_SET; This->outstr = NULL; list_init(&This->params.list); This->params.count = 0; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Jun 3 22:31:11 2017 @@ -129,7 +129,7 @@ reactos/dll/win32/msvidc32 # Synced to WineStaging-1.9.11 reactos/dll/win32/msxml # Synced to WineStaging-1.9.11 reactos/dll/win32/msxml2 # Synced to WineStaging-1.9.11 -reactos/dll/win32/msxml3 # Synced to WineStaging-2.2 +reactos/dll/win32/msxml3 # Synced to WineStaging-2.9 reactos/dll/win32/msxml4 # Synced to WineStaging-1.9.11 reactos/dll/win32/msxml6 # Synced to WineStaging-1.9.11 reactos/dll/win32/nddeapi # Synced to WineStaging-1.9.11
7 years, 6 months
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
53
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Results per page:
10
25
50
100
200