ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

shlwapi_main.c
Go to the documentation of this file.
00001 /*
00002  * SHLWAPI initialisation
00003  *
00004  *  Copyright 1998 Marcus Meissner
00005  *  Copyright 1998 Juergen Schmied (jsch)
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00020  */
00021 
00022 #include <stdarg.h>
00023 
00024 #include "windef.h"
00025 #include "winbase.h"
00026 #define NO_SHLWAPI_REG
00027 #define NO_SHLWAPI_STREAM
00028 #include "shlwapi.h"
00029 #include "wine/debug.h"
00030 
00031 WINE_DEFAULT_DEBUG_CHANNEL(shell);
00032 
00033 HINSTANCE shlwapi_hInstance = 0;
00034 DWORD SHLWAPI_ThreadRef_index = TLS_OUT_OF_INDEXES;
00035 
00036 /*************************************************************************
00037  * SHLWAPI {SHLWAPI}
00038  *
00039  * The Shell Light-Weight Api dll provides a large number of utility functions
00040  * which are commonly required by Win32 programs. Originally distributed with
00041  * Internet Explorer as a free download, it became a core part of Windows when
00042  * Internet Explorer was 'integrated' into the O/S with the release of Win98.
00043  *
00044  * All functions exported by ordinal are undocumented by MS. The vast majority
00045  * of these are wrappers for Unicode functions that may not exist on early 16
00046  * bit platforms. The remainder perform various small tasks and presumably were
00047  * added to facilitate code reuse amongst the MS developers.
00048  */
00049 
00050 /*************************************************************************
00051  * SHLWAPI DllMain
00052  *
00053  * NOTES
00054  *  calling oleinitialize here breaks sone apps.
00055  */
00056 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
00057 {
00058     TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad);
00059     switch (fdwReason)
00060     {
00061       case DLL_PROCESS_ATTACH:
00062             DisableThreadLibraryCalls(hinstDLL);
00063         shlwapi_hInstance = hinstDLL;
00064         SHLWAPI_ThreadRef_index = TlsAlloc();
00065         break;
00066       case DLL_PROCESS_DETACH:
00067         if (SHLWAPI_ThreadRef_index != TLS_OUT_OF_INDEXES) TlsFree(SHLWAPI_ThreadRef_index);
00068         break;
00069     }
00070     return TRUE;
00071 }
00072 
00073 /***********************************************************************
00074  * DllGetVersion [SHLWAPI.@]
00075  *
00076  * Retrieve "shlwapi.dll" version information.
00077  *
00078  * PARAMS
00079  *     pdvi [O] pointer to version information structure.
00080  *
00081  * RETURNS
00082  *     Success: S_OK. pdvi is updated with the version information
00083  *     Failure: E_INVALIDARG, if pdvi->cbSize is not set correctly.
00084  *
00085  * NOTES
00086  *     You may pass either a DLLVERSIONINFO of DLLVERSIONINFO2 structure
00087  *     as pdvi, provided that the size is set correctly.
00088  *     Returns version as shlwapi.dll from IE5.01.
00089  */
00090 HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
00091 {
00092   DLLVERSIONINFO2 *pdvi2 = (DLLVERSIONINFO2*)pdvi;
00093 
00094   TRACE("(%p)\n",pdvi);
00095 
00096   switch (pdvi2->info1.cbSize)
00097   {
00098   case sizeof(DLLVERSIONINFO2):
00099     pdvi2->dwFlags = 0;
00100     pdvi2->ullVersion = MAKEDLLVERULL(6, 0, 2800, 1612);
00101     /* Fall through */
00102   case sizeof(DLLVERSIONINFO):
00103     pdvi2->info1.dwMajorVersion = 6;
00104     pdvi2->info1.dwMinorVersion = 0;
00105     pdvi2->info1.dwBuildNumber = 2800;
00106     pdvi2->info1.dwPlatformID = DLLVER_PLATFORM_WINDOWS;
00107     return S_OK;
00108  }
00109  if (pdvi)
00110    WARN("pdvi->cbSize = %d, unhandled\n", pdvi2->info1.cbSize);
00111  return E_INVALIDARG;
00112 }

Generated on Sat May 26 2012 04:25:07 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.