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
December 2004
----- 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
26 participants
824 discussions
Start a n
N
ew thread
[chorns] 12611: Rename krnl0011 tag to ReactOS-0.0.11.
by chorns@svn.reactos.com
Rename krnl0011 tag to ReactOS-0.0.11. Added: tags/ReactOS-0.0.11/ Deleted: tags/krnl0011/ _____ Copied: tags/ReactOS-0.0.11 (from rev 12610, tags/krnl0011)
19 years, 11 months
1
0
0
0
[chorns] 12610: Rename krnl0010 tag to ReactOS-0.0.10.
by chorns@svn.reactos.com
Rename krnl0010 tag to ReactOS-0.0.10. Added: tags/ReactOS-0.0.10/ Deleted: tags/krnl0010/ _____ Copied: tags/ReactOS-0.0.10 (from rev 12609, tags/krnl0010)
19 years, 11 months
1
0
0
0
[gvg] 12609: Need to remove existing files before doing vendor import
by gvg@svn.reactos.com
Need to remove existing files before doing vendor import Deleted: trunk/reactos/lib/shlwapi/
19 years, 11 months
1
0
0
0
[chorns] 12608: Rename krnl0009 tag to ReactOS-0.0.9.
by chorns@svn.reactos.com
Rename krnl0009 tag to ReactOS-0.0.9. Added: tags/ReactOS-0.0.9/ Deleted: tags/krnl0009/ _____ Copied: tags/ReactOS-0.0.9 (from rev 12607, tags/krnl0009)
19 years, 11 months
1
0
0
0
[chorns] 12607: Rename krnl0008 tag to ReactOS-0.0.8.
by chorns@svn.reactos.com
Rename krnl0008 tag to ReactOS-0.0.8. Added: tags/ReactOS-0.0.8/ Deleted: tags/krnl0008/ _____ Copied: tags/ReactOS-0.0.8 (from rev 12605, tags/krnl0008)
19 years, 11 months
1
0
0
0
[gvg] 12606: Tag Wine-20041201
by gvg@svn.reactos.com
Tag Wine-20041201 Added: vendor/wine/dlls/shlwapi/Wine-20041201/ _____ Copied: vendor/wine/dlls/shlwapi/Wine-20041201 (from rev 12605, vendor/wine/dlls/shlwapi/current)
19 years, 11 months
1
0
0
0
[chorns] 12605: Rename krnl0007 tag to ReactOS-0.0.7.
by chorns@svn.reactos.com
Rename krnl0007 tag to ReactOS-0.0.7. Added: tags/ReactOS-0.0.7/ Deleted: tags/krnl0007/ _____ Copied: tags/ReactOS-0.0.7 (from rev 12603, tags/krnl0007)
19 years, 11 months
1
0
0
0
[gvg] 12604: Wine-20041201 vendor drop
by gvg@svn.reactos.com
Wine-20041201 vendor drop Added: vendor/wine/dlls/shlwapi/ Added: vendor/wine/dlls/shlwapi/current/ Added: vendor/wine/dlls/shlwapi/current/Makefile.in Added: vendor/wine/dlls/shlwapi/current/assoc.c Added: vendor/wine/dlls/shlwapi/current/clist.c Added: vendor/wine/dlls/shlwapi/current/istream.c Added: vendor/wine/dlls/shlwapi/current/msgbox.c Added: vendor/wine/dlls/shlwapi/current/ordinal.c Added: vendor/wine/dlls/shlwapi/current/path.c Added: vendor/wine/dlls/shlwapi/current/reg.c Added: vendor/wine/dlls/shlwapi/current/regstream.c Added: vendor/wine/dlls/shlwapi/current/resource.h Added: vendor/wine/dlls/shlwapi/current/shlwapi.rc Added: vendor/wine/dlls/shlwapi/current/shlwapi.spec Added: vendor/wine/dlls/shlwapi/current/shlwapi_De.rc Added: vendor/wine/dlls/shlwapi/current/shlwapi_En.rc Added: vendor/wine/dlls/shlwapi/current/shlwapi_Es.rc Added: vendor/wine/dlls/shlwapi/current/shlwapi_It.rc Added: vendor/wine/dlls/shlwapi/current/shlwapi_Ja.rc Added: vendor/wine/dlls/shlwapi/current/shlwapi_Nl.rc Added: vendor/wine/dlls/shlwapi/current/shlwapi_Pt.rc Added: vendor/wine/dlls/shlwapi/current/shlwapi_main.c Added: vendor/wine/dlls/shlwapi/current/stopwatch.c Added: vendor/wine/dlls/shlwapi/current/string.c Added: vendor/wine/dlls/shlwapi/current/thread.c Added: vendor/wine/dlls/shlwapi/current/url.c Added: vendor/wine/dlls/shlwapi/current/wsprintf.c _____ Added: vendor/wine/dlls/shlwapi/current/Makefile.in --- vendor/wine/dlls/shlwapi/current/Makefile.in 2004-12-31 16:07:59 UTC (rev 12603) +++ vendor/wine/dlls/shlwapi/current/Makefile.in 2004-12-31 16:09:02 UTC (rev 12604) @@ -0,0 +1,34 @@ +EXTRADEFS = -D_SHLWAPI_ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = shlwapi.dll +IMPORTS = ole32 user32 gdi32 advapi32 kernel32 ntdll +DELAYIMPORTS = oleaut32 +EXTRALIBS = -luuid $(LIBUNICODE) + +C_SRCS = \ + assoc.c \ + clist.c \ + istream.c \ + msgbox.c \ + ordinal.c \ + path.c \ + reg.c \ + regstream.c \ + shlwapi_main.c \ + stopwatch.c \ + string.c \ + thread.c \ + url.c \ + wsprintf.c + +RC_SRCS = \ + shlwapi.rc + +SUBDIRS = tests + +@MAKE_DLL_RULES@ + +### Dependencies: _____ Added: vendor/wine/dlls/shlwapi/current/assoc.c --- vendor/wine/dlls/shlwapi/current/assoc.c 2004-12-31 16:07:59 UTC (rev 12603) +++ vendor/wine/dlls/shlwapi/current/assoc.c 2004-12-31 16:09:02 UTC (rev 12604) @@ -0,0 +1,704 @@ +/* + * IQueryAssociations object and helper functions + * + * Copyright 2002 Jon Griffiths + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "winreg.h" +#include "objbase.h" +#include "shlguid.h" +#include "shlwapi.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +/********************************************************************** **** + * IQueryAssociations {SHLWAPI} + * + * DESCRIPTION + * This object provides a layer of abstraction over the system registry in + * order to simplify the process of parsing associations between files. + * Associations in this context means the registry entries that link (for + * example) the extension of a file with its description, list of + * applications to open the file with, and actions that can be performed on it + * (the shell displays such information in the context menu of explorer + * when you right-click on a file). + * + * HELPERS + * You can use this object tranparently by calling the helper functions + * AssocQueryKeyA(), AssocQueryStringA() and AssocQueryStringByKeyA(). These + * create an IQueryAssociations object, perform the requested actions + * and then dispose of the object. Alternatively, you can create an instance + * of the object using AssocCreate() and call the following methods on it: + * + * METHODS + */ + +/* Default IQueryAssociations::Init() flags */ +#define SHLWAPI_DEF_ASSOCF (ASSOCF_INIT_BYEXENAME|ASSOCF_INIT_DEFAULTTOSTAR| \ + ASSOCF_INIT_DEFAULTTOFOLDER) + +typedef struct +{ + IQueryAssociationsVtbl *lpVtbl; + LONG ref; + HKEY hkeySource; + HKEY hkeyProgID; +} IQueryAssociationsImpl; + +static struct IQueryAssociationsVtbl IQueryAssociations_vtbl; + +/********************************************************************** **** + * IQueryAssociations_Constructor [internal] + * + * Construct a new IQueryAssociations object. + */ +static IQueryAssociations* IQueryAssociations_Constructor(void) +{ + IQueryAssociationsImpl* iface; + + iface = HeapAlloc(GetProcessHeap(),0,sizeof(IQueryAssociationsImpl)); + iface->lpVtbl = &IQueryAssociations_vtbl; + iface->ref = 1; + iface->hkeySource = NULL; + iface->hkeyProgID = NULL; + + TRACE("Returning IQueryAssociations* %p\n", iface); + return (IQueryAssociations*)iface; +} + +/********************************************************************** *** + * SHLWAPI_ParamAToW + * + * Internal helper function: Convert ASCII parameter to Unicode. + */ +static BOOL SHLWAPI_ParamAToW(LPCSTR lpszParam, LPWSTR lpszBuff, DWORD dwLen, + LPWSTR* lpszOut) +{ + if (lpszParam) + { + DWORD dwStrLen = MultiByteToWideChar(CP_ACP, 0, lpszParam, -1, NULL, 0); + + if (dwStrLen < dwLen) + { + *lpszOut = lpszBuff; /* Use Buffer, it is big enough */ + } + else + { + /* Create a new buffer big enough for the string */ + *lpszOut = HeapAlloc(GetProcessHeap(), 0, + dwStrLen * sizeof(WCHAR)); + if (!*lpszOut) + return FALSE; + } + MultiByteToWideChar(CP_ACP, 0, lpszParam, -1, *lpszOut, dwStrLen); + } + else + *lpszOut = NULL; + return TRUE; +} + +/********************************************************************** *** + * AssocCreate [SHLWAPI.@] + * + * Create a new IQueryAssociations object. + * + * PARAMS + * clsid [I] CLSID of object + * refiid [I] REFIID of interface + * lpInterface [O] Destination for the created IQueryAssociations object + * + * RETURNS + * Success: S_OK. lpInterface contains the new object. + * Failure: An HRESULT error code indicating the error. + * + * NOTES + * refiid must be equal to IID_IQueryAssociations, or this function will fail. + */ +HRESULT WINAPI AssocCreate(CLSID clsid, REFIID refiid, void **lpInterface) +{ + HRESULT hRet; + IQueryAssociations* lpAssoc; + + TRACE("(%s,%s,%p)\n", debugstr_guid(&clsid), debugstr_guid(refiid), + lpInterface); + + if (!lpInterface) + return E_INVALIDARG; + + *(DWORD*)lpInterface = 0; + + if (!IsEqualGUID(&clsid, &IID_IQueryAssociations)) + return E_NOTIMPL; + + lpAssoc = IQueryAssociations_Constructor(); + + if (!lpAssoc) + return E_OUTOFMEMORY; + + hRet = IQueryAssociations_QueryInterface(lpAssoc, refiid, lpInterface); + IQueryAssociations_Release(lpAssoc); + return hRet; +} + +/********************************************************************** *** + * AssocQueryKeyW [SHLWAPI.@] + * + * See AssocQueryKeyA. + */ +HRESULT WINAPI AssocQueryKeyW(ASSOCF cfFlags, ASSOCKEY assockey, LPCWSTR pszAssoc, + LPCWSTR pszExtra, HKEY *phkeyOut) +{ + HRESULT hRet; + IQueryAssociations* lpAssoc; + + TRACE("(0x%8lx,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_w(pszAssoc), + debugstr_w(pszExtra), phkeyOut); + + lpAssoc = IQueryAssociations_Constructor(); + + if (!lpAssoc) + return E_OUTOFMEMORY; + + cfFlags &= SHLWAPI_DEF_ASSOCF; + hRet = IQueryAssociations_Init(lpAssoc, cfFlags, pszAssoc, NULL, NULL); + + if (SUCCEEDED(hRet)) + hRet = IQueryAssociations_GetKey(lpAssoc, cfFlags, assockey, pszExtra, phkeyOut); + + IQueryAssociations_Release(lpAssoc); + return hRet; +} + +/********************************************************************** *** + * AssocQueryKeyA [SHLWAPI.@] + * + * Get a file association key from the registry. + * + * PARAMS + * cfFlags [I] ASSOCF_ flags from "shlwapi.h" + * assockey [I] Type of key to get + * pszAssoc [I] Key name to search below + * pszExtra [I] Extra information about the key location + * phkeyOut [O] Destination for the association key + * + * RETURNS + * Success: S_OK. phkeyOut contains the key. + * Failure: An HRESULT error code indicating the error. + */ +HRESULT WINAPI AssocQueryKeyA(ASSOCF cfFlags, ASSOCKEY assockey, LPCSTR pszAssoc, + LPCSTR pszExtra, HKEY *phkeyOut) +{ + WCHAR szAssocW[MAX_PATH], *lpszAssocW = NULL; + WCHAR szExtraW[MAX_PATH], *lpszExtraW = NULL; + HRESULT hRet = E_OUTOFMEMORY; + + TRACE("(0x%8lx,0x%8x,%s,%s,%p)\n", cfFlags, assockey, debugstr_a(pszAssoc), + debugstr_a(pszExtra), phkeyOut); + + if (SHLWAPI_ParamAToW(pszAssoc, szAssocW, MAX_PATH, &lpszAssocW) && + SHLWAPI_ParamAToW(pszExtra, szExtraW, MAX_PATH, &lpszExtraW)) + { + hRet = AssocQueryKeyW(cfFlags, assockey, lpszAssocW, lpszExtraW, phkeyOut); + } + + if (lpszAssocW && lpszAssocW != szAssocW) + HeapFree(GetProcessHeap(), 0, lpszAssocW); + + if (lpszExtraW && lpszExtraW != szExtraW) + HeapFree(GetProcessHeap(), 0, lpszExtraW); + + return hRet; +} + +/********************************************************************** *** + * AssocQueryStringW [SHLWAPI.@] + * + * See AssocQueryStringA. + */ +HRESULT WINAPI AssocQueryStringW(ASSOCF cfFlags, ASSOCSTR str, LPCWSTR pszAssoc, + LPCWSTR pszExtra, LPWSTR pszOut, DWORD *pcchOut) +{ + HRESULT hRet; + IQueryAssociations* lpAssoc; + + TRACE("(0x%8lx,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_w(pszAssoc), + debugstr_w(pszExtra), pszOut, pcchOut); + + if (!pcchOut) + return E_INVALIDARG; + + lpAssoc = IQueryAssociations_Constructor(); + + if (!lpAssoc) + return E_OUTOFMEMORY; + + hRet = IQueryAssociations_Init(lpAssoc, cfFlags & SHLWAPI_DEF_ASSOCF, + pszAssoc, NULL, NULL); + + if (SUCCEEDED(hRet)) + hRet = IQueryAssociations_GetString(lpAssoc, cfFlags, str, pszExtra, + pszOut, pcchOut); + + IQueryAssociations_Release(lpAssoc); + return hRet; +} + +/********************************************************************** *** + * AssocQueryStringA [SHLWAPI.@] + * + * Get a file association string from the registry. + * + * PARAMS + * cfFlags [I] ASSOCF_ flags from "shlwapi.h" + * str [I] Type of string to get (ASSOCSTR enum from "shlwapi.h") + * pszAssoc [I] Key name to search below + * pszExtra [I] Extra information about the string location + * pszOut [O] Destination for the association string + * pcchOut [O] Length of pszOut + * + * RETURNS + * Success: S_OK. pszOut contains the string, pcchOut contains its length. + * Failure: An HRESULT error code indicating the error. + */ +HRESULT WINAPI AssocQueryStringA(ASSOCF cfFlags, ASSOCSTR str, LPCSTR pszAssoc, + LPCSTR pszExtra, LPSTR pszOut, DWORD *pcchOut) +{ + WCHAR szAssocW[MAX_PATH], *lpszAssocW = NULL; + WCHAR szExtraW[MAX_PATH], *lpszExtraW = NULL; + HRESULT hRet = E_OUTOFMEMORY; + + TRACE("(0x%8lx,0x%8x,%s,%s,%p,%p)\n", cfFlags, str, debugstr_a(pszAssoc), + debugstr_a(pszExtra), pszOut, pcchOut); + + if (!pcchOut) + hRet = E_INVALIDARG; + else if (SHLWAPI_ParamAToW(pszAssoc, szAssocW, MAX_PATH, &lpszAssocW) && + SHLWAPI_ParamAToW(pszExtra, szExtraW, MAX_PATH, &lpszExtraW)) + { + WCHAR szReturnW[MAX_PATH], *lpszReturnW = szReturnW; + DWORD dwLenOut = *pcchOut; + + if (dwLenOut >= MAX_PATH) + lpszReturnW = HeapAlloc(GetProcessHeap(), 0, + (dwLenOut + 1) * sizeof(WCHAR)); + + if (!lpszReturnW) + hRet = E_OUTOFMEMORY; + else + { + hRet = AssocQueryStringW(cfFlags, str, lpszAssocW, lpszExtraW, + lpszReturnW, &dwLenOut); + + if (SUCCEEDED(hRet)) + WideCharToMultiByte(CP_ACP,0,szReturnW,-1,pszOut,dwLenOut,0,0); + *pcchOut = dwLenOut; + + if (lpszReturnW && lpszReturnW != szReturnW) + HeapFree(GetProcessHeap(), 0, lpszReturnW); + } + } + + if (lpszAssocW && lpszAssocW != szAssocW) + HeapFree(GetProcessHeap(), 0, lpszAssocW); + if (lpszExtraW && lpszExtraW != szExtraW) + HeapFree(GetProcessHeap(), 0, lpszExtraW); + return hRet; +} + +/********************************************************************** *** + * AssocQueryStringByKeyW [SHLWAPI.@] + * + * See AssocQueryStringByKeyA. + */ +HRESULT WINAPI AssocQueryStringByKeyW(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc, + LPCWSTR pszExtra, LPWSTR pszOut, + DWORD *pcchOut) +{ + HRESULT hRet; + IQueryAssociations* lpAssoc; + + TRACE("(0x%8lx,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, + debugstr_w(pszExtra), pszOut, pcchOut); + + lpAssoc = IQueryAssociations_Constructor(); + + if (!lpAssoc) + return E_OUTOFMEMORY; + + cfFlags &= SHLWAPI_DEF_ASSOCF; + hRet = IQueryAssociations_Init(lpAssoc, cfFlags, 0, hkAssoc, NULL); + + if (SUCCEEDED(hRet)) + hRet = IQueryAssociations_GetString(lpAssoc, cfFlags, str, pszExtra, + pszOut, pcchOut); + + IQueryAssociations_Release(lpAssoc); + return hRet; +} + +/********************************************************************** *** + * AssocQueryStringByKeyA [SHLWAPI.@] + * + * Get a file association string from the registry, given a starting key. + * + * PARAMS + * cfFlags [I] ASSOCF_ flags from "shlwapi.h" + * str [I] Type of string to get + * hkAssoc [I] Key to search below + * pszExtra [I] Extra information about the string location + * pszOut [O] Destination for the association string + * pcchOut [O] Length of pszOut + * + * RETURNS + * Success: S_OK. pszOut contains the string, pcchOut contains its length. + * Failure: An HRESULT error code indicating the error. + */ +HRESULT WINAPI AssocQueryStringByKeyA(ASSOCF cfFlags, ASSOCSTR str, HKEY hkAssoc, + LPCSTR pszExtra, LPSTR pszOut, + DWORD *pcchOut) +{ + WCHAR szExtraW[MAX_PATH], *lpszExtraW; + WCHAR szReturnW[MAX_PATH], *lpszReturnW = szReturnW; + HRESULT hRet = E_OUTOFMEMORY; + + TRACE("(0x%8lx,0x%8x,%p,%s,%p,%p)\n", cfFlags, str, hkAssoc, + debugstr_a(pszExtra), pszOut, pcchOut); + + if (!pcchOut) + hRet = E_INVALIDARG; + else if (SHLWAPI_ParamAToW(pszExtra, szExtraW, MAX_PATH, &lpszExtraW)) + { + DWORD dwLenOut = *pcchOut; + if (dwLenOut >= MAX_PATH) + lpszReturnW = HeapAlloc(GetProcessHeap(), 0, + (dwLenOut + 1) * sizeof(WCHAR)); + + if (lpszReturnW) + { + hRet = AssocQueryStringByKeyW(cfFlags, str, hkAssoc, lpszExtraW, + lpszReturnW, &dwLenOut); + + if (SUCCEEDED(hRet)) + WideCharToMultiByte(CP_ACP,0,szReturnW,-1,pszOut,dwLenOut,0,0); + *pcchOut = dwLenOut; + + if (lpszReturnW != szReturnW) + HeapFree(GetProcessHeap(), 0, lpszReturnW); + } + } + + if (lpszExtraW && lpszExtraW != szExtraW) + HeapFree(GetProcessHeap(), 0, lpszExtraW); + return hRet; +} + + +/********************************************************************** **** + * AssocIsDangerous (SHLWAPI.@) + * + * Determine if a file association is dangerous (potentially malware). + * + * PARAMS + * lpszAssoc [I] Name of file or file extension to check. + * + * RETURNS + * TRUE, if lpszAssoc may potentially be malware (executable), + * FALSE, Otherwise. + */ +BOOL WINAPI AssocIsDangerous(LPCWSTR lpszAssoc) +{ + FIXME("%s\n", debugstr_w(lpszAssoc)); + return FALSE; +} + +/********************************************************************** **** + * IQueryAssociations_QueryInterface {SHLWAPI} + * + * See IUnknown_QueryInterface. + */ +static HRESULT WINAPI IQueryAssociations_fnQueryInterface( + IQueryAssociations* iface, + REFIID riid, + LPVOID *ppvObj) +{ + IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; + + TRACE("(%p,%s,%p)\n",This, debugstr_guid(riid), ppvObj); + + *ppvObj = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IQueryAssociations)) + { + *ppvObj = (IQueryAssociations*)This; + + IQueryAssociations_AddRef((IQueryAssociations*)*ppvObj); + TRACE("Returning IQueryAssociations (%p)\n", *ppvObj); + return S_OK; + } + TRACE("Returning E_NOINTERFACE\n"); + return E_NOINTERFACE; +} + +/********************************************************************** **** + * IQueryAssociations_AddRef {SHLWAPI} + * + * See IUnknown_AddRef. + */ +static ULONG WINAPI IQueryAssociations_fnAddRef(IQueryAssociations *iface) +{ + IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; + + TRACE("(%p)->(ref before=%lu)\n",This, This->ref); + + return InterlockedIncrement(&This->ref); +} + +/********************************************************************** **** + * IQueryAssociations_Release {SHLWAPI} + * + * See IUnknown_Release. + */ +static ULONG WINAPI IQueryAssociations_fnRelease(IQueryAssociations *iface) +{ + IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; + ULONG ulRet; + + TRACE("(%p)->(ref before=%lu)\n",This, This->ref); + + if (!(ulRet = InterlockedDecrement(&This->ref))) + { + TRACE("Destroying IQueryAssociations (%p)\n", This); + HeapFree(GetProcessHeap(), 0, This); + } + return ulRet; +} + +/********************************************************************** **** + * IQueryAssociations_Init {SHLWAPI} + * + * Initialise an IQueryAssociations object. + * + * PARAMS + * iface [I] IQueryAssociations interface to initialise + * cfFlags [I] ASSOCF_ flags from "shlwapi.h" + * pszAssoc [I] String for the root key name, or NULL if hkProgid is given + * hkeyProgid [I] Handle for the root key, or NULL if pszAssoc is given + * hWnd [I] Reserved, must be NULL. + * + * RETURNS + * Success: S_OK. iface is initialised with the parameters given. + * Failure: An HRESULT error code indicating the error. + */ +static HRESULT WINAPI IQueryAssociations_fnInit( + IQueryAssociations *iface, + ASSOCF cfFlags, + LPCWSTR pszAssoc, + HKEY hkeyProgid, + HWND hWnd) +{ + static const WCHAR szProgID[] = {'P','r','o','g','I','D',0}; + IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; + HRESULT hr; + + TRACE("(%p)->(%ld,%s,%p,%p)\n", iface, + cfFlags, + debugstr_w(pszAssoc), + hkeyProgid, + hWnd); + if (hWnd != NULL) + FIXME("hwnd != NULL not supported\n"); + if (cfFlags != 0) + FIXME("unsupported flags: %lx\n", cfFlags); + if (pszAssoc != NULL) + { + hr = RegOpenKeyExW(HKEY_CLASSES_ROOT, + pszAssoc, + 0, + KEY_READ, + &This->hkeySource); + if (FAILED(hr)) + return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION); + /* if this is not a prog id */ + if ((*pszAssoc == '.') || (*pszAssoc == '{')) + { + hr = RegOpenKeyExW(This->hkeySource, + szProgID, + 0, + KEY_READ, + &This->hkeyProgID); + if (FAILED(hr)) + FIXME("Don't know what to return\n"); + } + else + This->hkeyProgID = This->hkeySource; + return S_OK; + } + else if (hkeyProgid != NULL) + { + This->hkeyProgID = hkeyProgid; + return S_OK; + } + else + return E_FAIL; +} + +/********************************************************************** **** + * IQueryAssociations_GetString {SHLWAPI} + * + * Get a file association string from the registry. + * + * PARAMS + * iface [I] IQueryAssociations interface to query + * cfFlags [I] ASSOCF_ flags from "shlwapi.h" + * str [I] Type of string to get (ASSOCSTR enum from "shlwapi.h") + * pszExtra [I] Extra information about the string location + * pszOut [O] Destination for the association string + * pcchOut [I/O] Length of pszOut + * + * RETURNS + * Success: S_OK. pszOut contains the string, pcchOut contains its length. + * Failure: An HRESULT error code indicating the error. + */ +static HRESULT WINAPI IQueryAssociations_fnGetString( + IQueryAssociations *iface, + ASSOCF cfFlags, + ASSOCSTR str, + LPCWSTR pszExtra, + LPWSTR pszOut, + DWORD *pcchOut) +{ + IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; + + FIXME("(%p,0x%8lx,0x%8x,%s,%p,%p)-stub!\n", This, cfFlags, str, + debugstr_w(pszExtra), pszOut, pcchOut); + return E_NOTIMPL; +} + +/********************************************************************** **** + * IQueryAssociations_GetKey {SHLWAPI} + * + * Get a file association key from the registry. + * + * PARAMS + * iface [I] IQueryAssociations interface to query + * cfFlags [I] ASSOCF_ flags from "shlwapi.h" + * assockey [I] Type of key to get (ASSOCKEY enum from "shlwapi.h") + * pszExtra [I] Extra information about the key location + * phkeyOut [O] Destination for the association key + * + * RETURNS + * Success: S_OK. phkeyOut contains a handle to the key. + * Failure: An HRESULT error code indicating the error. + */ +static HRESULT WINAPI IQueryAssociations_fnGetKey( + IQueryAssociations *iface, + ASSOCF cfFlags, + ASSOCKEY assockey, + LPCWSTR pszExtra, + HKEY *phkeyOut) +{ + IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; + + FIXME("(%p,0x%8lx,0x%8x,%s,%p)-stub!\n", This, cfFlags, assockey, + debugstr_w(pszExtra), phkeyOut); + return E_NOTIMPL; +} + +/********************************************************************** **** + * IQueryAssociations_GetData {SHLWAPI} + * + * Get the data for a file association key from the registry. + * + * PARAMS + * iface [I] IQueryAssociations interface to query + * cfFlags [I] ASSOCF_ flags from "shlwapi.h" + * assocdata [I] Type of data to get (ASSOCDATA enum from "shlwapi.h") + * pszExtra [I] Extra information about the data location + * pvOut [O] Destination for the association key + * pcbOut [I/O] Size of pvOut + * + * RETURNS + * Success: S_OK. pszOut contains the data, pcbOut contains its length. + * Failure: An HRESULT error code indicating the error. + */ +static HRESULT WINAPI IQueryAssociations_fnGetData( + IQueryAssociations *iface, + ASSOCF cfFlags, + ASSOCDATA assocdata, + LPCWSTR pszExtra, + LPVOID pvOut, + DWORD *pcbOut) +{ + IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; + + FIXME("(%p,0x%8lx,0x%8x,%s,%p,%p)-stub!\n", This, cfFlags, assocdata, + debugstr_w(pszExtra), pvOut, pcbOut); + return E_NOTIMPL; +} + +/********************************************************************** **** + * IQueryAssociations_GetEnum {SHLWAPI} + * + * Not yet implemented in native Win32. + * + * PARAMS + * iface [I] IQueryAssociations interface to query + * cfFlags [I] ASSOCF_ flags from "shlwapi.h" + * assocenum [I] Type of enum to get (ASSOCENUM enum from "shlwapi.h") + * pszExtra [I] Extra information about the enum location + * riid [I] REFIID to look for + * ppvOut [O] Destination for the interface. + * + * RETURNS + * Success: S_OK. + * Failure: An HRESULT error code indicating the error. + * + * NOTES + * Presumably this function returns an enumerator object. + */ +static HRESULT WINAPI IQueryAssociations_fnGetEnum( + IQueryAssociations *iface, + ASSOCF cfFlags, + ASSOCENUM assocenum, + LPCWSTR pszExtra, + REFIID riid, + LPVOID *ppvOut) +{ + IQueryAssociationsImpl *This = (IQueryAssociationsImpl *)iface; + + FIXME("(%p,0x%8lx,0x%8x,%s,%s,%p)-stub!\n", This, cfFlags, assocenum, + debugstr_w(pszExtra), debugstr_guid(riid), ppvOut); + return E_NOTIMPL; +} + +static struct IQueryAssociationsVtbl IQueryAssociations_vtbl = +{ + IQueryAssociations_fnQueryInterface, + IQueryAssociations_fnAddRef, + IQueryAssociations_fnRelease, + IQueryAssociations_fnInit, + IQueryAssociations_fnGetString, + IQueryAssociations_fnGetKey, + IQueryAssociations_fnGetData, + IQueryAssociations_fnGetEnum +}; _____ Added: vendor/wine/dlls/shlwapi/current/clist.c --- vendor/wine/dlls/shlwapi/current/clist.c 2004-12-31 16:07:59 UTC (rev 12603) +++ vendor/wine/dlls/shlwapi/current/clist.c 2004-12-31 16:09:02 UTC (rev 12604) @@ -0,0 +1,455 @@ +/* + * SHLWAPI DataBlock List functions + * + * Copyright 2002 Jon Griffiths + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <stdarg.h> +#include <string.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + +/* DataBlock list element (ordinals 17-22) */ +typedef struct tagSHLWAPI_CLIST +{ + ULONG ulSize; /* Size of this list element and its data */ + ULONG ulId; /* If 0xFFFFFFFF, The real element follows */ + /* Item data (or a contained SHLWAPI_CLIST) follows... */ +} SHLWAPI_CLIST, *LPSHLWAPI_CLIST; + +typedef const SHLWAPI_CLIST* LPCSHLWAPI_CLIST; + +/* ulId for contained SHLWAPI_CLIST items */ +#define CLIST_ID_CONTAINER (~0UL) + +HRESULT WINAPI SHAddDataBlock(LPSHLWAPI_CLIST*,LPCSHLWAPI_CLIST); + +/********************************************************************** *** + * NextItem + * + * Internal helper: move a DataBlock pointer to the next item. + */ +inline static LPSHLWAPI_CLIST NextItem(LPCSHLWAPI_CLIST lpList) +{ + const char* address = (const char*)lpList; + address += lpList->ulSize; + return (LPSHLWAPI_CLIST)address; +} + +/********************************************************************** *** + * @ [SHLWAPI.17] + * + * Write a DataBlock list to an IStream object. + * + * PARAMS + * lpStream [I] IStream object to write the list to + * lpList [I] List of items to write + * + * RETURNS + * Success: S_OK. The object is written to the stream. + * Failure: An HRESULT error code + * + * NOTES + * Ordinals 17,18,19,20,21 and 22 are related and together provide a compact + * list structure (a "DataBlock List"), which may be stored and retrieved from + * an IStream object. + * + * The exposed API consists of: + * + * - SHWriteDataBlockList() - Write a DataBlock list to a stream, + * - SHReadDataBlockList() - Read and create a list from a stream, + * - SHFreeDataBlockList() - Free a list, + * - SHAddDataBlock() - Insert a new item into a list, + * - SHRemoveDataBlock() - Remove an item from a list, + * - SHFindDataBlock() - Find an item in a list. + * + * The DataBlock list is stored packed into a memory array. Each element has a + * size and an associated ID. Elements must be less than 64k if the list is + * to be subsequently read from a stream. + * + * Elements are aligned on DWORD boundaries. If an elements data size is not + * a DWORD size multiple, the element is wrapped by inserting a surrounding + * element with an Id of 0xFFFFFFFF, and size sufficient to pad to a DWORD boundary. + * + * These functions are slow for large objects and long lists. + */ +HRESULT WINAPI SHWriteDataBlockList(IStream* lpStream, LPSHLWAPI_CLIST lpList) +{ + ULONG ulSize; + HRESULT hRet = E_FAIL; + + TRACE("(%p,%p)\n", lpStream, lpList); + + if(lpList) + { + while (lpList->ulSize) + { + LPSHLWAPI_CLIST lpItem = lpList; + + if(lpList->ulId == CLIST_ID_CONTAINER) + lpItem++; + + hRet = IStream_Write(lpStream,lpItem,lpItem->ulSize,&ulSize); + if (FAILED(hRet)) + return hRet; + + if(lpItem->ulSize != ulSize) + return STG_E_MEDIUMFULL; + + lpList = NextItem(lpList); + } + } + + if(SUCCEEDED(hRet)) + { + ULONG ulDummy; + ulSize = 0; + + /* Write a terminating list entry with zero size */ + hRet = IStream_Write(lpStream, &ulSize,sizeof(ulSize),&ulDummy); + } + + return hRet; +} + +/********************************************************************** *** + * @ [SHLWAPI.18] + * + * Read and create a DataBlock list from an IStream object. + * + * PARAMS + * lpStream [I] Stream to read the list from + * lppList [0] Pointer to receive the new List + * + * RETURNS + * Success: S_OK + * Failure: An HRESULT error code + * + * NOTES + * When read from a file, list objects are limited in size to 64k. + * See SHWriteDataBlockList. + */ +HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPSHLWAPI_CLIST* lppList) +{ + SHLWAPI_CLIST bBuff[128]; /* Temporary storage for new list item */ + ULONG ulBuffSize = sizeof(bBuff); + LPSHLWAPI_CLIST pItem = bBuff; + ULONG ulRead, ulSize; + HRESULT hRet = S_OK; + + TRACE("(%p,%p)\n", lpStream, lppList); + + if(*lppList) + { + /* Free any existing list */ + LocalFree((HLOCAL)*lppList); + *lppList = NULL; + } + + do + { + /* Read the size of the next item */ + hRet = IStream_Read(lpStream, &ulSize,sizeof(ulSize),&ulRead); + + if(FAILED(hRet) || ulRead != sizeof(ulSize) || !ulSize) + break; /* Read failed or read zero size (the end of the list) */ + + if(ulSize > 0xFFFF) + { + LARGE_INTEGER liZero; + ULARGE_INTEGER ulPos; + + liZero.QuadPart = 0; + + /* Back the stream up; this object is too big for the list */ + if(SUCCEEDED(IStream_Seek(lpStream, liZero, STREAM_SEEK_CUR, &ulPos))) + { + liZero.QuadPart = ulPos.QuadPart - sizeof(ULONG); + IStream_Seek(lpStream, liZero, STREAM_SEEK_SET, NULL); + } + break; + } + else if (ulSize >= sizeof(SHLWAPI_CLIST)) + { + /* Add this new item to the list */ + if(ulSize > ulBuffSize) + { + /* We need more buffer space, allocate it */ + LPSHLWAPI_CLIST lpTemp; + + if (pItem == bBuff) + lpTemp = (LPSHLWAPI_CLIST)LocalAlloc(LMEM_ZEROINIT, ulSize); + else + lpTemp = (LPSHLWAPI_CLIST)LocalReAlloc((HLOCAL)pItem, ulSize, + LMEM_ZEROINIT|LMEM_MOVEABLE); + + if(!lpTemp) + { + hRet = E_OUTOFMEMORY; + break; + } + ulBuffSize = ulSize; + pItem = lpTemp; + } + + pItem->ulSize = ulSize; + ulSize -= sizeof(pItem->ulSize); /* already read this member */ + + /* Read the item Id and data */ + hRet = IStream_Read(lpStream, &pItem->ulId, ulSize, &ulRead); + + if(FAILED(hRet) || ulRead != ulSize) + break; + + SHAddDataBlock(lppList, pItem); /* Insert Item */ + } + } while(1); + + /* If we allocated space, free it */ + if(pItem != bBuff) + LocalFree((HLOCAL)pItem); + + return hRet; +} + +/********************************************************************** *** + * @ [SHLWAPI.19] + * + * Free a DataBlock list. + * + * PARAMS + * lpList [I] List to free + * + * RETURNS + * Nothing. + * + * NOTES + * See SHWriteDataBlockList. [truncated at 1000 lines; 19759 more skipped]
19 years, 11 months
1
0
0
0
[gvg] 12603: Import and merge Wine-20041201
by gvg@svn.reactos.com
Import and merge Wine-20041201 Added: trunk/reactos/lib/shdocvw/ Added: trunk/reactos/lib/shdocvw/Makefile Added: trunk/reactos/lib/shdocvw/Makefile.ros-template _____ Copied: trunk/reactos/lib/shdocvw (from rev 12602, vendor/wine/dlls/shdocvw/current) _____ Added: trunk/reactos/lib/shdocvw/Makefile --- vendor/wine/dlls/shdocvw/current/Makefile 2004-12-31 16:06:52 UTC (rev 12602) +++ trunk/reactos/lib/shdocvw/Makefile 2004-12-31 16:07:59 UTC (rev 12603) @@ -0,0 +1,9 @@ +# $Id: Makefile 12297 2004-12-23 08:55:00Z gvg $ + +PATH_TO_TOP = ../.. + +TARGET_TYPE = winedll + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk \ No newline at end of file _____ Added: trunk/reactos/lib/shdocvw/Makefile.ros-template --- vendor/wine/dlls/shdocvw/current/Makefile.ros-template 2004-12-31 16:06:52 UTC (rev 12602) +++ trunk/reactos/lib/shdocvw/Makefile.ros-template 2004-12-31 16:07:59 UTC (rev 12603) @@ -0,0 +1,19 @@ +# $Id: Makefile.ros-template 12297 2004-12-23 08:55:00Z gvg $ + +TARGET_NAME = shdocvw + +TARGET_OBJECTS = @C_SRCS@ + +TARGET_CFLAGS = @EXTRADEFS@ + +TARGET_SDKLIBS = @IMPORTS@ wine.a wine_uuid.a ntdll.a + +TARGET_BASE = $(TARGET_BASE_LIB_SHDOCVW) + +TARGET_NORC = yes + +default: all + +DEP_OBJECTS = $(TARGET_OBJECTS) + +include $(TOOLS_PATH)/depend.mk
19 years, 11 months
1
0
0
0
[gvg] 12602: Need to remove existing files before doing vendor import
by gvg@svn.reactos.com
Need to remove existing files before doing vendor import Deleted: trunk/reactos/lib/shdocvw/
19 years, 11 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
83
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Results per page:
10
25
50
100
200