ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
236 discussions
Start a n
N
ew thread
[akhaldi] 57427: [SHLWAPI]: Sync to Wine 1.5.13. CORE-6415 CORE-5759 #resolve #comment Fixed in r57427.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 29 13:14:20 2012 New Revision: 57427 URL:
http://svn.reactos.org/svn/reactos?rev=57427&view=rev
Log: [SHLWAPI]: Sync to Wine 1.5.13. CORE-6415 CORE-5759 #resolve #comment Fixed in r57427. Modified: trunk/reactos/dll/win32/shlwapi/CMakeLists.txt trunk/reactos/dll/win32/shlwapi/assoc.c trunk/reactos/dll/win32/shlwapi/istream.c trunk/reactos/dll/win32/shlwapi/ordinal.c trunk/reactos/dll/win32/shlwapi/path.c trunk/reactos/dll/win32/shlwapi/reg.c trunk/reactos/dll/win32/shlwapi/regstream.c trunk/reactos/dll/win32/shlwapi/resource.h trunk/reactos/dll/win32/shlwapi/shlwapi.spec trunk/reactos/dll/win32/shlwapi/shlwapi_main.c trunk/reactos/dll/win32/shlwapi/string.c trunk/reactos/dll/win32/shlwapi/thread.c trunk/reactos/dll/win32/shlwapi/url.c trunk/reactos/dll/win32/shlwapi/wsprintf.c trunk/reactos/include/psdk/shlwapi.h trunk/reactos/include/psdk/shtypes.idl trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/shlwapi/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/CMakeLists.txt [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -1,6 +1,8 @@ include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) -add_definitions(-D__WINESRC__) +add_definitions( + -D__WINESRC__ + -D_SHLWAPI_) remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) Modified: trunk/reactos/dll/win32/shlwapi/assoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/assoc.c?…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/assoc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/assoc.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -103,6 +103,42 @@ } /************************************************************************* + * AssocGetPerceivedType [SHLWAPI.@] + * + * Detect the type of a file by inspecting its extension + * + * PARAMS + * lpszExt [I] File extension to evaluate. + * lpType [O] Pointer to perceived type + * lpFlag [O] Pointer to perceived type flag + * lppszType [O] Address to pointer for perceived type text + * + * RETURNS + * Success: S_OK. lpType and lpFlag contain the perceived type and + * its information. If lppszType is not NULL, it will point + * to a string with perceived type text. + * Failure: An HRESULT error code indicating the error. + * + * NOTES + * lppszType is optional and it can be NULL. + * if lpType or lpFlag are NULL, the function will crash. + * if lpszExt is NULL, an error is returned. + * + * BUGS + * Unimplemented. + */ +HRESULT WINAPI AssocGetPerceivedType(LPCWSTR lpszExt, PERCEIVED *lpType, + INT *lpFlag, LPWSTR *lppszType) +{ + FIXME("(%s, %p, %p, %p) not supported\n", debugstr_w(lpszExt), lpType, lpFlag, lppszType); + + if (lpszExt == NULL) + return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); + + return E_NOTIMPL; +} + +/************************************************************************* * AssocQueryKeyW [SHLWAPI.@] * * See AssocQueryKeyA. @@ -113,7 +149,7 @@ HRESULT hRet; IQueryAssociations* lpAssoc; - TRACE("(0x%8x,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_w(pszAssoc), + TRACE("(0x%x,%d,%s,%s,%p)\n", cfFlags, assockey, debugstr_w(pszAssoc), debugstr_w(pszExtra), phkeyOut); hRet = AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (void **)&lpAssoc ); @@ -152,7 +188,7 @@ WCHAR szExtraW[MAX_PATH], *lpszExtraW = NULL; HRESULT hRet = E_OUTOFMEMORY; - TRACE("(0x%8x,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_a(pszAssoc), + TRACE("(0x%x,%d,%s,%s,%p)\n", cfFlags, assockey, debugstr_a(pszAssoc), debugstr_a(pszExtra), phkeyOut); if (SHLWAPI_ParamAToW(pszAssoc, szAssocW, MAX_PATH, &lpszAssocW) && @@ -181,7 +217,7 @@ HRESULT hRet; IQueryAssociations* lpAssoc; - TRACE("(0x%8x,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_w(pszAssoc), + TRACE("(0x%x,%d,%s,%s,%p,%p)\n", cfFlags, str, debugstr_w(pszAssoc), debugstr_w(pszExtra), pszOut, pcchOut); if (!pcchOut) @@ -225,7 +261,7 @@ WCHAR szExtraW[MAX_PATH], *lpszExtraW = NULL; HRESULT hRet = E_OUTOFMEMORY; - TRACE("(0x%8x,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_a(pszAssoc), + TRACE("(0x%x,0x%d,%s,%s,%p,%p)\n", cfFlags, str, debugstr_a(pszAssoc), debugstr_a(pszExtra), pszOut, pcchOut); if (!pcchOut) @@ -278,7 +314,7 @@ HRESULT hRet; IQueryAssociations* lpAssoc; - TRACE("(0x%8x,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, + TRACE("(0x%x,0x%d,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, debugstr_w(pszExtra), pszOut, pcchOut); hRet = AssocCreate( CLSID_QueryAssociations, &IID_IQueryAssociations, (void **)&lpAssoc ); @@ -320,7 +356,7 @@ WCHAR szReturnW[MAX_PATH], *lpszReturnW = szReturnW; HRESULT hRet = E_OUTOFMEMORY; - TRACE("(0x%8x,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, + TRACE("(0x%x,0x%d,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, debugstr_a(pszExtra), pszOut, pcchOut); if (!pcchOut) Modified: trunk/reactos/dll/win32/shlwapi/istream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/istream.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/istream.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/istream.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -42,7 +42,7 @@ /* Layout of ISHFileStream object */ typedef struct { - const IStreamVtbl *lpVtbl; + IStream IStream_iface; LONG ref; HANDLE hFile; DWORD dwMode; @@ -51,6 +51,11 @@ DWORD grfStateBits; } ISHFileStream; +static inline ISHFileStream *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, ISHFileStream, IStream_iface); +} + static HRESULT WINAPI IStream_fnCommit(IStream*,DWORD); @@ -59,7 +64,7 @@ */ static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ppvObj); @@ -80,7 +85,7 @@ */ static ULONG WINAPI IStream_fnAddRef(IStream *iface) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); ULONG refCount = InterlockedIncrement(&This->ref); TRACE("(%p)->(ref before=%u)\n",This, refCount - 1); @@ -93,7 +98,7 @@ */ static ULONG WINAPI IStream_fnRelease(IStream *iface) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p)->(ref before=%u)\n",This, refCount + 1); @@ -114,7 +119,7 @@ */ static HRESULT WINAPI IStream_fnRead(IStream *iface, void* pv, ULONG cb, ULONG* pcbRead) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); DWORD dwRead = 0; TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbRead); @@ -134,7 +139,7 @@ */ static HRESULT WINAPI IStream_fnWrite(IStream *iface, const void* pv, ULONG cb, ULONG* pcbWritten) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); DWORD dwWritten = 0; TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbWritten); @@ -162,7 +167,7 @@ static HRESULT WINAPI IStream_fnSeek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* pNewPos) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); DWORD dwPos; TRACE("(%p,%d,%d,%p)\n", This, dlibMove.u.LowPart, dwOrigin, pNewPos); @@ -185,7 +190,7 @@ */ static HRESULT WINAPI IStream_fnSetSize(IStream *iface, ULARGE_INTEGER libNewSize) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); TRACE("(%p,%d)\n", This, libNewSize.u.LowPart); @@ -205,7 +210,7 @@ static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); char copyBuff[1024]; ULONGLONG ulSize; HRESULT hRet = S_OK; @@ -254,7 +259,7 @@ */ static HRESULT WINAPI IStream_fnCommit(IStream *iface, DWORD grfCommitFlags) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); TRACE("(%p,%d)\n", This, grfCommitFlags); /* Currently unbuffered: This function is not needed */ @@ -266,7 +271,7 @@ */ static HRESULT WINAPI IStream_fnRevert(IStream *iface) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); TRACE("(%p)\n", This); return E_NOTIMPL; @@ -278,7 +283,7 @@ static HRESULT WINAPI IStream_fnLockUnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); TRACE("(%p,%d,%d,%d)\n", This, libOffset.u.LowPart, cb.u.LowPart, dwLockType); return E_NOTIMPL; } @@ -289,7 +294,7 @@ static HRESULT WINAPI IStream_fnStat(IStream *iface, STATSTG* lpStat, DWORD grfStatFlag) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); BY_HANDLE_FILE_INFORMATION fi; HRESULT hRet = S_OK; @@ -326,7 +331,7 @@ */ static HRESULT WINAPI IStream_fnClone(IStream *iface, IStream** ppstm) { - ISHFileStream *This = (ISHFileStream *)iface; + ISHFileStream *This = impl_from_IStream(iface); TRACE("(%p)\n",This); if (ppstm) @@ -365,7 +370,7 @@ if (fileStream) { - fileStream->lpVtbl = &SHLWAPI_fsVTable; + fileStream->IStream_iface.lpVtbl = &SHLWAPI_fsVTable; fileStream->ref = 1; fileStream->hFile = hFile; fileStream->dwMode = dwMode; @@ -374,7 +379,7 @@ fileStream->grfStateBits = 0; /* FIXME */ } TRACE ("Returning %p\n", fileStream); - return (IStream *)fileStream; + return &fileStream->IStream_iface; } /************************************************************************* Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -76,7 +76,7 @@ /************************************************************************* * SHLWAPI_DupSharedHandle * - * Internal implemetation of SHLWAPI_11. + * Internal implementation of SHLWAPI_11. */ static HANDLE SHLWAPI_DupSharedHandle(HANDLE hShared, DWORD dwDstProcId, DWORD dwSrcProcId, DWORD dwAccess, @@ -144,7 +144,7 @@ * the view pointer returned by this size. * */ -HANDLE WINAPI SHAllocShared(LPVOID lpvData, ULONG dwSize, DWORD dwProcId) +HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId) { HANDLE hMap; LPVOID pMapped; @@ -446,7 +446,7 @@ IEnumFORMATETC_Release(pClone); } - IEnumFORMATETC_Release(pIUnknown); + IUnknown_Release(pIUnknown); } IUnknown_Release(V_UNKNOWN(&var)); } @@ -1136,14 +1136,14 @@ TRACE("%p, %p\n", hWnd, hWndParent); if(GetParent(hWnd) == hWndParent) - return 0; + return NULL; if(hWndParent) - SHSetWindowBits(hWnd, GWL_STYLE, WS_CHILD, WS_CHILD); + SHSetWindowBits(hWnd, GWL_STYLE, WS_CHILD | WS_POPUP, WS_CHILD); else - SHSetWindowBits(hWnd, GWL_STYLE, WS_POPUP, WS_POPUP); - - return SetParent(hWnd, hWndParent); + SHSetWindowBits(hWnd, GWL_STYLE, WS_CHILD | WS_POPUP, WS_POPUP); + + return hWndParent ? SetParent(hWnd, hWndParent) : NULL; } /************************************************************************* @@ -1202,7 +1202,7 @@ IConnectionPoint_Release(lpCP); /* Release it */ } - IUnknown_Release(lpContainer); + IConnectionPointContainer_Release(lpContainer); } return hRet; } @@ -1334,7 +1334,7 @@ if (SUCCEEDED(hRet)) { - /* Lazyness here - Since GetWindow() is the first method for the above 3 + /* Laziness here - Since GetWindow() is the first method for the above 3 * interfaces, we use the same call for them all. */ hRet = IOleWindow_GetWindow((IOleWindow*)lpOle, lphWnd); @@ -1400,7 +1400,7 @@ { hr = IObjectWithSite_SetSite(iobjwithsite, site); TRACE("done IObjectWithSite_SetSite ret=%08x\n", hr); - IUnknown_Release(iobjwithsite); + IObjectWithSite_Release(iobjwithsite); } else { @@ -1410,7 +1410,7 @@ hr = IInternetSecurityManager_SetSecuritySite(isecmgr, (IInternetSecurityMgrSite *)site); TRACE("done IInternetSecurityManager_SetSecuritySite ret=%08x\n", hr); - IUnknown_Release(isecmgr); + IInternetSecurityManager_Release(isecmgr); } return hr; } @@ -1435,7 +1435,7 @@ IPersist* lpPersist; HRESULT hRet = E_FAIL; - TRACE("(%p,%p)\n", lpUnknown, debugstr_guid(lpClassId)); + TRACE("(%p,%s)\n", lpUnknown, debugstr_guid(lpClassId)); if (lpUnknown) { @@ -1493,7 +1493,7 @@ TRACE("(IServiceProvider*)%p returned (IUnknown*)%p\n", pService, *lppOut); - IUnknown_Release(pService); + IServiceProvider_Release(pService); } return hRet; } @@ -1571,7 +1571,10 @@ if (pService) hr = IProfferService_ProfferService(proffer, service, pService, pCookie); else + { hr = IProfferService_RevokeService(proffer, *pCookie); + *pCookie = 0; + } IProfferService_Release(proffer); } @@ -1610,7 +1613,7 @@ if (ret == S_OK) { ret = IInputObject_UIActivateIO(object, activate, msg); - IUnknown_Release(object); + IInputObject_Release(object); } return ret; @@ -3735,7 +3738,6 @@ /************************************************************************* * @ [SHLWAPI.404] */ -#if 1 HRESULT WINAPI SHIShellFolder_EnumObjects(LPSHELLFOLDER lpFolder, HWND hwnd, SHCONTF flags, IEnumIDList **ppenum) { /* Windows attempts to get an IPersist interface and, if that fails, an @@ -3752,29 +3754,6 @@ return IShellFolder_EnumObjects(lpFolder, hwnd, flags, ppenum); } -#else -HRESULT WINAPI SHIShellFolder_EnumObjects(LPSHELLFOLDER lpFolder, HWND hwnd, SHCONTF flags, IEnumIDList **ppenum) -{ - IPersist *persist; - HRESULT hr; - - hr = IShellFolder_QueryInterface(lpFolder, &IID_IPersist, (LPVOID)&persist); - if(SUCCEEDED(hr)) - { - CLSID clsid; - hr = IPersist_GetClassID(persist, &clsid); - if(SUCCEEDED(hr)) - { - if(IsEqualCLSID(&clsid, &CLSID_ShellFSFolder)) - hr = IShellFolder_EnumObjects(lpFolder, hwnd, flags, ppenum); - else - hr = E_FAIL; - } - IPersist_Release(persist); - } - return hr; -} -#endif /* INTERNAL: Map from HLS color space to RGB */ static WORD ConvertHue(int wHue, WORD wMid1, WORD wMid2) @@ -3863,6 +3842,28 @@ default: return 0; } +} + +/************************************************************************* + * @ [SHLWAPI.416] + * + */ +DWORD WINAPI SHWinHelpOnDemandW(HWND hwnd, LPCWSTR helpfile, DWORD flags1, VOID *ptr1, DWORD flags2) +{ + + FIXME("(%p, %s, 0x%x, %p, %d)\n", hwnd, debugstr_w(helpfile), flags1, ptr1, flags2); + return 0; +} + +/************************************************************************* + * @ [SHLWAPI.417] + * + */ +DWORD WINAPI SHWinHelpOnDemandA(HWND hwnd, LPCSTR helpfile, DWORD flags1, VOID *ptr1, DWORD flags2) +{ + + FIXME("(%p, %s, 0x%x, %p, %d)\n", hwnd, debugstr_a(helpfile), flags1, ptr1, flags2); + return 0; } /************************************************************************* @@ -4062,8 +4063,11 @@ case OS_ANYSERVER: ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT) case OS_WOW6432: - FIXME("(OS_WOW6432) Should we check this?\n"); - return FALSE; + { + BOOL is_wow64; + IsWow64Process(GetCurrentProcess(), &is_wow64); + return is_wow64; + } case OS_WEBSERVER: ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT) case OS_SMALLBUSINESSSERVER: @@ -4425,12 +4429,141 @@ } /*********************************************************************** - * SHGetShellKey (SHLWAPI.@) + * SHGetShellKey (SHLWAPI.491) */ HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create) { - FIXME("(0x%08x, %s, %d): stub\n", flags, debugstr_w(sub_key), create); - return (HKEY)0x50; + enum _shellkey_flags { + SHKEY_Root_HKCU = 0x1, + SHKEY_Root_HKLM = 0x2, + SHKEY_Key_Explorer = 0x00, + SHKEY_Key_Shell = 0x10, + SHKEY_Key_ShellNoRoam = 0x20, + SHKEY_Key_Classes = 0x30, + SHKEY_Subkey_Default = 0x0000, + SHKEY_Subkey_ResourceName = 0x1000, + SHKEY_Subkey_Handlers = 0x2000, + SHKEY_Subkey_Associations = 0x3000, + SHKEY_Subkey_Volatile = 0x4000, + SHKEY_Subkey_MUICache = 0x5000, + SHKEY_Subkey_FileExts = 0x6000 + }; + + static const WCHAR explorerW[] = {'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'E','x','p','l','o','r','e','r','\\'}; + static const WCHAR shellW[] = {'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\', + 'S','h','e','l','l','\\'}; + static const WCHAR shell_no_roamW[] = {'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\', + 'S','h','e','l','l','N','o','R','o','a','m','\\'}; + static const WCHAR classesW[] = {'S','o','f','t','w','a','r','e','\\', + 'C','l','a','s','s','e','s','\\'}; + + static const WCHAR localized_resource_nameW[] = {'L','o','c','a','l','i','z','e','d', + 'R','e','s','o','u','r','c','e','N','a','m','e','\\'}; + static const WCHAR handlersW[] = {'H','a','n','d','l','e','r','s','\\'}; + static const WCHAR associationsW[] = {'A','s','s','o','c','i','a','t','i','o','n','s','\\'}; + static const WCHAR volatileW[] = {'V','o','l','a','t','i','l','e','\\'}; + static const WCHAR mui_cacheW[] = {'M','U','I','C','a','c','h','e','\\'}; + static const WCHAR file_extsW[] = {'F','i','l','e','E','x','t','s','\\'}; + + WCHAR *path; + const WCHAR *key, *subkey; + int size_key, size_subkey, size_user; + HKEY hkey = NULL; + + TRACE("(0x%08x, %s, %d)\n", flags, debugstr_w(sub_key), create); + + /* For compatibility with Vista+ */ + if(flags == 0x1ffff) + flags = 0x21; + + switch(flags&0xff0) { + case SHKEY_Key_Explorer: + key = explorerW; + size_key = sizeof(explorerW); + break; + case SHKEY_Key_Shell: + key = shellW; + size_key = sizeof(shellW); + break; + case SHKEY_Key_ShellNoRoam: + key = shell_no_roamW; + size_key = sizeof(shell_no_roamW); + break; + case SHKEY_Key_Classes: + key = classesW; + size_key = sizeof(classesW); + break; + default: + FIXME("unsupported flags (0x%08x)\n", flags); + return NULL; + } + + switch(flags&0xff000) { + case SHKEY_Subkey_Default: + subkey = NULL; + size_subkey = 0; + break; + case SHKEY_Subkey_ResourceName: + subkey = localized_resource_nameW; + size_subkey = sizeof(localized_resource_nameW); + break; + case SHKEY_Subkey_Handlers: + subkey = handlersW; + size_subkey = sizeof(handlersW); + break; + case SHKEY_Subkey_Associations: + subkey = associationsW; + size_subkey = sizeof(associationsW); + break; + case SHKEY_Subkey_Volatile: + subkey = volatileW; + size_subkey = sizeof(volatileW); + break; + case SHKEY_Subkey_MUICache: + subkey = mui_cacheW; + size_subkey = sizeof(mui_cacheW); + break; + case SHKEY_Subkey_FileExts: + subkey = file_extsW; + size_subkey = sizeof(file_extsW); + break; + default: + FIXME("unsupported flags (0x%08x)\n", flags); + return NULL; + } + + if(sub_key) + size_user = lstrlenW(sub_key)*sizeof(WCHAR); + else + size_user = 0; + + path = HeapAlloc(GetProcessHeap(), 0, size_key+size_subkey+size_user+sizeof(WCHAR)); + if(!path) { + ERR("Out of memory\n"); + return NULL; + } + + memcpy(path, key, size_key); + if(subkey) + memcpy(path+size_key/sizeof(WCHAR), subkey, size_subkey); + if(sub_key) + memcpy(path+(size_key+size_subkey)/sizeof(WCHAR), sub_key, size_user); + path[(size_key+size_subkey+size_user)/sizeof(WCHAR)] = '\0'; + + if(create) + RegCreateKeyExW((flags&0xf)==SHKEY_Root_HKLM?HKEY_LOCAL_MACHINE:HKEY_CURRENT_USER, + path, 0, NULL, 0, MAXIMUM_ALLOWED, NULL, &hkey, NULL); + else + RegOpenKeyExW((flags&0xf)==SHKEY_Root_HKLM?HKEY_LOCAL_MACHINE:HKEY_CURRENT_USER, + path, 0, MAXIMUM_ALLOWED, &hkey); + + HeapFree(GetProcessHeap(), 0, path); + return hkey; } /*********************************************************************** @@ -4499,12 +4632,104 @@ } /*********************************************************************** - * SHGetValueW (SHLWAPI.@) - */ -HRESULT WINAPI SKGetValueW(DWORD a, LPWSTR b, LPWSTR c, DWORD d, DWORD e, DWORD f) -{ - FIXME("(%x, %s, %s, %x, %x, %x): stub\n", a, debugstr_w(b), debugstr_w(c), d, e, f); - return E_FAIL; + * SKAllocValueW (SHLWAPI.519) + */ +HRESULT WINAPI SKAllocValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD *type, + LPVOID *data, DWORD *count) +{ + DWORD ret, size; + HKEY hkey; + + TRACE("(0x%x, %s, %s, %p, %p, %p)\n", flags, debugstr_w(subkey), + debugstr_w(value), type, data, count); + + hkey = SHGetShellKey(flags, subkey, FALSE); + if (!hkey) + return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); + + ret = SHQueryValueExW(hkey, value, NULL, type, NULL, &size); + if (ret) { + RegCloseKey(hkey); + return HRESULT_FROM_WIN32(ret); + } + + size += 2; + *data = LocalAlloc(0, size); + if (!*data) { + RegCloseKey(hkey); + return E_OUTOFMEMORY; + } + + ret = SHQueryValueExW(hkey, value, NULL, type, *data, &size); + if (count) + *count = size; + + RegCloseKey(hkey); + return HRESULT_FROM_WIN32(ret); +} + +/*********************************************************************** + * SKDeleteValueW (SHLWAPI.518) + */ +HRESULT WINAPI SKDeleteValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value) +{ + DWORD ret; + HKEY hkey; + + TRACE("(0x%x, %s %s)\n", flags, debugstr_w(subkey), debugstr_w(value)); + + hkey = SHGetShellKey(flags, subkey, FALSE); + if (!hkey) + return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); + + ret = RegDeleteValueW(hkey, value); + + RegCloseKey(hkey); + return HRESULT_FROM_WIN32(ret); +} + +/*********************************************************************** + * SKGetValueW (SHLWAPI.516) + */ +HRESULT WINAPI SKGetValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, DWORD *type, + void *data, DWORD *count) +{ + DWORD ret; + HKEY hkey; + + TRACE("(0x%x, %s, %s, %p, %p, %p)\n", flags, debugstr_w(subkey), + debugstr_w(value), type, data, count); + + hkey = SHGetShellKey(flags, subkey, FALSE); + if (!hkey) + return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); + + ret = SHQueryValueExW(hkey, value, NULL, type, data, count); + + RegCloseKey(hkey); + return HRESULT_FROM_WIN32(ret); +} + +/*********************************************************************** + * SKSetValueW (SHLWAPI.516) + */ +HRESULT WINAPI SKSetValueW(DWORD flags, LPCWSTR subkey, LPCWSTR value, + DWORD type, void *data, DWORD count) +{ + DWORD ret; + HKEY hkey; + + TRACE("(0x%x, %s, %s, %x, %p, %d)\n", flags, debugstr_w(subkey), + debugstr_w(value), type, data, count); + + hkey = SHGetShellKey(flags, subkey, TRUE); + if (!hkey) + return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); + + ret = RegSetValueExW(hkey, value, 0, type, data, count); + + RegCloseKey(hkey); + return HRESULT_FROM_WIN32(ret); } typedef HRESULT (WINAPI *DllGetVersion_func)(DLLVERSIONINFO *); Modified: trunk/reactos/dll/win32/shlwapi/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/path.c?r…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -760,6 +760,10 @@ * PARAMS * lpszPath [I/O] Path to remove the extension from * + * NOTES + * The NUL terminator must be written only if extension exists + * and if the pointed character is not already NUL. + * * RETURNS * Nothing. */ @@ -770,7 +774,8 @@ if (lpszPath) { lpszPath = PathFindExtensionA(lpszPath); - *lpszPath = '\0'; + if (lpszPath && *lpszPath != '\0') + *lpszPath = '\0'; } } @@ -786,7 +791,8 @@ if (lpszPath) { lpszPath = PathFindExtensionW(lpszPath); - *lpszPath = '\0'; + if (lpszPath && *lpszPath != '\0') + *lpszPath = '\0'; } } @@ -1074,7 +1080,7 @@ */ BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath,DWORD dwWhich) { - static const WCHAR pszExts[7][5] = { { '.', 'p', 'i', 'f', 0}, + static const WCHAR pszExts[][5] = { { '.', 'p', 'i', 'f', 0}, { '.', 'c', 'o', 'm', 0}, { '.', 'e', 'x', 'e', 0}, { '.', 'b', 'a', 't', 0}, @@ -1708,7 +1714,7 @@ iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS); dwAttr = GetFileAttributesA(lpszPath); SetErrorMode(iPrevErrMode); - return dwAttr == INVALID_FILE_ATTRIBUTES ? FALSE : TRUE; + return dwAttr != INVALID_FILE_ATTRIBUTES; } /************************************************************************* @@ -1729,7 +1735,7 @@ iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS); dwAttr = GetFileAttributesW(lpszPath); SetErrorMode(iPrevErrMode); - return dwAttr == INVALID_FILE_ATTRIBUTES ? FALSE : TRUE; + return dwAttr != INVALID_FILE_ATTRIBUTES; } /************************************************************************* @@ -2416,7 +2422,7 @@ else if (lpszSrc[1] == '.' && (lpszDst == lpszBuf || lpszDst[-1] == '\\')) { /* \.. backs up a directory, over the root if it has no \ following X:. - * .. is ignored if it would remove a UNC server name or inital \\ + * .. is ignored if it would remove a UNC server name or initial \\ */ if (lpszDst != lpszBuf) { @@ -2974,7 +2980,7 @@ { if (ch < 126) { - if ((ch & 0x1 && ch != ';') || !ch || isalnum(ch) || ch == '$' || ch == '&' || ch == '(' || + if (((ch & 0x1) && ch != ';') || !ch || isalnum(ch) || ch == '$' || ch == '&' || ch == '(' || ch == '.' || ch == '@' || ch == '^' || ch == '\'' || ch == 130 || ch == '`') flags |= GCT_SHORTCHAR; /* All these are valid for DOS */ Modified: trunk/reactos/dll/win32/shlwapi/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/reg.c?re…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -235,12 +235,49 @@ * * See SHRegCreateUSKeyA. */ -LONG WINAPI SHRegCreateUSKeyW(LPCWSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, - PHUSKEY phNewUSKey, DWORD dwFlags) -{ - FIXME("(%s, 0x%08x, %p, %p, 0x%08x) stub\n", debugstr_w(pszPath), samDesired, - hRelativeUSKey, phNewUSKey, dwFlags); - return ERROR_SUCCESS; +LONG WINAPI SHRegCreateUSKeyW(LPCWSTR path, REGSAM samDesired, HUSKEY relative_key, + PHUSKEY new_uskey, DWORD flags) +{ + LONG ret = ERROR_CALL_NOT_IMPLEMENTED; + SHUSKEY *ret_key; + + TRACE("(%s, 0x%08x, %p, %p, 0x%08x)\n", debugstr_w(path), samDesired, + relative_key, new_uskey, flags); + + if (!new_uskey) return ERROR_INVALID_PARAMETER; + + *new_uskey = NULL; + + if (flags & ~SHREGSET_FORCE_HKCU) + { + FIXME("unsupported flags 0x%08x\n", flags); + return ERROR_SUCCESS; + } + + ret_key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret_key)); + lstrcpynW(ret_key->lpszPath, path, sizeof(ret_key->lpszPath)/sizeof(WCHAR)); + + if (relative_key) + { + ret_key->HKCUstart = SHRegDuplicateHKey(REG_GetHKEYFromHUSKEY(relative_key, REG_HKCU)); + ret_key->HKLMstart = SHRegDuplicateHKey(REG_GetHKEYFromHUSKEY(relative_key, REG_HKLM)); + } + else + { + ret_key->HKCUstart = HKEY_CURRENT_USER; + ret_key->HKLMstart = HKEY_LOCAL_MACHINE; + } + + if (flags & SHREGSET_FORCE_HKCU) + { + ret = RegCreateKeyExW(ret_key->HKCUstart, path, 0, NULL, 0, samDesired, NULL, &ret_key->HKCUkey, NULL); + if (ret == ERROR_SUCCESS) + *new_uskey = ret_key; + else + HeapFree(GetProcessHeap(), 0, ret_key); + } + + return ret; } /************************************************************************* @@ -1853,17 +1890,14 @@ */ BOOL WINAPI RegisterMIMETypeForExtensionA(LPCSTR lpszSubKey, LPCSTR lpszValue) { - DWORD dwRet; - if (!lpszValue) { WARN("Invalid lpszValue would crash under Win32!\n"); return FALSE; } - dwRet = SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA, + return !SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA, REG_SZ, lpszValue, strlen(lpszValue)); - return dwRet ? FALSE : TRUE; } /************************************************************************* @@ -1873,17 +1907,14 @@ */ BOOL WINAPI RegisterMIMETypeForExtensionW(LPCWSTR lpszSubKey, LPCWSTR lpszValue) { - DWORD dwRet; - if (!lpszValue) { WARN("Invalid lpszValue would crash under Win32!\n"); return FALSE; } - dwRet = SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW, + return !SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW, REG_SZ, lpszValue, strlenW(lpszValue)); - return dwRet ? FALSE : TRUE; } /************************************************************************* @@ -1900,8 +1931,7 @@ */ BOOL WINAPI UnregisterMIMETypeForExtensionA(LPCSTR lpszSubKey) { - HRESULT ret = SHDeleteValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA); - return ret ? FALSE : TRUE; + return !SHDeleteValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA); } /************************************************************************* @@ -1911,8 +1941,7 @@ */ BOOL WINAPI UnregisterMIMETypeForExtensionW(LPCWSTR lpszSubKey) { - HRESULT ret = SHDeleteValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW); - return ret ? FALSE : TRUE; + return !SHDeleteValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW); } /************************************************************************* Modified: trunk/reactos/dll/win32/shlwapi/regstream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/regstrea…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/regstream.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/regstream.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -37,7 +37,7 @@ typedef struct { - const IStreamVtbl *lpVtbl; + IStream IStream_iface; LONG ref; HKEY hKey; LPBYTE pbBuffer; @@ -51,12 +51,17 @@ BOOL bUnicode; } ISHRegStream; +static inline ISHRegStream *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, ISHRegStream, IStream_iface); +} + /************************************************************************** * IStream_fnQueryInterface */ static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj); @@ -82,7 +87,7 @@ */ static ULONG WINAPI IStream_fnAddRef(IStream *iface) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); ULONG refCount = InterlockedIncrement(&This->ref); TRACE("(%p)->(ref before=%u)\n",This, refCount - 1); @@ -95,7 +100,7 @@ */ static ULONG WINAPI IStream_fnRelease(IStream *iface) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p)->(ref before=%u)\n",This, refCount + 1); @@ -144,7 +149,7 @@ */ static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG* pcbRead) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); DWORD dwBytesToRead; TRACE("(%p)->(%p,0x%08x,%p)\n",This, pv, cb, pcbRead); @@ -172,7 +177,7 @@ */ static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG* pcbWritten) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); DWORD newLen = This->dwPos + cb; TRACE("(%p, %p, %d, %p)\n",This, pv, cb, pcbWritten); @@ -203,7 +208,7 @@ */ static HRESULT WINAPI IStream_fnSeek (IStream * iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); LARGE_INTEGER tmp; TRACE("(%p, %s, %d %p)\n", This, wine_dbgstr_longlong(dlibMove.QuadPart), dwOrigin, plibNewPosition); @@ -233,7 +238,7 @@ */ static HRESULT WINAPI IStream_fnSetSize (IStream * iface, ULARGE_INTEGER libNewSize) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); DWORD newLen; LPBYTE newBuf; @@ -256,7 +261,7 @@ */ static HRESULT WINAPI IStream_fnCopyTo (IStream * iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); TRACE("(%p)\n",This); if (pcbRead) @@ -273,7 +278,7 @@ */ static HRESULT WINAPI IStream_fnCommit (IStream * iface, DWORD grfCommitFlags) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); TRACE("(%p)\n",This); @@ -286,7 +291,7 @@ */ static HRESULT WINAPI IStream_fnRevert (IStream * iface) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); TRACE("(%p)\n",This); @@ -299,7 +304,7 @@ */ static HRESULT WINAPI IStream_fnLockUnlockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); TRACE("(%p)\n",This); @@ -312,7 +317,7 @@ */ static HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG* pstatstg, DWORD grfStatFlag) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); TRACE("(%p, %p, %d)\n",This,pstatstg,grfStatFlag); @@ -339,7 +344,7 @@ */ static HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); TRACE("(%p)\n",This); *ppstm = NULL; @@ -373,7 +378,7 @@ */ static ULONG WINAPI IStream_fnAddRefDummy(IStream *iface) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); TRACE("(%p)\n", This); return 2; } @@ -383,7 +388,7 @@ */ static ULONG WINAPI IStream_fnReleaseDummy(IStream *iface) { - ISHRegStream *This = (ISHRegStream *)iface; + ISHRegStream *This = impl_from_IStream(iface); TRACE("(%p)\n", This); return 1; } @@ -419,7 +424,7 @@ /* Dummy registry stream object */ static ISHRegStream rsDummyRegStream = { - &DummyRegStreamVTable, + { &DummyRegStreamVTable }, 1, NULL, NULL, @@ -443,7 +448,7 @@ if (regStream) { - regStream->lpVtbl = &rstvt; + regStream->IStream_iface.lpVtbl = &rstvt; regStream->ref = 1; regStream->hKey = hKey; regStream->pbBuffer = pbBuffer; @@ -516,7 +521,7 @@ tmp->dwMode = dwMode; tmp->bUnicode = FALSE; - return (IStream *)tmp; + return &tmp->IStream_iface; } } @@ -576,7 +581,7 @@ tmp->dwMode = dwMode; tmp->bUnicode = TRUE; - return (IStream *)tmp; + return &tmp->IStream_iface; } } @@ -610,7 +615,7 @@ TRACE("(%p,%s,%s,0x%08x)\n", hkey, pszSubkey, pszValue, dwMode); iStream = SHOpenRegStream2A(hkey, pszSubkey, pszValue, dwMode); - return iStream ? iStream : (IStream *)&rsDummyRegStream; + return iStream ? iStream : &rsDummyRegStream.IStream_iface; } /************************************************************************* @@ -626,7 +631,7 @@ TRACE("(%p,%s,%s,0x%08x)\n", hkey, debugstr_w(pszSubkey), debugstr_w(pszValue), dwMode); iStream = SHOpenRegStream2W(hkey, pszSubkey, pszValue, dwMode); - return iStream ? iStream : (IStream *)&rsDummyRegStream; + return iStream ? iStream : &rsDummyRegStream.IStream_iface; } /************************************************************************* @@ -648,7 +653,7 @@ */ IStream * WINAPI SHCreateMemStream(const BYTE *lpbData, UINT dwDataLen) { - IStream *iStrmRet = NULL; + ISHRegStream *strm = NULL; LPBYTE lpbDup; TRACE("(%p,%d)\n", lpbData, dwDataLen); @@ -661,12 +666,12 @@ if (lpbDup) { memcpy(lpbDup, lpbData, dwDataLen); - iStrmRet = (IStream *)IStream_Create(NULL, lpbDup, dwDataLen); - - if (!iStrmRet) + strm = IStream_Create(NULL, lpbDup, dwDataLen); + + if (!strm) HeapFree(GetProcessHeap(), 0, lpbDup); } - return iStrmRet; + return &strm->IStream_iface; } /************************************************************************* @@ -691,7 +696,7 @@ HRESULT WINAPI SHCreateStreamWrapper(LPBYTE lpbData, DWORD dwDataLen, DWORD dwReserved, IStream **lppStream) { - IStream* lpStream; + ISHRegStream *strm; if (lppStream) *lppStream = NULL; @@ -699,12 +704,12 @@ if(dwReserved || !lppStream) return E_INVALIDARG; - lpStream = (IStream *)IStream_Create(NULL, lpbData, dwDataLen); - - if(!lpStream) + strm = IStream_Create(NULL, lpbData, dwDataLen); + + if(!strm) return E_OUTOFMEMORY; - IStream_QueryInterface(lpStream, &IID_IStream, (void**)lppStream); - IStream_Release(lpStream); + IStream_QueryInterface(&strm->IStream_iface, &IID_IStream, (void**)lppStream); + IStream_Release(&strm->IStream_iface); return S_OK; } Modified: trunk/reactos/dll/win32/shlwapi/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/resource…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/resource.h [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -28,7 +28,7 @@ #define IDS_TIME_INTERVAL_MINUTES 66 #define IDS_TIME_INTERVAL_SECONDS 67 -/* These numbers match native ID's and shouldn't be arbitrarily changed */ +/* These numbers match native IDs and shouldn't be arbitrarily changed */ #define IDD_ERR_DIALOG 0x1200 #define IDS_ERR_USER_MSG 0x1201 #define IDC_ERR_DONT_SHOW 0x1202 Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.spec [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -1,19 +1,19 @@ -1 stdcall -noname ParseURLA(str ptr) -2 stdcall -noname ParseURLW(wstr ptr) +1 stdcall -ordinal ParseURLA(str ptr) +2 stdcall -ordinal ParseURLW(wstr ptr) 3 stdcall -noname PathFileExistsDefExtA(str long) 4 stdcall -noname PathFileExistsDefExtW(wstr long) 5 stdcall -noname PathFindOnPathExA(str ptr long) 6 stdcall -noname PathFindOnPathExW(wstr ptr long) -7 stdcall -noname SHAllocShared(ptr long long) -8 stdcall -noname SHLockShared(long long) -9 stdcall -noname SHUnlockShared(ptr) -10 stdcall -noname SHFreeShared(long long) +7 stdcall -ordinal SHAllocShared(ptr long long) +8 stdcall -ordinal SHLockShared(long long) +9 stdcall -ordinal SHUnlockShared(ptr) +10 stdcall -ordinal SHFreeShared(long long) 11 stdcall -noname SHMapHandle(long long long long long) -12 stdcall -noname SHCreateMemStream(ptr long) +12 stdcall -ordinal SHCreateMemStream(ptr long) 13 stdcall -noname RegisterDefaultAcceptHeaders(ptr ptr) -14 stdcall -noname GetAcceptLanguagesA(ptr ptr) -15 stdcall -noname GetAcceptLanguagesW(ptr ptr) -16 stdcall -noname SHCreateThread(ptr ptr long ptr) +14 stdcall -ordinal GetAcceptLanguagesA(ptr ptr) +15 stdcall -ordinal GetAcceptLanguagesW(ptr ptr) +16 stdcall -ordinal SHCreateThread(ptr ptr long ptr) 17 stdcall -noname SHWriteDataBlockList(ptr ptr) 18 stdcall -noname SHReadDataBlockList(ptr ptr) 19 stdcall -noname SHFreeDataBlockList(ptr) @@ -26,7 +26,7 @@ 26 stdcall -noname IsCharUpperWrapW(long) user32.IsCharUpperW 27 stdcall -noname IsCharLowerWrapW(long) user32.IsCharLowerW 28 stdcall -noname IsCharAlphaNumericWrapW(long) user32.IsCharAlphaNumericW -29 stdcall -noname IsCharSpaceW(long) +29 stdcall -ordinal IsCharSpaceW(long) 30 stdcall -noname IsCharBlankW(long) 31 stdcall -noname IsCharPunctW(long) 32 stdcall -noname IsCharCntrlW(ptr) @@ -148,14 +148,14 @@ 148 stdcall -noname VkKeyScanWrapW(long) user32.VkKeyScanW 149 stdcall -noname WinHelpWrapW(long wstr long long) user32.WinHelpW 150 stdcall -noname wvsprintfWrapW(ptr wstr ptr) user32.wvsprintfW -151 stdcall -noname StrCmpNCA(str ptr long) -152 stdcall -noname StrCmpNCW(wstr wstr long) -153 stdcall -noname StrCmpNICA(long long long) -154 stdcall -noname StrCmpNICW(wstr wstr long) -155 stdcall -noname StrCmpCA(str str) -156 stdcall -noname StrCmpCW(wstr wstr) -157 stdcall -noname StrCmpICA(str str) -158 stdcall -noname StrCmpICW(wstr wstr) +151 stdcall -ordinal StrCmpNCA(str ptr long) +152 stdcall -ordinal StrCmpNCW(wstr wstr long) +153 stdcall -ordinal StrCmpNICA(long long long) +154 stdcall -ordinal StrCmpNICW(wstr wstr long) +155 stdcall -ordinal StrCmpCA(str str) +156 stdcall -ordinal StrCmpCW(wstr wstr) +157 stdcall -ordinal StrCmpICA(str str) +158 stdcall -ordinal StrCmpICW(wstr wstr) 159 stdcall -noname CompareStringAltW(long long wstr long wstr long) kernel32.CompareStringW 160 stdcall -noname SHAboutInfoA(ptr long) 161 stdcall -noname SHAboutInfoW(ptr long) @@ -165,15 +165,15 @@ 165 stdcall -noname SHSetWindowBits(long long long long) 166 stdcall -noname SHIsEmptyStream(ptr) 167 stdcall -noname SHSetParentHwnd(long ptr) -168 stdcall -noname ConnectToConnectionPoint(ptr ptr long ptr ptr ptr) -169 stdcall -noname IUnknown_AtomicRelease(long) +168 stdcall -ordinal ConnectToConnectionPoint(ptr ptr long ptr ptr ptr) +169 stdcall -ordinal IUnknown_AtomicRelease(long) 170 stdcall -noname PathSkipLeadingSlashesA(str) 171 stdcall -noname SHIsSameObject(ptr ptr) -172 stdcall -noname IUnknown_GetWindow(ptr ptr) +172 stdcall -ordinal IUnknown_GetWindow(ptr ptr) 173 stdcall -noname IUnknown_SetOwner(ptr ptr) -174 stdcall -noname IUnknown_SetSite(ptr ptr) +174 stdcall -ordinal IUnknown_SetSite(ptr ptr) 175 stdcall -noname IUnknown_GetClassID(ptr ptr) -176 stdcall -noname IUnknown_QueryService(ptr ptr ptr ptr) +176 stdcall -ordinal IUnknown_QueryService(ptr ptr ptr ptr) 177 stdcall -noname SHLoadMenuPopup(ptr wstr) 178 stdcall -noname SHPropagateMessage(ptr long long long long) 179 stdcall -noname SHMenuIndexFromID(long long) @@ -181,14 +181,14 @@ 181 stdcall -noname SHEnableMenuItem(long long long) 182 stdcall -noname SHCheckMenuItem(long long long) 183 stdcall -noname SHRegisterClassA(ptr) -184 stdcall -noname IStream_Read(ptr ptr long) SHIStream_Read -185 stdcall -noname SHMessageBoxCheckA(ptr str str long long str) +184 stdcall -ordinal IStream_Read(ptr ptr long) SHIStream_Read +185 stdcall -ordinal SHMessageBoxCheckA(ptr str str long long str) 186 stdcall -noname SHSimulateDrop(ptr ptr long ptr ptr) 187 stdcall -noname SHLoadFromPropertyBag(ptr ptr) 188 stdcall -noname IUnknown_TranslateAcceleratorOCS(ptr ptr long) 189 stdcall -noname IUnknown_OnFocusOCS(ptr ptr) 190 stdcall -noname IUnknown_HandleIRestrict(ptr ptr ptr ptr ptr) -191 stdcall -noname SHMessageBoxCheckW(ptr wstr wstr long long wstr) +191 stdcall -ordinal SHMessageBoxCheckW(ptr wstr wstr long long wstr) 192 stdcall -noname SHGetMenuFromID(ptr long) 193 stdcall -noname SHGetCurColorRes() 194 stdcall -noname SHWaitForSendMessageThread(ptr long) @@ -196,12 +196,12 @@ 196 stdcall -noname SHVerbExistsNA(str ptr ptr long) 197 stdcall -noname SHFillRectClr(long ptr long) 198 stdcall -noname SHSearchMapInt(ptr ptr long long) -199 stdcall -noname IUnknown_Set(ptr ptr) +199 stdcall -ordinal IUnknown_Set(ptr ptr) 200 stdcall -noname MayQSForward(ptr ptr ptr long ptr ptr) 201 stdcall -noname MayExecForward(ptr long ptr long long ptr ptr) 202 stdcall -noname IsQSForward(ptr long ptr) -203 stdcall -noname SHStripMneumonicA(str) -204 stdcall -noname SHIsChildOrSelf(long long) +203 stdcall -ordinal SHStripMneumonicA(str) +204 stdcall -ordinal SHIsChildOrSelf(long long) 205 stdcall -noname SHGetValueGoodBootA(long str str ptr ptr ptr) 206 stdcall -noname SHGetValueGoodBootW(long wstr wstr ptr ptr ptr) 207 stub -noname IContextMenu_Invoke @@ -209,12 +209,12 @@ 209 stdcall -noname FDSA_Destroy(ptr) 210 stdcall -noname FDSA_InsertItem(ptr long ptr) 211 stdcall -noname FDSA_DeleteItem(ptr long) -212 stdcall -noname IStream_Write(ptr ptr long) SHIStream_Write -213 stdcall -noname IStream_Reset(ptr) -214 stdcall -noname IStream_Size(ptr ptr) -215 stdcall -noname SHAnsiToUnicode(str ptr long) +212 stdcall -ordinal IStream_Write(ptr ptr long) SHIStream_Write +213 stdcall -ordinal IStream_Reset(ptr) +214 stdcall -ordinal IStream_Size(ptr ptr) +215 stdcall -ordinal SHAnsiToUnicode(str ptr long) 216 stdcall -noname SHAnsiToUnicodeCP(long str ptr long) -217 stdcall -noname SHUnicodeToAnsi(wstr ptr ptr) +217 stdcall -ordinal SHUnicodeToAnsi(wstr ptr ptr) 218 stdcall -noname SHUnicodeToAnsiCP(long wstr ptr long) 219 stdcall QISearch(long long long long) 220 stdcall -noname SHSetDefaultDialogFont(ptr long) @@ -222,7 +222,7 @@ 222 stdcall -noname SHGlobalCounterCreate(long) 223 stdcall -noname SHGlobalCounterGetValue(long) 224 stdcall -noname SHGlobalCounterIncrement(long) -225 stdcall -noname SHStripMneumonicW(wstr) +225 stdcall -ordinal SHStripMneumonicW(wstr) 226 stub -noname ZoneCheckPathA 227 stub -noname ZoneCheckPathW 228 stub -noname ZoneCheckUrlA @@ -253,7 +253,7 @@ 253 stub -noname StopWatchExA 254 stub -noname StopWatchExW 255 stub -noname EventTraceHandler -256 stdcall -noname IUnknown_GetSite(ptr ptr ptr) +256 stdcall -ordinal IUnknown_GetSite(ptr ptr ptr) 257 stdcall -noname SHCreateWorkerWindowA(long ptr long long ptr long) 258 stub -noname SHRegisterWaitForSingleObject 259 stub -noname SHUnregisterWait @@ -273,11 +273,11 @@ 273 stub -noname SHTerminateThreadPool 274 stub -noname RegisterGlobalHotkeyW 275 stub -noname RegisterGlobalHotkeyA -276 stdcall -noname WhichPlatform() +276 stdcall -ordinal WhichPlatform() 277 stub -noname SHDialogBox 278 stdcall -noname SHCreateWorkerWindowW(long long long long long long) 279 stdcall -noname SHInvokeDefaultCommand(ptr ptr ptr) -280 stdcall -noname SHRegGetIntW(ptr wstr long) +280 stdcall -ordinal SHRegGetIntW(ptr wstr long) 281 stdcall -noname SHPackDispParamsV(ptr ptr long ptr) 282 varargs -noname SHPackDispParams(ptr ptr long) 283 stdcall -noname IConnectionPoint_InvokeWithCancel(ptr long long long long) @@ -342,16 +342,16 @@ 342 stdcall -noname SHInterlockedCompareExchange(ptr ptr ptr) 343 stdcall -noname SHRegGetCLSIDKeyA(ptr str long long ptr) 344 stdcall -noname SHRegGetCLSIDKeyW(ptr wstr long long ptr) -345 stdcall -noname SHAnsiToAnsi(str ptr long) -346 stdcall -noname SHUnicodeToUnicode(wstr ptr long) +345 stdcall -ordinal SHAnsiToAnsi(str ptr long) +346 stdcall -ordinal SHUnicodeToUnicode(wstr ptr long) 347 stdcall -noname RegDeleteValueWrapW(long wstr) advapi32.RegDeleteValueW 348 stub -noname SHGetFileDescriptionW 349 stub -noname SHGetFileDescriptionA 350 stdcall -noname GetFileVersionInfoSizeWrapW(wstr ptr) 351 stdcall -noname GetFileVersionInfoWrapW(wstr long long ptr) 352 stdcall -noname VerQueryValueWrapW(ptr wstr ptr ptr) -353 stdcall -noname SHFormatDateTimeA(ptr ptr str long) -354 stdcall -noname SHFormatDateTimeW(ptr ptr wstr long) +353 stdcall -ordinal SHFormatDateTimeA(ptr ptr str long) +354 stdcall -ordinal SHFormatDateTimeW(ptr ptr wstr long) 355 stdcall -noname IUnknown_EnableModeless(ptr long) 356 stdcall -noname CreateAllAccessSecurityAttributes(ptr ptr long) 357 stdcall -noname SHGetNewLinkInfoWrapW(wstr wstr wstr long long) @@ -374,8 +374,8 @@ 374 stub -noname SHCheckDiskForMediaA 375 stub -noname SHCheckDiskForMediaW 376 stdcall -noname MLGetUILanguage() kernel32.GetUserDefaultUILanguage -377 stdcall -noname MLLoadLibraryA(str long long) -378 stdcall -noname MLLoadLibraryW(wstr long long) +377 stdcall -ordinal MLLoadLibraryA(str long long) +378 stdcall -ordinal MLLoadLibraryW(wstr long long) 379 stub -noname Shell_GetCachedImageIndexWrapW 380 stub -noname Shell_GetCachedImageIndexWrapA 381 stub -noname AssocCopyVerbs @@ -385,7 +385,7 @@ 385 stub -noname SHLoadRawAccelerators 386 stub -noname SHQueryRawAccelerator 387 stub -noname SHQueryRawAcceleratorMsg -388 varargs -noname ShellMessageBoxWrapW(long long wstr wstr long) +388 varargs -ordinal ShellMessageBoxWrapW(long long wstr wstr long) 389 stdcall -noname GetSaveFileNameWrapW(ptr) 390 stdcall -noname WNetRestoreConnectionWrapW(long wstr) 391 stdcall -noname WNetGetLastErrorWrapW(ptr ptr long ptr long) @@ -413,9 +413,9 @@ 413 stdcall -noname SHGetMachineInfo(long) 414 stub -noname SHHtmlHelpOnDemandW 415 stub -noname SHHtmlHelpOnDemandA -416 stub -noname SHWinHelpOnDemandW -417 stub -noname SHWinHelpOnDemandA -418 stdcall -noname MLFreeLibrary(long) +416 stdcall -noname SHWinHelpOnDemandW(long wstr long ptr long) +417 stdcall -noname SHWinHelpOnDemandA(long str long ptr long) +418 stdcall -ordinal MLFreeLibrary(long) 419 stdcall -noname SHFlushSFCacheWrap() 420 stub SHLWAPI_420 # CMemStream::Commit 421 stub -noname SHLoadPersistedDataObject @@ -429,12 +429,12 @@ 429 stdcall -noname MLIsMLHInstance(long) 430 stdcall -noname MLSetMLHInstance(long long) 431 stdcall -noname MLClearMLHInstance(long) -432 stdcall -noname SHSendMessageBroadcastA(long long long) -433 stdcall -noname SHSendMessageBroadcastW(long long long) +432 stdcall -ordinal SHSendMessageBroadcastA(long long long) +433 stdcall -ordinal SHSendMessageBroadcastW(long long long) 434 stdcall -noname SendMessageTimeoutWrapW(long long long long long long ptr) user32.SendMessageTimeoutW 435 stdcall -noname CLSIDFromProgIDWrap(wstr ptr) ole32.CLSIDFromProgID 436 stdcall -noname CLSIDFromStringWrap(wstr ptr) -437 stdcall -noname IsOS(long) +437 stdcall -ordinal IsOS(long) 438 stub -noname SHLoadRegUIStringA 439 stdcall -noname SHLoadRegUIStringW(ptr wstr ptr long) 440 stdcall -noname SHGetWebFolderFilePathA(str ptr long) @@ -459,12 +459,12 @@ 459 stdcall -noname SHExpandEnvironmentStringsA(str ptr long) kernel32.ExpandEnvironmentStringsA 460 stdcall -noname SHExpandEnvironmentStringsW(wstr ptr long) kernel32.ExpandEnvironmentStringsW 461 stdcall -noname SHGetAppCompatFlags(long) -462 stdcall -noname UrlFixupW(wstr wstr long) +462 stdcall -ordinal UrlFixupW(wstr wstr long) 463 stdcall -noname SHExpandEnvironmentStringsForUserA(ptr str ptr long) userenv.ExpandEnvironmentStringsForUserA 464 stdcall -noname SHExpandEnvironmentStringsForUserW(ptr wstr ptr long) userenv.ExpandEnvironmentStringsForUserW 465 stub -noname PathUnExpandEnvStringsForUserA 466 stub -noname PathUnExpandEnvStringsForUserW -467 stub -noname SHRunIndirectRegClientCommand +467 stub -ordinal SHRunIndirectRegClientCommand 468 stub -noname RunIndirectRegCommand 469 stub -noname RunRegCommand 470 stub -noname IUnknown_ProfferServiceOld @@ -484,7 +484,7 @@ 484 stdcall -noname IUnknown_QueryServiceExec(ptr ptr ptr long long long ptr) 485 stub -noname MapWin32ErrorToSTG 486 stub -noname ModeToCreateFileFlags -487 stdcall -noname SHLoadIndirectString(wstr ptr long ptr) +487 stdcall -ordinal SHLoadIndirectString(wstr ptr long ptr) 488 stub -noname SHConvertGraphicsFile 489 stdcall -noname GlobalAddAtomWrapW(wstr) kernel32.GlobalAddAtomW 490 stdcall -noname GlobalFindAtomWrapW(wstr) kernel32.GlobalFindAtomW @@ -505,14 +505,14 @@ 509 stdcall -noname IUnknown_OnFocusChangeIS(ptr ptr long) 510 stub -noname SHLockSharedEx 511 stub -noname PathFileExistsDefExtAndAttributesW -512 stub -noname IStream_ReadPidl -513 stub -noname IStream_WritePidl +512 stub -ordinal IStream_ReadPidl +513 stub -ordinal IStream_WritePidl 514 stdcall -noname IUnknown_ProfferService(ptr ptr ptr ptr) -515 stdcall -noname SHGetViewStatePropertyBag(ptr wstr long ptr ptr) -516 stdcall -noname SKGetValueW(long wstr wstr long long long) -517 stub -noname SKSetValueW -518 stub -noname SKDeleteValueW -519 stub -noname SKAllocValueW +515 stdcall -ordinal SHGetViewStatePropertyBag(ptr wstr long ptr ptr) +516 stdcall -noname SKGetValueW(long wstr wstr ptr ptr ptr) +517 stdcall -noname SKSetValueW(long wstr wstr long ptr long) +518 stdcall -noname SKDeleteValueW(long wstr wstr) +519 stdcall -noname SKAllocValueW(long wstr wstr ptr ptr ptr) 520 stub -noname SHPropertyBag_ReadBSTR 521 stub -noname SHPropertyBag_ReadPOINTL 522 stub -noname SHPropertyBag_WritePOINTL @@ -547,6 +547,7 @@ 551 stub -noname IShellFolder_CompareIDs @ stdcall AssocCreate(double double ptr ptr) +@ stdcall AssocGetPerceivedType(wstr ptr ptr ptr) @ stdcall AssocIsDangerous(long) @ stdcall AssocQueryKeyA(long long str ptr ptr) @ stdcall AssocQueryKeyW(long long wstr ptr ptr) @@ -772,11 +773,11 @@ @ stdcall StrCpyW (ptr wstr) @ stdcall StrDupA (str) @ stdcall StrDupW (wstr) -@ stdcall StrFormatByteSize64A(double ptr long) +@ stdcall StrFormatByteSize64A(int64 ptr long) @ stdcall StrFormatByteSizeA(long ptr long) -@ stdcall StrFormatByteSizeW(double ptr long) -@ stdcall StrFormatKBSizeA(double str long) -@ stdcall StrFormatKBSizeW(double wstr long) +@ stdcall StrFormatByteSizeW(int64 ptr long) +@ stdcall StrFormatKBSizeA(int64 str long) +@ stdcall StrFormatKBSizeW(int64 wstr long) @ stdcall StrFromTimeIntervalA(ptr long long long) @ stdcall StrFromTimeIntervalW(ptr long long long) @ stdcall StrIsIntlEqualA(long str str long) @@ -804,6 +805,8 @@ @ stdcall StrStrNW(wstr wstr long) @ stdcall StrStrNIW(wstr wstr long) @ stdcall StrStrW(wstr wstr) +@ stdcall StrToInt64ExA(str long ptr) +@ stdcall StrToInt64ExW(wstr long ptr) @ stdcall StrToIntA(str) @ stdcall StrToIntExA(str long ptr) @ stdcall StrToIntExW(wstr long ptr) Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_main.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -30,13 +30,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -HINSTANCE shlwapi_hInstance = 0; -DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES; +DECLSPEC_HIDDEN HINSTANCE shlwapi_hInstance = 0; +DECLSPEC_HIDDEN DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES; /************************************************************************* * SHLWAPI {SHLWAPI} * - * The Shell Light-Weight Api dll provides a large number of utility functions + * The Shell Light-Weight API dll provides a large number of utility functions * which are commonly required by Win32 programs. Originally distributed with * Internet Explorer as a free download, it became a core part of Windows when * Internet Explorer was 'integrated' into the O/S with the release of Win98. @@ -51,7 +51,7 @@ * SHLWAPI DllMain * * NOTES - * calling oleinitialize here breaks sone apps. + * calling oleinitialize here breaks some apps. */ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) { Modified: trunk/reactos/dll/win32/shlwapi/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/string.c…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -176,7 +176,7 @@ else str2[1] = '\0'; - return CompareStringA(GetThreadLocale(), dwFlags, str1, -1, str2, -1) - 2; + return CompareStringA(GetThreadLocale(), dwFlags, str1, -1, str2, -1) - CSTR_EQUAL; } /************************************************************************* @@ -216,7 +216,7 @@ */ BOOL WINAPI ChrCmpIW(WCHAR ch1, WCHAR ch2) { - return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, &ch1, 1, &ch2, 1) - 2; + return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, &ch1, 1, &ch2, 1) - CSTR_EQUAL; } /************************************************************************* @@ -352,12 +352,8 @@ */ int WINAPI StrCmpIW(LPCWSTR lpszStr, LPCWSTR lpszComp) { - int iRet; - TRACE("(%s,%s)\n", debugstr_w(lpszStr),debugstr_w(lpszComp)); - - iRet = CompareStringW(GetThreadLocale(), NORM_IGNORECASE, lpszStr, -1, lpszComp, -1); - return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0; + return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, lpszStr, -1, lpszComp, -1) - CSTR_EQUAL; } /************************************************************************* @@ -376,12 +372,8 @@ */ INT WINAPI StrCmpNA(LPCSTR lpszStr, LPCSTR lpszComp, INT iLen) { - INT iRet; - TRACE("(%s,%s,%i)\n", debugstr_a(lpszStr), debugstr_a(lpszComp), iLen); - - iRet = CompareStringA(GetThreadLocale(), 0, lpszStr, iLen, lpszComp, iLen); - return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0; + return CompareStringA(GetThreadLocale(), 0, lpszStr, iLen, lpszComp, iLen) - CSTR_EQUAL; } /************************************************************************* @@ -391,12 +383,8 @@ */ INT WINAPI StrCmpNW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen) { - INT iRet; - TRACE("(%s,%s,%i)\n", debugstr_w(lpszStr), debugstr_w(lpszComp), iLen); - - iRet = CompareStringW(GetThreadLocale(), 0, lpszStr, iLen, lpszComp, iLen); - return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0; + return CompareStringW(GetThreadLocale(), 0, lpszStr, iLen, lpszComp, iLen) - CSTR_EQUAL; } /************************************************************************* @@ -415,12 +403,8 @@ */ int WINAPI StrCmpNIA(LPCSTR lpszStr, LPCSTR lpszComp, int iLen) { - INT iRet; - TRACE("(%s,%s,%i)\n", debugstr_a(lpszStr), debugstr_a(lpszComp), iLen); - - iRet = CompareStringA(GetThreadLocale(), NORM_IGNORECASE, lpszStr, iLen, lpszComp, iLen); - return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0; + return CompareStringA(GetThreadLocale(), NORM_IGNORECASE, lpszStr, iLen, lpszComp, iLen) - CSTR_EQUAL; } /************************************************************************* @@ -430,12 +414,8 @@ */ INT WINAPI StrCmpNIW(LPCWSTR lpszStr, LPCWSTR lpszComp, int iLen) { - INT iRet; - TRACE("(%s,%s,%i)\n", debugstr_w(lpszStr), debugstr_w(lpszComp), iLen); - - iRet = CompareStringW(GetThreadLocale(), NORM_IGNORECASE, lpszStr, iLen, lpszComp, iLen); - return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0; + return CompareStringW(GetThreadLocale(), NORM_IGNORECASE, lpszStr, iLen, lpszComp, iLen) - CSTR_EQUAL; } /************************************************************************* @@ -453,12 +433,8 @@ */ int WINAPI StrCmpW(LPCWSTR lpszStr, LPCWSTR lpszComp) { - INT iRet; - TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszComp)); - - iRet = CompareStringW(GetThreadLocale(), 0, lpszStr, -1, lpszComp, -1); - return iRet == CSTR_LESS_THAN ? -1 : iRet == CSTR_GREATER_THAN ? 1 : 0; + return CompareStringW(GetThreadLocale(), 0, lpszStr, -1, lpszComp, -1) - CSTR_EQUAL; } /************************************************************************* @@ -477,7 +453,8 @@ { TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSrc)); - strcatW(lpszStr, lpszSrc); + if (lpszStr && lpszSrc) + strcatW(lpszStr, lpszSrc); return lpszStr; } @@ -497,7 +474,8 @@ { TRACE("(%p,%s)\n", lpszStr, debugstr_w(lpszSrc)); - strcpyW(lpszStr, lpszSrc); + if (lpszStr && lpszSrc) + strcpyW(lpszStr, lpszSrc); return lpszStr; } @@ -855,8 +833,25 @@ */ BOOL WINAPI StrToIntExA(LPCSTR lpszStr, DWORD dwFlags, LPINT lpiRet) { + LONGLONG li; + BOOL bRes; + + TRACE("(%s,%08X,%p)\n", debugstr_a(lpszStr), dwFlags, lpiRet); + + bRes = StrToInt64ExA(lpszStr, dwFlags, &li); + if (bRes) *lpiRet = li; + return bRes; +} + +/************************************************************************* + * StrToInt64ExA [SHLWAPI.@] + * + * See StrToIntExA. + */ +BOOL WINAPI StrToInt64ExA(LPCSTR lpszStr, DWORD dwFlags, LONGLONG *lpiRet) +{ BOOL bNegative = FALSE; - int iRet = 0; + LONGLONG iRet = 0; TRACE("(%s,%08X,%p)\n", debugstr_a(lpszStr), dwFlags, lpiRet); @@ -865,10 +860,7 @@ WARN("Invalid parameter would crash under Win32!\n"); return FALSE; } - if (dwFlags > STIF_SUPPORT_HEX) - { - WARN("Unknown flags (%08lX)!\n", dwFlags & ~STIF_SUPPORT_HEX); - } + if (dwFlags > STIF_SUPPORT_HEX) WARN("Unknown flags %08x\n", dwFlags); /* Skip leading space, '+', '-' */ while (isspace(*lpszStr)) @@ -925,8 +917,25 @@ */ BOOL WINAPI StrToIntExW(LPCWSTR lpszStr, DWORD dwFlags, LPINT lpiRet) { + LONGLONG li; + BOOL bRes; + + TRACE("(%s,%08X,%p)\n", debugstr_w(lpszStr), dwFlags, lpiRet); + + bRes = StrToInt64ExW(lpszStr, dwFlags, &li); + if (bRes) *lpiRet = li; + return bRes; +} + +/************************************************************************* + * StrToInt64ExW [SHLWAPI.@] + * + * See StrToIntExA. + */ +BOOL WINAPI StrToInt64ExW(LPCWSTR lpszStr, DWORD dwFlags, LONGLONG *lpiRet) +{ BOOL bNegative = FALSE; - int iRet = 0; + LONGLONG iRet = 0; TRACE("(%s,%08X,%p)\n", debugstr_w(lpszStr), dwFlags, lpiRet); @@ -935,10 +944,7 @@ WARN("Invalid parameter would crash under Win32!\n"); return FALSE; } - if (dwFlags > STIF_SUPPORT_HEX) - { - WARN("Unknown flags (%08lX)!\n", dwFlags & ~STIF_SUPPORT_HEX); - } + if (dwFlags > STIF_SUPPORT_HEX) WARN("Unknown flags %08x\n", dwFlags); /* Skip leading space, '+', '-' */ while (isspaceW(*lpszStr)) lpszStr++; @@ -1419,7 +1425,7 @@ * It was duplicated because not every version of Shlwapi.dll exports * StrRetToBufA. If you change one routine, change them both. */ - TRACE("dest=%p len=0x%x strret=%p pidl=%p stub\n",dest,len,src,pidl); + TRACE("dest=%p len=0x%x strret=%p pidl=%p\n", dest, len, src, pidl); if (!src) { @@ -1463,7 +1469,7 @@ */ HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len) { - TRACE("dest=%p len=0x%x strret=%p pidl=%p stub\n",dest,len,src,pidl); + TRACE("dest=%p len=0x%x strret=%p pidl=%p\n", dest, len, src, pidl); if (!src) { @@ -2344,7 +2350,7 @@ { WCHAR wszBytesFormat[64]; LoadStringW(shlwapi_hInstance, IDS_BYTES_FORMAT, wszBytesFormat, 64); - snprintfW(lpszDest, cchMax, wszBytesFormat, (long)llBytes); + snprintfW(lpszDest, cchMax, wszBytesFormat, (int)llBytes); return lpszDest; } @@ -2364,7 +2370,7 @@ * counts that lie exactly on a 1024 byte boundary. */ if (i > 8) - dBytes = (double)(llBytes >> 20) + 0.001; /* Scale down by I MB */ + dBytes = (double)(llBytes >> 20) + 0.001; /* Scale down by 1 MB */ else dBytes = (double)llBytes + 0.00001; @@ -2473,17 +2479,12 @@ if ((lpszIter = StrChrA(lpszStr, '&'))) { lpszTmp = CharNextA(lpszIter); - if (lpszTmp && *lpszTmp) + if (*lpszTmp) { if (*lpszTmp != '&') ch = *lpszTmp; - while (lpszIter && *lpszIter) - { - lpszTmp = CharNextA(lpszIter); - *lpszIter = *lpszTmp; - lpszIter = lpszTmp; - } + memmove( lpszIter, lpszTmp, strlen(lpszTmp) + 1 ); } } @@ -2507,17 +2508,12 @@ if ((lpszIter = StrChrW(lpszStr, '&'))) { lpszTmp = lpszIter + 1; - if (lpszTmp && *lpszTmp) + if (*lpszTmp) { if (*lpszTmp != '&') ch = *lpszTmp; - while (lpszIter && *lpszIter) - { - lpszTmp = lpszIter + 1; - *lpszIter = *lpszTmp; - lpszIter = lpszTmp; - } + memmove( lpszIter, lpszTmp, (strlenW(lpszTmp) + 1) * sizeof(WCHAR) ); } } Modified: trunk/reactos/dll/win32/shlwapi/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/thread.c…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/thread.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/thread.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -122,13 +122,18 @@ typedef struct { - const IUnknownVtbl* lpVtbl; + IUnknown IUnknown_iface; LONG *ref; } threadref; +static inline threadref *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, threadref, IUnknown_iface); +} + static HRESULT WINAPI threadref_QueryInterface(IUnknown *iface, REFIID riid, LPVOID *ppvObj) { - threadref * This = (threadref *)iface; + threadref * This = impl_from_IUnknown(iface); TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObj); @@ -149,7 +154,7 @@ static ULONG WINAPI threadref_AddRef(IUnknown *iface) { - threadref * This = (threadref *)iface; + threadref * This = impl_from_IUnknown(iface); TRACE("(%p)\n", This); return InterlockedIncrement(This->ref); @@ -158,7 +163,7 @@ static ULONG WINAPI threadref_Release(IUnknown *iface) { LONG refcount; - threadref * This = (threadref *)iface; + threadref * This = impl_from_IUnknown(iface); TRACE("(%p)\n", This); @@ -199,11 +204,11 @@ return E_INVALIDARG; This = HeapAlloc(GetProcessHeap(), 0, sizeof(threadref)); - This->lpVtbl = &threadref_vt; + This->IUnknown_iface.lpVtbl = &threadref_vt; This->ref = lprefcount; *lprefcount = 1; - *lppUnknown = (IUnknown *) This; + *lppUnknown = &This->IUnknown_iface; TRACE("=> returning S_OK with %p\n", This); return S_OK; } @@ -360,7 +365,7 @@ ti.pfnThreadProc = pfnThreadProc; ti.pfnCallback = pfnCallback; ti.pData = pData; - ti.bInitCom = dwFlags & CTF_COINIT ? TRUE : FALSE; + ti.bInitCom = (dwFlags & CTF_COINIT) != 0; ti.hEvent = CreateEventW(NULL,FALSE,FALSE,NULL); /* Hold references to the current thread and IE process, if desired */ Modified: trunk/reactos/dll/win32/shlwapi/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?re…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -41,6 +41,21 @@ HRESULT WINAPI MLBuildResURLW(LPCWSTR,HMODULE,DWORD,LPCWSTR,LPWSTR,DWORD); WINE_DEFAULT_DEBUG_CHANNEL(shell); + +static inline WCHAR *heap_strdupAtoW(const char *str) +{ + LPWSTR ret = NULL; + + if(str) { + DWORD len; + + len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); + ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); + } + + return ret; +} /* The following schemes were identified in the native version of * SHLWAPI.DLL version 5.50 @@ -234,7 +249,6 @@ { LPWSTR url, canonical; HRESULT ret; - DWORD len; TRACE("(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d\n", debugstr_a(pszUrl), pszCanonicalized, pcchCanonicalized, dwFlags, pcchCanonicalized ? *pcchCanonicalized : -1); @@ -242,8 +256,7 @@ if(!pszUrl || !pszCanonicalized || !pcchCanonicalized || !*pcchCanonicalized) return E_INVALIDARG; - len = strlen(pszUrl)+1; - url = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + url = heap_strdupAtoW(pszUrl); canonical = HeapAlloc(GetProcessHeap(), 0, *pcchCanonicalized*sizeof(WCHAR)); if(!url || !canonical) { HeapFree(GetProcessHeap(), 0, url); @@ -251,13 +264,12 @@ return E_OUTOFMEMORY; } - MultiByteToWideChar(0, 0, pszUrl, -1, url, len); - ret = UrlCanonicalizeW(url, canonical, pcchCanonicalized, dwFlags); if(ret == S_OK) WideCharToMultiByte(0, 0, canonical, -1, pszCanonicalized, *pcchCanonicalized+1, 0, 0); + HeapFree(GetProcessHeap(), 0, url); HeapFree(GetProcessHeap(), 0, canonical); return ret; } @@ -273,9 +285,10 @@ HRESULT hr = S_OK; DWORD EscapeFlags; LPCWSTR wk1, root; - LPWSTR lpszUrlCpy, wk2, mp, mp2; + LPWSTR lpszUrlCpy, url, wk2, mp, mp2; INT state; DWORD nByteLen, nLen, nWkLen; + BOOL is_file_url; WCHAR slash = '\0'; static const WCHAR wszFile[] = {'f','i','l','e',':'}; @@ -295,22 +308,39 @@ return S_OK; } + /* Remove '\t' characters from URL */ nByteLen = (strlenW(pszUrl) + 1) * sizeof(WCHAR); /* length in bytes */ + url = HeapAlloc(GetProcessHeap(), 0, nByteLen); + if(!url) + return E_OUTOFMEMORY; + + wk1 = pszUrl; + wk2 = url; + do { + while(*wk1 == '\t') + wk1++; + *wk2++ = *wk1; + } while(*wk1++); + /* Allocate memory for simplified URL (before escaping) */ + nByteLen = (wk2-url)*sizeof(WCHAR); lpszUrlCpy = HeapAlloc(GetProcessHeap(), 0, nByteLen+sizeof(wszFilePrefix)+sizeof(WCHAR)); + if(!lpszUrlCpy) { + HeapFree(GetProcessHeap(), 0, url); + return E_OUTOFMEMORY; + } + + is_file_url = !strncmpW(wszFile, url, sizeof(wszFile)/sizeof(WCHAR)); if ((nByteLen >= sizeof(wszHttp) && - !memcmp(wszHttp, pszUrl, sizeof(wszHttp))) || - (nByteLen >= sizeof(wszFile) && - !memcmp(wszFile, pszUrl, sizeof(wszFile)))) + !memcmp(wszHttp, url, sizeof(wszHttp))) || is_file_url) slash = '/'; - if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszFile) - && !memcmp(wszFile, pszUrl, sizeof(wszFile))) + if((dwFlags & (URL_FILE_USE_PATHURL | URL_WININET_COMPATIBILITY)) && is_file_url) slash = '\\'; - if(nByteLen >= sizeof(wszRes) && !memcmp(wszRes, pszUrl, sizeof(wszRes))) { + if(nByteLen >= sizeof(wszRes) && !memcmp(wszRes, url, sizeof(wszRes))) { dwFlags &= ~URL_FILE_USE_PATHURL; slash = '\0'; } @@ -326,14 +356,14 @@ * 6 have location (found /) save root location */ - wk1 = pszUrl; + wk1 = url; wk2 = lpszUrlCpy; state = 0; - if(pszUrl[1] == ':') { /* Assume path */ + if(url[1] == ':') { /* Assume path */ memcpy(wk2, wszFilePrefix, sizeof(wszFilePrefix)); wk2 += sizeof(wszFilePrefix)/sizeof(WCHAR); - if (dwFlags & URL_FILE_USE_PATHURL) + if (dwFlags & (URL_FILE_USE_PATHURL | URL_WININET_COMPATIBILITY)) { slash = '\\'; --wk2; @@ -341,6 +371,7 @@ else dwFlags |= URL_ESCAPE_UNSAFE; state = 5; + is_file_url = TRUE; } while (*wk1) { @@ -361,14 +392,47 @@ if (*wk1 != '/') {state = 6; break;} *wk2++ = *wk1++; if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszLocalhost) - && !strncmpW(wszFile, pszUrl, sizeof(wszFile)/sizeof(WCHAR)) + && is_file_url && !memcmp(wszLocalhost, wk1, sizeof(wszLocalhost))){ wk1 += sizeof(wszLocalhost)/sizeof(WCHAR); while(*wk1 == '\\' && (dwFlags & URL_FILE_USE_PATHURL)) wk1++; } - if(*wk1 == '/' && (dwFlags & URL_FILE_USE_PATHURL)) + + if(*wk1 == '/' && (dwFlags & URL_FILE_USE_PATHURL)){ wk1++; + }else if(is_file_url){ + const WCHAR *body = wk1; + + while(*body == '/') + ++body; + + if(isalnumW(*body) && *(body+1) == ':'){ + if(!(dwFlags & (URL_WININET_COMPATIBILITY | URL_FILE_USE_PATHURL))){ + if(slash) + *wk2++ = slash; + else + *wk2++ = '/'; + } + }else{ + if(dwFlags & URL_WININET_COMPATIBILITY){ + if(*wk1 == '/' && *(wk1+1) != '/'){ + *wk2++ = '\\'; + }else{ + *wk2++ = '\\'; + *wk2++ = '\\'; + } + }else{ + if(*wk1 == '/' && *(wk1+1) != '/'){ + if(slash) + *wk2++ = slash; + else + *wk2++ = '/'; + } + } + } + wk1 = body; + } state = 4; break; case 3: @@ -483,6 +547,7 @@ default: FIXME("how did we get here - state=%d\n", state); HeapFree(GetProcessHeap(), 0, lpszUrlCpy); + HeapFree(GetProcessHeap(), 0, url); return E_INVALIDARG; } *wk2 = '\0'; @@ -495,7 +560,7 @@ if((dwFlags & URL_UNESCAPE) || ((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszFile) - && !memcmp(wszFile, pszUrl, sizeof(wszFile)))) + && !memcmp(wszFile, url, sizeof(wszFile)))) UrlUnescapeW(lpszUrlCpy, NULL, &nLen, URL_UNESCAPE_INPLACE); if((EscapeFlags = dwFlags & (URL_ESCAPE_UNSAFE | @@ -518,6 +583,7 @@ } HeapFree(GetProcessHeap(), 0, lpszUrlCpy); + HeapFree(GetProcessHeap(), 0, url); if (hr == S_OK) TRACE("result %s\n", debugstr_w(pszCanonicalized)); @@ -596,7 +662,7 @@ { PARSEDURLW base, relative; DWORD myflags, sizeloc = 0; - DWORD len, res1, res2, process_case = 0; + DWORD i, len, res1, res2, process_case = 0; LPWSTR work, preliminary, mbase, mrelative; static const WCHAR myfilestr[] = {'f','i','l','e',':','/','/','/','\0'}; HRESULT ret; @@ -636,6 +702,10 @@ } else do { BOOL manual_search = FALSE; + + work = (LPWSTR)base.pszProtocol; + for(i=0; i<base.cchProtocol; i++) + work[i] = tolowerW(work[i]); /* mk is a special case */ if(base.nScheme == URL_SCHEME_MK) { @@ -676,7 +746,9 @@ const WCHAR htmW[] = {'.','h','t','m',0}; const int len_htmW = 4; - if (work - base.pszSuffix > len_htmW * sizeof(WCHAR)) { + if (base.nScheme == URL_SCHEME_HTTP || base.nScheme == URL_SCHEME_HTTPS) + manual_search = TRUE; + else if (work - base.pszSuffix > len_htmW) { work -= len_htmW; if (strncmpiW(work, htmW, len_htmW) == 0) manual_search = TRUE; @@ -684,7 +756,7 @@ } if (!manual_search && - work - base.pszSuffix > len_htmlW * sizeof(WCHAR)) { + work - base.pszSuffix > len_htmlW) { work -= len_htmlW; if (strncmpiW(work, htmlW, len_htmlW) == 0) manual_search = TRUE; @@ -696,15 +768,15 @@ /* search backwards starting from the current position */ while (*work != '/' && work > base.pszSuffix + sizeloc) --work; - if (work > base.pszSuffix + sizeloc) - base.cchSuffix = work - base.pszSuffix + 1; + base.cchSuffix = work - base.pszSuffix + 1; }else { /* search backwards starting from the end of the string */ work = strrchrW((base.pszSuffix+sizeloc), '/'); if (work) { len = (DWORD)(work - base.pszSuffix + 1); base.cchSuffix = len; - } + }else + base.cchSuffix = sizeloc; } /* @@ -747,9 +819,22 @@ process_case = 4; break; } + if (*mrelative == '#') { + if(!(work = strchrW(base.pszSuffix+base.cchSuffix, '#'))) + work = (LPWSTR)base.pszSuffix + strlenW(base.pszSuffix); + + memcpy(preliminary, base.pszProtocol, (work-base.pszProtocol)*sizeof(WCHAR)); + preliminary[work-base.pszProtocol] = '\0'; + process_case = 1; + break; + } process_case = (*base.pszSuffix == '/' || base.nScheme == URL_SCHEME_MK) ? 5 : 3; break; - } + }else { + work = (LPWSTR)relative.pszProtocol; + for(i=0; i<relative.cchProtocol; i++) + work[i] = tolowerW(work[i]); + } /* handle cases where pszRelative has scheme */ if ((base.cchProtocol == relative.cchProtocol) && @@ -995,15 +1080,15 @@ LPCWSTR src; DWORD needed = 0, ret; BOOL stop_escaping = FALSE; - WCHAR next[5], *dst = pszEscaped; + WCHAR next[5], *dst, *dst_ptr; INT len; PARSEDURLW parsed_url; DWORD int_flags; DWORD slashes = 0; static const WCHAR localhost[] = {'l','o','c','a','l','h','o','s','t',0}; - TRACE("(%s %p %p 0x%08x)\n", debugstr_w(pszUrl), pszEscaped, - pcchEscaped, dwFlags); + TRACE("(%p(%s) %p %p 0x%08x)\n", pszUrl, debugstr_w(pszUrl), + pszEscaped, pcchEscaped, dwFlags); if(!pszUrl || !pcchEscaped) return E_INVALIDARG; @@ -1013,6 +1098,10 @@ URL_DONT_ESCAPE_EXTRA_INFO | URL_ESCAPE_PERCENT)) FIXME("Unimplemented flags: %08x\n", dwFlags); + + dst_ptr = dst = HeapAlloc(GetProcessHeap(), 0, *pcchEscaped*sizeof(WCHAR)); + if(!dst_ptr) + return E_OUTOFMEMORY; /* fix up flags */ if (dwFlags & URL_ESCAPE_SPACES_ONLY) @@ -1130,12 +1219,16 @@ if(needed < *pcchEscaped) { *dst = '\0'; - ret = S_OK; + memcpy(pszEscaped, dst_ptr, (needed+1)*sizeof(WCHAR)); + + ret = S_OK; } else { needed++; /* add one for the '\0' */ - ret = E_POINTER; + ret = E_POINTER; } *pcchEscaped = needed; + + HeapFree(GetProcessHeap(), 0, dst_ptr); return ret; } @@ -1611,6 +1704,39 @@ return E_FAIL; } +static HRESULT URL_CreateFromPath(LPCWSTR pszPath, LPWSTR pszUrl, LPDWORD pcchUrl) +{ + DWORD needed; + HRESULT ret = S_OK; + WCHAR *pszNewUrl; + WCHAR file_colonW[] = {'f','i','l','e',':',0}; + WCHAR three_slashesW[] = {'/','/','/',0}; + PARSEDURLW parsed_url; + + parsed_url.cbSize = sizeof(parsed_url); + if(ParseURLW(pszPath, &parsed_url) == S_OK) { + if(parsed_url.nScheme != URL_SCHEME_INVALID && parsed_url.cchProtocol > 1) { + needed = strlenW(pszPath); + if (needed >= *pcchUrl) { + *pcchUrl = needed + 1; + return E_POINTER; + } else { + *pcchUrl = needed; + return S_FALSE; + } + } + } + + pszNewUrl = HeapAlloc(GetProcessHeap(), 0, (strlenW(pszPath) + 9) * sizeof(WCHAR)); /* "file:///" + pszPath_len + 1 */ + strcpyW(pszNewUrl, file_colonW); + if(isalphaW(pszPath[0]) && pszPath[1] == ':') + strcatW(pszNewUrl, three_slashesW); + strcatW(pszNewUrl, pszPath); + ret = UrlEscapeW(pszNewUrl, pszUrl, pcchUrl, URL_ESCAPE_PERCENT); + HeapFree(GetProcessHeap(), 0, pszNewUrl); + return ret; +} + static HRESULT URL_ApplyDefault(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut) { HKEY newkey; @@ -1658,11 +1784,18 @@ if (!pszIn || !pszOut || !pcchOut) return E_INVALIDARG; if (dwFlags & URL_APPLY_GUESSFILE) { - FIXME("(%s %p %p(%d) 0x%08x): stub URL_APPLY_GUESSFILE not implemented\n", - debugstr_w(pszIn), pszOut, pcchOut, *pcchOut, dwFlags); - strcpyW(pszOut, pszIn); - *pcchOut = strlenW(pszOut); - return S_FALSE; + if (*pcchOut > 1 && ':' == pszIn[1]) { + res1 = *pcchOut; + ret = URL_CreateFromPath(pszIn, pszOut, &res1); + if (ret == S_OK || ret == E_POINTER){ + *pcchOut = res1; + return ret; + } + else if (ret == S_FALSE) + { + return ret; + } + } } in_scheme.cbSize = sizeof(in_scheme); @@ -1673,20 +1806,6 @@ if (dwFlags & URL_APPLY_GUESSSCHEME) { if ((ret = URL_GuessScheme(pszIn, pszOut, pcchOut)) != E_FAIL) return ret; - } - } - else { - /* we have a scheme, see if valid (known scheme) */ - if (in_scheme.nScheme) { - /* have valid scheme, so just copy and exit */ - if (strlenW(pszIn) + 1 > *pcchOut) { - *pcchOut = strlenW(pszIn) + 1; - return E_POINTER; - } - strcpyW(pszOut, pszIn); - *pcchOut = strlenW(pszOut); - TRACE("valid scheme, returning copy\n"); - return S_OK; } } @@ -1901,6 +2020,10 @@ else cont = FALSE; } + + if(*start != ':') + *size = 0; + break; case USERPASS: @@ -1956,7 +2079,8 @@ if (isalnumW(*start) || (*start == '-') || (*start == '.') || - (*start == ' ') ) { + (*start == ' ') || + (*start == '*') ) { start++; (*size)++; } @@ -2124,7 +2248,7 @@ switch (dwPart) { case URL_PART_SCHEME: - if (!pl.szScheme || scheme == URL_SCHEME_UNKNOWN) { + if (!pl.szScheme) { *pcchOut = 0; return S_FALSE; } @@ -2328,12 +2452,7 @@ */ HRESULT WINAPI UrlCreateFromPathW(LPCWSTR pszPath, LPWSTR pszUrl, LPDWORD pcchUrl, DWORD dwReserved) { - DWORD needed; HRESULT ret; - WCHAR *pszNewUrl; - WCHAR file_colonW[] = {'f','i','l','e',':',0}; - WCHAR three_slashesW[] = {'/','/','/',0}; - PARSEDURLW parsed_url; TRACE("(%s, %p, %p, 0x%08x)\n", debugstr_w(pszPath), pszUrl, pcchUrl, dwReserved); @@ -2343,30 +2462,11 @@ if (!pszUrl || !pcchUrl) return E_INVALIDARG; - - parsed_url.cbSize = sizeof(parsed_url); - if(ParseURLW(pszPath, &parsed_url) == S_OK) { - if(parsed_url.nScheme != URL_SCHEME_INVALID && parsed_url.cchProtocol > 1) { - needed = strlenW(pszPath); - if (needed >= *pcchUrl) { - *pcchUrl = needed + 1; - return E_POINTER; - } else { - *pcchUrl = needed; - strcpyW(pszUrl, pszPath); - return S_FALSE; - } - } - } - - pszNewUrl = HeapAlloc(GetProcessHeap(), 0, (strlenW(pszPath) + 9) * sizeof(WCHAR)); /* "file:///" + pszPath_len + 1 */ - strcpyW(pszNewUrl, file_colonW); - if(isalphaW(pszPath[0]) && pszPath[1] == ':') - strcatW(pszNewUrl, three_slashesW); - strcatW(pszNewUrl, pszPath); - ret = UrlEscapeW(pszNewUrl, pszUrl, pcchUrl, URL_ESCAPE_PERCENT); - - HeapFree(GetProcessHeap(), 0, pszNewUrl); + ret = URL_CreateFromPath(pszPath, pszUrl, pcchUrl); + + if (S_FALSE == ret) + strcpyW(pszUrl, pszPath); + return ret; } Modified: trunk/reactos/dll/win32/shlwapi/wsprintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/wsprintf…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/wsprintf.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/wsprintf.c [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -43,6 +43,8 @@ #define WPRINTF_SHORT 0x0010 /* Short arg ('h' prefix) */ #define WPRINTF_UPPER_HEX 0x0020 /* Upper-case hex ('X' specifier) */ #define WPRINTF_WIDE 0x0040 /* Wide arg ('w' prefix) */ +#define WPRINTF_INTPTR 0x0080 /* Pointer-size arg ('I' prefix) */ +#define WPRINTF_I64 0x0100 /* 64-bit arg ('I64' prefix) */ typedef enum { @@ -65,11 +67,11 @@ } WPRINTF_FORMAT; typedef union { - WCHAR wchar_view; - CHAR char_view; - LPCSTR lpcstr_view; - LPCWSTR lpcwstr_view; - INT int_view; + WCHAR wchar_view; + CHAR char_view; + LPCSTR lpcstr_view; + LPCWSTR lpcwstr_view; + LONGLONG int_view; } WPRINTF_DATA; static const CHAR null_stringA[] = "(null)"; @@ -111,6 +113,12 @@ if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; } else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; } else if (*p == 'w') { res->flags |= WPRINTF_WIDE; p++; } + else if (*p == 'I') + { + if (p[1] == '6' && p[2] == '4') { res->flags |= WPRINTF_I64; p += 3; } + else if (p[1] == '3' && p[2] == '2') p += 3; + else { res->flags |= WPRINTF_INTPTR; p++; } + } switch(*p) { case 'c': @@ -132,6 +140,10 @@ case 'u': res->type = WPR_UNSIGNED; break; + case 'p': + res->width = 2 * sizeof(void *); + res->flags |= WPRINTF_ZEROPAD | WPRINTF_INTPTR; + /* fall through */ case 'X': res->flags |= WPRINTF_UPPER_HEX; /* fall through */ @@ -183,7 +195,13 @@ if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; } else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; } else if (*p == 'w') { res->flags |= WPRINTF_WIDE; p++; } - switch((CHAR)*p) + else if (*p == 'I') + { + if (p[1] == '6' && p[2] == '4') { res->flags |= WPRINTF_I64; p += 3; } + else if (p[1] == '3' && p[2] == '2') p += 3; + else { res->flags |= WPRINTF_INTPTR; p++; } + } + switch(*p) { case 'c': res->type = (res->flags & WPRINTF_SHORT) ? WPR_CHAR : WPR_WCHAR; @@ -204,6 +222,10 @@ case 'u': res->type = WPR_UNSIGNED; break; + case 'p': + res->width = 2 * sizeof(void *); + res->flags |= WPRINTF_ZEROPAD | WPRINTF_INTPTR; + /* fall through */ case 'X': res->flags |= WPRINTF_UPPER_HEX; /* fall through */ @@ -247,16 +269,32 @@ if (len > maxlen) len = maxlen; return (format->precision = len); case WPR_SIGNED: - len = sprintf( number, "%d", arg->int_view ); - break; case WPR_UNSIGNED: - len = sprintf( number, "%u", (UINT)arg->int_view ); - break; case WPR_HEXA: - len = sprintf( number, - (format->flags & WPRINTF_UPPER_HEX) ? "%X" : "%x", - (UINT)arg->int_view); - break; + { + const char *digits = (format->flags & WPRINTF_UPPER_HEX) ? "0123456789ABCDEF" : "0123456789abcdef"; + ULONGLONG num = arg->int_view; + int base = format->type == WPR_HEXA ? 16 : 10; + char buffer[20], *p = buffer, *dst = number; + + if (format->type == WPR_SIGNED && arg->int_view < 0) + { + *dst++ = '-'; + num = -arg->int_view; + } + if (format->flags & WPRINTF_INTPTR) num = (UINT_PTR)num; + else if (!(format->flags & WPRINTF_I64)) num = (UINT)num; + + do + { + *p++ = digits[num % base]; + num /= base; + } while (num); + while (p > buffer) *dst++ = *(--p); + *dst = 0; + len = dst - number; + break; + } default: return 0; } @@ -318,7 +356,9 @@ case WPR_HEXA: case WPR_SIGNED: case WPR_UNSIGNED: - argData.int_view = va_arg( args, INT ); + if (format.flags & WPRINTF_INTPTR) argData.int_view = va_arg(args, INT_PTR); + else if (format.flags & WPRINTF_I64) argData.int_view = va_arg(args, LONGLONG); + else argData.int_view = va_arg(args, INT); break; default: argData.wchar_view = 0; @@ -423,7 +463,9 @@ case WPR_HEXA: case WPR_SIGNED: case WPR_UNSIGNED: - argData.int_view = va_arg( args, INT ); + if (format.flags & WPRINTF_INTPTR) argData.int_view = va_arg(args, INT_PTR); + else if (format.flags & WPRINTF_I64) argData.int_view = va_arg(args, LONGLONG); + else argData.int_view = va_arg(args, INT); break; default: argData.wchar_view = 0; @@ -446,7 +488,7 @@ case WPR_STRING: { LPCSTR ptr = argData.lpcstr_view; - for (i = 0; i < len; i++) *p++ = (WCHAR)*ptr++; + for (i = 0; i < len; i++) *p++ = (BYTE)*ptr++; } break; case WPR_WSTRING: @@ -472,7 +514,7 @@ /* fall through */ case WPR_UNSIGNED: for (i = len; i < format.precision; i++, maxlen--) *p++ = '0'; - for (i = sign; i < len; i++) *p++ = (WCHAR)number[i]; + for (i = sign; i < len; i++) *p++ = (BYTE)number[i]; break; case WPR_UNKNOWN: continue; Modified: trunk/reactos/include/psdk/shlwapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlwapi.h?rev…
============================================================================== --- trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/shlwapi.h [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -1119,11 +1119,6 @@ HRESULT WINAPI QISearch(void* base, const QITAB *pqit, REFIID riid, void **ppv); -HANDLE WINAPI SHAllocShared(LPVOID pv, ULONG cb, DWORD pid); -BOOL WINAPI SHFreeShared(HANDLE hMem, DWORD pid); -LPVOID WINAPI SHLockShared(HANDLE hMem, DWORD pid); -BOOL WINAPI SHUnlockShared(LPVOID pv); - #include <poppack.h> #ifdef __cplusplus Modified: trunk/reactos/include/psdk/shtypes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shtypes.idl?r…
============================================================================== --- trunk/reactos/include/psdk/shtypes.idl [iso-8859-1] (original) +++ trunk/reactos/include/psdk/shtypes.idl [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -66,7 +66,7 @@ { [case(STRRET_WSTR)][string] LPWSTR pOleStr; /* OLESTR that will be freed */ [case(STRRET_OFFSET)] UINT uOffset; /* Offset into SHITEMID (ANSI) */ - [case(STRRET_CSTR)] CHAR cStr[MAX_PATH]; /* ANSI Buffer */ + [case(STRRET_CSTR)] char cStr[MAX_PATH]; /* ANSI Buffer */ } DUMMYUNIONNAME; } STRRET, *LPSTRRET; cpp_quote("#include <poppack.h>") @@ -135,3 +135,28 @@ cpp_quote("#else") cpp_quote("#define REFFOLDERTYPEID const FOLDERTYPEID * __MIDL_CONST") cpp_quote("#endif") + +typedef [v1_enum] enum tagPERCEIVED { + PERCEIVED_TYPE_CUSTOM = -3, + PERCEIVED_TYPE_UNSPECIFIED = -2, + PERCEIVED_TYPE_FOLDER = -1, + PERCEIVED_TYPE_UNKNOWN = 0, + PERCEIVED_TYPE_TEXT = 1, + PERCEIVED_TYPE_IMAGE = 2, + PERCEIVED_TYPE_AUDIO = 3, + PERCEIVED_TYPE_VIDEO = 4, + PERCEIVED_TYPE_COMPRESSED = 5, + PERCEIVED_TYPE_DOCUMENT = 6, + PERCEIVED_TYPE_SYSTEM = 7, + PERCEIVED_TYPE_APPLICATION = 8, + PERCEIVED_TYPE_GAMEMEDIA = 9, + PERCEIVED_TYPE_CONTACTS = 10 +} PERCEIVED; + +cpp_quote("#define PERCEIVEDFLAG_UNDEFINED 0x0000") +cpp_quote("#define PERCEIVEDFLAG_SOFTCODED 0x0001") +cpp_quote("#define PERCEIVEDFLAG_HARDCODED 0x0002") +cpp_quote("#define PERCEIVEDFLAG_NATIVESUPPORT 0x0004") +cpp_quote("#define PERCEIVEDFLAG_GDIPLUS 0x0010") +cpp_quote("#define PERCEIVEDFLAG_WMSDK 0x0020") +cpp_quote("#define PERCEIVEDFLAG_ZIPFOLDER 0x0040") Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Sep 29 13:14:20 2012 @@ -162,7 +162,7 @@ reactos/dll/win32/shdocvw # Autosync reactos/dll/win32/shell32 # Forked at Wine-20071011 reactos/dll/win32/shfolder # Autosync -reactos/dll/win32/shlwapi # Autosync +reactos/dll/win32/shlwapi # Synced to Wine-1.5.13 reactos/dll/win32/slbcsp # Synced to Wine-1.5.4 reactos/dll/win32/snmpapi # Synced to Wine-1.5.4 reactos/dll/win32/softpub # Synced to Wine-1.5.4
12 years, 2 months
1
0
0
0
[fireball] 57426: - Patch to apply to trunk if you want to build arwinss (includes win32csr changes). Eventually these changes will be cleaned up and merged to trunk.
by fireball@svn.reactos.org
Author: fireball Date: Sat Sep 29 12:42:28 2012 New Revision: 57426 URL:
http://svn.reactos.org/svn/reactos?rev=57426&view=rev
Log: - Patch to apply to trunk if you want to build arwinss (includes win32csr changes). Eventually these changes will be cleaned up and merged to trunk. Added: branches/arwinss/trunk.diff Added: branches/arwinss/trunk.diff URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/trunk.diff?rev=57426&vi…
============================================================================== --- branches/arwinss/trunk.diff (added) +++ branches/arwinss/trunk.diff [iso-8859-1] Sat Sep 29 12:42:28 2012 @@ -1,0 +1,900 @@ +Index: base/shell/explorer/desktop/desktop.cpp +=================================================================== +--- base/shell/explorer/desktop/desktop.cpp (revision 57368) ++++ base/shell/explorer/desktop/desktop.cpp (working copy) +@@ -327,8 +327,8 @@ + HWND DesktopWindow::Create() + { + static IconWindowClass wcDesktop(TEXT("Progman"), IDI_REACTOS, CS_DBLCLKS); +- /* (disabled because of small ugly temporary artefacts when hiding start menu) +- wcDesktop.hbrBackground = (HBRUSH)(COLOR_BACKGROUND+1); */ ++ /* (disabled because of small ugly temporary artefacts when hiding start menu) */ ++ wcDesktop.hbrBackground = (HBRUSH)(COLOR_BACKGROUND+1); + + int width = GetSystemMetrics(SM_CXSCREEN); + int height = GetSystemMetrics(SM_CYSCREEN); +Index: cmake/baseaddress.cmake +=================================================================== +--- cmake/baseaddress.cmake (revision 57368) ++++ cmake/baseaddress.cmake (working copy) +@@ -1,7 +1,7 @@ + set(baseaddress_ntdll 0x77f20000) + set(baseaddress_kernel32 0x77da0000) + set(baseaddress_msvcrt 0x77d10000) +-set(baseaddress_advapi32 0x77c60000) ++set(baseaddress_advapi32 0x77cb0000) + set(baseaddress_gdi32 0x77bf0000) + set(baseaddress_user32 0x77a60000) + set(baseaddress_dhcpcsvc 0x77a10000) +@@ -296,3 +296,4 @@ + set(baseaddress_netevent 0x70a10000) + set(baseaddress_tapiui 0x709b0000) + set(baseaddress_iologmsg 0x669a0000) ++set(baseaddress_freetypd 0x709b0000) +Index: cmake/config.cmake +=================================================================== +--- cmake/config.cmake (revision 57368) ++++ cmake/config.cmake (working copy) +@@ -26,7 +26,7 @@ + + set(GDB FALSE CACHE BOOL + "Whether to compile for debugging with GDB. +-If you don't use GDB, don't enable this.") ++If you don't use GDB, don't enable this.") + + if(CMAKE_BUILD_TYPE STREQUAL "Release") + set(DBG FALSE CACHE BOOL +@@ -56,6 +56,9 @@ + "Whether to compile support for ELF files. + Do not enable unless you know what you're doing.") + ++set(_ARWINSS_ TRUE CACHE BOOL ++"Whether to build and use Wine-based Win32 subsystem.") ++ + set(NSWPAT FALSE CACHE BOOL + "Whether to compile apps/libs with features covered software patents or not. + If you live in a country where software patents are valid/apply, don't +Index: cmake/gcc.cmake +=================================================================== +--- cmake/gcc.cmake (revision 57368) ++++ cmake/gcc.cmake (working copy) +@@ -171,7 +171,7 @@ + + SET(CMAKE_C_COMPILE_OBJECT "${CCACHE} <CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") + SET(CMAKE_CXX_COMPILE_OBJECT "${CCACHE} <CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") +-set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>") ++set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> -I\"${REACTOS_SOURCE_DIR}/include/asm\" -I\"${REACTOS_BINARY_DIR}/include/asm\" <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>") + + set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} <DEFINES> <SOURCE> <OBJECT>") + set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor \"${MINGW_TOOLCHAIN_PREFIX}gcc -E -xc-header -MMD -MF <DEPFILE> -MT <OBJECT>\" ") +@@ -353,7 +353,7 @@ + + add_custom_command( + OUTPUT ${_object_file} +- COMMAND ${CMAKE_ASM_COMPILER} -x assembler-with-cpp -o ${_object_file} -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm -D__ASM__ -c ${_asm_file} ++ COMMAND ${CMAKE_ASM_COMPILER} -x assembler-with-cpp -o ${_object_file} -I\"${REACTOS_SOURCE_DIR}/include/asm\" -I\"${REACTOS_BINARY_DIR}/include/asm\" -D__ASM__ -c ${_asm_file} + DEPENDS ${_asm_file}) + + add_custom_command( +Index: CMakeLists.txt +=================================================================== +--- CMakeLists.txt (revision 57368) ++++ CMakeLists.txt (working copy) +@@ -126,16 +126,20 @@ + add_definitions(-D_WINKD_=1) + endif() + ++ if(_ARWINSS_) ++ add_definitions(-D_ARWINSS_=1) ++ endif() ++ + if(USE_PSEH3) + add_definitions(-D_USE_PSEH3=1) + endif() + + # Version Options +- add_definitions(-DWINVER=0x502 ++ add_definitions(-DWINVER=0x600 + -D_WIN32_IE=0x600 +- -D_WIN32_WINNT=0x502 +- -D_WIN32_WINDOWS=0x502 +- -D_SETUPAPI_VER=0x502) ++ -D_WIN32_WINNT=0x600 ++ -D_WIN32_WINDOWS=0x600 ++ -D_SETUPAPI_VER=0x600) + + # Arch Options + if(ARCH STREQUAL "i386") +@@ -245,6 +249,9 @@ + add_subdirectory(ntoskrnl) + add_subdirectory(subsystems) + add_subdirectory(win32ss) ++ if (_ARWINSS_) ++ add_subdirectory(arwinss) ++ endif() + + file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/include/reactos) + +Index: drivers/filesystems/npfs/create.c +=================================================================== +--- drivers/filesystems/npfs/create.c (revision 57368) ++++ drivers/filesystems/npfs/create.c (working copy) +@@ -226,6 +226,9 @@ + } + + Ccb->FileObject = FileObject; ++ KeInitializeEvent(&Ccb->ConnectEvent, SynchronizationEvent, FALSE); ++ KeInitializeEvent(&Ccb->ReadEvent, NotificationEvent, FALSE); ++ KeInitializeEvent(&Ccb->WriteEvent, NotificationEvent, FALSE); + + FileObject->FsContext = Fcb; + FileObject->FsContext2 = Ccb; +Index: include/asm/syscalls.inc +=================================================================== +--- include/asm/syscalls.inc (revision 57368) ++++ include/asm/syscalls.inc (working copy) +@@ -95,6 +95,7 @@ + + MACRO(STUB_U, Name, ArgCount) + MAKE_LABEL Zw&Name, %ArgCount * 4 ++ MAKE_LABEL Name, %ArgCount * 4 + START_PROC Nt&Name, %ArgCount * 4 + STUBCODE_U Name, SyscallId, %ArgCount + .ENDP +@@ -102,6 +103,7 @@ + ENDM + + MACRO(STUB_K, Name, ArgCount) ++ MAKE_LABEL Name, %ArgCount * 4 + START_PROC Zw&Name, %ArgCount * 4 + STUBCODE_K Name, SyscallId, %ArgCount + .ENDP +Index: include/psdk/winddi.h +=================================================================== +--- include/psdk/winddi.h (revision 57368) ++++ include/psdk/winddi.h (working copy) +@@ -2665,7 +2665,7 @@ + _In_ ULONG cjSize, + _Out_bytecap_(cjSize) FONTINFO *pfi); + +-#if (NTDDI_VERSION <= NTDDI_WINXP) ++#if 0//(NTDDI_VERSION <= NTDDI_WINXP) + GAMMA_TABLES* + APIENTRY + FONTOBJ_pGetGammaTables( +Index: include/psdk/winuser.h +=================================================================== +--- include/psdk/winuser.h (revision 57368) ++++ include/psdk/winuser.h (working copy) +@@ -2818,8 +2818,8 @@ + typedef LRESULT(CALLBACK *HOOKPROC)(int,WPARAM,LPARAM); + typedef BOOL(CALLBACK *PROPENUMPROCA)(HWND,LPCSTR,HANDLE); + typedef BOOL(CALLBACK *PROPENUMPROCW)(HWND,LPCWSTR,HANDLE); +-typedef BOOL(CALLBACK *PROPENUMPROCEXA)(HWND,LPSTR,HANDLE,DWORD); +-typedef BOOL(CALLBACK *PROPENUMPROCEXW)(HWND,LPWSTR,HANDLE,DWORD); ++typedef BOOL(CALLBACK *PROPENUMPROCEXA)(HWND,LPSTR,HANDLE,ULONG_PTR); ++typedef BOOL(CALLBACK *PROPENUMPROCEXW)(HWND,LPWSTR,HANDLE,ULONG_PTR); + typedef int(CALLBACK *EDITWORDBREAKPROCA)(LPSTR,int,int,int); + typedef int(CALLBACK *EDITWORDBREAKPROCW)(LPWSTR,int,int,int); + typedef LRESULT(CALLBACK *WNDPROC)(HWND,UINT,WPARAM,LPARAM); +Index: include/reactos/wine/config.h +=================================================================== +--- include/reactos/wine/config.h (revision 57368) ++++ include/reactos/wine/config.h (working copy) +@@ -1,3 +1,5 @@ ++#include "reactos/buildno.h" ++ + #define __WINE_CONFIG_H + + /* Define to a function attribute for Microsoft hotpatch assembly prefix. */ +Index: lib/3rdparty/CMakeLists.txt +=================================================================== +--- lib/3rdparty/CMakeLists.txt (revision 57368) ++++ lib/3rdparty/CMakeLists.txt (working copy) +@@ -3,7 +3,9 @@ + add_subdirectory(bzip2) + add_subdirectory(cardlib) + add_subdirectory(expat) ++if (NOT _ARWINSS_) + add_subdirectory(freetype) ++endif () + add_subdirectory(fullfat) + add_subdirectory(libmpg123) + add_subdirectory(libsamplerate) +Index: lib/3rdparty/freetype/CMakeLists.txt +=================================================================== +--- lib/3rdparty/freetype/CMakeLists.txt (revision 57368) ++++ lib/3rdparty/freetype/CMakeLists.txt (working copy) +@@ -11,7 +11,9 @@ + src/base/ftbbox.c + src/base/ftbdf.c + src/base/ftbitmap.c ++ src/base/ftcid.c + src/base/ftdebug.c ++ src/base/ftfstype.c + src/base/ftgasp.c + src/base/ftglyph.c + src/base/ftgxval.c +Index: win32ss/CMakeLists.txt +=================================================================== +--- win32ss/CMakeLists.txt (revision 57368) ++++ win32ss/CMakeLists.txt (working copy) +@@ -10,10 +10,12 @@ + add_subdirectory(gdi/diblib) + endif() + ++add_subdirectory(user/win32csr) ++ ++if (NOT _ARWINSS_) + add_subdirectory(gdi/gdi32) + add_subdirectory(reactx) + add_subdirectory(user/user32) +-add_subdirectory(user/win32csr) + + spec2def(win32k.sys win32k.spec ADD_IMPORTLIB) + +@@ -227,3 +229,5 @@ + + add_library(win32ksys sys-stubs.S) + set_source_files_properties(sys-stubs.S PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/w32ksvc.h) ++ ++endif() # _ARWINSS_ +\ No newline at end of file +Index: win32ss/drivers/CMakeLists.txt +=================================================================== +--- win32ss/drivers/CMakeLists.txt (revision 57368) ++++ win32ss/drivers/CMakeLists.txt (working copy) +@@ -1,5 +1,7 @@ + + add_subdirectory(displays) ++if (NOT _ARWINSS_) + add_subdirectory(font) ++endif () + add_subdirectory(miniport) + add_subdirectory(videoprt) +Index: win32ss/include/ntgdihdl.h +=================================================================== +--- win32ss/include/ntgdihdl.h (revision 57368) ++++ win32ss/include/ntgdihdl.h (working copy) +@@ -270,6 +270,7 @@ + DWORD dwCFCount; + } GDI_SHARED_HANDLE_TABLE, *PGDI_SHARED_HANDLE_TABLE; + ++#ifndef _ARWINSS_ + typedef struct _RGN_ATTR + { + ULONG AttrFlags; +@@ -357,6 +358,19 @@ + RGN_ATTR VisRectRegion; + } DC_ATTR, *PDC_ATTR; + ++#else ++ ++typedef struct _DC_ATTR ++{ ++ HDC hdc; ++ HDC hKernelDC; ++ RECT dc_rect; /* DC rectangle relative to drawable */ ++ HRGN region; /* Device region (visible region & clip region) */ ++ int cache_index; /* cache of a currently selected font */ ++} DC_ATTR, *PDC_ATTR; ++ ++#endif ++ + typedef struct _BRUSH_ATTR /* Used with pen too. */ + { + FLONG AttrFlags; +Index: win32ss/user/win32csr/CMakeLists.txt +=================================================================== +--- win32ss/user/win32csr/CMakeLists.txt (revision 57368) ++++ win32ss/user/win32csr/CMakeLists.txt (working copy) +@@ -22,6 +22,7 @@ + file.c + guiconsole.c + handle.c ++ input.c + harderror.c + lineinput.c + tuiconsole.c +Index: win32ss/user/win32csr/desktopbg.c +=================================================================== +--- win32ss/user/win32csr/desktopbg.c (revision 57368) ++++ win32ss/user/win32csr/desktopbg.c (working copy) +@@ -53,7 +53,9 @@ + + static BOOL BgInitialized = FALSE; + static HWND VisibleDesktopWindow = NULL; +-#if 0 ++#ifdef _ARWINSS_ ++static HWND BackgroundWnd; ++ + static + LRESULT + CALLBACK +@@ -82,7 +84,7 @@ + return (LRESULT)TRUE; + + case WM_CREATE: +- NtUserSetWindowFNID(Wnd, FNID_DESKTOP); // Anti-ReactOS hack! ++ //NtUserSetWindowFNID(Wnd, FNID_DESKTOP); // Anti-ReactOS hack! + case WM_CLOSE: + return 0; + +@@ -146,6 +148,7 @@ + FASTCALL + DtbgInit(VOID) + { ++#ifndef _ARWINSS_ + WNDCLASSEXW Class; + ATOM ClassAtom; + +@@ -172,9 +175,19 @@ + + return FALSE; + } +- ++#endif + VisibleDesktopWindow = NULL; + ++#ifdef _ARWINSS_ ++ /* set winstation if we don't have one yet */ ++ if (!GetProcessWindowStation()) ++ { ++ static const WCHAR WinSta0[] = {'W','i','n','S','t','a','0',0}; ++ HANDLE handle = OpenWindowStationW(WinSta0, FALSE, WINSTA_ALL_ACCESS); ++ if (handle) SetProcessWindowStation(handle); ++ } ++#endif ++ + return TRUE; + } + #endif +@@ -183,7 +196,9 @@ + WINAPI + DtbgDesktopThread(PVOID Data) + { ++#ifndef _ARWINSS_ + HWND BackgroundWnd; ++#endif + MSG msg; + PDTBG_THREAD_DATA ThreadData = (PDTBG_THREAD_DATA)Data; + +@@ -199,7 +214,7 @@ + + BackgroundWnd = CreateWindowW((LPCWSTR)DESKTOP_WINDOW_ATOM, + L"", +- WS_POPUP | WS_CLIPCHILDREN, ++ WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, + GetSystemMetrics(SM_XVIRTUALSCREEN), + GetSystemMetrics(SM_YVIRTUALSCREEN), + GetSystemMetrics(SM_CXVIRTUALSCREEN), +@@ -218,6 +233,9 @@ + + DPRINT("BackgroundWnd 0x%p\n",BackgroundWnd); + ++ /* Set window proc */ ++ SetWindowLongPtrW( BackgroundWnd, GWLP_WNDPROC, (LONG_PTR)DtbgWindowProc ); ++ + ThreadData->Status = STATUS_SUCCESS; + SetEvent(ThreadData->Event); + +@@ -245,9 +263,10 @@ + if (!BgInitialized) + { + BgInitialized = TRUE; +- +- // if (!DtbgInit()) +- // return STATUS_UNSUCCESSFUL; ++#ifdef _ARWINSS_ ++ if (!DtbgInit()) ++ return STATUS_UNSUCCESSFUL; ++#endif + } + + /* +@@ -283,6 +302,28 @@ + WaitForSingleObject(ThreadData.Event, INFINITE); + CloseHandle(ThreadData.Event); + ++#ifdef _ARWINSS_ ++ /* Show the desktop immediately */ ++ { ++ PRIVATE_NOTIFY_DESKTOP nmh; ++ ++ nmh.hdr.hwndFrom = BackgroundWnd; ++ nmh.hdr.idFrom = 0; ++ nmh.hdr.code = PM_SHOW_DESKTOP; ++ ++ nmh.ShowDesktop.Width = GetSystemMetrics(SM_CXVIRTUALSCREEN); ++ nmh.ShowDesktop.Height = GetSystemMetrics(SM_CYVIRTUALSCREEN); ++ ++ SendMessageW(BackgroundWnd, ++ WM_NOTIFY, ++ (WPARAM)nmh.hdr.hwndFrom, ++ (LPARAM)&nmh) ++ ? STATUS_UNSUCCESSFUL : STATUS_SUCCESS; ++ ++ RedrawWindow(BackgroundWnd, NULL, 0, RDW_INVALIDATE | RDW_FRAME | RDW_ERASENOW | RDW_ALLCHILDREN); ++ } ++#endif ++ + return ThreadData.Status; + } + +Index: win32ss/user/win32csr/dllmain.c +=================================================================== +--- win32ss/user/win32csr/dllmain.c (revision 57368) ++++ win32ss/user/win32csr/dllmain.c (working copy) +@@ -16,6 +16,9 @@ + extern VOID WINAPI PrivateCsrssManualGuiCheck(LONG Check); + extern LIST_ENTRY DosDeviceHistory; + extern RTL_CRITICAL_SECTION Win32CsrDefineDosDeviceCritSec; ++#ifdef _ARWINSS_ ++void CsrInitInputSupport(); ++#endif + + /* GLOBALS *******************************************************************/ + +@@ -262,7 +265,9 @@ + // + // HACK HACK HACK ReactOS to BOOT! Initialization BUG ALERT! See bug 5655. + // ++#ifndef _ARWINSS_ + hhk = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, NULL, 0); ++#endif + // BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! + // BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! + // BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! +@@ -312,14 +317,18 @@ + WINAPI + PrivateCsrssManualGuiCheck(LONG Check) + { ++#ifndef _ARWINSS_ + NtUserCallOneParam(Check, ONEPARAM_ROUTINE_CSRSS_GUICHECK); ++#endif + } + + DWORD + WINAPI + CreateSystemThreads(PVOID pParam) + { ++#ifndef _ARWINSS_ + NtUserCallOneParam((DWORD)pParam, ONEPARAM_ROUTINE_CREATESYSTEMTHREADS); ++#endif + DPRINT1("This thread should not terminate!\n"); + return 0; + } +@@ -328,9 +337,11 @@ + WINAPI + Win32CsrInitialization(IN PCSR_SERVER_DLL ServerDll) + { ++#ifndef _ARWINSS_ + HANDLE ServerThread; + CLIENT_ID ClientId; + NTSTATUS Status; ++#endif + + Win32CsrApiHeap = RtlGetProcessHeap(); + +@@ -353,6 +364,9 @@ + InitializeListHead(&DosDeviceHistory); + + /* Start Raw Input Threads */ ++#ifdef _ARWINSS_ ++ CsrInitInputSupport(); ++#else + Status = RtlCreateUserThread(NtCurrentProcess(), NULL, TRUE, 0, 0, 0, (PTHREAD_START_ROUTINE)CreateSystemThreads, (PVOID)0, &ServerThread, &ClientId); + if (NT_SUCCESS(Status)) + { +@@ -361,7 +375,7 @@ + } + else + DPRINT1("Cannot start Raw Input Thread!\n"); +- ++#endif + return STATUS_SUCCESS; + } + +Index: win32ss/user/win32csr/input.c +=================================================================== +--- win32ss/user/win32csr/input.c (revision 0) ++++ win32ss/user/win32csr/input.c (working copy) +@@ -0,0 +1,387 @@ ++/* ++ * PROJECT: ReactOS CSRSS ++ * LICENSE: GPL - See COPYING in the top level directory ++ * FILE: subsystems/win32/csrss/api/input.c ++ * PURPOSE: CSRSS input support ++ * COPYRIGHT: Casper S. Hornstrup (chorns(a)users.sourceforge.net) ++ * ++ * this file is heavily based on subsystems\win32\win32k\ntuser\input.c from trunk ++ */ ++ ++#define NDEBUG ++#include "w32csr.h" ++#include <debug.h> ++#define NTOS_MODE_USER ++#include <ndk/iofuncs.h> ++#include <ntddmou.h> ++#include <ntddkbd.h> ++ ++static HHOOK gKeyboardHook, gMouseHook; ++ ++#define ClearMouseInput(mi) \ ++ mi.dx = 0; \ ++ mi.dy = 0; \ ++ mi.mouseData = 0; \ ++ mi.dwFlags = 0; ++ ++#define SendMouseEvent(mi) \ ++ if(mi.dx != 0 || mi.dy != 0) \ ++ mi.dwFlags |= MOUSEEVENTF_MOVE; \ ++ if(mi.dwFlags) \ ++ mouse_event(mi.dwFlags,mi.dx,mi.dy, mi.mouseData, 0); \ ++ ClearMouseInput(mi); ++ ++ ++static LRESULT CALLBACK DummyHookProc( INT code, WPARAM wparam, LPARAM lparam ){ ++ return CallNextHookEx( 0, code, wparam, lparam ); ++} ++ ++ ++VOID FASTCALL ++ProcessMouseInputData(PMOUSE_INPUT_DATA Data, ULONG InputCount) ++{ ++ PMOUSE_INPUT_DATA mid; ++ MOUSEINPUT mi; ++ ULONG i; ++ ++ ClearMouseInput(mi); ++ mi.time = 0; ++ mi.dwExtraInfo = 0; ++ for(i = 0; i < InputCount; i++) ++ { ++ mid = (Data + i); ++ mi.dx += mid->LastX; ++ mi.dy += mid->LastY; ++ ++ /* Check if the mouse move is absolute */ ++ if (mid->Flags == MOUSE_MOVE_ABSOLUTE) ++ { ++ /* Set flag and convert to screen location */ ++ mi.dwFlags |= MOUSEEVENTF_ABSOLUTE; ++ mi.dx = mi.dx / (65535 / (GetSystemMetrics(SM_CXVIRTUALSCREEN) - 1)); ++ mi.dy = mi.dy / (65535 / (GetSystemMetrics(SM_CYVIRTUALSCREEN) - 1)); ++ } ++ ++ if(mid->ButtonFlags) ++ { ++ if(mid->ButtonFlags & MOUSE_LEFT_BUTTON_DOWN) ++ { ++ mi.dwFlags |= MOUSEEVENTF_LEFTDOWN; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_LEFT_BUTTON_UP) ++ { ++ mi.dwFlags |= MOUSEEVENTF_LEFTUP; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_MIDDLE_BUTTON_DOWN) ++ { ++ mi.dwFlags |= MOUSEEVENTF_MIDDLEDOWN; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_MIDDLE_BUTTON_UP) ++ { ++ mi.dwFlags |= MOUSEEVENTF_MIDDLEUP; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_RIGHT_BUTTON_DOWN) ++ { ++ mi.dwFlags |= MOUSEEVENTF_RIGHTDOWN; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_RIGHT_BUTTON_UP) ++ { ++ mi.dwFlags |= MOUSEEVENTF_RIGHTUP; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_BUTTON_4_DOWN) ++ { ++ mi.mouseData |= XBUTTON1; ++ mi.dwFlags |= MOUSEEVENTF_XDOWN; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_BUTTON_4_UP) ++ { ++ mi.mouseData |= XBUTTON1; ++ mi.dwFlags |= MOUSEEVENTF_XUP; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_BUTTON_5_DOWN) ++ { ++ mi.mouseData |= XBUTTON2; ++ mi.dwFlags |= MOUSEEVENTF_XDOWN; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_BUTTON_5_UP) ++ { ++ mi.mouseData |= XBUTTON2; ++ mi.dwFlags |= MOUSEEVENTF_XUP; ++ SendMouseEvent(mi); ++ } ++ if(mid->ButtonFlags & MOUSE_WHEEL) ++ { ++ mi.mouseData = mid->ButtonData; ++ mi.dwFlags |= MOUSEEVENTF_WHEEL; ++ SendMouseEvent(mi); ++ } ++ } ++ } ++ ++ SendMouseEvent(mi); ++} ++ ++DWORD WINAPI MouseInputThread(LPVOID lpParameter) ++{ ++ UNICODE_STRING MouseDeviceName = RTL_CONSTANT_STRING(L"\\Device\\PointerClass0"); ++ OBJECT_ATTRIBUTES MouseObjectAttributes; ++ IO_STATUS_BLOCK Iosb; ++ HANDLE MouseDeviceHandle; ++ NTSTATUS Status; ++ ++ InitializeObjectAttributes(&MouseObjectAttributes, ++ &MouseDeviceName, ++ 0, ++ NULL, ++ NULL); ++ ++ do ++ { ++ Sleep(1000); ++ Status = NtOpenFile(&MouseDeviceHandle, ++ FILE_ALL_ACCESS, ++ &MouseObjectAttributes, ++ &Iosb, ++ 0, ++ FILE_SYNCHRONOUS_IO_ALERT); ++ } while (!NT_SUCCESS(Status)); ++ ++ while(1) ++ { ++ MOUSE_INPUT_DATA MouseInput; ++ Status = NtReadFile(MouseDeviceHandle, ++ NULL, ++ NULL, ++ NULL, ++ &Iosb, ++ &MouseInput, ++ sizeof(MOUSE_INPUT_DATA), ++ NULL, ++ NULL); ++ //if(Status == STATUS_ALERTED) ++ //{ ++ // break; ++ //} ++ if(Status == STATUS_PENDING) ++ { ++ NtWaitForSingleObject(MouseDeviceHandle, FALSE, NULL); ++ Status = Iosb.Status; ++ } ++ if(!NT_SUCCESS(Status)) ++ { ++ DPRINT1("Win32K: Failed to read from mouse.\n"); ++ return Status; ++ } ++ DPRINT("MouseEvent\n"); ++ ++ if(!gMouseHook) ++ gMouseHook = SetWindowsHookEx(WH_MOUSE_LL, DummyHookProc, NULL, 0); ++ ++ ProcessMouseInputData(&MouseInput, Iosb.Information / sizeof(MOUSE_INPUT_DATA)); ++ } ++} ++ ++/* Sends the keyboard commands to turn on/off the lights. ++ */ ++static NTSTATUS APIENTRY ++IntKeyboardUpdateLeds(HANDLE KeyboardDeviceHandle, ++ PKEYBOARD_INPUT_DATA KeyInput, ++ PKEYBOARD_INDICATOR_TRANSLATION IndicatorTrans) ++{ ++ NTSTATUS Status; ++ UINT Count; ++ static KEYBOARD_INDICATOR_PARAMETERS Indicators; ++ IO_STATUS_BLOCK Block; ++ ++ if (!IndicatorTrans) ++ return STATUS_NOT_SUPPORTED; ++ ++ if (KeyInput->Flags & (KEY_E0 | KEY_E1 | KEY_BREAK)) ++ return STATUS_SUCCESS; ++ ++ for (Count = 0; Count < IndicatorTrans->NumberOfIndicatorKeys; Count++) ++ { ++ if (KeyInput->MakeCode == IndicatorTrans->IndicatorList[Count].MakeCode) ++ { ++ Indicators.LedFlags ^= ++ IndicatorTrans->IndicatorList[Count].IndicatorFlags; ++ ++ /* Update the lights on the hardware */ ++ ++ Status = NtDeviceIoControlFile(KeyboardDeviceHandle, ++ NULL, ++ NULL, ++ NULL, ++ &Block, ++ IOCTL_KEYBOARD_SET_INDICATORS, ++ &Indicators, sizeof(Indicators), ++ NULL, 0); ++ ++ return Status; ++ } ++ } ++ ++ return STATUS_SUCCESS; ++} ++ ++/* Asks the keyboard driver to send a small table that shows which ++ * lights should connect with which scancodes ++ */ ++static NTSTATUS APIENTRY ++IntKeyboardGetIndicatorTrans(HANDLE KeyboardDeviceHandle, ++ PKEYBOARD_INDICATOR_TRANSLATION *IndicatorTrans) ++{ ++ NTSTATUS Status; ++ DWORD Size = 0; ++ IO_STATUS_BLOCK Block; ++ PKEYBOARD_INDICATOR_TRANSLATION Ret; ++ ++ Size = sizeof(KEYBOARD_INDICATOR_TRANSLATION); ++ ++ Ret = HeapAlloc(Win32CsrApiHeap, 0, Size); ++ ++ while (Ret) ++ { ++ Status = NtDeviceIoControlFile(KeyboardDeviceHandle, ++ NULL, ++ NULL, ++ NULL, ++ &Block, ++ IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION, ++ NULL, ++ 0, ++ Ret, Size); ++ ++ if (Status != STATUS_BUFFER_TOO_SMALL) ++ break; ++ ++ HeapFree(Win32CsrApiHeap, 0, Ret); ++ ++ Size += sizeof(KEYBOARD_INDICATOR_TRANSLATION); ++ ++ Ret = HeapAlloc(Win32CsrApiHeap, 0, Size); ++ } ++ ++ if (!Ret) ++ return STATUS_INSUFFICIENT_RESOURCES; ++ ++ if (Status != STATUS_SUCCESS) ++ { ++ HeapFree(Win32CsrApiHeap, 0, Ret); ++ return Status; ++ } ++ ++ *IndicatorTrans = Ret; ++ return Status; ++} ++ ++DWORD WINAPI KeyboardInputThread(LPVOID lpParameter) ++{ ++ UNICODE_STRING KeyboardDeviceName = RTL_CONSTANT_STRING(L"\\Device\\KeyboardClass0"); ++ OBJECT_ATTRIBUTES KeyboardObjectAttributes; ++ IO_STATUS_BLOCK Iosb; ++ HANDLE KeyboardDeviceHandle; ++ NTSTATUS Status; ++ PKEYBOARD_INDICATOR_TRANSLATION IndicatorTrans = NULL; ++ ++ InitializeObjectAttributes(&KeyboardObjectAttributes, ++ &KeyboardDeviceName, ++ 0, ++ NULL, ++ NULL); ++ ++ do ++ { ++ Sleep(1000); ++ Status = NtOpenFile(&KeyboardDeviceHandle, ++ FILE_ALL_ACCESS, ++ &KeyboardObjectAttributes, ++ &Iosb, ++ 0, ++ FILE_SYNCHRONOUS_IO_ALERT); ++ } while (!NT_SUCCESS(Status)); ++ ++ IntKeyboardGetIndicatorTrans(KeyboardDeviceHandle, ++ &IndicatorTrans); ++ while(1) ++ { ++ KEYBOARD_INPUT_DATA KeyInput; ++ DWORD flags; ++ ++ Status = NtReadFile(KeyboardDeviceHandle, ++ NULL, ++ NULL, ++ NULL, ++ &Iosb, ++ &KeyInput, ++ sizeof(KEYBOARD_INPUT_DATA), ++ NULL, ++ NULL); ++ ++ if(Status == STATUS_ALERTED) ++ { ++ break; ++ } ++ if(Status == STATUS_PENDING) ++ { ++ NtWaitForSingleObject(KeyboardDeviceHandle, FALSE, NULL); ++ Status = Iosb.Status; ++ } ++ if(!NT_SUCCESS(Status)) ++ { ++ DPRINT1("Win32K: Failed to read from mouse.\n"); ++ return Status; ++ } ++ ++ DPRINT("KeyRaw: %s %04x\n", ++ (KeyInput.Flags & KEY_BREAK) ? "up" : "down", ++ KeyInput.MakeCode ); ++ ++ if (!NT_SUCCESS(Status)) ++ { ++ DPRINT1("Win32K: Failed to read from keyboard.\n"); ++ return Status; ++ } ++ ++ IntKeyboardUpdateLeds(KeyboardDeviceHandle, ++ &KeyInput, ++ IndicatorTrans); ++ ++ flags = 0; ++ ++ if (KeyInput.Flags & KEY_E0) ++ flags |= KEYEVENTF_EXTENDEDKEY; ++ ++ if (KeyInput.Flags & KEY_BREAK) ++ flags |= KEYEVENTF_KEYUP; ++ ++ if(!gKeyboardHook) ++ gKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, DummyHookProc, NULL, 0); ++ ++ keybd_event(MapVirtualKey(KeyInput.MakeCode & 0xff, MAPVK_VSC_TO_VK), KeyInput.MakeCode & 0xff, flags , 0); ++ } ++ ++ return Status; ++} ++ ++ ++void CsrInitInputSupport() ++{ ++ HANDLE MouseThreadHandle, KeyboardThreadHandle; ++ ++ ClipCursor(NULL); ++ ++ MouseThreadHandle = CreateThread(NULL, 0, MouseInputThread, NULL, 0,NULL); ++ KeyboardThreadHandle = CreateThread(NULL, 0, KeyboardInputThread, NULL, 0,NULL); ++} ++ ++/* EOF */ +Index: win32ss/user/win32csr/input.c +=================================================================== +--- win32ss/user/win32csr/input.c (revision 48725) ++++ win32ss/user/win32csr/input.c (working copy) + +Property changes on: win32ss/user/win32csr/input.c +___________________________________________________________________ +Added: svn:eol-style +## -0,0 +1 ## ++native +\ No newline at end of property
12 years, 2 months
1
0
0
0
[akhaldi] 57425: [PSDK]: Sync wintrust.h with Wine 1.5.14 CORE-6365 #resolve #comment Committed in r57425. Thanks Carlo ; )
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 29 11:27:12 2012 New Revision: 57425 URL:
http://svn.reactos.org/svn/reactos?rev=57425&view=rev
Log: [PSDK]: Sync wintrust.h with Wine 1.5.14 CORE-6365 #resolve #comment Committed in r57425. Thanks Carlo ;) Modified: trunk/reactos/include/psdk/wintrust.h Modified: trunk/reactos/include/psdk/wintrust.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wintrust.h?re…
============================================================================== --- trunk/reactos/include/psdk/wintrust.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/wintrust.h [iso-8859-1] Sat Sep 29 11:27:12 2012 @@ -371,7 +371,7 @@ #define CPD_UISTATE_MODE_ALLOW 0x00000002 #define CPD_UISTATE_MODE_MASK 0x00000003 -typedef BOOL (CALLBACK *PFN_PROVUI_CALL)(HWND hWndSecurityDialog, +typedef BOOL (*PFN_PROVUI_CALL)(HWND hWndSecurityDialog, struct _CRYPT_PROVIDER_DATA *pProvData); typedef struct _CRYPT_PROVUI_FUNCS {
12 years, 2 months
1
0
0
0
[tfaber] 57424: [NPFS] - Reset read and write events directly before waiting. Fixes an issue where a read could return 0 bytes if the previous read had read all available data without waiting (thus...
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Sep 29 11:20:25 2012 New Revision: 57424 URL:
http://svn.reactos.org/svn/reactos?rev=57424&view=rev
Log: [NPFS] - Reset read and write events directly before waiting. Fixes an issue where a read could return 0 bytes if the previous read had read all available data without waiting (thus leaving the event set). Modified: trunk/reactos/drivers/filesystems/npfs/rw.c Modified: trunk/reactos/drivers/filesystems/npfs/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/r…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] Sat Sep 29 11:20:25 2012 @@ -393,6 +393,7 @@ { /* this is a new request */ Irp->IoStatus.Information = 0; + KeResetEvent(&Ccb->ReadEvent); Context->WaitEvent = &Ccb->ReadEvent; InsertTailList(&Ccb->ReadRequestListHead, &Context->ListEntry); if (Ccb->ReadRequestListHead.Flink != &Context->ListEntry) @@ -454,6 +455,7 @@ Status = STATUS_PIPE_BROKEN; break; } + KeResetEvent(&Ccb->ReadEvent); ExReleaseFastMutex(&Ccb->DataListLock); if (IoIsOperationSynchronous(Irp)) @@ -537,7 +539,6 @@ { KeSetEvent(&Ccb->OtherSide->WriteEvent, IO_NO_INCREMENT, FALSE); } - KeResetEvent(&Ccb->ReadEvent); break; } } @@ -638,8 +639,6 @@ } else { - KeResetEvent(&Ccb->ReadEvent); - if ((Ccb->PipeState == FILE_PIPE_CONNECTED_STATE) && (Ccb->WriteQuotaAvailable > 0) && (Ccb->OtherSide)) { KeSetEvent(&Ccb->OtherSide->WriteEvent, IO_NO_INCREMENT, FALSE); @@ -831,6 +830,7 @@ goto done; } KeSetEvent(&ReaderCcb->ReadEvent, IO_NO_INCREMENT, FALSE); + KeResetEvent(&Ccb->WriteEvent); ExReleaseFastMutex(&ReaderCcb->DataListLock); DPRINT("Write Waiting for buffer space (%wZ)\n", &Fcb->PipeName); @@ -908,7 +908,6 @@ if (Length == 0) { KeSetEvent(&ReaderCcb->ReadEvent, IO_NO_INCREMENT, FALSE); - KeResetEvent(&Ccb->WriteEvent); break; } } @@ -961,7 +960,6 @@ if (Information > 0) { KeSetEvent(&ReaderCcb->ReadEvent, IO_NO_INCREMENT, FALSE); - KeResetEvent(&Ccb->WriteEvent); break; } }
12 years, 2 months
1
0
0
0
[tkreuzer] 57423: [DESK] Enhance 8-bit spectrum bitmap. Patch by Lee Schroeder. CORE-6069 #resolve
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Sep 29 09:26:34 2012 New Revision: 57423 URL:
http://svn.reactos.org/svn/reactos?rev=57423&view=rev
Log: [DESK] Enhance 8-bit spectrum bitmap. Patch by Lee Schroeder. CORE-6069 #resolve Modified: trunk/reactos/dll/cpl/desk/resources/spectrum_8.bmp Modified: trunk/reactos/dll/cpl/desk/resources/spectrum_8.bmp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/resources/spe…
============================================================================== Binary files - no diff available.
12 years, 2 months
1
0
0
0
[ekohl] 57422: [FORMATTING] - Fix indentation. - Remove dead code. No code changes!
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Sep 29 09:06:42 2012 New Revision: 57422 URL:
http://svn.reactos.org/svn/reactos?rev=57422&view=rev
Log: [FORMATTING] - Fix indentation. - Remove dead code. No code changes! Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c trunk/reactos/dll/win32/advapi32/misc/shutdown.c trunk/reactos/dll/win32/advapi32/reg/reg.c Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/lo…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] Sat Sep 29 09:06:42 2012 @@ -130,9 +130,18 @@ /* * @unimplemented */ -BOOL WINAPI CreateProcessWithLogonW( LPCWSTR lpUsername, LPCWSTR lpDomain, LPCWSTR lpPassword, DWORD dwLogonFlags, - LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation ) +BOOL WINAPI +CreateProcessWithLogonW(LPCWSTR lpUsername, + LPCWSTR lpDomain, + LPCWSTR lpPassword, + DWORD dwLogonFlags, + LPCWSTR lpApplicationName, + LPWSTR lpCommandLine, + DWORD dwCreationFlags, + LPVOID lpEnvironment, + LPCWSTR lpCurrentDirectory, + LPSTARTUPINFOW lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) { FIXME("%s %s %s 0x%08x %s %s 0x%08x %p %s %p %p stub\n", debugstr_w(lpUsername), debugstr_w(lpDomain), debugstr_w(lpPassword), dwLogonFlags, debugstr_w(lpApplicationName), @@ -301,98 +310,6 @@ GetUserSid(LPCWSTR UserName, PSID *Sid) { -#if 0 - PSID lpSid; - DWORD dwLength; - HKEY hUsersKey; - HKEY hUserKey; - - if (Sid != NULL) - *Sid = NULL; - - /* Open the Users key */ - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, - L"SAM\\SAM\\Domains\\Account\\Users", - 0, - KEY_READ, - &hUsersKey)) - { - ERR("Failed to open Users key! (Error %lu)\n", GetLastError()); - return FALSE; - } - - /* Open the user key */ - if (RegOpenKeyExW(hUsersKey, - UserName, - 0, - KEY_READ, - &hUserKey)) - { - if (GetLastError() == ERROR_FILE_NOT_FOUND) - { - ERR("Invalid user name!\n"); - SetLastError(ERROR_NO_SUCH_USER); - } - else - { - ERR("Failed to open user key! (Error %lu)\n", GetLastError()); - } - - RegCloseKey(hUsersKey); - return FALSE; - } - - RegCloseKey (hUsersKey); - - /* Get SID size */ - dwLength = 0; - if (RegQueryValueExW(hUserKey, - L"Sid", - NULL, - NULL, - NULL, - &dwLength)) - { - ERR("Failed to read the SID size! (Error %lu)\n", GetLastError()); - RegCloseKey(hUserKey); - return FALSE; - } - - /* Allocate sid buffer */ - TRACE("Required SID buffer size: %lu\n", dwLength); - lpSid = (PSID)RtlAllocateHeap(RtlGetProcessHeap(), - 0, - dwLength); - if (lpSid == NULL) - { - ERR("Failed to allocate SID buffer!\n"); - RegCloseKey(hUserKey); - return FALSE; - } - - /* Read sid */ - if (RegQueryValueExW(hUserKey, - L"Sid", - NULL, - NULL, - (LPBYTE)lpSid, - &dwLength)) - { - ERR("Failed to read the SID! (Error %lu)\n", GetLastError()); - RtlFreeHeap(RtlGetProcessHeap(), - 0, - lpSid); - RegCloseKey(hUserKey); - return FALSE; - } - - RegCloseKey(hUserKey); - - *Sid = lpSid; - - return TRUE; -#endif - PSID AccountDomainSid = NULL; ULONG ulUserRid; DWORD dwLength; Modified: trunk/reactos/dll/win32/advapi32/misc/shutdown.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/sh…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/shutdown.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/shutdown.c [iso-8859-1] Sat Sep 29 09:06:42 2012 @@ -3,7 +3,7 @@ * PROJECT: ReactOS system libraries * FILE: dll/win32/advapi32/misc/shutdown.c * PURPOSE: System shutdown functions - * PROGRAMMER: Lee Schroeder <spaceseel at gmail dot com> + * PROGRAMMER: Lee Schroeder <spaceseel at gmail dot com> * Emanuele Aliberti */ @@ -64,7 +64,7 @@ BOOL bForceAppsClosed, BOOL bRebootAfterShutdown) { - return InitiateSystemShutdownExW(lpMachineName, + return InitiateSystemShutdownExW(lpMachineName, lpMessage, dwTimeout, bForceAppsClosed, @@ -87,7 +87,7 @@ BOOL bForceAppsClosed, BOOL bRebootAfterShutdown) { - return InitiateSystemShutdownExA(lpMachineName, + return InitiateSystemShutdownExA(lpMachineName, lpMessage, dwTimeout, bForceAppsClosed, @@ -178,7 +178,7 @@ return FALSE; } } - + rv = InitiateSystemShutdownExW(MachineNameW.Buffer, MessageW.Buffer, dwTimeout, Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] Sat Sep 29 09:06:42 2012 @@ -931,7 +931,7 @@ LocalObjectAttributes.ObjectName = &LocalKeyName; FullNameLength = LocalKeyName.Length / sizeof(WCHAR); - LocalKeyHandle = NULL; + LocalKeyHandle = NULL; /* Remove the last part of the key name and try to create the key again. */ while (Status == STATUS_OBJECT_NAME_NOT_FOUND)
12 years, 2 months
1
0
0
0
[tfaber] 57421: [NPFS] - Do not access ThreadContext after freeing it in NpfsWaiterThread - Correctly update Vcb->EmptyWaiterCount when terminating in NpfsWaiterThread - Fix more MSVC warnings, lot...
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Sep 29 09:05:18 2012 New Revision: 57421 URL:
http://svn.reactos.org/svn/reactos?rev=57421&view=rev
Log: [NPFS] - Do not access ThreadContext after freeing it in NpfsWaiterThread - Correctly update Vcb->EmptyWaiterCount when terminating in NpfsWaiterThread - Fix more MSVC warnings, lots of DPRINTs Modified: trunk/reactos/drivers/filesystems/npfs/fsctrl.c trunk/reactos/drivers/filesystems/npfs/npfs.c trunk/reactos/drivers/filesystems/npfs/rw.c Modified: trunk/reactos/drivers/filesystems/npfs/fsctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] Sat Sep 29 09:05:18 2012 @@ -361,7 +361,7 @@ /* Fail if not pipe was found */ if (Fcb == NULL) { - DPRINT("No pipe found!\n", Fcb); + DPRINT("No pipe found!\n"); return STATUS_OBJECT_NAME_NOT_FOUND; } @@ -483,7 +483,7 @@ /* Fail if not pipe was found */ if (Fcb == NULL) { - DPRINT("No pipe found!\n", Fcb); + DPRINT("No pipe found!\n"); return STATUS_OBJECT_NAME_NOT_FOUND; } @@ -583,7 +583,7 @@ DPRINT("OutputBufferLength: %lu\n", OutputBufferLength); /* Validate parameters */ - if (OutputBufferLength < FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data[0])) + if (OutputBufferLength < (ULONG)FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data[0])) { DPRINT1("Buffer too small\n"); return STATUS_INVALID_PARAMETER; @@ -601,7 +601,7 @@ ExAcquireFastMutex(&Ccb->DataListLock); BufferPtr = Ccb->ReadPtr; - DPRINT("BufferPtr = %x\n", BufferPtr); + DPRINT("BufferPtr = %p\n", BufferPtr); if (Ccb->Fcb->PipeType == FILE_PIPE_BYTE_STREAM_TYPE) { DPRINT("Byte Stream Mode\n"); @@ -609,7 +609,7 @@ DPRINT("Reply->MessageLength %lu\n", Reply->MessageLength); MessageCount = 1; - if (OutputBufferLength >= FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data[Ccb->ReadDataAvailable])) + if (OutputBufferLength >= (ULONG)FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data[Ccb->ReadDataAvailable])) { RtlCopyMemory(Reply->Data, BufferPtr, Ccb->ReadDataAvailable); ReturnLength = Ccb->ReadDataAvailable; @@ -639,7 +639,7 @@ /* If its the first message, copy the Message if the size of buffer is large enough */ if (MessageCount == 1) { - if (OutputBufferLength >= FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data[MessageLength])) + if (OutputBufferLength >= (ULONG)FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER, Data[MessageLength])) { RtlCopyMemory(Reply->Data, (PVOID)((ULONG_PTR)BufferPtr + sizeof(MessageLength)), @@ -649,7 +649,7 @@ } BufferPtr = (PVOID)((ULONG_PTR)BufferPtr + sizeof(MessageLength) + MessageLength); - DPRINT("BufferPtr = %x\n", BufferPtr); + DPRINT("BufferPtr = %p\n", BufferPtr); DPRINT("ReadDataAvailable: %lu\n", ReadDataAvailable); } Modified: trunk/reactos/drivers/filesystems/npfs/npfs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/npfs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/npfs.c [iso-8859-1] Sat Sep 29 09:05:18 2012 @@ -67,7 +67,7 @@ &DeviceObject); if (!NT_SUCCESS(Status)) { - DPRINT("Failed to create named pipe device! (Status %x)\n", Status); + DPRINT1("Failed to create named pipe device! (Status %lx)\n", Status); return Status; } Modified: trunk/reactos/drivers/filesystems/npfs/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/r…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] Sat Sep 29 09:05:18 2012 @@ -119,7 +119,7 @@ static VOID NTAPI NpfsWaiterThread(PVOID InitContext) { - PNPFS_THREAD_CONTEXT ThreadContext = (PNPFS_THREAD_CONTEXT) InitContext; + PNPFS_THREAD_CONTEXT ThreadContext = InitContext; ULONG CurrentCount; ULONG Count = 0, i; PIRP Irp = NULL; @@ -194,9 +194,11 @@ if (ThreadContext->Count == 1 && ThreadContext->Vcb->EmptyWaiterCount >= MAXIMUM_WAIT_OBJECTS) { /* there is another thread with empty wait slots, we can remove our thread from the list */ + ASSERT(Irp == NULL); + ThreadContext->Vcb->EmptyWaiterCount -= MAXIMUM_WAIT_OBJECTS - 1; RemoveEntryList(&ThreadContext->ListEntry); + KeUnlockMutex(&ThreadContext->Vcb->PipeListLock); ExFreePoolWithTag(ThreadContext, TAG_NPFS_THREAD_CONTEXT); - KeUnlockMutex(&ThreadContext->Vcb->PipeListLock); break; } } @@ -499,7 +501,7 @@ /* If the pipe type and read mode are both byte stream */ if (Ccb->Fcb->PipeType == FILE_PIPE_BYTE_STREAM_TYPE) { - DPRINT("Byte stream mode: Ccb->Data %x\n", Ccb->Data); + DPRINT("Byte stream mode: Ccb->Data %p\n", Ccb->Data); /* Byte stream mode */ while (Length > 0 && Ccb->ReadDataAvailable > 0) { @@ -541,7 +543,7 @@ } else if (Ccb->Fcb->PipeType == FILE_PIPE_MESSAGE_TYPE) { - DPRINT("Message mode: Ccb>Data %x\n", Ccb->Data); + DPRINT("Message mode: Ccb>Data %p\n", Ccb->Data); /* Check if buffer is full and the read pointer is not at the start of the buffer */ if ((Ccb->WriteQuotaAvailable == 0) && (Ccb->ReadPtr > Ccb->Data)) @@ -611,7 +613,7 @@ Ccb->ReadPtr = Ccb->Data; } #ifndef NDEBUG - DPRINT("Length %d Buffer %x\n",CopyLength,Buffer); + DPRINT("Length %d Buffer %x\n", CopyLength, Buffer); HexDump((PUCHAR)Buffer, CopyLength); #endif @@ -812,7 +814,7 @@ ExAcquireFastMutex(&ReaderCcb->DataListLock); - DPRINT("Length %d Buffer %x Offset %x\n",Length,Buffer,Offset); + DPRINT("Length %lu Buffer %p Offset %lu\n", Length, Buffer, Offset); #ifndef NDEBUG HexDump(Buffer, Length); @@ -854,7 +856,7 @@ */ if (Ccb->PipeState != FILE_PIPE_CONNECTED_STATE || !Ccb->OtherSide) { - DPRINT("PipeState: %x\n", Ccb->PipeState); + DPRINT("PipeState: %lx\n", Ccb->PipeState); Status = STATUS_PIPE_BROKEN; goto done; } @@ -869,7 +871,7 @@ if (Ccb->Fcb->PipeType == FILE_PIPE_BYTE_STREAM_TYPE) { - DPRINT("Byte stream mode: Ccb->Data %x, Ccb->WritePtr %x\n", ReaderCcb->Data, ReaderCcb->WritePtr); + DPRINT("Byte stream mode: Ccb->Data %p, Ccb->WritePtr %p\n", ReaderCcb->Data, ReaderCcb->WritePtr); while (Length > 0 && ReaderCcb->WriteQuotaAvailable > 0) { @@ -913,7 +915,7 @@ else if (Ccb->Fcb->PipeType == FILE_PIPE_MESSAGE_TYPE) { /* For Message Type Pipe, the Pipes memory will be used to store the size of each message */ - DPRINT("Message mode: Ccb->Data %x, Ccb->WritePtr %x\n",ReaderCcb->Data, ReaderCcb->WritePtr); + DPRINT("Message mode: Ccb->Data %p, Ccb->WritePtr %p\n", ReaderCcb->Data, ReaderCcb->WritePtr); if (Length > 0) { /* Verify the WritePtr is still inside the buffer */ @@ -921,7 +923,7 @@ ((ULONG_PTR)ReaderCcb->WritePtr < (ULONG_PTR)ReaderCcb->Data)) { DPRINT1("NPFS is writing out of its buffer. Report to developer!\n"); - DPRINT1("ReaderCcb->WritePtr %x, ReaderCcb->Data %x, ReaderCcb->MaxDataLength %lu\n", + DPRINT1("ReaderCcb->WritePtr %p, ReaderCcb->Data %p, ReaderCcb->MaxDataLength %lu\n", ReaderCcb->WritePtr, ReaderCcb->Data, ReaderCcb->MaxDataLength); ASSERT(FALSE); }
12 years, 2 months
1
0
0
0
[ekohl] 57420: [INCLUDE] Fix the declarations of LsarQueryTrustedDomainInfoByName and LsarSetTrustedDomainInfoByName.
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Sep 29 08:39:40 2012 New Revision: 57420 URL:
http://svn.reactos.org/svn/reactos?rev=57420&view=rev
Log: [INCLUDE] Fix the declarations of LsarQueryTrustedDomainInfoByName and LsarSetTrustedDomainInfoByName. Modified: trunk/reactos/dll/win32/advapi32/sec/lsa.c trunk/reactos/dll/win32/lsasrv/lsarpc.c trunk/reactos/include/reactos/idl/lsa.idl Modified: trunk/reactos/dll/win32/advapi32/sec/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/lsa…
============================================================================== --- trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] Sat Sep 29 08:39:40 2012 @@ -1566,7 +1566,7 @@ Status = LsarQueryTrustedDomainInfoByName((LSAPR_HANDLE)PolicyHandle, (PRPC_UNICODE_STRING)TrustedDomainName, InformationClass, - (unsigned long *)Buffer); // Shuld be: (PLSAPR_POLICY_INFORMATION *)Buffer + (PLSAPR_TRUSTED_DOMAIN_INFO *)Buffer); } RpcExcept(EXCEPTION_EXECUTE_HANDLER) { Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Sat Sep 29 08:39:40 2012 @@ -1812,7 +1812,7 @@ LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING TrustedDomainName, POLICY_INFORMATION_CLASS InformationClass, - unsigned long *PolicyInformation) + PLSAPR_TRUSTED_DOMAIN_INFO *PolicyInformation) { UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; @@ -1824,7 +1824,7 @@ LSAPR_HANDLE PolicyHandle, PRPC_UNICODE_STRING TrustedDomainName, POLICY_INFORMATION_CLASS InformationClass, - unsigned long PolicyInformation) + PLSAPR_TRUSTED_DOMAIN_INFO PolicyInformation) { UNIMPLEMENTED; return STATUS_NOT_IMPLEMENTED; Modified: trunk/reactos/include/reactos/idl/lsa.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/lsa.id…
============================================================================== --- trunk/reactos/include/reactos/idl/lsa.idl [iso-8859-1] (original) +++ trunk/reactos/include/reactos/idl/lsa.idl [iso-8859-1] Sat Sep 29 08:39:40 2012 @@ -902,16 +902,14 @@ [in] LSAPR_HANDLE PolicyHandle, [in] PRPC_UNICODE_STRING TrustedDomainName, [in] POLICY_INFORMATION_CLASS InformationClass, - [out] unsigned long *PolicyInformation); - /* FIXME: should be [out, switch_is(InformationClass)] PLSAPR_POLICY_INFORMATION *PolicyInformation); */ + [out, switch_is(InformationClass)] PLSAPR_TRUSTED_DOMAIN_INFO *PolicyInformation); /* Function 49 */ NTSTATUS __stdcall LsarSetTrustedDomainInfoByName( [in] LSAPR_HANDLE PolicyHandle, [in] PRPC_UNICODE_STRING TrustedDomainName, [in] POLICY_INFORMATION_CLASS InformationClass, - [in] unsigned long PolicyInformation); - /* FIXME: should be [in, switch_is(InformationClass)] PLSAPR_POLICY_INFORMATION PolicyInformation); */ + [in, switch_is(InformationClass)] PLSAPR_TRUSTED_DOMAIN_INFO PolicyInformation); /* Function 50 */ NTSTATUS __stdcall LsarEnumerateTrustedDomainsEx(
12 years, 2 months
1
0
0
0
[tfaber] 57419: [NPFS] - Fix return status if no listening server found in NpfsCreate - Do not use obsolete function MmGetSystemAddressForMdl - Fix a few MSVC/GCC 4.7 warnings - Correctly handle de...
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Sep 29 08:19:24 2012 New Revision: 57419 URL:
http://svn.reactos.org/svn/reactos?rev=57419&view=rev
Log: [NPFS] - Fix return status if no listening server found in NpfsCreate - Do not use obsolete function MmGetSystemAddressForMdl - Fix a few MSVC/GCC 4.7 warnings - Correctly handle device/root FCB allocation failure - Fix type of NPFS_CCB::RefCount Modified: trunk/reactos/drivers/filesystems/npfs/create.c trunk/reactos/drivers/filesystems/npfs/dirctl.c trunk/reactos/drivers/filesystems/npfs/finfo.c trunk/reactos/drivers/filesystems/npfs/fsctrl.c trunk/reactos/drivers/filesystems/npfs/npfs.c trunk/reactos/drivers/filesystems/npfs/npfs.h trunk/reactos/drivers/filesystems/npfs/rw.c trunk/reactos/drivers/filesystems/npfs/volume.c Modified: trunk/reactos/drivers/filesystems/npfs/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/create.c [iso-8859-1] Sat Sep 29 08:19:24 2012 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel -* FILE: drivers/fs/np/create.c +* FILE: drivers/filesystems/npfs/create.c * PURPOSE: Named pipe filesystem * PROGRAMMER: David Welch <welch(a)cwcom.net> */ @@ -49,6 +49,7 @@ Ccb->RefCount = 1; Ccb->Type = Type; + // FIXME: why does this function not reference Fcb? Ccb->Fcb = Fcb; Ccb->OtherSide = NULL; @@ -60,7 +61,7 @@ NpfsReferenceCcb(PNPFS_CCB Ccb) { ASSERT(Ccb->RefCount > 0); - InterlockedIncrement((PLONG)&Ccb->RefCount); + InterlockedIncrement(&Ccb->RefCount); } static @@ -69,7 +70,7 @@ { /* Decrement reference count */ ASSERT(Ccb->RefCount > 0); - if (InterlockedDecrement((PLONG)&Ccb->RefCount) == 0) + if (InterlockedDecrement(&Ccb->RefCount) == 0) { /* Its zero, delete CCB */ ExFreePoolWithTag(Ccb, TAG_NPFS_CCB); @@ -249,9 +250,9 @@ PNPFS_CCB ClientCcb; PNPFS_CCB ServerCcb = NULL; PNPFS_VCB Vcb; - ACCESS_MASK DesiredAccess; NTSTATUS Status; #ifndef USING_PROPER_NPFS_WAIT_SEMANTICS + ACCESS_MASK DesiredAccess; BOOLEAN SpecialAccess; #endif @@ -262,7 +263,9 @@ FileObject = IoStack->FileObject; RelatedFileObject = FileObject->RelatedFileObject; FileName = &FileObject->FileName; +#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS DesiredAccess = IoStack->Parameters.CreatePipe.SecurityContext->DesiredAccess; +#endif DPRINT("FileObject %p\n", FileObject); DPRINT("FileName %wZ\n", &FileObject->FileName); @@ -444,9 +447,9 @@ NpfsDereferenceCcb(ClientCcb); KeUnlockMutex(&Fcb->CcbListLock); NpfsDereferenceFcb(Fcb); - Irp->IoStatus.Status = STATUS_OBJECT_PATH_NOT_FOUND; + Irp->IoStatus.Status = STATUS_OBJECT_NAME_NOT_FOUND; IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_OBJECT_PATH_NOT_FOUND; + return STATUS_OBJECT_NAME_NOT_FOUND; } } else Modified: trunk/reactos/drivers/filesystems/npfs/dirctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/d…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/dirctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/dirctl.c [iso-8859-1] Sat Sep 29 08:19:24 2012 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: drivers/filesastems/npfs/dirctl.c + * FILE: drivers/filesystems/npfs/dirctl.c * PURPOSE: Named pipe filesystem * PROGRAMMER: Eric Kohl */ @@ -55,7 +55,8 @@ /* Determine Buffer for result */ if (Irp->MdlAddress) { - Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress); + Buffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, + NormalPagePriority); } else { @@ -298,6 +299,8 @@ NTSTATUS Status; ULONG Size = 0; + UNREFERENCED_PARAMETER(DeviceObject); + DPRINT("NpfsDirectoryControl() called\n"); IoStack = IoGetCurrentIrpStackLocation(Irp); Modified: trunk/reactos/drivers/filesystems/npfs/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/finfo.c [iso-8859-1] Sat Sep 29 08:19:24 2012 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel -* FILE: drivers/fs/np/finfo.c +* FILE: drivers/filesystems/npfs/finfo.c * PURPOSE: Named pipe filesystem * PROGRAMMER: Eric Kohl */ @@ -24,6 +24,9 @@ { PNPFS_FCB Fcb; PFILE_PIPE_INFORMATION Request; + + UNREFERENCED_PARAMETER(DeviceObject); + DPRINT("NpfsSetPipeInformation()\n"); if (*BufferLength < sizeof(FILE_PIPE_INFORMATION)) @@ -48,7 +51,7 @@ { Fcb->ClientReadMode = Request->ReadMode; } - else + else { Fcb->ServerReadMode = Request->ReadMode; } @@ -68,6 +71,9 @@ { PNPFS_FCB Fcb; PFILE_PIPE_REMOTE_INFORMATION Request; + + UNREFERENCED_PARAMETER(DeviceObject); + DPRINT("NpfsSetPipeRemoteInformation()\n"); if (*BufferLength < sizeof(FILE_PIPE_REMOTE_INFORMATION)) @@ -97,6 +103,9 @@ { PNPFS_FCB Fcb; ULONG ConnectionSideReadMode; + + UNREFERENCED_PARAMETER(DeviceObject); + DPRINT("NpfsQueryPipeInformation()\n"); if (*BufferLength < sizeof(FILE_PIPE_INFORMATION)) @@ -132,6 +141,9 @@ PULONG BufferLength) { PNPFS_FCB Fcb; + + UNREFERENCED_PARAMETER(DeviceObject); + DPRINT("NpfsQueryPipeRemoteInformation()\n"); if (*BufferLength < sizeof(FILE_PIPE_REMOTE_INFORMATION)) @@ -164,6 +176,8 @@ PULONG BufferLength) { PNPFS_FCB Fcb; + + UNREFERENCED_PARAMETER(DeviceObject); DPRINT("NpfsQueryLocalPipeInformation()\n"); Modified: trunk/reactos/drivers/filesystems/npfs/fsctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] Sat Sep 29 08:19:24 2012 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel -* FILE: drivers/fs/np/fsctrl.c +* FILE: drivers/filesystems/npfs/fsctrl.c * PURPOSE: Named pipe filesystem * PROGRAMMER: David Welch <welch(a)cwcom.net> * Eric Kohl @@ -25,6 +25,8 @@ IN PIRP Irp) { PNPFS_WAITER_ENTRY Waiter; + + UNREFERENCED_PARAMETER(DeviceObject); Waiter = (PNPFS_WAITER_ENTRY)&Irp->Tail.Overlay.DriverContext; @@ -795,6 +797,7 @@ PIRP Irp) { /* FIXME: Implement */ + UNREFERENCED_PARAMETER(DeviceObject); Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; Modified: trunk/reactos/drivers/filesystems/npfs/npfs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/npfs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/npfs.c [iso-8859-1] Sat Sep 29 08:19:24 2012 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel -* FILE: drivers/fs/np/mount.c +* FILE: drivers/filesystems/npfs/npfs.c * PURPOSE: Named pipe filesystem * PROGRAMMER: David Welch <welch(a)cwcom.net> */ @@ -24,6 +24,8 @@ PNPFS_VCB Vcb; PNPFS_FCB Fcb; NTSTATUS Status; + + UNREFERENCED_PARAMETER(RegistryPath); DPRINT("Named Pipe FSD 0.0.2\n"); @@ -87,6 +89,12 @@ /* Create the device FCB */ Fcb = ExAllocatePoolWithTag(NonPagedPool, sizeof(NPFS_FCB), TAG_NPFS_FCB); + if (!Fcb) + { + DPRINT1("Out of memory for device FCB!\n"); + IoDeleteDevice(DeviceObject); + return STATUS_INSUFFICIENT_RESOURCES; + } Fcb->Type = FCB_DEVICE; Fcb->Vcb = Vcb; Fcb->RefCount = 1; @@ -94,6 +102,13 @@ /* Create the root directory FCB */ Fcb = ExAllocatePoolWithTag(NonPagedPool, sizeof(NPFS_FCB), TAG_NPFS_FCB); + if (!Fcb) + { + DPRINT1("Out of memory for root FCB!\n"); + IoDeleteDevice(DeviceObject); + ExFreePoolWithTag(Vcb->DeviceFcb, TAG_NPFS_FCB); + return STATUS_INSUFFICIENT_RESOURCES; + } Fcb->Type = FCB_DIRECTORY; Fcb->Vcb = Vcb; Fcb->RefCount = 1; Modified: trunk/reactos/drivers/filesystems/npfs/npfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/npfs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/npfs.h [iso-8859-1] Sat Sep 29 08:19:24 2012 @@ -95,7 +95,7 @@ ULONG PipeState; ULONG ReadDataAvailable; ULONG WriteQuotaAvailable; - ULONG RefCount; + volatile LONG RefCount; LIST_ENTRY ReadRequestListHead; Modified: trunk/reactos/drivers/filesystems/npfs/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/r…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] Sat Sep 29 08:19:24 2012 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel -* FILE: drivers/fs/np/rw.c +* FILE: drivers/filesystems/npfs/rw.c * PURPOSE: Named pipe filesystem * PROGRAMMER: David Welch <welch(a)cwcom.net> * Michael Martin @@ -115,6 +115,7 @@ } } +static KSTART_ROUTINE NpfsWaiterThread; static VOID NTAPI NpfsWaiterThread(PVOID InitContext) { @@ -175,7 +176,7 @@ } else { - /* someone has add a new wait request or cancelled an old one */ + /* someone has added a new wait request or cancelled an old one */ Irp = NULL; /* Look for cancelled requests */ @@ -183,16 +184,16 @@ { if (ThreadContext->WaitIrpArray[i] == NULL) { - ThreadContext->Count--; - ThreadContext->Vcb->EmptyWaiterCount++; - ThreadContext->WaitObjectArray[i] = ThreadContext->WaitObjectArray[ThreadContext->Count]; - ThreadContext->WaitIrpArray[i] = ThreadContext->WaitIrpArray[ThreadContext->Count]; + ThreadContext->Count--; + ThreadContext->Vcb->EmptyWaiterCount++; + ThreadContext->WaitObjectArray[i] = ThreadContext->WaitObjectArray[ThreadContext->Count]; + ThreadContext->WaitIrpArray[i] = ThreadContext->WaitIrpArray[ThreadContext->Count]; } } } if (ThreadContext->Count == 1 && ThreadContext->Vcb->EmptyWaiterCount >= MAXIMUM_WAIT_OBJECTS) { - /* it exist an other thread with empty wait slots, we can remove our thread from the list */ + /* there is another thread with empty wait slots, we can remove our thread from the list */ RemoveEntryList(&ThreadContext->ListEntry); ExFreePoolWithTag(ThreadContext, TAG_NPFS_THREAD_CONTEXT); KeUnlockMutex(&ThreadContext->Vcb->PipeListLock); @@ -416,10 +417,11 @@ while (1) { - Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress); + Buffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, + NormalPagePriority); Information = Irp->IoStatus.Information; Length = IoGetCurrentIrpStackLocation(Irp)->Parameters.Read.Length; - ASSERT (Information <= Length); + ASSERT(Information <= Length); Buffer = (PVOID)((ULONG_PTR)Buffer + Information); Length -= Information; Status = STATUS_SUCCESS; @@ -443,7 +445,8 @@ { break; } - if (((Ccb->PipeState != FILE_PIPE_CONNECTED_STATE) || (!Ccb->OtherSide)) && (Ccb->ReadDataAvailable == 0)) + ASSERT(Ccb->ReadDataAvailable == 0); + if ((Ccb->PipeState != FILE_PIPE_CONNECTED_STATE) || (!Ccb->OtherSide)) { DPRINT("PipeState: %x\n", Ccb->PipeState); Status = STATUS_PIPE_BROKEN; @@ -556,7 +559,7 @@ { ULONG NextMessageLength = 0; - /*First get the size of the message */ + /* First get the size of the message */ memcpy(&NextMessageLength, Ccb->ReadPtr, sizeof(NextMessageLength)); if ((NextMessageLength == 0) || (NextMessageLength > Ccb->ReadDataAvailable)) @@ -579,7 +582,7 @@ /* Client only requested part of the message */ { /* Calculate the remaining message new size */ - ULONG NewMessageSize = NextMessageLength-CopyLength; + ULONG NewMessageSize = NextMessageLength - CopyLength; /* Update ReadPtr to point to new Message size location */ Ccb->ReadPtr = (PVOID)((ULONG_PTR)Ccb->ReadPtr + CopyLength); @@ -616,7 +619,7 @@ Ccb->ReadDataAvailable -= CopyLength; - if ((ULONG)Ccb->WriteQuotaAvailable > (ULONG)Ccb->MaxDataLength) ASSERT(FALSE); + ASSERT(Ccb->WriteQuotaAvailable <= Ccb->MaxDataLength); } if (Information > 0) @@ -740,6 +743,8 @@ ULONG CopyLength; ULONG TempLength; + UNREFERENCED_PARAMETER(DeviceObject); + DPRINT("NpfsWrite()\n"); IoStack = IoGetCurrentIrpStackLocation(Irp); @@ -794,7 +799,7 @@ } Status = STATUS_SUCCESS; - Buffer = MmGetSystemAddressForMdlSafe (Irp->MdlAddress, NormalPagePriority); + Buffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); if (!Buffer) { @@ -813,7 +818,7 @@ HexDump(Buffer, Length); #endif - while(1) + while (1) { if (ReaderCcb->WriteQuotaAvailable == 0) { Modified: trunk/reactos/drivers/filesystems/npfs/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/v…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/volume.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/volume.c [iso-8859-1] Sat Sep 29 08:19:24 2012 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel -* FILE: drivers/fs/npfs/volume.c +* FILE: drivers/filesystems/npfs/volume.c * PURPOSE: Named pipe filesystem * PROGRAMMER: Eric Kohl */
12 years, 2 months
1
0
0
0
[tkreuzer] 57418: [NTOSKRNL] Fix file header. Patch by Lee Schoeder. WDA-6701 #resolve
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Sep 28 23:32:59 2012 New Revision: 57418 URL:
http://svn.reactos.org/svn/reactos?rev=57418&view=rev
Log: [NTOSKRNL] Fix file header. Patch by Lee Schoeder. WDA-6701 #resolve Modified: trunk/reactos/ntoskrnl/ex/shutdown.c Modified: trunk/reactos/ntoskrnl/ex/shutdown.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/shutdown.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ex/shutdown.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/shutdown.c [iso-8859-1] Fri Sep 28 23:32:59 2012 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel - * FILE: ntoskrnl/ex/power.c + * FILE: ntoskrnl/ex/shutdown.c * PURPOSE: Power managment * * PROGRAMMERS: David Welch (welch(a)cwcom.net)
12 years, 2 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
24
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
Results per page:
10
25
50
100
200