Author: cwittich
Date: Sat Jan 31 08:48:46 2009
New Revision: 39238
URL:
http://svn.reactos.org/svn/reactos?rev=39238&view=rev
Log:
sync shlwapi with wine 1.1.14
Added:
trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc (with props)
Modified:
trunk/reactos/dll/win32/shlwapi/assoc.c
trunk/reactos/dll/win32/shlwapi/msgbox.c
trunk/reactos/dll/win32/shlwapi/ordinal.c
trunk/reactos/dll/win32/shlwapi/reg.c
trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild
trunk/reactos/dll/win32/shlwapi/shlwapi.rc
trunk/reactos/dll/win32/shlwapi/string.c
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 Jan 31 08:48:46 2009
@@ -455,7 +455,7 @@
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IQueryAssociations))
{
- *ppvObj = (IQueryAssociations*)This;
+ *ppvObj = This;
IQueryAssociations_AddRef((IQueryAssociations*)*ppvObj);
TRACE("Returning IQueryAssociations (%p)\n", *ppvObj);
@@ -594,9 +594,8 @@
return S_OK;
}
-static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This,
- LPCWSTR pszExtra, LPWSTR path,
- DWORD pathlen, DWORD *len)
+static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This,
+ LPCWSTR pszExtra, WCHAR **ppszCommand)
{
HKEY hkeyCommand;
HKEY hkeyFile;
@@ -604,15 +603,10 @@
HKEY hkeyVerb;
HRESULT hr;
LONG ret;
- WCHAR * pszCommand;
- WCHAR * pszEnd;
WCHAR * pszExtraFromReg = NULL;
WCHAR * pszFileType;
- WCHAR * pszStart;
static const WCHAR commandW[] = {
'c','o','m','m','a','n','d',0 };
static const WCHAR shellW[] = {
's','h','e','l','l',0 };
-
- assert(len);
hr = ASSOC_GetValue(This->hkeySource, &pszFileType);
if (FAILED(hr))
@@ -672,8 +666,23 @@
RegCloseKey(hkeyVerb);
if (ret != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(ret);
- hr = ASSOC_GetValue(hkeyCommand, &pszCommand);
+ hr = ASSOC_GetValue(hkeyCommand, ppszCommand);
RegCloseKey(hkeyCommand);
+ return hr;
+}
+
+static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This,
+ LPCWSTR pszExtra, LPWSTR path,
+ DWORD pathlen, DWORD *len)
+{
+ WCHAR *pszCommand;
+ WCHAR *pszStart;
+ WCHAR *pszEnd;
+ HRESULT hr;
+
+ assert(len);
+
+ hr = ASSOC_GetCommand(This, pszExtra, &pszCommand);
if (FAILED(hr))
return hr;
@@ -763,6 +772,18 @@
switch (str)
{
+ case ASSOCSTR_COMMAND:
+ {
+ WCHAR *command;
+ hr = ASSOC_GetCommand(This, pszExtra, &command);
+ if (SUCCEEDED(hr))
+ {
+ hr = ASSOC_ReturnData(pszOut, pcchOut, command, strlenW(command) + 1);
+ HeapFree(GetProcessHeap(), 0, command);
+ }
+ return hr;
+ }
+
case ASSOCSTR_EXECUTABLE:
{
hr = ASSOC_GetExecutable(This, pszExtra, path, MAX_PATH, &len);
@@ -770,6 +791,38 @@
return hr;
len++;
return ASSOC_ReturnData(pszOut, pcchOut, path, len);
+ }
+
+ case ASSOCSTR_FRIENDLYDOCNAME:
+ {
+ WCHAR *pszFileType;
+ DWORD ret;
+ DWORD size;
+
+ hr = ASSOC_GetValue(This->hkeySource, &pszFileType);
+ if (FAILED(hr))
+ return hr;
+ size = 0;
+ ret = RegGetValueW(HKEY_CLASSES_ROOT, pszFileType, NULL, RRF_RT_REG_SZ, NULL, NULL,
&size);
+ if (ret == ERROR_SUCCESS)
+ {
+ WCHAR *docName = HeapAlloc(GetProcessHeap(), 0, size);
+ if (docName)
+ {
+ ret = RegGetValueW(HKEY_CLASSES_ROOT, pszFileType, NULL, RRF_RT_REG_SZ, NULL,
docName, &size);
+ if (ret == ERROR_SUCCESS)
+ hr = ASSOC_ReturnData(pszOut, pcchOut, docName, strlenW(docName) + 1);
+ else
+ hr = HRESULT_FROM_WIN32(ret);
+ HeapFree(GetProcessHeap(), 0, docName);
+ }
+ else
+ hr = E_OUTOFMEMORY;
+ }
+ else
+ hr = HRESULT_FROM_WIN32(ret);
+ HeapFree(GetProcessHeap(), 0, pszFileType);
+ return hr;
}
case ASSOCSTR_FRIENDLYAPPNAME:
@@ -825,6 +878,73 @@
return ASSOC_ReturnData(pszOut, pcchOut, path, strlenW(path) + 1);
}
+ case ASSOCSTR_CONTENTTYPE:
+ {
+ static const WCHAR Content_TypeW[] =
{'C','o','n','t','e','n','t','
','T','y','p','e',0};
+ WCHAR *contentType;
+ DWORD ret;
+ DWORD size;
+
+ size = 0;
+ ret = RegGetValueW(This->hkeySource, NULL, Content_TypeW, RRF_RT_REG_SZ, NULL,
NULL, &size);
+ if (ret != ERROR_SUCCESS)
+ return HRESULT_FROM_WIN32(ret);
+ contentType = HeapAlloc(GetProcessHeap(), 0, size);
+ if (contentType != NULL)
+ {
+ ret = RegGetValueW(This->hkeySource, NULL, Content_TypeW, RRF_RT_REG_SZ, NULL,
contentType, &size);
+ if (ret == ERROR_SUCCESS)
+ hr = ASSOC_ReturnData(pszOut, pcchOut, contentType, strlenW(contentType) + 1);
+ else
+ hr = HRESULT_FROM_WIN32(ret);
+ HeapFree(GetProcessHeap(), 0, contentType);
+ }
+ else
+ hr = E_OUTOFMEMORY;
+ return hr;
+ }
+
+ case ASSOCSTR_DEFAULTICON:
+ {
+ static const WCHAR DefaultIconW[] =
{'D','e','f','a','u','l','t','I','c','o','n',0};
+ WCHAR *pszFileType;
+ DWORD ret;
+ DWORD size;
+ HKEY hkeyFile;
+
+ hr = ASSOC_GetValue(This->hkeySource, &pszFileType);
+ if (FAILED(hr))
+ return hr;
+ ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, pszFileType, 0, KEY_READ, &hkeyFile);
+ if (ret == ERROR_SUCCESS)
+ {
+ size = 0;
+ ret = RegGetValueW(hkeyFile, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, NULL,
&size);
+ if (ret == ERROR_SUCCESS)
+ {
+ WCHAR *icon = HeapAlloc(GetProcessHeap(), 0, size);
+ if (icon)
+ {
+ ret = RegGetValueW(hkeyFile, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, icon,
&size);
+ if (ret == ERROR_SUCCESS)
+ hr = ASSOC_ReturnData(pszOut, pcchOut, icon, strlenW(icon) + 1);
+ else
+ hr = HRESULT_FROM_WIN32(ret);
+ HeapFree(GetProcessHeap(), 0, icon);
+ }
+ else
+ hr = E_OUTOFMEMORY;
+ }
+ else
+ hr = HRESULT_FROM_WIN32(ret);
+ RegCloseKey(hkeyFile);
+ }
+ else
+ hr = HRESULT_FROM_WIN32(ret);
+ HeapFree(GetProcessHeap(), 0, pszFileType);
+ return hr;
+ }
+
default:
FIXME("assocstr %d unimplemented!\n", str);
return E_NOTIMPL;
Modified: trunk/reactos/dll/win32/shlwapi/msgbox.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/msgbox.c…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/msgbox.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/msgbox.c [iso-8859-1] Sat Jan 31 08:48:46 2009
@@ -173,7 +173,7 @@
d.dlgProc = dlgProc;
d.lParam = lParam;
d.lpszId = lpszId;
- return DialogBoxParamW(hInst, (LPCWSTR)lpszName, hWnd, SHDlgProcEx, (LPARAM)&d);
+ return DialogBoxParamW(hInst, lpszName, hWnd, SHDlgProcEx, (LPARAM)&d);
}
/* Data held by each shlwapi message box */
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 Jan 31 08:48:46 2009
@@ -1250,12 +1250,10 @@
if (lpInt1 == lpInt2)
return TRUE;
- if (FAILED(IUnknown_QueryInterface(lpInt1, &IID_IUnknown,
- (LPVOID *)&lpUnknown1)))
+ if (FAILED(IUnknown_QueryInterface(lpInt1, &IID_IUnknown, &lpUnknown1)))
return FALSE;
- if (FAILED(IUnknown_QueryInterface(lpInt2, &IID_IUnknown,
- (LPVOID *)&lpUnknown2)))
+ if (FAILED(IUnknown_QueryInterface(lpInt2, &IID_IUnknown, &lpUnknown2)))
return FALSE;
if (lpUnknown1 == lpUnknown2)
@@ -2236,7 +2234,7 @@
if (IsEqualIID(riid, xmove->refid)) {
a_vtbl = (IUnknown*)(xmove->indx + (LPBYTE)w);
TRACE("matched, returning (%p)\n", a_vtbl);
- *ppv = (LPVOID)a_vtbl;
+ *ppv = a_vtbl;
IUnknown_AddRef(a_vtbl);
return S_OK;
}
@@ -2246,7 +2244,7 @@
if (IsEqualIID(riid, &IID_IUnknown)) {
a_vtbl = (IUnknown*)(x->indx + (LPBYTE)w);
TRACE("returning first for IUnknown (%p)\n", a_vtbl);
- *ppv = (LPVOID)a_vtbl;
+ *ppv = a_vtbl;
IUnknown_AddRef(a_vtbl);
return S_OK;
}
@@ -2539,7 +2537,7 @@
if (retval != ERROR_SUCCESS)
return 0;
- SHGetValueW(hKey, lpSubName, lpValue, NULL, (LPBYTE)&retval, &datsize);
+ SHGetValueW(hKey, lpSubName, lpValue, NULL, &retval, &datsize);
RegCloseKey(hKey);
return retval;
}
@@ -2618,7 +2616,7 @@
*ppv = NULL;
if(pUnk && pInner) {
- hret = IUnknown_QueryInterface(pInner, riid, (LPVOID*)ppv);
+ hret = IUnknown_QueryInterface(pInner, riid, ppv);
if (SUCCEEDED(hret)) IUnknown_Release(pUnk);
}
TRACE("-- 0x%08x\n", hret);
@@ -4167,7 +4165,7 @@
{
IUnknown* lpUnk;
- if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, (LPOLESTR)szSkipBinding, &lpUnk)))
+ if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, szSkipBinding, &lpUnk)))
{
CLSID clsid;
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 Jan 31 08:48:46 2009
@@ -190,7 +190,7 @@
LONG WINAPI SHRegCloseUSKey(
HUSKEY hUSKey) /* [I] Key to close */
{
- LPSHUSKEY hKey = (LPSHUSKEY)hUSKey;
+ LPSHUSKEY hKey = hUSKey;
LONG ret = ERROR_SUCCESS;
if (hKey->HKCUkey)
@@ -393,8 +393,8 @@
if (ret != ERROR_SUCCESS) {
if (pvDefaultData && (dwDefaultDataSize != 0)) {
maxmove = (dwDefaultDataSize >= *pcbData) ? *pcbData : dwDefaultDataSize;
- src = (CHAR*)pvDefaultData;
- dst = (CHAR*)pvData;
+ src = pvDefaultData;
+ dst = pvData;
for(i=0; i<maxmove; i++) *dst++ = *src++;
*pcbData = maxmove;
TRACE("setting default data\n");
@@ -444,8 +444,8 @@
if (ret != ERROR_SUCCESS) {
if (pvDefaultData && (dwDefaultDataSize != 0)) {
maxmove = (dwDefaultDataSize >= *pcbData) ? *pcbData : dwDefaultDataSize;
- src = (CHAR*)pvDefaultData;
- dst = (CHAR*)pvData;
+ src = pvDefaultData;
+ dst = pvData;
for(i=0; i<maxmove; i++) *dst++ = *src++;
*pcbData = maxmove;
TRACE("setting default data\n");
@@ -934,7 +934,7 @@
LPVOID pvData, DWORD cbData, DWORD dwFlags)
{
DWORD dummy;
- LPSHUSKEY hKey = (LPSHUSKEY)hUSKey;
+ LPSHUSKEY hKey = hUSKey;
LONG ret = ERROR_SUCCESS;
TRACE("(%p,%s,%d,%p,%d,%d)\n", hUSKey, debugstr_w(pszValue),
@@ -2242,7 +2242,7 @@
DWORD dwKeyCount = 0, dwValueCount = 0, dwMaxKeyLen = 0;
DWORD dwMaxValueLen = 0, dwMaxDataLen = 0, i;
BYTE buff[1024];
- LPVOID lpBuff = (LPVOID)buff;
+ LPVOID lpBuff = buff;
WCHAR szName[MAX_PATH], *lpszName = szName;
DWORD dwRet = S_OK;
Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild [iso-8859-1] Sat Jan 31 08:48:46 2009
@@ -5,6 +5,7 @@
<importlibrary definition="shlwapi.spec" />
<include base="shlwapi">.</include>
<include base="ReactOS">include/reactos/wine</include>
+ <define name="_WIN32_WINNT">0x600</define>
<define name="__WINESRC__" />
<file>assoc.c</file>
<file>clist.c</file>
Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] Sat Jan 31 08:48:46 2009
@@ -43,7 +43,7 @@
#include "shlwapi_Ro.rc"
#include "shlwapi_Ru.rc"
#include "shlwapi_Si.rc"
+#include "shlwapi_Sk.rc"
#include "shlwapi_Sv.rc"
#include "shlwapi_Tr.rc"
-#include "shlwapi_Uk.rc"
-#include "shlwapi_Zh.rc"
+#include "shlwapi_Uk.rc"#include "shlwapi_Zh.rc"
Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc (added)
+++ trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc [iso-8859-1] Sat Jan 31 08:48:46 2009
@@ -1,0 +1,43 @@
+/* Slovak translation for shlwapi
+ *
+ * Copyright 2004 Jon Griffiths
+ * Copyright 2008 Mário Kaèmár (Mario Kacmar)
+ *
+ * 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_SLOVAK, SUBLANG_DEFAULT
+
+IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Chyba!"
+FONT 8, "MS Shell Dlg"
+{
+ LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20
+ LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8
+ CHECKBOX "Nabudúce toto dialógové okno nezo&brazova", 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"&Zrui" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON L"Án&o" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON L"&Nie" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP
+}
+
+STRINGTABLE DISCARDABLE
+{
+ IDS_BYTES_FORMAT "%ld bajtov"
+ IDS_TIME_INTERVAL_HOURS " hod."
+ IDS_TIME_INTERVAL_MINUTES " min."
+ IDS_TIME_INTERVAL_SECONDS " s"
+}
Propchange: trunk/reactos/dll/win32/shlwapi/shlwapi_Sk.rc
------------------------------------------------------------------------------
svn:eol-style = native
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 Jan 31 08:48:46 2009
@@ -1342,7 +1342,7 @@
break;
case STRRET_CSTR:
- lstrcpynA((LPSTR)dest, src->u.cStr, len);
+ lstrcpynA(dest, src->u.cStr, len);
break;
case STRRET_OFFSET:
@@ -1381,7 +1381,7 @@
switch (src->uType)
{
case STRRET_WSTR:
- lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
+ lstrcpynW(dest, src->u.pOleStr, len);
CoTaskMemFree(src->u.pOleStr);
break;