Author: pschweitzer Date: Sun Jun 8 12:13:54 2008 New Revision: 33903
URL: http://svn.reactos.org/svn/reactos?rev=33903&view=rev Log: SySynced shlwapi.dll with Wine HEAD
Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc (with props) trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc (with props) Modified: 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/resource.h trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild trunk/reactos/dll/win32/shlwapi/shlwapi.rc trunk/reactos/dll/win32/shlwapi/shlwapi_Sv.rc trunk/reactos/dll/win32/shlwapi/string.c trunk/reactos/dll/win32/shlwapi/url.c
Modified: trunk/reactos/dll/win32/shlwapi/istream.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/istream.c... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/istream.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/istream.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -119,13 +119,10 @@
TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbRead);
- if (!pv) - return STG_E_INVALIDPOINTER; - if (!ReadFile(This->hFile, pv, cb, &dwRead, NULL)) { - ERR("error %d reading file\n", GetLastError()); - return HRESULT_FROM_WIN32(GetLastError()); + WARN("error %d reading file\n", GetLastError()); + return S_FALSE; } if (pcbRead) *pcbRead = dwRead; @@ -142,16 +139,13 @@
TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbWritten);
- if (!pv) - return STG_E_INVALIDPOINTER; - switch (STGM_ACCESS_MODE(This->dwMode)) { case STGM_WRITE: case STGM_READWRITE: break; default: - return E_FAIL; + return STG_E_ACCESSDENIED; }
if (!WriteFile(This->hFile, pv, cb, &dwWritten, NULL)) @@ -176,7 +170,7 @@ IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ dwPos = SetFilePointer(This->hFile, dlibMove.u.LowPart, NULL, dwOrigin); if( dwPos == INVALID_SET_FILE_POINTER ) - return E_FAIL; + return HRESULT_FROM_WIN32(GetLastError());
if (pNewPos) { @@ -224,7 +218,7 @@ pcbWritten->QuadPart = 0;
if (!pstm) - return STG_E_INVALIDPOINTER; + return S_OK;
IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */
@@ -418,9 +412,6 @@
*lppStream = NULL;
- if (dwMode & STGM_TRANSACTED) - return E_INVALIDARG; - /* Access */ switch (STGM_ACCESS_MODE(dwMode)) { @@ -440,6 +431,9 @@ /* Sharing */ switch (STGM_SHARE_MODE(dwMode)) { + case 0: + dwShare = FILE_SHARE_READ|FILE_SHARE_WRITE; + break; case STGM_SHARE_DENY_READ: dwShare = FILE_SHARE_WRITE; break; @@ -459,7 +453,7 @@ switch(STGM_CREATE_MODE(dwMode)) { case STGM_FAILIFTHERE: - dwCreate = OPEN_EXISTING; + dwCreate = bCreate ? CREATE_NEW : OPEN_EXISTING; break; case STGM_CREATE: dwCreate = CREATE_ALWAYS; @@ -473,12 +467,7 @@ dwAttributes, 0);
if(hFile == INVALID_HANDLE_VALUE) - { - HRESULT hRet = (HRESULT)GetLastError(); - if(hRet > 0) - hRet = HRESULT_FROM_WIN32(hRet); - return hRet; - } + return HRESULT_FROM_WIN32(GetLastError());
*lppStream = IStream_Create(lpszPath, hFile, dwMode);
@@ -501,6 +490,9 @@ TRACE("(%s,%d,%p)\n", debugstr_w(lpszPath), dwMode, lppStream);
if (!lpszPath || !lppStream) + return E_INVALIDARG; + + if ((dwMode & (STGM_CONVERT|STGM_DELETEONRELEASE|STGM_TRANSACTED)) != 0) return E_INVALIDARG;
return SHCreateStreamOnFileEx(lpszPath, dwMode, 0, FALSE, NULL, lppStream); @@ -528,7 +520,8 @@ TRACE("(%s,%d,%p)\n", debugstr_a(lpszPath), dwMode, lppStream);
if (!lpszPath) - return E_INVALIDARG; + return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); + MultiByteToWideChar(0, 0, lpszPath, -1, szPath, MAX_PATH); return SHCreateStreamOnFileW(szPath, dwMode, lppStream); }
Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.c... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -62,7 +62,7 @@ BOOL WINAPI SHAboutInfoW(LPWSTR,DWORD);
/* - NOTES: Most functions exported by ordinal seem to be superflous. + NOTES: Most functions exported by ordinal seem to be superfluous. The reason for these functions to be there is to provide a wrapper for unicode functions to provide these functions on systems without unicode functions eg. win95/win98. Since we have such functions we just @@ -1492,11 +1492,11 @@ */ BOOL WINAPI SHLoadMenuPopup(HINSTANCE hInst, LPCWSTR szName) { - HMENU hMenu, hSubMenu; + HMENU hMenu;
if ((hMenu = LoadMenuW(hInst, szName))) { - if ((hSubMenu = GetSubMenu(hMenu, 0))) + if (GetSubMenu(hMenu, 0)) RemoveMenu(hMenu, 0, MF_BYPOSITION);
DestroyMenu(hMenu); @@ -1959,7 +1959,7 @@ /************************************************************************* * @ [SHLWAPI.198] * - * Return the value asociated with a key in a map. + * Return the value associated with a key in a map. * * PARAMS * lpKeys [I] A list of keys of length iLen @@ -2101,7 +2101,7 @@ /************************************************************************* * @ [SHLWAPI.208] * - * Initialize an FDSA arrary. + * Initialize an FDSA array. */ BOOL WINAPI FDSA_Initialize(DWORD block_size, DWORD inc, FDSA_info *info, void *mem, DWORD init_blocks) @@ -2543,7 +2543,7 @@ * NOTES * This function is used by the native SHRestricted function to search for the * policy and cache it once retrieved. The current Wine implementation uses a - * different POLICYDATA structure and implements a similar algorithme adapted to + * different POLICYDATA structure and implements a similar algorithm adapted to * that structure. */ DWORD WINAPI SHRestrictionLookup( @@ -3433,7 +3433,7 @@
FIXME("Ignoring luma adjustment\n");
- /* FIXME: The ajdustment is not linear */ + /* FIXME: The adjustment is not linear */
cRGB = ColorHLSToRGB(wH, wL, wS); }
Modified: trunk/reactos/dll/win32/shlwapi/path.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/path.c?re... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -894,7 +894,7 @@ /************************************************************************* * PathQuoteSpacesA [SHLWAPI.@] * - * Surround a path containg spaces in quotes. + * Surround a path containing spaces in quotes. * * PARAMS * lpszPath [I/O] Path to quote @@ -2040,7 +2040,7 @@ * Determine if a path is a file specification. * * PARAMS - * lpszPath [I] Path to chack + * lpszPath [I] Path to check * * RETURNS * TRUE If lpszPath is a file specification (i.e. Contains no directories). @@ -2323,7 +2323,7 @@ * * PARAMS * lpszBuf [O] Output path - * lpszPath [I] Path to cnonicalize + * lpszPath [I] Path to canonicalize * * RETURNS * Success: TRUE. lpszBuf contains the output path, @@ -3344,7 +3344,7 @@ * * RETURNS * TRUE If a relative path can be formed. lpszPath contains the new path - * FALSE If the paths are not relavtive or any parameters are invalid + * FALSE If the paths are not relative or any parameters are invalid * * NOTES * lpszTo should be at least MAX_PATH in length.
Modified: trunk/reactos/dll/win32/shlwapi/reg.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/reg.c?rev... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -215,7 +215,7 @@ * pszPath [I] Key name to create or open. * samDesired [I] Wanted security access. * hRelativeUSKey [I] Base path if pszPath is relative. NULL otherwise. - * phNewUSKey [O] Receives a handle to the new or openened key. + * phNewUSKey [O] Receives a handle to the new or opened key. * dwFlags [I] Base key under which the key should be opened. * * RETURNS @@ -626,7 +626,6 @@ BOOL fIgnoreHKCU, /* [I] TRUE=Don't check HKEY_CURRENT_USER */ BOOL fDefault) /* [I] Default value to use if pszValue is not present */ { - LONG retvalue; DWORD type, datalen, work; BOOL ret = fDefault; CHAR data[10]; @@ -636,9 +635,9 @@ (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM");
datalen = sizeof(data)-1; - if (!(retvalue = SHRegGetUSValueA( pszSubKey, pszValue, &type, - data, &datalen, - fIgnoreHKCU, 0, 0))) { + if (!SHRegGetUSValueA( pszSubKey, pszValue, &type, + data, &datalen, + fIgnoreHKCU, 0, 0)) { /* process returned data via type into bool */ switch (type) { case REG_SZ: @@ -687,7 +686,6 @@ static const WCHAR wTRUE[]= {'T','R','U','E','\0'}; static const WCHAR wNO[]= {'N','O','\0'}; static const WCHAR wFALSE[]={'F','A','L','S','E','\0'}; - LONG retvalue; DWORD type, datalen, work; BOOL ret = fDefault; WCHAR data[10]; @@ -697,9 +695,9 @@ (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM");
datalen = (sizeof(data)-1) * sizeof(WCHAR); - if (!(retvalue = SHRegGetUSValueW( pszSubKey, pszValue, &type, - data, &datalen, - fIgnoreHKCU, 0, 0))) { + if (!SHRegGetUSValueW( pszSubKey, pszValue, &type, + data, &datalen, + fIgnoreHKCU, 0, 0)) { /* process returned data via type into bool */ switch (type) { case REG_SZ:
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] Sun Jun 8 12:13:54 2008 @@ -25,7 +25,7 @@ #define IDS_TIME_INTERVAL_MINUTES 66 #define IDS_TIME_INTERVAL_SECONDS 67
-/* These numbers match native ID's and shouldn't be abitrarily changed */ +/* These numbers match native ID's 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.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.r... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -25,6 +25,7 @@ <file>shlwapi.rc</file> <file>shlwapi.spec</file> <library>wine</library> + <library>uuid</library> <library>user32</library> <library>gdi32</library> <library>advapi32</library> @@ -39,7 +40,6 @@ <library>shell32</library> <library>winmm</library> <library>version</library> - <library>uuid</library> <library>ntdll</library> </module> </group>
Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.r... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -25,6 +25,7 @@
#include "version.rc"
+#include "shlwapi_Da.rc" #include "shlwapi_De.rc" #include "shlwapi_En.rc" #include "shlwapi_Eo.rc" @@ -41,6 +42,7 @@ #include "shlwapi_Pt.rc" #include "shlwapi_Ro.rc" #include "shlwapi_Ru.rc" +#include "shlwapi_Si.rc" #include "shlwapi_Sv.rc" #include "shlwapi_Tr.rc" #include "shlwapi_Uk.rc"
Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_D... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc (added) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -1,0 +1,43 @@ +/* + * English resources for shlwapi + * + * Copyright 2008 Jens Albretsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_DANISH, SUBLANG_DEFAULT + +IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Fejl!" +FONT 8, "MS Shell Dlg" +{ + LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 + LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 + CHECKBOX "Vis ikke denne besked igen", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&OK" IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Annuller" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Ja" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Nej" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +}
Propchange: trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_S... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc (added) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -1,0 +1,47 @@ +/* + * Slovenian resources for shlwapi + * + * Copyright 2008 Rok Mandeljc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma code_page(65001) + +LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT + +IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Napak!" +FONT 8, "MS Shell Dlg" +{ + LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 + LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 + CHECKBOX "Tega sporoÄila ne &kaži veÄ", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&V redu" IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&PrekliÄi" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Da" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Ne" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bajtov" + IDS_TIME_INTERVAL_HOURS " ur" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sek" +} + +#pragma code_page(default)
Propchange: trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_Sv.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_S... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Sv.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Sv.rc [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
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] Sun Jun 8 12:13:54 2008 @@ -445,11 +445,11 @@ /************************************************************************* * StrCatW [SHLWAPI.@] * - * Concatanate two strings. + * Concatenate two strings. * * PARAMS * lpszStr [O] Initial string - * lpszSrc [I] String to concatanate + * lpszSrc [I] String to concatenate * * RETURNS * lpszStr.
Modified: trunk/reactos/dll/win32/shlwapi/url.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?rev... ============================================================================== --- trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -750,7 +750,7 @@ } process_case = 1; break; - } while(FALSE); /* a litte trick to allow easy exit from nested if's */ + } while(FALSE); /* a little trick to allow easy exit from nested if's */
ret = S_OK; switch (process_case) { @@ -2153,7 +2153,6 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) { PARSEDURLA base; - DWORD res1;
TRACE("%s\n", debugstr_a(lpstrPath));
@@ -2161,7 +2160,7 @@
/* get protocol */ base.cbSize = sizeof(base); - res1 = ParseURLA(lpstrPath, &base); + ParseURLA(lpstrPath, &base); return (base.nScheme != URL_SCHEME_INVALID); }
@@ -2173,7 +2172,6 @@ BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath) { PARSEDURLW base; - DWORD res1;
TRACE("%s\n", debugstr_w(lpstrPath));
@@ -2181,7 +2179,7 @@
/* get protocol */ base.cbSize = sizeof(base); - res1 = ParseURLW(lpstrPath, &base); + ParseURLW(lpstrPath, &base); return (base.nScheme != URL_SCHEME_INVALID); }
@@ -2312,7 +2310,7 @@ * dwDestLen [I] Length of lpszDest * * RETURNS - * Success: S_OK. lpszDest constains the resource Url. + * Success: S_OK. lpszDest contains the resource Url. * Failure: E_INVALIDARG, if any argument is invalid, or * E_FAIL if dwDestLen is too small. */