1 | /*
|
---|
2 | * SHLWAPI initialisation
|
---|
3 | *
|
---|
4 | * Copyright 1998 Marcus Meissner
|
---|
5 | * Copyright 1998 Juergen Schmied (jsch)
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "winbase.h"
|
---|
9 | #include "winerror.h"
|
---|
10 | #include "winreg.h"
|
---|
11 | #include "debugtools.h"
|
---|
12 | #define NO_SHLWAPI_STREAM
|
---|
13 | #ifndef __WIN32OS2__
|
---|
14 | #include "shlwapi.h"
|
---|
15 | #endif
|
---|
16 |
|
---|
17 | DEFAULT_DEBUG_CHANNEL(shell);
|
---|
18 |
|
---|
19 | HINSTANCE shlwapi_hInstance = 0;
|
---|
20 | HMODULE SHLWAPI_hshell32 = 0;
|
---|
21 | HMODULE SHLWAPI_hwinmm = 0;
|
---|
22 | HMODULE SHLWAPI_hcomdlg32 = 0;
|
---|
23 | HMODULE SHLWAPI_hmpr = 0;
|
---|
24 | HMODULE SHLWAPI_hmlang = 0;
|
---|
25 |
|
---|
26 | /*************************************************************************
|
---|
27 | * SHLWAPI LibMain
|
---|
28 | *
|
---|
29 | * NOTES
|
---|
30 | * calling oleinitialize here breaks sone apps.
|
---|
31 | */
|
---|
32 | BOOL WINAPI SHLWAPI_LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
---|
33 | {
|
---|
34 | TRACE("0x%x 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
|
---|
35 | switch (fdwReason)
|
---|
36 | {
|
---|
37 | case DLL_PROCESS_ATTACH:
|
---|
38 | shlwapi_hInstance = hinstDLL;
|
---|
39 | break;
|
---|
40 | case DLL_PROCESS_DETACH:
|
---|
41 | if (SHLWAPI_hshell32) FreeLibrary(SHLWAPI_hshell32);
|
---|
42 | if (SHLWAPI_hwinmm) FreeLibrary(SHLWAPI_hwinmm);
|
---|
43 | if (SHLWAPI_hcomdlg32) FreeLibrary(SHLWAPI_hcomdlg32);
|
---|
44 | if (SHLWAPI_hmpr) FreeLibrary(SHLWAPI_hmpr);
|
---|
45 | if (SHLWAPI_hmlang) FreeLibrary(SHLWAPI_hmlang);
|
---|
46 | break;
|
---|
47 | }
|
---|
48 | return TRUE;
|
---|
49 | }
|
---|
50 |
|
---|
51 | /***********************************************************************
|
---|
52 | * DllGetVersion [SHLWAPI.@]
|
---|
53 | *
|
---|
54 | * Retrieves version information of the 'SHLWAPI.DLL'
|
---|
55 | *
|
---|
56 | * PARAMS
|
---|
57 | * pdvi [O] pointer to version information structure.
|
---|
58 | *
|
---|
59 | * RETURNS
|
---|
60 | * Success: S_OK
|
---|
61 | * Failure: E_INVALIDARG
|
---|
62 | *
|
---|
63 | * NOTES
|
---|
64 | * Returns version of a SHLWAPI.dll from IE5.01.
|
---|
65 | */
|
---|
66 |
|
---|
67 | HRESULT WINAPI SHLWAPI_DllGetVersion (DLLVERSIONINFO *pdvi)
|
---|
68 | {
|
---|
69 | if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
|
---|
70 | {
|
---|
71 | WARN("wrong DLLVERSIONINFO size from app\n");
|
---|
72 | return E_INVALIDARG;
|
---|
73 | }
|
---|
74 |
|
---|
75 | pdvi->dwMajorVersion = 5;
|
---|
76 | pdvi->dwMinorVersion = 0;
|
---|
77 | pdvi->dwBuildNumber = 2314;
|
---|
78 | pdvi->dwPlatformID = 1000;
|
---|
79 |
|
---|
80 | TRACE("%lu.%lu.%lu.%lu\n",
|
---|
81 | pdvi->dwMajorVersion, pdvi->dwMinorVersion,
|
---|
82 | pdvi->dwBuildNumber, pdvi->dwPlatformID);
|
---|
83 |
|
---|
84 | return S_OK;
|
---|
85 | }
|
---|