2000-07-09 11:19:35 +00:00
|
|
|
/*
|
|
|
|
* SHLWAPI initialisation
|
|
|
|
*
|
|
|
|
* Copyright 1998 Marcus Meissner
|
|
|
|
* Copyright 1998 Juergen Schmied (jsch)
|
2002-03-09 23:29:33 +00:00
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-07-09 11:19:35 +00:00
|
|
|
*/
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
2000-07-09 11:19:35 +00:00
|
|
|
#include "winbase.h"
|
2002-07-19 00:25:26 +00:00
|
|
|
#define NO_SHLWAPI_REG
|
2001-12-11 00:30:17 +00:00
|
|
|
#define NO_SHLWAPI_STREAM
|
2000-09-29 01:03:30 +00:00
|
|
|
#include "shlwapi.h"
|
2007-03-28 11:13:54 +00:00
|
|
|
#include "wine/debug.h"
|
2000-08-03 04:22:35 +00:00
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
2000-07-09 11:19:35 +00:00
|
|
|
|
2011-04-28 11:32:20 +00:00
|
|
|
DECLSPEC_HIDDEN HINSTANCE shlwapi_hInstance = 0;
|
|
|
|
DECLSPEC_HIDDEN DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES;
|
2000-07-09 11:19:35 +00:00
|
|
|
|
2003-03-18 18:35:48 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* SHLWAPI {SHLWAPI}
|
|
|
|
*
|
2012-05-15 08:15:32 +00:00
|
|
|
* The Shell Light-Weight API dll provides a large number of utility functions
|
2003-03-18 18:35:48 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* All functions exported by ordinal are undocumented by MS. The vast majority
|
|
|
|
* of these are wrappers for Unicode functions that may not exist on early 16
|
|
|
|
* bit platforms. The remainder perform various small tasks and presumably were
|
|
|
|
* added to facilitate code reuse amongst the MS developers.
|
|
|
|
*/
|
|
|
|
|
2000-07-09 11:19:35 +00:00
|
|
|
/*************************************************************************
|
2002-11-04 23:53:41 +00:00
|
|
|
* SHLWAPI DllMain
|
2000-07-09 11:19:35 +00:00
|
|
|
*
|
|
|
|
* NOTES
|
2012-01-22 23:44:04 +00:00
|
|
|
* calling oleinitialize here breaks some apps.
|
2000-07-09 11:19:35 +00:00
|
|
|
*/
|
2002-11-04 23:53:41 +00:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
2000-07-09 11:19:35 +00:00
|
|
|
{
|
2006-10-06 10:43:28 +00:00
|
|
|
TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad);
|
2000-07-09 11:19:35 +00:00
|
|
|
switch (fdwReason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2003-06-30 20:53:48 +00:00
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
2000-07-09 11:19:35 +00:00
|
|
|
shlwapi_hInstance = hinstDLL;
|
2002-02-21 20:09:17 +00:00
|
|
|
SHLWAPI_ThreadRef_index = TlsAlloc();
|
2000-07-09 11:19:35 +00:00
|
|
|
break;
|
2001-02-13 20:17:59 +00:00
|
|
|
case DLL_PROCESS_DETACH:
|
2013-05-16 10:52:21 +00:00
|
|
|
if (fImpLoad) break;
|
2003-07-22 00:57:25 +00:00
|
|
|
if (SHLWAPI_ThreadRef_index != TLS_OUT_OF_INDEXES) TlsFree(SHLWAPI_ThreadRef_index);
|
2001-02-13 20:17:59 +00:00
|
|
|
break;
|
2000-07-09 11:19:35 +00:00
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
2000-07-26 17:51:32 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-20 23:03:14 +00:00
|
|
|
* DllGetVersion [SHLWAPI.@]
|
2000-07-26 17:51:32 +00:00
|
|
|
*
|
2003-03-18 18:35:48 +00:00
|
|
|
* Retrieve "shlwapi.dll" version information.
|
2000-07-26 17:51:32 +00:00
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pdvi [O] pointer to version information structure.
|
|
|
|
*
|
|
|
|
* RETURNS
|
2003-03-18 18:35:48 +00:00
|
|
|
* Success: S_OK. pdvi is updated with the version information
|
|
|
|
* Failure: E_INVALIDARG, if pdvi->cbSize is not set correctly.
|
2000-07-26 17:51:32 +00:00
|
|
|
*
|
|
|
|
* NOTES
|
2003-03-18 18:35:48 +00:00
|
|
|
* You may pass either a DLLVERSIONINFO of DLLVERSIONINFO2 structure
|
|
|
|
* as pdvi, provided that the size is set correctly.
|
|
|
|
* Returns version as shlwapi.dll from IE5.01.
|
2000-07-26 17:51:32 +00:00
|
|
|
*/
|
2005-08-08 17:43:51 +00:00
|
|
|
HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
|
2000-07-26 17:51:32 +00:00
|
|
|
{
|
2003-03-18 18:35:48 +00:00
|
|
|
DLLVERSIONINFO2 *pdvi2 = (DLLVERSIONINFO2*)pdvi;
|
2000-07-26 17:51:32 +00:00
|
|
|
|
2003-03-18 18:35:48 +00:00
|
|
|
TRACE("(%p)\n",pdvi);
|
2000-07-26 17:51:32 +00:00
|
|
|
|
2003-03-18 18:35:48 +00:00
|
|
|
switch (pdvi2->info1.cbSize)
|
|
|
|
{
|
|
|
|
case sizeof(DLLVERSIONINFO2):
|
|
|
|
pdvi2->dwFlags = 0;
|
2006-10-06 15:53:48 +00:00
|
|
|
pdvi2->ullVersion = MAKEDLLVERULL(6, 0, 2800, 1612);
|
2003-03-18 18:35:48 +00:00
|
|
|
/* Fall through */
|
|
|
|
case sizeof(DLLVERSIONINFO):
|
2006-10-06 15:53:48 +00:00
|
|
|
pdvi2->info1.dwMajorVersion = 6;
|
2003-03-18 18:35:48 +00:00
|
|
|
pdvi2->info1.dwMinorVersion = 0;
|
2006-10-06 15:53:48 +00:00
|
|
|
pdvi2->info1.dwBuildNumber = 2800;
|
|
|
|
pdvi2->info1.dwPlatformID = DLLVER_PLATFORM_WINDOWS;
|
2003-03-18 18:35:48 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
if (pdvi)
|
2006-10-06 10:43:28 +00:00
|
|
|
WARN("pdvi->cbSize = %d, unhandled\n", pdvi2->info1.cbSize);
|
2003-03-18 18:35:48 +00:00
|
|
|
return E_INVALIDARG;
|
2000-07-26 17:51:32 +00:00
|
|
|
}
|