SySynced shlwapi.dll with Wine HEAD

svn path=/trunk/; revision=33903
This commit is contained in:
Pierre Schweitzer 2008-06-08 17:13:54 +00:00
parent 939c49a493
commit 8a7513a6c7
12 changed files with 134 additions and 53 deletions

View file

@ -119,13 +119,10 @@ static HRESULT WINAPI IStream_fnRead(IStream *iface, void* pv, ULONG cb, ULONG*
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 @@ static HRESULT WINAPI IStream_fnWrite(IStream *iface, const void* pv, ULONG cb,
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 @@ static HRESULT WINAPI IStream_fnSeek(IStream *iface, LARGE_INTEGER dlibMove,
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 @@ static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream* pstm, ULARGE_INT
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 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
*lppStream = NULL;
if (dwMode & STGM_TRANSACTED)
return E_INVALIDARG;
/* Access */
switch (STGM_ACCESS_MODE(dwMode))
{
@ -440,6 +431,9 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
/* 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 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
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 @@ HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode,
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);
@ -503,6 +492,9 @@ HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode,
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 @@ HRESULT WINAPI SHCreateStreamOnFileA(LPCSTR lpszPath, DWORD dwMode,
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);
}

View file

@ -62,7 +62,7 @@ HRESULT WINAPI SHInvokeCommand(HWND,IShellFolder*,LPCITEMIDLIST,BOOL);
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 @@ HRESULT WINAPI IUnknown_QueryService(IUnknown* lpUnknown, REFGUID sid, REFIID ri
*/
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 @@ DWORD WINAPI SHFillRectClr(HDC hDC, LPCRECT pRect, COLORREF cRef)
/*************************************************************************
* @ [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 @@ typedef struct
/*************************************************************************
* @ [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 @@ DWORD WINAPI SHGetRestriction(LPCWSTR lpSubKey, LPCWSTR lpSubName, LPCWSTR lpVal
* 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 @@ COLORREF WINAPI ColorAdjustLuma(COLORREF cRGB, int dwLuma, BOOL bUnknown)
FIXME("Ignoring luma adjustment\n");
/* FIXME: The ajdustment is not linear */
/* FIXME: The adjustment is not linear */
cRGB = ColorHLSToRGB(wH, wL, wS);
}

View file

@ -894,7 +894,7 @@ VOID WINAPI PathRemoveBlanksW(LPWSTR lpszPath)
/*************************************************************************
* 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 @@ BOOL WINAPI PathIsContentTypeW(LPCWSTR lpszPath, LPCWSTR lpszContentType)
* 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 @@ BOOL WINAPI PathIsUNCServerShareW(LPCWSTR lpszPath)
*
* 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 @@ HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath,
*
* 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.

View file

@ -215,7 +215,7 @@ LONG WINAPI SHRegCloseUSKey(
* 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 WINAPI SHRegGetBoolUSValueA(
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 @@ BOOL WINAPI SHRegGetBoolUSValueA(
(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 @@ BOOL WINAPI SHRegGetBoolUSValueW(
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 @@ BOOL WINAPI SHRegGetBoolUSValueW(
(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:

View file

@ -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

View file

@ -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>

View file

@ -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"

View file

@ -0,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"
}

View file

@ -0,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)

View file

@ -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

View file

@ -445,11 +445,11 @@ int WINAPI StrCmpW(LPCWSTR lpszStr, LPCWSTR lpszComp)
/*************************************************************************
* 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.

View file

@ -750,7 +750,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
}
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 @@ HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut,
BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
{
PARSEDURLA base;
DWORD res1;
TRACE("%s\n", debugstr_a(lpstrPath));
@ -2161,7 +2160,7 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
/* 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 PathIsURLA(LPCSTR lpstrPath)
BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
{
PARSEDURLW base;
DWORD res1;
TRACE("%s\n", debugstr_w(lpstrPath));
@ -2181,7 +2179,7 @@ BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
/* get protocol */
base.cbSize = sizeof(base);
res1 = ParseURLW(lpstrPath, &base);
ParseURLW(lpstrPath, &base);
return (base.nScheme != URL_SCHEME_INVALID);
}
@ -2312,7 +2310,7 @@ HRESULT WINAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags)
* 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.
*/