2000-07-09 13:19:35 +02:00
|
|
|
/*
|
|
|
|
* SHLWAPI initialisation
|
|
|
|
*
|
|
|
|
* Copyright 1998 Marcus Meissner
|
|
|
|
* Copyright 1998 Juergen Schmied (jsch)
|
2002-03-10 00:29:33 +01: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 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-07-09 13:19:35 +02:00
|
|
|
*/
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
2000-07-09 13:19:35 +02:00
|
|
|
#include "winbase.h"
|
2000-07-26 19:51:32 +02:00
|
|
|
#include "winerror.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2002-07-19 02:25:26 +02:00
|
|
|
#define NO_SHLWAPI_REG
|
2001-12-11 01:30:17 +01:00
|
|
|
#define NO_SHLWAPI_STREAM
|
2000-09-29 03:03:30 +02:00
|
|
|
#include "shlwapi.h"
|
2000-08-03 06:22:35 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
2000-07-09 13:19:35 +02:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
HINSTANCE shlwapi_hInstance = 0;
|
2001-02-13 21:17:59 +01:00
|
|
|
HMODULE SHLWAPI_hshell32 = 0;
|
|
|
|
HMODULE SHLWAPI_hwinmm = 0;
|
|
|
|
HMODULE SHLWAPI_hcomdlg32 = 0;
|
2002-08-16 03:43:11 +02:00
|
|
|
HMODULE SHLWAPI_hcomctl32 = 0;
|
2001-02-13 21:17:59 +01:00
|
|
|
HMODULE SHLWAPI_hmpr = 0;
|
|
|
|
HMODULE SHLWAPI_hmlang = 0;
|
2003-07-22 02:57:25 +02:00
|
|
|
HMODULE SHLWAPI_hurlmon = 0;
|
2002-02-21 21:09:17 +01:00
|
|
|
HMODULE SHLWAPI_hversion = 0;
|
|
|
|
|
2003-07-22 02:57:25 +02:00
|
|
|
DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES;
|
2000-07-09 13:19:35 +02:00
|
|
|
|
2003-03-18 19:35:48 +01:00
|
|
|
/*************************************************************************
|
|
|
|
* SHLWAPI {SHLWAPI}
|
|
|
|
*
|
|
|
|
* The Shell Light-Weight Api dll provides a large number of utility functions
|
|
|
|
* 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 13:19:35 +02:00
|
|
|
/*************************************************************************
|
2002-11-05 00:53:41 +01:00
|
|
|
* SHLWAPI DllMain
|
2000-07-09 13:19:35 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
|
|
|
* calling oleinitialize here breaks sone apps.
|
|
|
|
*/
|
2002-11-05 00:53:41 +01:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
2000-07-09 13:19:35 +02:00
|
|
|
{
|
2002-10-25 05:12:32 +02:00
|
|
|
TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
|
2000-07-09 13:19:35 +02:00
|
|
|
switch (fdwReason)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2003-06-30 22:53:48 +02:00
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
2000-07-09 13:19:35 +02:00
|
|
|
shlwapi_hInstance = hinstDLL;
|
2002-02-21 21:09:17 +01:00
|
|
|
SHLWAPI_ThreadRef_index = TlsAlloc();
|
2000-07-09 13:19:35 +02:00
|
|
|
break;
|
2001-02-13 21:17:59 +01:00
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
if (SHLWAPI_hshell32) FreeLibrary(SHLWAPI_hshell32);
|
|
|
|
if (SHLWAPI_hwinmm) FreeLibrary(SHLWAPI_hwinmm);
|
|
|
|
if (SHLWAPI_hcomdlg32) FreeLibrary(SHLWAPI_hcomdlg32);
|
2002-08-20 01:55:46 +02:00
|
|
|
if (SHLWAPI_hcomctl32) FreeLibrary(SHLWAPI_hcomctl32);
|
2001-02-13 21:17:59 +01:00
|
|
|
if (SHLWAPI_hmpr) FreeLibrary(SHLWAPI_hmpr);
|
|
|
|
if (SHLWAPI_hmlang) FreeLibrary(SHLWAPI_hmlang);
|
2003-07-22 02:57:25 +02:00
|
|
|
if (SHLWAPI_hurlmon) FreeLibrary(SHLWAPI_hurlmon);
|
2002-02-21 21:09:17 +01:00
|
|
|
if (SHLWAPI_hversion) FreeLibrary(SHLWAPI_hversion);
|
2003-07-22 02:57:25 +02:00
|
|
|
if (SHLWAPI_ThreadRef_index != TLS_OUT_OF_INDEXES) TlsFree(SHLWAPI_ThreadRef_index);
|
2001-02-13 21:17:59 +01:00
|
|
|
break;
|
2000-07-09 13:19:35 +02:00
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
2000-07-26 19:51:32 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* DllGetVersion [SHLWAPI.@]
|
2000-07-26 19:51:32 +02:00
|
|
|
*
|
2003-03-18 19:35:48 +01:00
|
|
|
* Retrieve "shlwapi.dll" version information.
|
2000-07-26 19:51:32 +02:00
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* pdvi [O] pointer to version information structure.
|
|
|
|
*
|
|
|
|
* RETURNS
|
2003-03-18 19:35:48 +01:00
|
|
|
* Success: S_OK. pdvi is updated with the version information
|
|
|
|
* Failure: E_INVALIDARG, if pdvi->cbSize is not set correctly.
|
2000-07-26 19:51:32 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
2003-03-18 19:35:48 +01: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 19:51:32 +02:00
|
|
|
*/
|
2005-08-08 19:43:51 +02:00
|
|
|
HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
|
2000-07-26 19:51:32 +02:00
|
|
|
{
|
2003-03-18 19:35:48 +01:00
|
|
|
DLLVERSIONINFO2 *pdvi2 = (DLLVERSIONINFO2*)pdvi;
|
2000-07-26 19:51:32 +02:00
|
|
|
|
2003-03-18 19:35:48 +01:00
|
|
|
TRACE("(%p)\n",pdvi);
|
2000-07-26 19:51:32 +02:00
|
|
|
|
2003-03-18 19:35:48 +01:00
|
|
|
switch (pdvi2->info1.cbSize)
|
|
|
|
{
|
|
|
|
case sizeof(DLLVERSIONINFO2):
|
|
|
|
pdvi2->dwFlags = 0;
|
|
|
|
pdvi2->ullVersion = MAKEDLLVERULL(5, 0, 2314, 0);
|
|
|
|
/* Fall through */
|
|
|
|
case sizeof(DLLVERSIONINFO):
|
|
|
|
pdvi2->info1.dwMajorVersion = 5;
|
|
|
|
pdvi2->info1.dwMinorVersion = 0;
|
|
|
|
pdvi2->info1.dwBuildNumber = 2314;
|
|
|
|
pdvi2->info1.dwPlatformID = 1000;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
if (pdvi)
|
|
|
|
WARN("pdvi->cbSize = %ld, unhandled\n", pdvi2->info1.cbSize);
|
|
|
|
return E_INVALIDARG;
|
2000-07-26 19:51:32 +02:00
|
|
|
}
|