ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2015
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
18 participants
496 discussions
Start a n
N
ew thread
[akhaldi] 66533: [QEDIT] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 1 22:47:11 2015 New Revision: 66533 URL:
http://svn.reactos.org/svn/reactos?rev=66533&view=rev
Log: [QEDIT] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/reactos/dll/directx/wine/qedit/mediadet.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/qedit/mediadet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/qedit/med…
======================================================================
…
[View More]
======== --- trunk/reactos/dll/directx/wine/qedit/mediadet.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/qedit/mediadet.c [iso-8859-1] Sun Mar 1 22:47:11 2015 @@ -648,7 +648,6 @@ obj->cur_pin = NULL; obj->num_streams = -1; obj->cur_stream = 0; - *ppv = obj; if (pUnkOuter) obj->outer_unk = pUnkOuter; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Mar 1 22:47:11 2015 @@ -45,7 +45,7 @@ reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.27 reactos/dll/directx/wine/dxgi # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.7.37 -reactos/dll/directx/wine/qedit # Synced to Wine-1.7.27 +reactos/dll/directx/wine/qedit # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/quartz # Synced to Wine-1.7.27 reactos/dll/directx/wine/wined3d # Synced to WineStaging-1.7.37
[View Less]
10 years, 3 months
1
0
0
0
[akhaldi] 66532: [MSDMO] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 1 22:39:22 2015 New Revision: 66532 URL:
http://svn.reactos.org/svn/reactos?rev=66532&view=rev
Log: [MSDMO] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/reactos/dll/directx/wine/msdmo/dmoreg.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/msdmo/dmoreg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/msdmo/dmo…
==========================================================================
…
[View More]
==== --- trunk/reactos/dll/directx/wine/msdmo/dmoreg.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/msdmo/dmoreg.c [iso-8859-1] Sun Mar 1 22:39:22 2015 @@ -121,10 +121,11 @@ static HRESULT write_types(HKEY hkey, LPCWSTR name, const DMO_PARTIAL_MEDIATYPE* types, DWORD count) { - HRESULT hres = S_OK; + LONG ret; + if (MSDMO_MAJOR_VERSION > 5) { - hres = RegSetValueExW(hkey, name, 0, REG_BINARY, (const BYTE*) types, + ret = RegSetValueExW(hkey, name, 0, REG_BINARY, (const BYTE*) types, count* sizeof(DMO_PARTIAL_MEDIATYPE)); } else @@ -133,15 +134,18 @@ DWORD index = 0; WCHAR szGuidKey[64]; - hres = RegCreateKeyExW(hkey, name, 0, NULL, REG_OPTION_NON_VOLATILE, + ret = RegCreateKeyExW(hkey, name, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &skey1, NULL); + if (ret) + return HRESULT_FROM_WIN32(ret); + while (index < count) { GUIDToString(szGuidKey,&types[index].type); - hres = RegCreateKeyExW(skey1, szGuidKey, 0, NULL, + ret = RegCreateKeyExW(skey1, szGuidKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &skey2, NULL); GUIDToString(szGuidKey,&types[index].subtype); - hres = RegCreateKeyExW(skey2, szGuidKey, 0, NULL, + ret = RegCreateKeyExW(skey2, szGuidKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &skey3, NULL); RegCloseKey(skey3); RegCloseKey(skey2); @@ -150,7 +154,7 @@ RegCloseKey(skey1); } - return hres; + return HRESULT_FROM_WIN32(ret); } /*************************************************************** @@ -176,7 +180,10 @@ HKEY hckey = 0; HKEY hclskey = 0; - TRACE("%s\n", debugstr_w(szName)); + TRACE("%s %s %s\n", debugstr_w(szName), debugstr_guid(clsidDMO), debugstr_guid(guidCategory)); + + if (IsEqualGUID(guidCategory, &GUID_NULL)) + return E_INVALIDARG; hres = RegCreateKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hrkey, NULL); @@ -240,46 +247,70 @@ return hres; } +static HRESULT unregister_dmo_from_category(const WCHAR *dmoW, const WCHAR *catW, HKEY categories) +{ + HKEY catkey; + LONG ret; + + ret = RegOpenKeyExW(categories, catW, 0, KEY_WRITE, &catkey); + if (!ret) + { + ret = RegDeleteKeyW(catkey, dmoW); + RegCloseKey(catkey); + } + + return !ret ? S_OK : S_FALSE; +} /*************************************************************** * DMOUnregister (MSDMO.@) * * Unregister a DirectX Media Object. */ -HRESULT WINAPI DMOUnregister(REFCLSID clsidDMO, REFGUID guidCategory) -{ - HRESULT hres; - WCHAR szguid[64]; - HKEY hrkey = 0; - HKEY hckey = 0; - - GUIDToString(szguid, clsidDMO); - - TRACE("%s %p\n", debugstr_w(szguid), guidCategory); - - hres = RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_WRITE, &hrkey); - if (ERROR_SUCCESS != hres) +HRESULT WINAPI DMOUnregister(REFCLSID dmo, REFGUID category) +{ + HKEY rootkey = 0, categorieskey = 0; + WCHAR dmoW[64], catW[64]; + HRESULT hr = S_FALSE; + LONG ret; + + TRACE("%s %s\n", debugstr_guid(dmo), debugstr_guid(category)); + + ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_WRITE, &rootkey); + if (ret) + return S_FALSE; + + GUIDToString(dmoW, dmo); + RegDeleteKeyW(rootkey, dmoW); + + /* open 'Categories' */ + ret = RegOpenKeyExW(rootkey, szDMOCategories, 0, KEY_WRITE|KEY_ENUMERATE_SUB_KEYS, &categorieskey); + RegCloseKey(rootkey); + if (ret) + { + hr = HRESULT_FROM_WIN32(ret); goto lend; - - hres = RegDeleteKeyW(hrkey, szguid); - if (ERROR_SUCCESS != hres) - goto lend; - - hres = RegOpenKeyExW(hrkey, szDMOCategories, 0, KEY_WRITE, &hckey); - if (ERROR_SUCCESS != hres) - goto lend; - - hres = RegDeleteKeyW(hckey, szguid); - if (ERROR_SUCCESS != hres) - goto lend; + } + + /* remove from all categories */ + if (IsEqualGUID(category, &GUID_NULL)) + { + DWORD index = 0, len = sizeof(catW)/sizeof(WCHAR); + + while (!RegEnumKeyExW(categorieskey, index++, catW, &len, NULL, NULL, NULL, NULL)) + hr = unregister_dmo_from_category(dmoW, catW, categorieskey); + } + else + { + GUIDToString(catW, category); + hr = unregister_dmo_from_category(dmoW, catW, categorieskey); + } lend: - if (hckey) - RegCloseKey(hckey); - if (hrkey) - RegCloseKey(hrkey); - - return hres; + if (categorieskey) + RegCloseKey(categorieskey); + + return hr; } @@ -291,27 +322,24 @@ HRESULT WINAPI DMOGetName(REFCLSID clsidDMO, WCHAR szName[]) { WCHAR szguid[64]; - HRESULT hres; HKEY hrkey = 0; HKEY hkey = 0; static const INT max_name_len = 80; DWORD count; + LONG ret; TRACE("%s\n", debugstr_guid(clsidDMO)); - hres = RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, - 0, KEY_READ, &hrkey); - if (ERROR_SUCCESS != hres) + ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &hrkey); + if (ERROR_SUCCESS != ret) goto lend; - hres = RegOpenKeyExW(hrkey, GUIDToString(szguid, clsidDMO), - 0, KEY_READ, &hkey); - if (ERROR_SUCCESS != hres) + ret = RegOpenKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, KEY_READ, &hkey); + if (ERROR_SUCCESS != ret) goto lend; count = max_name_len * sizeof(WCHAR); - hres = RegQueryValueExW(hkey, NULL, NULL, NULL, - (LPBYTE) szName, &count); + ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE) szName, &count); TRACE(" szName=%s\n", debugstr_w(szName)); lend: @@ -320,9 +348,8 @@ if (hkey) RegCloseKey(hkey); - return hres; -} - + return HRESULT_FROM_WIN32(ret); +} /************************************************************************** * IEnumDMOImpl_Destructor @@ -344,81 +371,90 @@ /************************************************************************** * IEnumDMO_Constructor */ -static IEnumDMO * IEnumDMO_Constructor( +static HRESULT IEnumDMO_Constructor( REFGUID guidCategory, DWORD dwFlags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, - const DMO_PARTIAL_MEDIATYPE *pOutTypes) -{ + const DMO_PARTIAL_MEDIATYPE *pOutTypes, + IEnumDMO **obj) +{ + IEnumDMOImpl* lpedmo; + HRESULT hr = S_OK; UINT size; - IEnumDMOImpl* lpedmo; - BOOL ret = FALSE; + LONG ret; + + *obj = NULL; lpedmo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumDMOImpl)); - - if (lpedmo) - { - lpedmo->ref = 1; - lpedmo->IEnumDMO_iface.lpVtbl = &edmovt; - lpedmo->index = -1; - lpedmo->guidCategory = guidCategory; - lpedmo->dwFlags = dwFlags; - - if (cInTypes > 0) + if (!lpedmo) + return E_OUTOFMEMORY; + + lpedmo->IEnumDMO_iface.lpVtbl = &edmovt; + lpedmo->ref = 1; + lpedmo->index = -1; + lpedmo->guidCategory = guidCategory; + lpedmo->dwFlags = dwFlags; + + if (cInTypes > 0) + { + size = cInTypes * sizeof(DMO_PARTIAL_MEDIATYPE); + lpedmo->pInTypes = HeapAlloc(GetProcessHeap(), 0, size); + if (!lpedmo->pInTypes) { - size = cInTypes * sizeof(DMO_PARTIAL_MEDIATYPE); - lpedmo->pInTypes = HeapAlloc(GetProcessHeap(), 0, size); - if (!lpedmo->pInTypes) - goto lerr; - memcpy(lpedmo->pInTypes, pInTypes, size); - lpedmo->cInTypes = cInTypes; + hr = E_OUTOFMEMORY; + goto lerr; } - - if (cOutTypes > 0) + memcpy(lpedmo->pInTypes, pInTypes, size); + lpedmo->cInTypes = cInTypes; + } + + if (cOutTypes > 0) + { + size = cOutTypes * sizeof(DMO_PARTIAL_MEDIATYPE); + lpedmo->pOutTypes = HeapAlloc(GetProcessHeap(), 0, size); + if (!lpedmo->pOutTypes) { - size = cOutTypes * sizeof(DMO_PARTIAL_MEDIATYPE); - lpedmo->pOutTypes = HeapAlloc(GetProcessHeap(), 0, size); - if (!lpedmo->pOutTypes) - goto lerr; - memcpy(lpedmo->pOutTypes, pOutTypes, size); - lpedmo->cOutTypes = cOutTypes; + hr = E_OUTOFMEMORY; + goto lerr; } - - /* If not filtering by category enum from media objects root */ - if (IsEqualGUID(guidCategory, &GUID_NULL)) - { - if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, - 0, KEY_READ, &lpedmo->hkey)) - ret = TRUE; - } - else - { - WCHAR szguid[64]; - WCHAR szKey[MAX_PATH]; - - wsprintfW(szKey, szCat3Fmt, szDMORootKey, szDMOCategories, - GUIDToString(szguid, guidCategory)); - if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, - 0, KEY_READ, &lpedmo->hkey)) - ret = TRUE; - } + memcpy(lpedmo->pOutTypes, pOutTypes, size); + lpedmo->cOutTypes = cOutTypes; + } + + /* If not filtering by category enum from media objects root */ + if (IsEqualGUID(guidCategory, &GUID_NULL)) + { + if ((ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &lpedmo->hkey))) + hr = HRESULT_FROM_WIN32(ret); + } + else + { + WCHAR szguid[64]; + WCHAR szKey[MAX_PATH]; + + wsprintfW(szKey, szCat3Fmt, szDMORootKey, szDMOCategories, + GUIDToString(szguid, guidCategory)); + if ((ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &lpedmo->hkey))) + hr = HRESULT_FROM_WIN32(ret); + } lerr: - if(!ret) - { - IEnumDMOImpl_Destructor(lpedmo); - HeapFree(GetProcessHeap(),0,lpedmo); - lpedmo = NULL; - } - } - - TRACE("returning %p\n", lpedmo); - - return (IEnumDMO*)lpedmo; -} - + + if (FAILED(hr)) + { + IEnumDMOImpl_Destructor(lpedmo); + HeapFree(GetProcessHeap(), 0, lpedmo); + } + else + { + TRACE("returning %p\n", lpedmo); + *obj = &lpedmo->IEnumDMO_iface; + } + + return hr; +} /****************************************************************************** * IEnumDMO_fnAddRef @@ -426,36 +462,31 @@ static ULONG WINAPI IEnumDMO_fnAddRef(IEnumDMO * iface) { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); - return InterlockedIncrement(&This->ref); -} - + ULONG refCount = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, refCount); + return refCount; +} /************************************************************************** * EnumDMO_QueryInterface */ -static HRESULT WINAPI IEnumDMO_fnQueryInterface( - IEnumDMO* iface, - REFIID riid, - LPVOID *ppvObj) +static HRESULT WINAPI IEnumDMO_fnQueryInterface(IEnumDMO* iface, REFIID riid, void **ppvObj) { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObj); + *ppvObj = NULL; - if(IsEqualIID(riid, &IID_IUnknown)) - *ppvObj = This; - else if(IsEqualIID(riid, &IID_IEnumDMO)) - *ppvObj = This; - - if(*ppvObj) - { - IEnumDMO_fnAddRef(*ppvObj); - return S_OK; - } - - return E_NOINTERFACE; -} - + if (IsEqualIID(riid, &IID_IEnumDMO) || + IsEqualIID(riid, &IID_IUnknown)) + { + *ppvObj = iface; + IEnumDMO_fnAddRef(iface); + } + + return *ppvObj ? S_OK : E_NOINTERFACE; +} /****************************************************************************** * IEnumDMO_fnRelease @@ -464,6 +495,8 @@ { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); ULONG refCount = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(%d)\n", This, refCount); if (!refCount) { @@ -493,10 +526,11 @@ DWORD len; UINT count = 0; HRESULT hres = S_OK; + LONG ret; IEnumDMOImpl *This = impl_from_IEnumDMO(iface); - TRACE("--> (%p) %d %p %p %p\n", iface, cItemsToFetch, pCLSID, Names, pcItemsFetched); + TRACE("(%p)->(%d %p %p %p)\n", This, cItemsToFetch, pCLSID, Names, pcItemsFetched); if (!pCLSID || !Names || !pcItemsFetched) return E_POINTER; @@ -506,17 +540,20 @@ This->index++; len = MAX_PATH; - hres = RegEnumKeyExW(This->hkey, This->index, szNextKey, &len, NULL, NULL, NULL, &ft); - if (hres != ERROR_SUCCESS) + ret = RegEnumKeyExW(This->hkey, This->index, szNextKey, &len, NULL, NULL, NULL, &ft); + if (ret != ERROR_SUCCESS) + { + hres = HRESULT_FROM_WIN32(ret); break; + } TRACE("found %s\n", debugstr_w(szNextKey)); if (!(This->dwFlags & DMO_ENUMF_INCLUDE_KEYED)) { wsprintfW(szKey, szCat3Fmt, szDMORootKey, szNextKey, szDMOKeyed); - hres = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &hkey); - if (ERROR_SUCCESS == hres) + ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &hkey); + if (ERROR_SUCCESS == ret) { RegCloseKey(hkey); /* Skip Keyed entries */ @@ -525,7 +562,7 @@ } wsprintfW(szKey, szCat2Fmt, szDMORootKey, szNextKey); - hres = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &hkey); + ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &hkey); if (This->pInTypes) { @@ -537,7 +574,7 @@ sizeof(szValue)/sizeof(DMO_PARTIAL_MEDIATYPE), (DMO_PARTIAL_MEDIATYPE*)szValue); - if (ERROR_SUCCESS != hres) + if (FAILED(hres)) { RegCloseKey(hkey); continue; @@ -574,7 +611,7 @@ sizeof(szValue)/sizeof(DMO_PARTIAL_MEDIATYPE), (DMO_PARTIAL_MEDIATYPE*)szValue); - if (ERROR_SUCCESS != hres) + if (FAILED(hres)) { RegCloseKey(hkey); continue; @@ -604,8 +641,8 @@ /* Media object wasn't filtered so add it to return list */ Names[count] = NULL; len = MAX_PATH * sizeof(WCHAR); - hres = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE) szValue, &len); - if (ERROR_SUCCESS == hres) + ret = RegQueryValueExW(hkey, NULL, NULL, NULL, (LPBYTE)szValue, &len); + if (ERROR_SUCCESS == ret) { Names[count] = HeapAlloc(GetProcessHeap(), 0, (strlenW(szValue) + 1) * sizeof(WCHAR)); if (Names[count]) @@ -635,6 +672,7 @@ { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); + TRACE("(%p)->(%d)\n", This, cItemsToSkip); This->index += cItemsToSkip; return S_OK; @@ -648,6 +686,7 @@ { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); + TRACE("(%p)\n", This); This->index = -1; return S_OK; @@ -657,13 +696,12 @@ /****************************************************************************** * IEnumDMO_fnClone */ -static HRESULT WINAPI IEnumDMO_fnClone(IEnumDMO * iface, IEnumDMO **ppEnum) +static HRESULT WINAPI IEnumDMO_fnClone(IEnumDMO *iface, IEnumDMO **ppEnum) { IEnumDMOImpl *This = impl_from_IEnumDMO(iface); - - FIXME("(%p)->() to (%p)->() E_NOTIMPL\n", This, ppEnum); - - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, ppEnum); + return IEnumDMO_Constructor(This->guidCategory, This->dwFlags, This->cInTypes, This->pInTypes, + This->cOutTypes, This->pOutTypes, ppEnum); } @@ -681,17 +719,11 @@ const DMO_PARTIAL_MEDIATYPE *pOutTypes, IEnumDMO **ppEnum) { - HRESULT hres = E_FAIL; - TRACE("guidCategory=%p dwFlags=0x%08x cInTypes=%d cOutTypes=%d\n", guidCategory, dwFlags, cInTypes, cOutTypes); - *ppEnum = IEnumDMO_Constructor(guidCategory, dwFlags, cInTypes, - pInTypes, cOutTypes, pOutTypes); - if (*ppEnum) - hres = S_OK; - - return hres; + return IEnumDMO_Constructor(guidCategory, dwFlags, cInTypes, + pInTypes, cOutTypes, pOutTypes, ppEnum); } @@ -710,11 +742,16 @@ HRESULT read_types(HKEY root, LPCWSTR key, ULONG *supplied, ULONG requested, DMO_PARTIAL_MEDIATYPE* types ) { HRESULT ret = S_OK; + if (MSDMO_MAJOR_VERSION > 5) { DWORD len; + LONG rc; + len = requested * sizeof(DMO_PARTIAL_MEDIATYPE); - ret = RegQueryValueExW(root, key, NULL, NULL, (LPBYTE) types, &len); + rc = RegQueryValueExW(root, key, NULL, NULL, (LPBYTE) types, &len); + ret = HRESULT_FROM_WIN32(rc); + *supplied = len / sizeof(DMO_PARTIAL_MEDIATYPE); } else Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Mar 1 22:39:22 2015 @@ -44,7 +44,7 @@ reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29 reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.27 reactos/dll/directx/wine/dxgi # Synced to WineStaging-1.7.37 -reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.27 +reactos/dll/directx/wine/msdmo # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/qedit # Synced to Wine-1.7.27 reactos/dll/directx/wine/quartz # Synced to Wine-1.7.27 reactos/dll/directx/wine/wined3d # Synced to WineStaging-1.7.37
[View Less]
10 years, 3 months
1
0
0
0
[akhaldi] 66531: [DXGI] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 1 22:38:27 2015 New Revision: 66531 URL:
http://svn.reactos.org/svn/reactos?rev=66531&view=rev
Log: [DXGI] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/reactos/dll/directx/wine/dxgi/adapter.c trunk/reactos/dll/directx/wine/dxgi/device.c trunk/reactos/dll/directx/wine/dxgi/dxgi_private.h trunk/reactos/dll/directx/wine/dxgi/factory.c trunk/reactos/dll/directx/wine/dxgi/output.c trunk/reactos/dll/directx/wine/dxgi/surface.c
…
[View More]
trunk/reactos/dll/directx/wine/dxgi/swapchain.c trunk/reactos/dll/directx/wine/dxgi/utils.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/directx/wine/dxgi/adapter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/adap…
============================================================================== --- trunk/reactos/dll/directx/wine/dxgi/adapter.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dxgi/adapter.c [iso-8859-1] Sun Mar 1 22:38:27 2015 @@ -66,6 +66,7 @@ if (!refcount) { IDXGIOutput_Release(adapter->output); + wined3d_private_store_cleanup(&adapter->private_store); HeapFree(GetProcessHeap(), 0, adapter); } @@ -75,25 +76,31 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter1 *iface, REFGUID guid, UINT data_size, const void *data) { - FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_set_private_data(&adapter->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IDXGIAdapter1 *iface, REFGUID guid, const IUnknown *object) { - FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); - - return E_NOTIMPL; + struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface); + + TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object); + + return dxgi_set_private_data_interface(&adapter->private_store, guid, object); } static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IDXGIAdapter1 *iface, REFGUID guid, UINT *data_size, void *data) { - FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_get_private_data(&adapter->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, REFIID iid, void **parent) @@ -225,11 +232,12 @@ adapter->IDXGIAdapter1_iface.lpVtbl = &dxgi_adapter_vtbl; adapter->parent = parent; adapter->refcount = 1; + wined3d_private_store_init(&adapter->private_store); adapter->ordinal = ordinal; - output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output)); - if (!output) - { + if (!(output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output)))) + { + wined3d_private_store_cleanup(&adapter->private_store); return E_OUTOFMEMORY; } dxgi_output_init(output, adapter); Modified: trunk/reactos/dll/directx/wine/dxgi/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/devi…
============================================================================== --- trunk/reactos/dll/directx/wine/dxgi/device.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dxgi/device.c [iso-8859-1] Sun Mar 1 22:38:27 2015 @@ -79,6 +79,7 @@ wined3d_device_decref(This->wined3d_device); LeaveCriticalSection(&dxgi_cs); IDXGIFactory1_Release(This->factory); + wined3d_private_store_cleanup(&This->private_store); HeapFree(GetProcessHeap(), 0, This); } @@ -90,25 +91,31 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateData(IWineDXGIDevice *iface, REFGUID guid, UINT data_size, const void *data) { - FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_device *device = impl_from_IWineDXGIDevice(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_set_private_data(&device->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateDataInterface(IWineDXGIDevice *iface, REFGUID guid, const IUnknown *object) { - FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); - - return E_NOTIMPL; + struct dxgi_device *device = impl_from_IWineDXGIDevice(iface); + + TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object); + + return dxgi_set_private_data_interface(&device->private_store, guid, object); } static HRESULT STDMETHODCALLTYPE dxgi_device_GetPrivateData(IWineDXGIDevice *iface, REFGUID guid, UINT *data_size, void *data) { - FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_device *device = impl_from_IWineDXGIDevice(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_get_private_data(&device->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IWineDXGIDevice *iface, REFIID riid, void **parent) @@ -321,7 +328,7 @@ dxgi_device_QueryResourceResidency, dxgi_device_SetGPUThreadPriority, dxgi_device_GetGPUThreadPriority, - /* IWineDXGIAdapter methods */ + /* IWineDXGIDevice methods */ dxgi_device_create_surface, dxgi_device_create_swapchain, }; @@ -352,6 +359,7 @@ device->IWineDXGIDevice_iface.lpVtbl = &dxgi_device_vtbl; device->refcount = 1; + wined3d_private_store_init(&device->private_store); layer_base = device + 1; @@ -359,6 +367,7 @@ device, &IID_IUnknown, (void **)&device->child_layer))) { WARN("Failed to create device, returning %#x.\n", hr); + wined3d_private_store_cleanup(&device->private_store); return hr; } @@ -367,6 +376,7 @@ { ERR("DXGI device should implement IWineD3DDeviceParent.\n"); IUnknown_Release(device->child_layer); + wined3d_private_store_cleanup(&device->private_store); return hr; } wined3d_device_parent = IWineDXGIDeviceParent_get_wined3d_device_parent(dxgi_device_parent); @@ -381,6 +391,7 @@ if (SUCCEEDED(hr)) hr = E_FAIL; IUnknown_Release(device->child_layer); + wined3d_private_store_cleanup(&device->private_store); return hr; } @@ -392,6 +403,7 @@ { WARN("Failed to create a wined3d device, returning %#x.\n", hr); IUnknown_Release(device->child_layer); + wined3d_private_store_cleanup(&device->private_store); return hr; } @@ -404,6 +416,7 @@ ERR("Failed to initialize 3D, hr %#x.\n", hr); wined3d_device_decref(device->wined3d_device); IUnknown_Release(device->child_layer); + wined3d_private_store_cleanup(&device->private_store); return hr; } Modified: trunk/reactos/dll/directx/wine/dxgi/dxgi_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/dxgi…
============================================================================== --- trunk/reactos/dll/directx/wine/dxgi/dxgi_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dxgi/dxgi_private.h [iso-8859-1] Sun Mar 1 22:38:27 2015 @@ -82,12 +82,19 @@ DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN; enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN; +HRESULT dxgi_get_private_data(struct wined3d_private_store *store, + REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN; +HRESULT dxgi_set_private_data(struct wined3d_private_store *store, + REFGUID guid, UINT data_size, const void *data) DECLSPEC_HIDDEN; +HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store, + REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN; /* IDXGIFactory */ struct dxgi_factory { IDXGIFactory1 IDXGIFactory1_iface; LONG refcount; + struct wined3d_private_store private_store; struct wined3d *wined3d; UINT adapter_count; IDXGIAdapter1 **adapters; @@ -105,6 +112,7 @@ IWineDXGIDevice IWineDXGIDevice_iface; IUnknown *child_layer; LONG refcount; + struct wined3d_private_store private_store; struct wined3d_device *wined3d_device; IDXGIFactory1 *factory; }; @@ -117,6 +125,7 @@ { IDXGIOutput IDXGIOutput_iface; LONG refcount; + struct wined3d_private_store private_store; struct dxgi_adapter *adapter; }; @@ -128,6 +137,7 @@ IDXGIAdapter1 IDXGIAdapter1_iface; struct dxgi_factory *parent; LONG refcount; + struct wined3d_private_store private_store; UINT ordinal; IDXGIOutput *output; }; @@ -140,6 +150,7 @@ { IDXGISwapChain IDXGISwapChain_iface; LONG refcount; + struct wined3d_private_store private_store; struct wined3d_swapchain *wined3d_swapchain; }; @@ -153,6 +164,7 @@ IUnknown IUnknown_iface; IUnknown *outer_unknown; LONG refcount; + struct wined3d_private_store private_store; IDXGIDevice *device; DXGI_SURFACE_DESC desc; Modified: trunk/reactos/dll/directx/wine/dxgi/factory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/fact…
============================================================================== --- trunk/reactos/dll/directx/wine/dxgi/factory.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dxgi/factory.c [iso-8859-1] Sun Mar 1 22:38:27 2015 @@ -80,6 +80,7 @@ EnterCriticalSection(&dxgi_cs); wined3d_decref(factory->wined3d); LeaveCriticalSection(&dxgi_cs); + wined3d_private_store_cleanup(&factory->private_store); HeapFree(GetProcessHeap(), 0, factory); } @@ -89,25 +90,31 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory1 *iface, REFGUID guid, UINT data_size, const void *data) { - FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_set_private_data(&factory->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory1 *iface, REFGUID guid, const IUnknown *object) { - FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); - - return E_NOTIMPL; + struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); + + TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object); + + return dxgi_set_private_data_interface(&factory->private_store, guid, object); } static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory1 *iface, REFGUID guid, UINT *data_size, void *data) { - FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_get_private_data(&factory->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory1 *iface, REFIID iid, void **parent) @@ -281,12 +288,14 @@ factory->IDXGIFactory1_iface.lpVtbl = &dxgi_factory_vtbl; factory->refcount = 1; + wined3d_private_store_init(&factory->private_store); EnterCriticalSection(&dxgi_cs); factory->wined3d = wined3d_create(0); if (!factory->wined3d) { LeaveCriticalSection(&dxgi_cs); + wined3d_private_store_cleanup(&factory->private_store); return DXGI_ERROR_UNSUPPORTED; } @@ -343,6 +352,7 @@ EnterCriticalSection(&dxgi_cs); wined3d_decref(factory->wined3d); LeaveCriticalSection(&dxgi_cs); + wined3d_private_store_cleanup(&factory->private_store); return hr; } @@ -378,6 +388,7 @@ if (!(factory->device_window = CreateWindowA("static", "DXGI device window", WS_DISABLED, 0, 0, 0, 0, NULL, NULL, NULL, NULL))) { + LeaveCriticalSection(&dxgi_cs); ERR("Failed to create a window.\n"); return NULL; } Modified: trunk/reactos/dll/directx/wine/dxgi/output.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/outp…
============================================================================== --- trunk/reactos/dll/directx/wine/dxgi/output.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dxgi/output.c [iso-8859-1] Sun Mar 1 22:38:27 2015 @@ -63,6 +63,7 @@ if (!refcount) { + wined3d_private_store_cleanup(&This->private_store); HeapFree(GetProcessHeap(), 0, This); } @@ -74,25 +75,31 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateData(IDXGIOutput *iface, REFGUID guid, UINT data_size, const void *data) { - FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_output *output = impl_from_IDXGIOutput(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_set_private_data(&output->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateDataInterface(IDXGIOutput *iface, REFGUID guid, const IUnknown *object) { - FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); - - return E_NOTIMPL; + struct dxgi_output *output = impl_from_IDXGIOutput(iface); + + TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object); + + return dxgi_set_private_data_interface(&output->private_store, guid, object); } static HRESULT STDMETHODCALLTYPE dxgi_output_GetPrivateData(IDXGIOutput *iface, REFGUID guid, UINT *data_size, void *data) { - FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_output *output = impl_from_IDXGIOutput(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_get_private_data(&output->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_output_GetParent(IDXGIOutput *iface, @@ -109,9 +116,34 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDesc(IDXGIOutput *iface, DXGI_OUTPUT_DESC *desc) { - FIXME("iface %p, desc %p stub!\n", iface, desc); - - return E_NOTIMPL; + struct dxgi_output *This = impl_from_IDXGIOutput(iface); + struct wined3d *wined3d; + MONITORINFOEXW monitor_info; + + FIXME("iface %p, desc %p semi-stub!\n", iface, desc); + + if (!desc) + return DXGI_ERROR_INVALID_CALL; + + wined3d = This->adapter->parent->wined3d; + + EnterCriticalSection(&dxgi_cs); + desc->Monitor = wined3d_get_adapter_monitor(wined3d, This->adapter->ordinal); + LeaveCriticalSection(&dxgi_cs); + + if (!desc->Monitor) + return DXGI_ERROR_INVALID_CALL; + + monitor_info.cbSize = sizeof(monitor_info); + if (!GetMonitorInfoW(desc->Monitor, (MONITORINFO *)&monitor_info)) + return DXGI_ERROR_INVALID_CALL; + + memcpy(&desc->DeviceName, &monitor_info.szDevice, sizeof(desc->DeviceName)); + memcpy(&desc->DesktopCoordinates, &monitor_info.rcMonitor, sizeof(RECT)); + desc->AttachedToDesktop = TRUE; + desc->Rotation = DXGI_MODE_ROTATION_IDENTITY; + + return S_OK; } static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *iface, @@ -284,5 +316,6 @@ { output->IDXGIOutput_iface.lpVtbl = &dxgi_output_vtbl; output->refcount = 1; + wined3d_private_store_init(&output->private_store); output->adapter = adapter; } Modified: trunk/reactos/dll/directx/wine/dxgi/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/surf…
============================================================================== --- trunk/reactos/dll/directx/wine/dxgi/surface.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dxgi/surface.c [iso-8859-1] Sun Mar 1 22:38:27 2015 @@ -66,7 +66,10 @@ TRACE("%p decreasing refcount to %u.\n", surface, refcount); if (!refcount) + { + wined3d_private_store_cleanup(&surface->private_store); HeapFree(GetProcessHeap(), 0, surface); + } return refcount; } @@ -105,25 +108,31 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateData(IDXGISurface *iface, REFGUID guid, UINT data_size, const void *data) { - FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_surface *surface = impl_from_IDXGISurface(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_set_private_data(&surface->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateDataInterface(IDXGISurface *iface, REFGUID guid, const IUnknown *object) { - FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); - - return E_NOTIMPL; + struct dxgi_surface *surface = impl_from_IDXGISurface(iface); + + TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object); + + return dxgi_set_private_data_interface(&surface->private_store, guid, object); } static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface *iface, REFGUID guid, UINT *data_size, void *data) { - FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_surface *surface = impl_from_IDXGISurface(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_get_private_data(&surface->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface *iface, REFIID riid, void **parent) @@ -205,6 +214,7 @@ surface->IDXGISurface_iface.lpVtbl = &dxgi_surface_vtbl; surface->IUnknown_iface.lpVtbl = &dxgi_surface_inner_unknown_vtbl; surface->refcount = 1; + wined3d_private_store_init(&surface->private_store); surface->outer_unknown = outer ? outer : &surface->IUnknown_iface; surface->device = device; surface->desc = *desc; Modified: trunk/reactos/dll/directx/wine/dxgi/swapchain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/swap…
============================================================================== --- trunk/reactos/dll/directx/wine/dxgi/swapchain.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dxgi/swapchain.c [iso-8859-1] Sun Mar 1 22:38:27 2015 @@ -77,25 +77,31 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateData(IDXGISwapChain *iface, REFGUID guid, UINT data_size, const void *data) { - FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_set_private_data(&swapchain->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateDataInterface(IDXGISwapChain *iface, REFGUID guid, const IUnknown *object) { - FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); - - return E_NOTIMPL; + struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface); + + TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object); + + return dxgi_set_private_data_interface(&swapchain->private_store, guid, object); } static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetPrivateData(IDXGISwapChain *iface, REFGUID guid, UINT *data_size, void *data) { - FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); - - return E_NOTIMPL; + struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return dxgi_get_private_data(&swapchain->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetParent(IDXGISwapChain *iface, REFIID riid, void **parent) @@ -271,6 +277,9 @@ static void STDMETHODCALLTYPE dxgi_swapchain_wined3d_object_released(void *parent) { + struct dxgi_swapchain *swapchain = parent; + + wined3d_private_store_cleanup(&swapchain->private_store); HeapFree(GetProcessHeap(), 0, parent); } @@ -286,11 +295,13 @@ swapchain->IDXGISwapChain_iface.lpVtbl = &dxgi_swapchain_vtbl; swapchain->refcount = 1; + wined3d_private_store_init(&swapchain->private_store); if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, swapchain, &dxgi_swapchain_wined3d_parent_ops, &swapchain->wined3d_swapchain))) { WARN("Failed to create wined3d swapchain, hr %#x.\n", hr); + wined3d_private_store_cleanup(&swapchain->private_store); return hr; } Modified: trunk/reactos/dll/directx/wine/dxgi/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/util…
============================================================================== --- trunk/reactos/dll/directx/wine/dxgi/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/dxgi/utils.c [iso-8859-1] Sun Mar 1 22:38:27 2015 @@ -319,3 +319,89 @@ return WINED3DFMT_UNKNOWN; } } + +HRESULT dxgi_get_private_data(struct wined3d_private_store *store, + REFGUID guid, UINT *data_size, void *data) +{ + const struct wined3d_private_data *stored_data; + DWORD size_in; + HRESULT hr; + + if (!data_size) + return E_INVALIDARG; + + EnterCriticalSection(&dxgi_cs); + if (!(stored_data = wined3d_private_store_get_private_data(store, guid))) + { + hr = DXGI_ERROR_NOT_FOUND; + *data_size = 0; + goto done; + } + + size_in = *data_size; + *data_size = stored_data->size; + if (!data) + { + hr = S_OK; + goto done; + } + if (size_in < stored_data->size) + { + hr = DXGI_ERROR_MORE_DATA; + goto done; + } + + if (stored_data->flags & WINED3DSPD_IUNKNOWN) + IUnknown_AddRef(stored_data->content.object); + memcpy(data, stored_data->content.data, stored_data->size); + hr = S_OK; + +done: + LeaveCriticalSection(&dxgi_cs); + + return hr; +} + +HRESULT dxgi_set_private_data(struct wined3d_private_store *store, + REFGUID guid, UINT data_size, const void *data) +{ + struct wined3d_private_data *entry; + HRESULT hr; + + if (!data) + { + EnterCriticalSection(&dxgi_cs); + if (!(entry = wined3d_private_store_get_private_data(store, guid))) + { + LeaveCriticalSection(&dxgi_cs); + return S_FALSE; + } + + wined3d_private_store_free_private_data(store, entry); + LeaveCriticalSection(&dxgi_cs); + + return S_OK; + } + + EnterCriticalSection(&dxgi_cs); + hr = wined3d_private_store_set_private_data(store, guid, data, data_size, 0); + LeaveCriticalSection(&dxgi_cs); + + return hr; +} + +HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store, + REFGUID guid, const IUnknown *object) +{ + HRESULT hr; + + if (!object) + return dxgi_set_private_data(store, guid, sizeof(object), &object); + + EnterCriticalSection(&dxgi_cs); + hr = wined3d_private_store_set_private_data(store, + guid, object, sizeof(object), WINED3DSPD_IUNKNOWN); + LeaveCriticalSection(&dxgi_cs); + + return hr; +} Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Mar 1 22:38:27 2015 @@ -43,7 +43,7 @@ reactos/dll/directx/wine/dplayx # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29 reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.27 -reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.27 +reactos/dll/directx/wine/dxgi # Synced to WineStaging-1.7.37 reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.27 reactos/dll/directx/wine/qedit # Synced to Wine-1.7.27 reactos/dll/directx/wine/quartz # Synced to Wine-1.7.27
[View Less]
10 years, 3 months
1
0
0
0
[akhaldi] 66530: [PSDK] Add missing E_NOT_SUFFICIENT_BUFFER definition.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 1 22:36:59 2015 New Revision: 66530 URL:
http://svn.reactos.org/svn/reactos?rev=66530&view=rev
Log: [PSDK] Add missing E_NOT_SUFFICIENT_BUFFER definition. Modified: trunk/reactos/include/psdk/winerror.h Modified: trunk/reactos/include/psdk/winerror.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winerror.h?re…
============================================================================== --- trunk/reactos/include/psdk/winerror.h [
…
[View More]
iso-8859-1] (original) +++ trunk/reactos/include/psdk/winerror.h [iso-8859-1] Sun Mar 1 22:36:59 2015 @@ -2152,6 +2152,8 @@ /* HRESULT values for OLE, SHELL and other Interface stuff */ /* the codes 4000-40ff are reserved for OLE */ +#define E_NOT_SUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) + #ifdef RC_INVOKED #define _HRESULT_TYPEDEF_(x) (x) #else
[View Less]
10 years, 3 months
1
0
0
0
[akhaldi] 66529: [NOTEPAD] Fix CIDs 510916 and 716307. By Ricardo Hanke. CORE-9300
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 1 22:35:47 2015 New Revision: 66529 URL:
http://svn.reactos.org/svn/reactos?rev=66529&view=rev
Log: [NOTEPAD] Fix CIDs 510916 and 716307. By Ricardo Hanke. CORE-9300 Modified: trunk/reactos/base/applications/notepad/dialog.c trunk/reactos/base/applications/notepad/main.c Modified: trunk/reactos/base/applications/notepad/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
========================================
…
[View More]
====================================== --- trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] Sun Mar 1 22:35:47 2015 @@ -983,6 +983,11 @@ if (Globals.hEdit == NULL) { + if (pTemp) + { + HeapFree(GetProcessHeap(), 0, pTemp); + } + ShowLastError(); return; } Modified: trunk/reactos/base/applications/notepad/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
============================================================================== --- trunk/reactos/base/applications/notepad/main.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/notepad/main.c [iso-8859-1] Sun Mar 1 22:35:47 2015 @@ -24,6 +24,8 @@ #include "notepad.h" +#include <strsafe.h> + NOTEPAD_GLOBALS Globals; static ATOM aFINDMSGSTRING; @@ -43,7 +45,7 @@ */ VOID SetFileName(LPCTSTR szFileName) { - _tcscpy(Globals.szFileName, szFileName); + StringCchCopy(Globals.szFileName, SIZEOF(Globals.szFileName), szFileName); Globals.szFileTitle[0] = 0; GetFileTitle(szFileName, Globals.szFileTitle, SIZEOF(Globals.szFileTitle)); }
[View Less]
10 years, 3 months
1
0
0
0
[tkreuzer] 66528: [WIN32K] Rewrite NtUserSetCursorIconData Fixes: - Memory leaks - Cursors left in an unpredictable / unhealthy state, including pointers to freed memory, when an operation failed -...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Mar 1 22:00:24 2015 New Revision: 66528 URL:
http://svn.reactos.org/svn/reactos?rev=66528&view=rev
Log: [WIN32K] Rewrite NtUserSetCursorIconData Fixes: - Memory leaks - Cursors left in an unpredictable / unhealthy state, including pointers to freed memory, when an operation failed - Decision whether a cursor uses an ACON or CURSOR as the underlying structure based on user provided flags, instead of cursor flags, which were not even set in the first place. -
…
[View More]
Allowing a usermode caller to corrupt the cusor structure, by converting an ACON with a smaller allocation size into a CURSOR CORE-9301 #resolve Modified: trunk/reactos/win32ss/include/ntuser.h trunk/reactos/win32ss/user/ntuser/cursoricon.c trunk/reactos/win32ss/user/ntuser/cursoricon.h Modified: trunk/reactos/win32ss/include/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?r…
============================================================================== --- trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] Sun Mar 1 22:00:24 2015 @@ -1103,12 +1103,12 @@ ULONG bpp; ULONG cx; ULONG cy; - INT cpcur; - INT cicur; + UINT cpcur; + UINT cicur; struct tagCURSORDATA *aspcur; DWORD *aicur; INT *ajifRate; - INT iicur; + UINT iicur; } CURSORDATA, *PCURSORDATA; /* !dso CURSORDATA */ /* CURSORF_flags: */ Modified: trunk/reactos/win32ss/user/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/cursoricon.c [iso-8859-1] Sun Mar 1 22:00:24 2015 @@ -75,6 +75,66 @@ return TRUE; } +static +VOID +IntInsertCursorIntoList( + _Inout_ PCURICON_OBJECT pcur) +{ + PPROCESSINFO ppi = pcur->head.ppi; + PCURICON_OBJECT *ppcurHead; + NT_ASSERT((pcur->CURSORF_flags & (CURSORF_GLOBAL|CURSORF_LRSHARED)) != 0); + NT_ASSERT((pcur->CURSORF_flags & CURSORF_LINKED) == 0); + + /* Get the right list head */ + ppcurHead = (pcur->CURSORF_flags & CURSORF_GLOBAL) ? + &gcurFirst : &ppi->pCursorCache; + + UserReferenceObject(pcur); + pcur->pcurNext = *ppcurHead; + *ppcurHead = pcur; + pcur->CURSORF_flags |= CURSORF_LINKED; +} + +// FIXME: should think about using a LIST_ENTRY! +static +VOID +IntRemoveCursorFromList( + _Inout_ PCURICON_OBJECT pcur) +{ + PPROCESSINFO ppi = pcur->head.ppi; + PCURICON_OBJECT *ppcurHead; + PCURICON_OBJECT *ppcur; + NT_ASSERT((pcur->CURSORF_flags & (CURSORF_GLOBAL|CURSORF_LRSHARED)) != 0); + NT_ASSERT((pcur->CURSORF_flags & CURSORF_LINKED) != 0); + + NT_ASSERT((pcur->CURSORF_flags & CURSORF_GLOBAL) == 0); + + /* Get the right list head */ + ppcurHead = (pcur->CURSORF_flags & CURSORF_GLOBAL) ? + &gcurFirst : &ppi->pCursorCache; + + /* Loop all cursors in the cache */ + for (ppcur = ppcurHead; + (*ppcur) != NULL; + ppcur = &(*ppcur)->pcurNext) + { + /* Check if this is the one we are looking for */ + if ((*ppcur) == pcur) + { + /* Remove it from the list */ + (*ppcur) = pcur->pcurNext; + + /* Dereference it */ + UserDereferenceObject(pcur); + pcur->CURSORF_flags &= ~CURSORF_LINKED; + return; + } + } + + /* We did not find it, this must not happen */ + NT_ASSERT(FALSE); +} + VOID IntLoadSystenIcons(HICON hcur, DWORD id) { @@ -110,16 +170,15 @@ if (gasysico[i].type == id) { gasysico[i].handle = pcur; - pcur->CURSORF_flags |= CURSORF_GLOBAL|CURSORF_LINKED; - UserReferenceObject(pcur); + pcur->CURSORF_flags |= CURSORF_GLOBAL; + // // The active switch between LR shared and Global public. // This is hacked around to support this while at the initial system start up. // pcur->head.ppi = NULL; - // - pcur->pcurNext = gcurFirst; - gcurFirst = pcur; + + IntInsertCursorIntoList(pcur); return; } } @@ -231,6 +290,13 @@ return FALSE; } + if (Animated) + { + /* We MUST set this flag, to track whether this is an ACON! */ + CurIcon->CURSORF_flags |= CURSORF_ACON; + } + + NT_ASSERT(CurIcon->pcurNext == NULL); UserDereferenceObject(CurIcon); return hCurIcon; @@ -242,35 +308,11 @@ { PCURICON_OBJECT CurIcon = Object; - /* Try finding it in its process cache */ - if (CurIcon->CURSORF_flags & CURSORF_LRSHARED) - { - PPROCESSINFO ppi; - - ppi = CurIcon->head.ppi; - if (ppi->pCursorCache == CurIcon) - { - ppi->pCursorCache = CurIcon->pcurNext; - UserDereferenceObject(CurIcon); - } - else - { - PCURICON_OBJECT CacheCurIcon = ppi->pCursorCache; - while (CacheCurIcon) - { - if (CacheCurIcon->pcurNext == CurIcon) - { - CacheCurIcon->pcurNext = CurIcon->pcurNext; - break; - } - CacheCurIcon = CacheCurIcon->pcurNext; - } - - /* We must have found it! */ - ASSERT(CacheCurIcon != NULL); - UserDereferenceObject(CurIcon); - } - CurIcon->CURSORF_flags &= ~CURSORF_LINKED; + /* Check if the cursor is in a list */ + if (CurIcon->CURSORF_flags & CURSORF_LINKED) + { + /* Remove the cursor from it's list */ + IntRemoveCursorFromList(CurIcon); } /* We just mark the handle as being destroyed. @@ -279,7 +321,7 @@ return TRUE; } -void +VOID FreeCurIconObject( _In_ PVOID Object) { @@ -295,19 +337,19 @@ if (bmpMask) { GreSetObjectOwner(bmpMask, GDI_OBJ_HMGR_POWNED); - GreDeleteObject(bmpMask); + NT_VERIFY(GreDeleteObject(bmpMask) == TRUE); CurIcon->hbmMask = NULL; } if (bmpColor) { GreSetObjectOwner(bmpColor, GDI_OBJ_HMGR_POWNED); - GreDeleteObject(bmpColor); + NT_VERIFY(GreDeleteObject(bmpColor) == TRUE); CurIcon->hbmColor = NULL; } if (bmpAlpha) { GreSetObjectOwner(bmpAlpha, GDI_OBJ_HMGR_POWNED); - GreDeleteObject(bmpAlpha); + NT_VERIFY(GreDeleteObject(bmpAlpha) == TRUE); CurIcon->hbmAlpha = NULL; } } @@ -318,8 +360,8 @@ for (i = 0; i < AniCurIcon->cpcur; i++) { - UserDereferenceObject(AniCurIcon->aspcur[i]); - IntDestroyCurIconObject(AniCurIcon->aspcur[i]); + NT_VERIFY(UserDereferenceObject(AniCurIcon->aspcur[i]) == TRUE); + NT_VERIFY(IntDestroyCurIconObject(AniCurIcon->aspcur[i]) == TRUE); } ExFreePoolWithTag(AniCurIcon->aspcur, USERTAG_CURSOR); } @@ -385,7 +427,7 @@ if (!(CurIcon = UserGetCurIconObject(hCurIcon))) { - WARN("UserGetIconObject(0x%08x) Failed.\n", hCurIcon); + WARN("UserGetIconObject(0x%p) Failed.\n", hCurIcon); UserLeave(); return FALSE; } @@ -747,7 +789,7 @@ BOOL ret; PCURICON_OBJECT CurIcon = NULL; - TRACE("Enter NtUserDestroyCursorIcon (%p, %u)\n", hCurIcon, bForce); + TRACE("Enter NtUserDestroyCursorIcon (%p, %i)\n", hCurIcon, bForce); UserEnterExclusive(); CurIcon = UserGetCurIconObject(hCurIcon); @@ -862,16 +904,11 @@ /* See if module names match */ if (atomModName == CurIcon->atomModName) { - /* They do. Now see if this is the same resource */ - if (IS_INTRESOURCE(CurIcon->strName.Buffer) != IS_INTRESOURCE(ustrRsrcSafe.Buffer)) - { - /* One is an INT resource and the other is not -> no match */ - CurIcon = CurIcon->pcurNext; - continue; - } - + /* Check if this is an INTRESOURCE */ if (IS_INTRESOURCE(CurIcon->strName.Buffer)) { + /* Compare if it matches the one we are looking for. This also + handles the case, where ustrRsrcSafe is not an INTRESOURCE */ if (CurIcon->strName.Buffer == ustrRsrcSafe.Buffer) { /* INT resources match */ @@ -886,9 +923,8 @@ } CurIcon = CurIcon->pcurNext; } - // - // Now search Global Cursors or Icons. - // + + /* Now search Global Cursors or Icons. */ if (CurIcon == NULL) { CurIcon = gcurFirst; @@ -1067,193 +1103,521 @@ } +static +BOOL +IntSetCursorData( + _Inout_ PCURICON_OBJECT pcur, + _In_opt_ PUNICODE_STRING pustrName, + _In_ ATOM atomModName, + _In_ const CURSORDATA* pcursordata) +{ + NT_ASSERT((pcur->CURSORF_flags & CURSORF_ACON) == 0); + + /* Check if the CURSORF_ACON is also set in the cursor data */ + if (pcursordata->CURSORF_flags & CURSORF_ACON) + { + ERR("Mismatch in CURSORF_flags! cursor: 0x%08lx, data: 0x%08lx\n", + pcur->CURSORF_flags, pcursordata->CURSORF_flags); + return FALSE; + } + + /* Check if this cursor was already set */ + if (pcur->hbmMask != NULL) + { + ERR("Cursor data already set!\n"); + return FALSE; + } + + /* We need a mask */ + if (pcursordata->hbmMask == NULL) + { + ERR("NtUserSetCursorIconData was got no hbmMask.\n"); + EngSetLastError(ERROR_INVALID_PARAMETER); + goto Cleanup; + } + + /* Take ownership of the mask bitmap */ + if (!GreSetObjectOwner(pcursordata->hbmMask, GDI_OBJ_HMGR_PUBLIC)) + { + goto Cleanup; + } + + /* Check if we have a color bitmap */ + if (pcursordata->hbmColor) + { + /* Take ownership of the color bitmap */ + if (!GreSetObjectOwner(pcursordata->hbmColor, GDI_OBJ_HMGR_PUBLIC)) + { + goto Cleanup; + } + } + + /* Check if we have an alpha bitmap */ + if (pcursordata->hbmAlpha) + { + /* Take ownership of the alpha bitmap */ + if (!GreSetObjectOwner(pcursordata->hbmAlpha, GDI_OBJ_HMGR_PUBLIC)) + { + goto Cleanup; + } + } + + /* Free the old name */ + if (pcur->strName.Buffer != NULL) + { + ExFreePoolWithTag(pcur->strName.Buffer, TAG_STRING); + pcur->strName.Buffer = NULL; + pcur->strName.Length = 0; + pcur->strName.MaximumLength = 0; + } + + /* Free the module atom */ + if (pcur->atomModName != 0) + { + NT_VERIFY(NT_SUCCESS(RtlDeleteAtomFromAtomTable(gAtomTable, pcur->atomModName))); + } + + /* Now set the new cursor data */ + pcur->atomModName = atomModName; + pcur->rt = pcursordata->rt; + pcur->CURSORF_flags = pcursordata->CURSORF_flags & CURSORF_USER_MASK; + pcur->xHotspot = pcursordata->xHotspot; + pcur->yHotspot = pcursordata->yHotspot; + pcur->hbmMask = pcursordata->hbmMask; + pcur->hbmColor = pcursordata->hbmColor; + pcur->hbmAlpha = pcursordata->hbmAlpha; + pcur->rcBounds.left = 0; + pcur->rcBounds.top = 0; + pcur->rcBounds.right = pcursordata->cx; + pcur->rcBounds.bottom = pcursordata->cy; + pcur->hbmUserAlpha = pcursordata->hbmUserAlpha; + pcur->bpp = pcursordata->bpp; + pcur->cx = pcursordata->cx; + pcur->cy = pcursordata->cy; + if (pustrName != NULL) + { + pcur->strName = *pustrName; + } + + return TRUE; + +Cleanup: + + if (pcursordata->hbmMask != NULL) + { + GreSetObjectOwner(pcursordata->hbmMask, GDI_OBJ_HMGR_POWNED); + GreDeleteObject(pcursordata->hbmMask); + } + + if (pcursordata->hbmColor != NULL) + { + GreSetObjectOwner(pcursordata->hbmColor, GDI_OBJ_HMGR_POWNED); + GreDeleteObject(pcursordata->hbmColor); + } + + if (pcursordata->hbmAlpha != NULL) + { + GreSetObjectOwner(pcursordata->hbmAlpha, GDI_OBJ_HMGR_POWNED); + GreDeleteObject(pcursordata->hbmAlpha); + } + + return FALSE; +} + +static +BOOL +IntSetAconData( + _Inout_ PACON pacon, + _In_opt_ PUNICODE_STRING pustrName, + _In_ ATOM atomModName, + _In_ PCURSORDATA pcursordata) +{ + PCURICON_OBJECT *aspcur; + DWORD *aicur; + INT *ajifRate; + PCURSORDATA pcdFrame; + HCURSOR hcurFrame; + UINT cjSize, i; + + NT_ASSERT((pacon->CURSORF_flags & CURSORF_ACON) != 0); + NT_ASSERT((ULONG_PTR)pcursordata->aspcur > MmUserProbeAddress); + NT_ASSERT((ULONG_PTR)pcursordata->aicur > MmUserProbeAddress); + NT_ASSERT((ULONG_PTR)pcursordata->ajifRate > MmUserProbeAddress); + NT_ASSERT(pcursordata->cpcur > 0); + NT_ASSERT(pcursordata->cicur > 0); + + /* Check if the CURSORF_ACON is also set in the cursor data */ + if (!(pcursordata->CURSORF_flags & CURSORF_ACON)) + { + ERR("Mismatch in CURSORF_flags! acon: 0x%08lx, data: 0x%08lx\n", + pacon->CURSORF_flags, pcursordata->CURSORF_flags); + return FALSE; + } + + /* Check if this acon was already set */ + if (pacon->aspcur != NULL) + { + ERR("Acon data already set!\n"); + return FALSE; + } + + /* Calculate size: one cursor object for each frame, and a frame + index and jiffies for each "step" */ + cjSize = (pcursordata->cpcur * sizeof(CURICON_OBJECT*)) + + (pcursordata->cicur * sizeof(DWORD)) + + (pcursordata->cicur * sizeof(INT)); + + /* Allocate a buffer */ + aspcur = ExAllocatePoolWithTag(PagedPool, cjSize, USERTAG_CURSOR); + if (aspcur == NULL) + { + ERR("Failed to allocate memory (cpcur = %u, cicur = %u)\n", + pcursordata->cpcur, pcursordata->cicur); + return FALSE; + } + + /* Set the pointers */ + aicur = (DWORD*)&aspcur[pcursordata->cpcur]; + ajifRate = (INT*)&aicur[pcursordata->cicur]; + + /* Get a pointer to the cursor data for each frame */ + pcdFrame = pcursordata->aspcur; + + /* Create the cursors */ + for (i = 0; i < pcursordata->cpcur; i++) + { + /* Create a cursor for this frame */ + hcurFrame = IntCreateCurIconHandle(FALSE); + if (hcurFrame == NULL) + { + ERR("Failed to create a cursor for frame %u\n", i); + aspcur[i] = NULL; + goto Cleanup; + } + + /* Get a pointer to the frame cursor */ + aspcur[i] = UserGetCurIconObject(hcurFrame); + NT_ASSERT(aspcur[i] != NULL); + + /* Mark this cursor as an acon frame */ + pcdFrame->CURSORF_flags |= CURSORF_ACONFRAME; + + /* Set the cursor data for this frame */ + if (!IntSetCursorData(aspcur[i], NULL, 0, &pcdFrame[i])) + { + ERR("Failed to set cursor data for frame %u\n", i); + goto Cleanup; + } + } + + /* Free the old name */ + if (pacon->strName.Buffer != NULL) + { + ExFreePoolWithTag(pacon->strName.Buffer, TAG_STRING); + pacon->strName.Buffer = NULL; + pacon->strName.Length = 0; + pacon->strName.MaximumLength = 0; + } + + /* Free the module atom */ + if (pacon->atomModName != 0) + { + NT_VERIFY(NT_SUCCESS(RtlDeleteAtomFromAtomTable(gAtomTable, pacon->atomModName))); + } + + /* Free the previous frames */ + if (pacon->aspcur != NULL) + { + for (i = 0; i < pacon->cpcur; i++) + { + NT_VERIFY(UserDereferenceObject(pacon->aspcur[i]) == TRUE); + NT_VERIFY(IntDestroyCurIconObject(pacon->aspcur[i]) == TRUE); + } + ExFreePoolWithTag(pacon->aspcur, USERTAG_CURSOR); + } + + /* Finally set the data in the acon */ + pacon->atomModName = atomModName; + pacon->rt = pcursordata->rt; + pacon->CURSORF_flags = pcursordata->CURSORF_flags & CURSORF_USER_MASK; + pacon->cpcur = pcursordata->cpcur; + pacon->cicur = pcursordata->cicur; + pacon->aspcur = aspcur; + pacon->aicur = aicur; + pacon->ajifRate = ajifRate; + pacon->iicur = 0; + if (pustrName != NULL) + { + pacon->strName = *pustrName; + } + + return TRUE; + +Cleanup: + + /* Clean up the cursors we created */ + for (i = 0; i < pcursordata->cpcur; i++) + { + if (aspcur[i] == NULL) + break; + + /* Destroy this cursor */ + NT_VERIFY(UserDereferenceObject(aspcur[i]) == TRUE); + NT_VERIFY(IntDestroyCurIconObject(aspcur[i]) == TRUE); + } + + /* Delete the allocated structure */ + ExFreePoolWithTag(aspcur, USERTAG_CURSOR); + + return FALSE; +} + +BOOL +APIENTRY +UserSetCursorIconData( + _In_ HCURSOR hcursor, + _In_opt_ PUNICODE_STRING pustrModule, + _In_opt_ PUNICODE_STRING pustrRsrc, + _In_ PCURSORDATA pcursordata) +{ + PCURICON_OBJECT pcur; + ATOM atomModName; + NTSTATUS status; + BOOL bResult; + + /* Do we have a module name? */ + if (pustrModule != NULL) + { + /* Create an atom for the module name */ + status = RtlAddAtomToAtomTable(gAtomTable, + pustrModule->Buffer, + &atomModName); + if (!NT_SUCCESS(status)) + { + ERR("Failed to create atom from module name '%wZ': %0x8lx\n", + pustrModule, status); + return FALSE; + } + } + else + { + /* No module name atom */ + atomModName = 0; + } + + /* Reference the cursor */ + pcur = UserGetCurIconObject(hcursor); + if (pcur == NULL) + { + ERR("Failed to reference cursor %p\n", hcursor); + bResult = FALSE; + goto Exit; + } + + /* Check if this is an acon */ + if (pcur->CURSORF_flags & CURSORF_ACON) + { + bResult = IntSetAconData((PACON)pcur, + pustrRsrc, + atomModName, + pcursordata); + } + else + { + bResult = IntSetCursorData(pcur, + pustrRsrc, + atomModName, + pcursordata); + } + +Exit: + + /* Check if we had success */ + if (bResult != FALSE) + { + /* Check if this is an LRSHARED cursor now */ + if (pcur->CURSORF_flags & CURSORF_LRSHARED) + { + /* Insert the cursor into the list. */ + IntInsertCursorIntoList(pcur); + } + } + else + { + /* Cleanup on failure */ + if (atomModName != 0) + { + NT_VERIFY(NT_SUCCESS(RtlDeleteAtomFromAtomTable(gAtomTable, atomModName))); + } + } + + /* Dereference the cursor and return the result */ + UserDereferenceObject(pcur); + return bResult; +} + + /* * @implemented */ +__kernel_entry BOOL APIENTRY NtUserSetCursorIconData( - _In_ HCURSOR Handle, - _In_opt_ PUNICODE_STRING pustrModule, - _In_opt_ PUNICODE_STRING pustrRsrc, - _In_ const CURSORDATA* pCursorData) -{ - PCURICON_OBJECT CurIcon; - NTSTATUS Status = STATUS_SUCCESS; - BOOLEAN Ret = FALSE; - BOOLEAN IsShared = FALSE, IsAnim = FALSE; - DWORD numFrames; - UINT i = 0; + _In_ HCURSOR hcursor, + _In_opt_ PUNICODE_STRING pustrModule, + _In_opt_ PUNICODE_STRING pustrRsrc, + _In_ const CURSORDATA* pCursorData) +{ + CURSORDATA cursordata; + UNICODE_STRING ustrModule, ustrRsrc; + _SEH2_VOLATILE PVOID pvBuffer; + UINT cjSize; + NTSTATUS status; + BOOL bResult; TRACE("Enter NtUserSetCursorIconData\n"); + /* Initialize buffer, so we can handle cleanup */ + ustrRsrc.Buffer = NULL; + ustrModule.Buffer = NULL; + pvBuffer = NULL; + + _SEH2_TRY + { + /* Probe and capture the cursor data structure */ + ProbeForRead(pCursorData, sizeof(*pCursorData), 1); + cursordata = *pCursorData; + + /* Check if this is an animated cursor */ + if (cursordata.CURSORF_flags & CURSORF_ACON) + { + /* Check of the range is ok */ + if ((cursordata.cpcur == 0) || (cursordata.cicur == 0) || + (cursordata.cpcur > 1000) || (cursordata.cicur > 1000)) + { + ERR("Range error (cpcur = %u, cicur = %u)\n", + cursordata.cpcur, cursordata.cicur); + bResult = FALSE; + goto Exit; + } + + /* Calculate size: one cursor data structure for each frame, + and a frame index and jiffies for each "step" */ + cjSize = (cursordata.cpcur * sizeof(CURSORDATA)) + + (cursordata.cicur * sizeof(DWORD)) + + (cursordata.cicur * sizeof(INT)); + + /* Allocate a buffer */ + pvBuffer = ExAllocatePoolWithTag(PagedPool, cjSize, USERTAG_CURSOR); + if (pvBuffer == NULL) + { + ERR("Failed to allocate memory (cpcur = %u, cicur = %u)\n", + cursordata.cpcur, cursordata.cicur); + bResult = FALSE; + goto Exit; + } + + /* Set the pointers */ + cursordata.aspcur = (CURSORDATA*)pvBuffer; + cursordata.aicur = (DWORD*)&cursordata.aspcur[cursordata.cpcur]; + cursordata.ajifRate = (INT*)&cursordata.aicur[cursordata.cicur]; + + /* Probe and copy aspcur */ + ProbeForRead(pCursorData->aspcur, cursordata.cpcur * sizeof(CURSORDATA), 1); + RtlCopyMemory(cursordata.aspcur, + pCursorData->aspcur, + cursordata.cpcur * sizeof(CURSORDATA)); + + /* Probe and copy aicur */ + ProbeForRead(pCursorData->aicur, cursordata.cicur * sizeof(DWORD), 1); + RtlCopyMemory(cursordata.aicur, + pCursorData->aicur, + cursordata.cicur * sizeof(DWORD)); + + /* Probe and copy ajifRate */ + ProbeForRead(pCursorData->ajifRate, cursordata.cicur * sizeof(INT), 1); + RtlCopyMemory(cursordata.ajifRate, + pCursorData->ajifRate, + cursordata.cicur * sizeof(INT)); + } + else + { + /* This is a standard cursor, we don't use the pointers */ + cursordata.aspcur = NULL; + cursordata.aicur = NULL; + cursordata.ajifRate = NULL; + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastNtError(_SEH2_GetExceptionCode()); + bResult = FALSE; + goto Exit; + } + _SEH2_END + + /* Check if we got a module name */ + if (pustrModule != NULL) + { + /* Capture the name */ + status = ProbeAndCaptureUnicodeString(&ustrModule, UserMode, pustrModule); + if (!NT_SUCCESS(status)) + { + ERR("Failed to copy pustrModule: status 0x%08lx\n", status); + goto Exit; + } + } + + /* Check if we got a resource name */ + if (pustrRsrc != NULL) + { + /* We use this function, because INTRESOURCEs and ATOMs are the same */ + status = ProbeAndCaptureUnicodeStringOrAtom(&ustrRsrc, pustrRsrc); + if (!NT_SUCCESS(status)) + { + ERR("Failed to copy pustrRsrc: status 0x%08lx\n", status); + goto Exit; + } + } + + /* Acquire the global user lock */ UserEnterExclusive(); - if (!(CurIcon = UserGetCurIconObject(Handle))) - { - UserLeave(); - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - - _SEH2_TRY - { - ProbeForRead(pCursorData, sizeof(*pCursorData), 1); - if (pCursorData->CURSORF_flags & CURSORF_ACON) - { - /* This is an animated cursor */ - PACON AniCurIcon = (PACON)CurIcon; - DWORD numSteps; - - numFrames = AniCurIcon->cpcur = pCursorData->cpcur; - numSteps = AniCurIcon->cicur = pCursorData->cicur; - AniCurIcon->iicur = pCursorData->iicur; - AniCurIcon->rt = pCursorData->rt; - - /* Calculate size: one cursor object for each frame, and a frame index and jiffies for each "step" */ - AniCurIcon->aspcur = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, /* Let SEH catch allocation failures */ - numFrames * sizeof(CURICON_OBJECT*) + numSteps * (sizeof(DWORD) + sizeof(INT)), - USERTAG_CURSOR); - AniCurIcon->aicur = (DWORD*)(AniCurIcon->aspcur + numFrames); - AniCurIcon->ajifRate = (INT*)(AniCurIcon->aicur + numSteps); - - RtlZeroMemory(AniCurIcon->aspcur, numFrames * sizeof(CURICON_OBJECT*)); - - ProbeForRead(pCursorData->aicur, numSteps * sizeof(DWORD), 1); - RtlCopyMemory(AniCurIcon->aicur, pCursorData->aicur, numSteps * sizeof(DWORD)); - ProbeForRead(pCursorData->ajifRate, numSteps * sizeof(INT), 1); - RtlCopyMemory(AniCurIcon->ajifRate, pCursorData->ajifRate, numSteps * sizeof(INT)); - - AniCurIcon->CURSORF_flags = pCursorData->CURSORF_flags; - pCursorData = pCursorData->aspcur; - - IsAnim = TRUE; - } - else - { - CurIcon->xHotspot = pCursorData->xHotspot; - CurIcon->yHotspot = pCursorData->yHotspot; - CurIcon->cx = pCursorData->cx; - CurIcon->cy = pCursorData->cy; - CurIcon->rt = pCursorData->rt; - CurIcon->bpp = pCursorData->bpp; - CurIcon->hbmMask = pCursorData->hbmMask; - CurIcon->hbmColor = pCursorData->hbmColor; - CurIcon->hbmAlpha = pCursorData->hbmAlpha; - CurIcon->CURSORF_flags = pCursorData->CURSORF_flags; - } - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END - - if (!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - goto done; - } - - if (IsAnim) - { - PACON AniCurIcon = (PACON)CurIcon; - /* This is an animated cursor. Create a cursor object for each frame and set up the data */ - for (i = 0; i < numFrames; i++) - { - HANDLE hCurFrame = IntCreateCurIconHandle(FALSE); - if (!NtUserSetCursorIconData(hCurFrame, NULL, NULL, pCursorData)) - goto done; - AniCurIcon->aspcur[i] = UserGetCurIconObject(hCurFrame); - if (!AniCurIcon->aspcur[i]) - goto done; - pCursorData++; - } - } - - if (CurIcon->CURSORF_flags & CURSORF_LRSHARED) - { - IsShared = TRUE; - } - - // Support global public cursors and icons too. - if (!IsAnim || IsShared) - { - if (pustrRsrc && pustrModule) - { - UNICODE_STRING ustrModuleSafe; - /* We use this convenient function, because INTRESOURCEs and ATOMs are the same */ - Status = ProbeAndCaptureUnicodeStringOrAtom(&CurIcon->strName, pustrRsrc); - if (!NT_SUCCESS(Status)) - goto done; - Status = ProbeAndCaptureUnicodeString(&ustrModuleSafe, UserMode, pustrModule); - if (!NT_SUCCESS(Status)) - goto done; - Status = RtlAddAtomToAtomTable(gAtomTable, ustrModuleSafe.Buffer, &CurIcon->atomModName); - ReleaseCapturedUnicodeString(&ustrModuleSafe, UserMode); - if (!NT_SUCCESS(Status)) - goto done; - } - } - - if (!CurIcon->hbmMask) - { - ERR("NtUserSetCursorIconData was got no hbmMask.\n"); - EngSetLastError(ERROR_INVALID_PARAMETER); - goto done; - } - - GreSetObjectOwner(CurIcon->hbmMask, GDI_OBJ_HMGR_PUBLIC); - - if (CurIcon->hbmColor) - GreSetObjectOwner(CurIcon->hbmColor, GDI_OBJ_HMGR_PUBLIC); - - if (CurIcon->hbmAlpha) - GreSetObjectOwner(CurIcon->hbmAlpha, GDI_OBJ_HMGR_PUBLIC); - - if (IsShared) - { - /* Update process cache in case of shared cursor */ - PPROCESSINFO ppi = CurIcon->head.ppi; - UserReferenceObject(CurIcon); - CurIcon->pcurNext = ppi->pCursorCache; - ppi->pCursorCache = CurIcon; - CurIcon->CURSORF_flags |= CURSORF_LINKED; - } - - Ret = TRUE; - -done: - if (!Ret && (!IsAnim || IsShared)) - { - if (!IS_INTRESOURCE(CurIcon->strName.Buffer)) - ExFreePoolWithTag(CurIcon->strName.Buffer, TAG_STRING); - } - - if (!Ret && IsAnim) - { - PACON AniCurIcon = (PACON)CurIcon; - for (i = 0; i < numFrames; i++) - { - if (AniCurIcon->aspcur[i]) - { - UserDereferenceObject(AniCurIcon->aspcur[i]); - IntDestroyCurIconObject(AniCurIcon->aspcur[i]); - } - } - AniCurIcon->cicur = 0; - AniCurIcon->cpcur = 0; - ExFreePoolWithTag(AniCurIcon->aspcur, USERTAG_CURSOR); - AniCurIcon->aspcur = NULL; - AniCurIcon->aicur = NULL; - AniCurIcon->ajifRate = NULL; - } - - UserDereferenceObject(CurIcon); - TRACE("Leave NtUserSetCursorIconData, ret=%i\n",Ret); + /* Call the internal function */ + bResult = UserSetCursorIconData(hcursor, + pustrModule ? &ustrModule : NULL, + pustrRsrc ? &ustrRsrc : NULL, + &cursordata); + + /* Release the global user lock */ UserLeave(); - return Ret; +Exit: + + /* Free the captured module name */ + if ((ustrModule.Buffer != NULL) && !IS_INTRESOURCE(ustrModule.Buffer)) + { + ReleaseCapturedUnicodeString(&ustrModule, UserMode); + } + + if (pvBuffer != NULL) + { + ExFreePoolWithTag(pvBuffer, USERTAG_CURSOR); + } + + /* Additional cleanup on failure */ + if (bResult == FALSE) + { + if (ustrRsrc.Buffer != NULL) + { + ExFreePoolWithTag(ustrRsrc.Buffer, TAG_STRING); + } + } + + TRACE("Leave NtUserSetCursorIconData, bResult = %i\n", bResult); + + return bResult; } /* Mostly inspired from wine code. @@ -1681,7 +2045,7 @@ if (!(pIcon = UserGetCurIconObject(hIcon))) { - ERR("UserGetCurIconObject(0x%08x) failed!\n", hIcon); + ERR("UserGetCurIconObject(0x%p) failed!\n", hIcon); UserLeave(); return FALSE; } @@ -1767,7 +2131,7 @@ UserDereferenceObject(CurIcon); UserLeave(); - TRACE("Leaving NtUserGetCursorFrameInfo, ret = 0x%08x\n", ret); + TRACE("Leaving NtUserGetCursorFrameInfo, ret = 0x%p\n", ret); return ret; } @@ -1814,11 +2178,9 @@ if (ppi->W32PF_flags & W32PF_CREATEDWINORDC) { gasyscur[i].handle = pcur; - pcur->CURSORF_flags |= CURSORF_GLOBAL|CURSORF_LINKED; - UserReferenceObject(pcur); + pcur->CURSORF_flags |= CURSORF_GLOBAL; pcur->head.ppi = NULL; - pcur->pcurNext = gcurFirst; - gcurFirst = pcur; + IntInsertCursorIntoList(pcur); Ret = TRUE; } break; Modified: trunk/reactos/win32ss/user/ntuser/cursoricon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/cursoricon.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/cursoricon.h [iso-8859-1] Sun Mar 1 22:00:24 2015 @@ -1,6 +1,10 @@ #pragma once #define MAXCURICONHANDLES 4096 + +/* Flags that are allowed to be set through NtUserSetCursorIconData() */ +#define CURSORF_USER_MASK \ + (CURSORF_FROMRESOURCE | CURSORF_LRSHARED | CURSORF_ACON) typedef struct _CURICON_OBJECT { @@ -35,18 +39,21 @@ PCURICON_OBJECT * aspcur; DWORD * aicur; INT * ajifRate; - INT iicur; + UINT iicur; } ACON, *PACON; C_ASSERT(FIELD_OFFSET(ACON, cpcur) == FIELD_OFFSET(CURICON_OBJECT, xHotspot)); BOOLEAN -IntDestroyCurIconObject(PVOID Object); +IntDestroyCurIconObject( + _In_ PVOID Object); VOID FASTCALL IntCleanupCurIconCache(PPROCESSINFO Win32Process); -void FreeCurIconObject(PVOID Object); +VOID +FreeCurIconObject( + _In_ PVOID Object); typedef struct _CURSORACCELERATION_INFO {
[View Less]
10 years, 3 months
1
0
0
0
[tkreuzer] 66527: [WIN32K] Formatting only. Add a space after if/for/while.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Mar 1 17:59:51 2015 New Revision: 66527 URL:
http://svn.reactos.org/svn/reactos?rev=66527&view=rev
Log: [WIN32K] Formatting only. Add a space after if/for/while. Modified: trunk/reactos/win32ss/user/ntuser/cursoricon.c Modified: trunk/reactos/win32ss/user/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
============================================================================== --- trunk/reactos/
…
[View More]
win32ss/user/ntuser/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/cursoricon.c [iso-8859-1] Sun Mar 1 17:59:51 2015 @@ -105,7 +105,7 @@ return; } - for(i = 0 ; i < 6; i++) + for (i = 0 ; i < 6; i++) { if (gasysico[i].type == id) { @@ -177,7 +177,7 @@ RECTL rcClip; POINT pt; - if(!(DesktopWindow = UserGetDesktopWindow())) + if (!(DesktopWindow = UserGetDesktopWindow())) { return FALSE; } @@ -190,10 +190,10 @@ else rcClip = CurInfo->rcClip; - if(x >= rcClip.right) x = rcClip.right - 1; - if(x < rcClip.left) x = rcClip.left; - if(y >= rcClip.bottom) y = rcClip.bottom - 1; - if(y < rcClip.top) y = rcClip.top; + if (x >= rcClip.right) x = rcClip.right - 1; + if (x < rcClip.left) x = rcClip.left; + if (y >= rcClip.bottom) y = rcClip.bottom - 1; + if (y < rcClip.top) y = rcClip.top; pt.x = x; pt.y = y; @@ -284,8 +284,8 @@ _In_ PVOID Object) { PCURICON_OBJECT CurIcon = Object; - - if(!(CurIcon->CURSORF_flags & CURSORF_ACON)) + + if (!(CurIcon->CURSORF_flags & CURSORF_ACON)) { HBITMAP bmpMask = CurIcon->hbmMask; HBITMAP bmpColor = CurIcon->hbmColor; @@ -316,7 +316,7 @@ PACON AniCurIcon = (PACON)CurIcon; UINT i; - for(i = 0; i < AniCurIcon->cpcur; i++) + for (i = 0; i < AniCurIcon->cpcur; i++) { UserDereferenceObject(AniCurIcon->aspcur[i]); IntDestroyCurIconObject(AniCurIcon->aspcur[i]); @@ -380,7 +380,7 @@ EngSetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - + UserEnterExclusive(); if (!(CurIcon = UserGetCurIconObject(hCurIcon))) @@ -389,17 +389,17 @@ UserLeave(); return FALSE; } - + /* Give back the icon information */ - if(IconInfo) + if (IconInfo) { PCURICON_OBJECT FrameCurIcon = CurIcon; - if(CurIcon->CURSORF_flags & CURSORF_ACON) + if (CurIcon->CURSORF_flags & CURSORF_ACON) { /* Get information from first frame. */ FrameCurIcon = ((PACON)CurIcon)->aspcur[0]; } - + /* Fill data */ ii.fIcon = is_icon(FrameCurIcon); ii.xHotspot = FrameCurIcon->xHotspot; @@ -439,7 +439,7 @@ } /* Give back the module name */ - if(lpModule) + if (lpModule) { ULONG BufLen = 0; if (!CurIcon->atomModName) @@ -475,7 +475,7 @@ goto leave; } } - + if (lpResName) { if (!CurIcon->strName.Buffer) @@ -515,7 +515,7 @@ SetLastNtError(Status); goto leave; } - + Ret = TRUE; leave: @@ -551,7 +551,7 @@ goto cleanup; } - if(CurIcon->CURSORF_flags & CURSORF_ACON) + if (CurIcon->CURSORF_flags & CURSORF_ACON) { /* Use first frame for animated cursors */ PACON AniCurIcon = (PACON)CurIcon; @@ -822,8 +822,7 @@ RTL_ATOM atomModName; TRACE("Enter NtUserFindExistingCursorIcon\n"); - - + _SEH2_TRY { ProbeForRead(param, sizeof(*param), 1); @@ -837,14 +836,14 @@ /* Capture resource name (it can be an INTRESOURCE == ATOM) */ Status = ProbeAndCaptureUnicodeStringOrAtom(&ustrRsrcSafe, pustrRsrc); - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) return NULL; Status = ProbeAndCaptureUnicodeString(&ustrModuleSafe, UserMode, pustrModule); - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) goto done; Status = RtlLookupAtomInAtomTable(gAtomTable, ustrModuleSafe.Buffer, &atomModName); ReleaseCapturedUnicodeString(&ustrModuleSafe, UserMode); - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) { /* The module is not in the atom table. No chance to find the cursor */ goto done; @@ -852,7 +851,7 @@ UserEnterShared(); CurIcon = pProcInfo->pCursorCache; - while(CurIcon) + while (CurIcon) { /* Icon/cursor */ if (paramSafe.bIcon != is_icon(CurIcon)) @@ -890,10 +889,10 @@ // // Now search Global Cursors or Icons. // - if(CurIcon == NULL) + if (CurIcon == NULL) { CurIcon = gcurFirst; - while(CurIcon) + while (CurIcon) { /* Icon/cursor */ if (paramSafe.bIcon != is_icon(CurIcon)) @@ -928,14 +927,14 @@ CurIcon = CurIcon->pcurNext; } } - if(CurIcon) + if (CurIcon) Ret = CurIcon->head.h; UserLeave(); done: - if(!IS_INTRESOURCE(ustrRsrcSafe.Buffer)) + if (!IS_INTRESOURCE(ustrRsrcSafe.Buffer)) ExFreePoolWithTag(ustrRsrcSafe.Buffer, TAG_STRING); - + return Ret; } @@ -1030,9 +1029,9 @@ Problem: System Global Cursors start out having at least 2 lock counts. If a system - cursor is the default cursor and is returned to the caller twice in its - life, the count will reach zero. Causing an assert to occur in objects. - + cursor is the default cursor and is returned to the caller twice in its + life, the count will reach zero. Causing an assert to occur in objects. + This fixes a SeaMonkey crash while the mouse crosses a boundary. */ if (pcurOld->CURSORF_flags & CURSORF_GLOBAL) @@ -1085,9 +1084,9 @@ BOOLEAN IsShared = FALSE, IsAnim = FALSE; DWORD numFrames; UINT i = 0; - + TRACE("Enter NtUserSetCursorIconData\n"); - + UserEnterExclusive(); if (!(CurIcon = UserGetCurIconObject(Handle))) @@ -1100,7 +1099,7 @@ _SEH2_TRY { ProbeForRead(pCursorData, sizeof(*pCursorData), 1); - if(pCursorData->CURSORF_flags & CURSORF_ACON) + if (pCursorData->CURSORF_flags & CURSORF_ACON) { /* This is an animated cursor */ PACON AniCurIcon = (PACON)CurIcon; @@ -1124,7 +1123,7 @@ RtlCopyMemory(AniCurIcon->aicur, pCursorData->aicur, numSteps * sizeof(DWORD)); ProbeForRead(pCursorData->ajifRate, numSteps * sizeof(INT), 1); RtlCopyMemory(AniCurIcon->ajifRate, pCursorData->ajifRate, numSteps * sizeof(INT)); - + AniCurIcon->CURSORF_flags = pCursorData->CURSORF_flags; pCursorData = pCursorData->aspcur; @@ -1149,55 +1148,55 @@ Status = _SEH2_GetExceptionCode(); } _SEH2_END - + if (!NT_SUCCESS(Status)) { SetLastNtError(Status); goto done; } - if(IsAnim) + if (IsAnim) { PACON AniCurIcon = (PACON)CurIcon; /* This is an animated cursor. Create a cursor object for each frame and set up the data */ - for(i = 0; i < numFrames; i++) + for (i = 0; i < numFrames; i++) { HANDLE hCurFrame = IntCreateCurIconHandle(FALSE); - if(!NtUserSetCursorIconData(hCurFrame, NULL, NULL, pCursorData)) + if (!NtUserSetCursorIconData(hCurFrame, NULL, NULL, pCursorData)) goto done; AniCurIcon->aspcur[i] = UserGetCurIconObject(hCurFrame); - if(!AniCurIcon->aspcur[i]) + if (!AniCurIcon->aspcur[i]) goto done; pCursorData++; } } - - if(CurIcon->CURSORF_flags & CURSORF_LRSHARED) + + if (CurIcon->CURSORF_flags & CURSORF_LRSHARED) { IsShared = TRUE; } // Support global public cursors and icons too. - if(!IsAnim || IsShared) - { - if(pustrRsrc && pustrModule) + if (!IsAnim || IsShared) + { + if (pustrRsrc && pustrModule) { UNICODE_STRING ustrModuleSafe; /* We use this convenient function, because INTRESOURCEs and ATOMs are the same */ Status = ProbeAndCaptureUnicodeStringOrAtom(&CurIcon->strName, pustrRsrc); - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) goto done; Status = ProbeAndCaptureUnicodeString(&ustrModuleSafe, UserMode, pustrModule); - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) goto done; Status = RtlAddAtomToAtomTable(gAtomTable, ustrModuleSafe.Buffer, &CurIcon->atomModName); ReleaseCapturedUnicodeString(&ustrModuleSafe, UserMode); - if(!NT_SUCCESS(Status)) + if (!NT_SUCCESS(Status)) goto done; } } - if(!CurIcon->hbmMask) + if (!CurIcon->hbmMask) { ERR("NtUserSetCursorIconData was got no hbmMask.\n"); EngSetLastError(ERROR_INVALID_PARAMETER); @@ -1206,13 +1205,13 @@ GreSetObjectOwner(CurIcon->hbmMask, GDI_OBJ_HMGR_PUBLIC); - if(CurIcon->hbmColor) + if (CurIcon->hbmColor) GreSetObjectOwner(CurIcon->hbmColor, GDI_OBJ_HMGR_PUBLIC); - - if(CurIcon->hbmAlpha) + + if (CurIcon->hbmAlpha) GreSetObjectOwner(CurIcon->hbmAlpha, GDI_OBJ_HMGR_PUBLIC); - if(IsShared) + if (IsShared) { /* Update process cache in case of shared cursor */ PPROCESSINFO ppi = CurIcon->head.ppi; @@ -1221,22 +1220,22 @@ ppi->pCursorCache = CurIcon; CurIcon->CURSORF_flags |= CURSORF_LINKED; } - + Ret = TRUE; done: - if(!Ret && (!IsAnim || IsShared)) - { - if(!IS_INTRESOURCE(CurIcon->strName.Buffer)) + if (!Ret && (!IsAnim || IsShared)) + { + if (!IS_INTRESOURCE(CurIcon->strName.Buffer)) ExFreePoolWithTag(CurIcon->strName.Buffer, TAG_STRING); } - if(!Ret && IsAnim) + if (!Ret && IsAnim) { PACON AniCurIcon = (PACON)CurIcon; - for(i = 0; i < numFrames; i++) - { - if(AniCurIcon->aspcur[i]) + for (i = 0; i < numFrames; i++) + { + if (AniCurIcon->aspcur[i]) { UserDereferenceObject(AniCurIcon->aspcur[i]); IntDestroyCurIconObject(AniCurIcon->aspcur[i]); @@ -1285,9 +1284,9 @@ RECTL rcDest, rcSrc; CLIPOBJ* pdcClipObj = NULL; EXLATEOBJ exlo; - + /* Stupid case */ - if((diFlags & DI_NORMAL) == 0) + if ((diFlags & DI_NORMAL) == 0) { ERR("DrawIconEx called without mask or color bitmap to draw.\n"); return FALSE; @@ -1296,7 +1295,7 @@ if (pIcon->CURSORF_flags & CURSORF_ACON) { ACON* pAcon = (ACON*)pIcon; - if(istepIfAniCur >= pAcon->cicur) + if (istepIfAniCur >= pAcon->cicur) { ERR("NtUserDrawIconEx: istepIfAniCur too big!\n"); return FALSE; @@ -1307,20 +1306,20 @@ hbmMask = pIcon->hbmMask; hbmColor = pIcon->hbmColor; hbmAlpha = pIcon->hbmAlpha; - + /* - * Get our objects. + * Get our objects. * Shared locks are enough, we are only reading those bitmaps */ psurfMask = SURFACE_ShareLockSurface(hbmMask); - if(psurfMask == NULL) + if (psurfMask == NULL) { ERR("Unable to lock the mask surface.\n"); return FALSE; } - + /* Color bitmap is not mandatory */ - if(hbmColor == NULL) + if (hbmColor == NULL) { /* But then the mask bitmap must have the information in it's bottom half */ ASSERT(psurfMask->SurfObj.sizlBitmap.cy == 2*pIcon->cy); @@ -1332,21 +1331,21 @@ SURFACE_ShareUnlockSurface(psurfMask); return FALSE; } - + pdc = DC_LockDc(hDc); - if(!pdc) + if (!pdc) { ERR("Could not lock the destination DC.\n"); SURFACE_ShareUnlockSurface(psurfMask); - if(psurfColor) SURFACE_ShareUnlockSurface(psurfColor); + if (psurfColor) SURFACE_ShareUnlockSurface(psurfColor); return FALSE; } /* Fix width parameter, if needed */ if (!cxWidth) { - if(diFlags & DI_DEFAULTSIZE) - cxWidth = is_icon(pIcon) ? + if (diFlags & DI_DEFAULTSIZE) + cxWidth = is_icon(pIcon) ? UserGetSystemMetrics(SM_CXICON) : UserGetSystemMetrics(SM_CXCURSOR); else cxWidth = pIcon->cx; @@ -1355,8 +1354,8 @@ /* Fix height parameter, if needed */ if (!cyHeight) { - if(diFlags & DI_DEFAULTSIZE) - cyHeight = is_icon(pIcon) ? + if (diFlags & DI_DEFAULTSIZE) + cyHeight = is_icon(pIcon) ? UserGetSystemMetrics(SM_CYICON) : UserGetSystemMetrics(SM_CYCURSOR); else cyHeight = pIcon->cy; @@ -1366,28 +1365,28 @@ RECTL_vSetRect(&rcDest, xLeft, yTop, xLeft + cxWidth, yTop + cyHeight); IntLPtoDP(pdc, (LPPOINT)&rcDest, 2); RECTL_vOffsetRect(&rcDest, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y); - + /* Prepare the underlying surface */ DC_vPrepareDCsForBlit(pdc, &rcDest, NULL, NULL); /* We now have our destination surface and rectangle */ psurfDest = pdc->dclevel.pSurface; - - if(psurfDest == NULL) + + if (psurfDest == NULL) { /* Empty DC */ DC_vFinishBlit(pdc, NULL); DC_UnlockDc(pdc); SURFACE_ShareUnlockSurface(psurfMask); - if(psurfColor) SURFACE_ShareUnlockSurface(psurfColor); + if (psurfColor) SURFACE_ShareUnlockSurface(psurfColor); return FALSE; } - + /* Set source rect */ RECTL_vSetRect(&rcSrc, 0, 0, pIcon->cx, pIcon->cy); /* Should we render off-screen? */ - bOffScreen = hbrFlickerFreeDraw && + bOffScreen = hbrFlickerFreeDraw && (GDI_HANDLE_GET_TYPE(hbrFlickerFreeDraw) == GDI_OBJECT_TYPE_BRUSH); if (bOffScreen) @@ -1395,10 +1394,10 @@ /* Yes: Allocate and paint the offscreen surface */ EBRUSHOBJ eboFill; PBRUSH pbrush = BRUSH_ShareLockBrush(hbrFlickerFreeDraw); - + TRACE("Performing off-screen rendering.\n"); - - if(!pbrush) + + if (!pbrush) { ERR("Failed to get brush object.\n"); goto Cleanup; @@ -1408,17 +1407,17 @@ psurfOffScreen = SURFACE_AllocSurface(STYPE_BITMAP, cxWidth, cyHeight, psurfDest->SurfObj.iBitmapFormat, 0, 0, NULL); - if(!psurfOffScreen) + if (!psurfOffScreen) { ERR("Failed to allocate the off-screen surface.\n"); BRUSH_ShareUnlockBrush(pbrush); goto Cleanup; } - + /* Paint the brush */ EBRUSHOBJ_vInit(&eboFill, pbrush, psurfOffScreen, 0x00FFFFFF, 0, NULL); RECTL_vSetRect(&rcDest, 0, 0, cxWidth, cyHeight); - + Ret = IntEngBitBlt(&psurfOffScreen->SurfObj, NULL, NULL, @@ -1434,20 +1433,20 @@ /* Clean up everything */ EBRUSHOBJ_vCleanup(&eboFill); BRUSH_ShareUnlockBrush(pbrush); - - if(!Ret) + + if (!Ret) { ERR("Failed to paint the off-screen surface.\n"); goto Cleanup; } - + /* We now have our destination surface */ psurfDest = psurfOffScreen; #else pdcClipObj = &pdc->co.ClipObj; /* Paint the brush */ EBRUSHOBJ_vInit(&eboFill, pbrush, psurfDest, 0x00FFFFFF, 0, NULL); - + Ret = IntEngBitBlt(&psurfDest->SurfObj, NULL, NULL, @@ -1463,8 +1462,8 @@ /* Clean up everything */ EBRUSHOBJ_vCleanup(&eboFill); BRUSH_ShareUnlockBrush(pbrush); - - if(!Ret) + + if (!Ret) { ERR("Failed to paint the off-screen surface.\n"); goto Cleanup; @@ -1480,21 +1479,21 @@ } /* Now do the rendering */ - if(hbmAlpha && ((diFlags & DI_NORMAL) == DI_NORMAL)) + if (hbmAlpha && ((diFlags & DI_NORMAL) == DI_NORMAL)) { BLENDOBJ blendobj = { {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA } }; PSURFACE psurf = NULL; psurf = SURFACE_ShareLockSurface(hbmAlpha); - if(!psurf) + if (!psurf) { ERR("SURFACE_LockSurface failed!\n"); goto NoAlpha; } - + /* Initialize color translation object */ EXLATEOBJ_vInitialize(&exlo, psurf->ppal, psurfDest->ppal, 0xFFFFFFFF, 0xFFFFFFFF, 0); - + /* Now do it */ Ret = IntEngAlphaBlend(&psurfDest->SurfObj, &psurf->SurfObj, @@ -1503,19 +1502,19 @@ &rcDest, &rcSrc, &blendobj); - + EXLATEOBJ_vCleanup(&exlo); SURFACE_ShareUnlockSurface(psurf); - if(Ret) goto done; + if (Ret) goto done; ERR("NtGdiAlphaBlend failed!\n"); } NoAlpha: if (diFlags & DI_MASK) { DWORD rop4 = (diFlags & DI_IMAGE) ? ROP4_SRCAND : ROP4_SRCCOPY; - + EXLATEOBJ_vInitSrcMonoXlate(&exlo, psurfDest->ppal, 0x00FFFFFF, 0); - + Ret = IntEngStretchBlt(&psurfDest->SurfObj, &psurfMask->SurfObj, NULL, @@ -1528,24 +1527,24 @@ NULL, NULL, rop4); - + EXLATEOBJ_vCleanup(&exlo); - if(!Ret) + if (!Ret) { ERR("Failed to mask the bitmap data.\n"); goto Cleanup; } } - if(diFlags & DI_IMAGE) + if (diFlags & DI_IMAGE) { if (psurfColor) { DWORD rop4 = (diFlags & DI_MASK) ? ROP4_SRCINVERT : ROP4_SRCCOPY ; - + EXLATEOBJ_vInitialize(&exlo, psurfColor->ppal, psurfDest->ppal, 0x00FFFFFF, 0x00FFFFFF, 0); - + Ret = IntEngStretchBlt(&psurfDest->SurfObj, &psurfColor->SurfObj, NULL, @@ -1558,10 +1557,10 @@ NULL, NULL, rop4); - + EXLATEOBJ_vCleanup(&exlo); - if(!Ret) + if (!Ret) { ERR("Failed to render the icon bitmap.\n"); goto Cleanup; @@ -1572,9 +1571,9 @@ /* Mask bitmap holds the information in its bottom half */ DWORD rop4 = (diFlags & DI_MASK) ? ROP4_SRCINVERT : ROP4_SRCCOPY; RECTL_vOffsetRect(&rcSrc, 0, pIcon->cy); - + EXLATEOBJ_vInitSrcMonoXlate(&exlo, psurfDest->ppal, 0x00FFFFFF, 0); - + Ret = IntEngStretchBlt(&psurfDest->SurfObj, &psurfMask->SurfObj, NULL, @@ -1587,10 +1586,10 @@ NULL, NULL, rop4); - + EXLATEOBJ_vCleanup(&exlo); - if(!Ret) + if (!Ret) { ERR("Failed to render the icon bitmap.\n"); goto Cleanup; @@ -1601,7 +1600,7 @@ done: #if 0 /* We're done. Was it a double buffered draw ? */ - if(bOffScreen) + if (bOffScreen) { /* Yes. Draw it back to our DC */ POINTL ptSrc = {0, 0}; @@ -1610,16 +1609,16 @@ RECTL_vSetRect(&rcDest, xLeft, yTop, xLeft + cxWidth, yTop + cyHeight); IntLPtoDP(pdc, (LPPOINT)&rcDest, 2); RECTL_vOffsetRect(&rcDest, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y); - + /* Get the clip object */ pdcClipObj = pdc->rosdc.CombinedClip; - + /* We now have our destination surface and rectangle */ psurfDest = pdc->dclevel.pSurface; - + /* Color translation */ EXLATEOBJ_vInitialize(&exlo, psurfOffScreen->ppal, psurfDest->ppal, 0x00FFFFFF, 0x00FFFFFF, 0); - + /* Blt it! */ Ret = IntEngBitBlt(&psurfDest->SurfObj, &psurfOffScreen->SurfObj, @@ -1632,12 +1631,12 @@ NULL, NULL, ROP4_SRCCOPY); - + EXLATEOBJ_vCleanup(&exlo); } #endif Cleanup: - if(pdc) + if (pdc) { DC_vFinishBlit(pdc, NULL); DC_UnlockDc(pdc); @@ -1645,13 +1644,13 @@ #if 0 /* Delete off screen rendering surface */ - if(psurfOffScreen) + if (psurfOffScreen) GDIOBJ_vDeleteObject(&psurfOffScreen->BaseObject); #endif /* Unlock other surfaces */ SURFACE_ShareUnlockSurface(psurfMask); - if(psurfColor) SURFACE_ShareUnlockSurface(psurfColor); + if (psurfColor) SURFACE_ShareUnlockSurface(psurfColor); return Ret; } @@ -1731,10 +1730,10 @@ ret = CurIcon->head.h; - if(CurIcon->CURSORF_flags & CURSORF_ACON) + if (CurIcon->CURSORF_flags & CURSORF_ACON) { PACON AniCurIcon = (PACON)CurIcon; - if(istep >= AniCurIcon->cicur) + if (istep >= AniCurIcon->cicur) { UserDereferenceObject(CurIcon); UserLeave(); @@ -1804,7 +1803,7 @@ ppi = PsGetCurrentProcessWin32Process(); - for(i = 0 ; i < 16; i++) + for (i = 0 ; i < 16; i++) { if (gasyscur[i].type == id) {
[View Less]
10 years, 3 months
1
0
0
0
[tkreuzer] 66526: [WIN32K] Get rid of our old cursoricon implementation. Rename cursoricon_new.c to cursoricon.c and remove all traces of NEW_CURSORICON
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Mar 1 17:36:12 2015 New Revision: 66526 URL:
http://svn.reactos.org/svn/reactos?rev=66526&view=rev
Log: [WIN32K] Get rid of our old cursoricon implementation. Rename cursoricon_new.c to cursoricon.c and remove all traces of NEW_CURSORICON Added: trunk/reactos/win32ss/user/ntuser/cursoricon.c - copied unchanged from r66525, trunk/reactos/win32ss/user/ntuser/cursoricon_new.c trunk/reactos/win32ss/user/user32/windows/cursoricon.c - copied
…
[View More]
unchanged from r66524, trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c Removed: trunk/reactos/win32ss/user/ntuser/cursoricon_new.c trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c Modified: trunk/reactos/win32ss/CMakeLists.txt trunk/reactos/win32ss/include/ntuser.h trunk/reactos/win32ss/user/ntuser/class.c trunk/reactos/win32ss/user/ntuser/cursoricon.h trunk/reactos/win32ss/user/ntuser/defwnd.c trunk/reactos/win32ss/user/ntuser/desktop.c trunk/reactos/win32ss/user/ntuser/main.c trunk/reactos/win32ss/user/ntuser/msgqueue.c trunk/reactos/win32ss/user/ntuser/object.c trunk/reactos/win32ss/user/ntuser/object.h trunk/reactos/win32ss/user/ntuser/windc.c trunk/reactos/win32ss/user/ntuser/window.c trunk/reactos/win32ss/user/user32/CMakeLists.txt trunk/reactos/win32ss/user/user32/windows/class.c trunk/reactos/win32ss/w32ksvc.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/win32ss/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/CMakeLists.txt?rev…
Modified: trunk/reactos/win32ss/include/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?r…
Modified: trunk/reactos/win32ss/user/ntuser/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/class.…
Modified: trunk/reactos/win32ss/user/ntuser/cursoricon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
Removed: trunk/reactos/win32ss/user/ntuser/cursoricon_new.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
Modified: trunk/reactos/win32ss/user/ntuser/defwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/defwnd…
Modified: trunk/reactos/win32ss/user/ntuser/desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/deskto…
Modified: trunk/reactos/win32ss/user/ntuser/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/main.c…
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
Modified: trunk/reactos/win32ss/user/ntuser/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/object…
Modified: trunk/reactos/win32ss/user/ntuser/object.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/object…
Modified: trunk/reactos/win32ss/user/ntuser/windc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/windc.…
Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
Modified: trunk/reactos/win32ss/user/user32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/CMakeL…
Modified: trunk/reactos/win32ss/user/user32/windows/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
Removed: trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
Modified: trunk/reactos/win32ss/w32ksvc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/w32ksvc.h?rev=6652…
[View Less]
10 years, 3 months
1
0
0
0
[tkreuzer] 66525: [NTOSKRNL] Add some _SEH2_VOLATILE and a comment about memory barriers
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Mar 1 16:33:43 2015 New Revision: 66525 URL:
http://svn.reactos.org/svn/reactos?rev=66525&view=rev
Log: [NTOSKRNL] Add some _SEH2_VOLATILE and a comment about memory barriers Modified: trunk/reactos/ntoskrnl/fsrtl/notify.c trunk/reactos/ntoskrnl/ob/oblife.c Modified: trunk/reactos/ntoskrnl/fsrtl/notify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/notify.c?re…
====================================================================
…
[View More]
========== --- trunk/reactos/ntoskrnl/fsrtl/notify.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/notify.c [iso-8859-1] Sun Mar 1 16:33:43 2015 @@ -85,7 +85,7 @@ PIO_STACK_LOCATION Stack; PNOTIFY_CHANGE NotifyChange; PREAL_NOTIFY_SYNC RealNotifySync; - PSECURITY_SUBJECT_CONTEXT SubjectContext = NULL; + PSECURITY_SUBJECT_CONTEXT _SEH2_VOLATILE SubjectContext = NULL; /* Get the NOTIFY_CHANGE struct and reset it */ NotifyChange = (PNOTIFY_CHANGE)Irp->IoStatus.Information; @@ -559,7 +559,7 @@ * @implemented * * Lets FSD know if changes occures in the specified directory. - * Directory will be reenumerated. + * Directory will be reenumerated. * * @param NotifySync * Synchronization object pointer @@ -568,7 +568,7 @@ * Used to identify the notify structure * * @param FullDirectoryName - * String (A or W) containing the full directory name + * String (A or W) containing the full directory name * * @param NotifyList * Notify list pointer (to head) @@ -620,7 +620,7 @@ * Synchronization object pointer * * @param NotifyList - * Notify list pointer (to head) + * Notify list pointer (to head) * * @param FsContext * Used to identify the notify structure @@ -638,7 +638,7 @@ { PNOTIFY_CHANGE NotifyChange; PREAL_NOTIFY_SYNC RealNotifySync; - PSECURITY_SUBJECT_CONTEXT SubjectContext = NULL; + PSECURITY_SUBJECT_CONTEXT _SEH2_VOLATILE SubjectContext = NULL; /* Get real structure hidden behind the opaque pointer */ RealNotifySync = (PREAL_NOTIFY_SYNC)NotifySync; @@ -1337,7 +1337,7 @@ { if (PoolQuotaCharged) { - PsReturnProcessPagedPoolQuota(NotifyChange->OwningProcess, NumberOfBytes); + PsReturnProcessPagedPoolQuota(NotifyChange->OwningProcess, NumberOfBytes); } NotifyChange->Flags |= NOTIFY_IMMEDIATELY; } @@ -1413,19 +1413,19 @@ * @name FsRtlNotifyFullChangeDirectory * @implemented * - * Lets FSD know if changes occures in the specified directory. + * Lets FSD know if changes occures in the specified directory. * * @param NotifySync * Synchronization object pointer * * @param NotifyList - * Notify list pointer (to head) + * Notify list pointer (to head) * * @param FsContext * Used to identify the notify structure * * @param FullDirectoryName - * String (A or W) containing the full directory name + * String (A or W) containing the full directory name * * @param WatchTree * True to notify changes in subdirectories too @@ -1489,13 +1489,13 @@ * Synchronization object pointer * * @param NotifyList - * Notify list pointer (to head) + * Notify list pointer (to head) * * @param FullTargetName * String (A or W) containing the full directory name that changed * * @param TargetNameOffset - * Offset, in FullTargetName, of the final component that is in the changed directory + * Offset, in FullTargetName, of the final component that is in the changed directory * * @param StreamName * String (A or W) containing a stream name @@ -1563,7 +1563,7 @@ PREAL_NOTIFY_SYNC RealNotifySync; *NotifySync = NULL; - + RealNotifySync = ExAllocatePoolWithTag(NonPagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, sizeof(REAL_NOTIFY_SYNC), 'FSNS'); ExInitializeFastMutex(&(RealNotifySync->FastMutex)); @@ -1583,7 +1583,7 @@ * Synchronization object pointer * * @param NotifyList - * Notify list pointer (to head) + * Notify list pointer (to head) * * @param FullTargetName * String (A or W) containing the full directory name that changed @@ -1616,7 +1616,7 @@ FilterMatch, 0, NULL, - NULL); + NULL); } /*++ Modified: trunk/reactos/ntoskrnl/ob/oblife.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/oblife.c?rev=6…
============================================================================== --- trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ob/oblife.c [iso-8859-1] Sun Mar 1 16:33:43 2015 @@ -370,7 +370,7 @@ { NTSTATUS Status = STATUS_SUCCESS; ULONG StringLength; - PWCHAR StringBuffer = NULL; + PWCHAR _SEH2_VOLATILE StringBuffer = NULL; UNICODE_STRING LocalName; PAGED_CODE(); @@ -491,7 +491,8 @@ /* Check if we have a security descriptor */ if (SecurityDescriptor) { - /* Capture it */ + /* Capture it. Note: This has an implicit memory barrier due + to the function call, so cleanup is safe here.) */ Status = SeCaptureSecurityDescriptor(SecurityDescriptor, AccessMode, NonPagedPool,
[View Less]
10 years, 3 months
1
0
0
0
[tkreuzer] 66524: [NTOSKRNL] Remove broken DbgBreakPoints
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Mar 1 16:30:58 2015 New Revision: 66524 URL:
http://svn.reactos.org/svn/reactos?rev=66524&view=rev
Log: [NTOSKRNL] Remove broken DbgBreakPoints Modified: trunk/reactos/ntoskrnl/lpc/reply.c Modified: trunk/reactos/ntoskrnl/lpc/reply.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/reply.c?rev=6…
============================================================================== --- trunk/reactos/ntoskrnl/lpc/reply.c [iso-8859-1] (original) ++
…
[View More]
+ trunk/reactos/ntoskrnl/lpc/reply.c [iso-8859-1] Sun Mar 1 16:30:58 2015 @@ -212,7 +212,6 @@ _SEH2_EXCEPT(ExSystemExceptionFilter()) { DPRINT1("SEH crash [1]\n"); - DbgBreakPoint(); _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; @@ -401,7 +400,6 @@ _SEH2_EXCEPT(ExSystemExceptionFilter()) { DPRINT1("SEH crash [1]\n"); - DbgBreakPoint(); _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; @@ -692,7 +690,6 @@ _SEH2_EXCEPT(ExSystemExceptionFilter()) { DPRINT1("SEH crash [2]\n"); - DbgBreakPoint(); Status = _SEH2_GetExceptionCode(); } _SEH2_END;
[View Less]
10 years, 3 months
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
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
Results per page:
10
25
50
100
200