Fixed some issues found by winapi_check.
[wine] / dlls / shlwapi / shlwapi_main.c
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 "debugtools.h"
11 #include "shlwapi.h"
12
13 DEFAULT_DEBUG_CHANNEL(shell);
14
15 HINSTANCE shlwapi_hInstance = 0; 
16
17 /*************************************************************************
18  * SHLWAPI LibMain
19  *
20  * NOTES
21  *  calling oleinitialize here breaks sone apps.
22  */
23 BOOL WINAPI SHLWAPI_LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
24 {
25         TRACE("0x%x 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
26         switch (fdwReason)
27         {
28           case DLL_PROCESS_ATTACH:
29             shlwapi_hInstance = hinstDLL;
30             break;
31         }
32         return TRUE;
33 }
34
35 /***********************************************************************
36  * DllGetVersion [SHLWAPI]
37  *
38  * Retrieves version information of the 'SHLWAPI.DLL'
39  *
40  * PARAMS
41  *     pdvi [O] pointer to version information structure.
42  *
43  * RETURNS
44  *     Success: S_OK
45  *     Failure: E_INVALIDARG
46  *
47  * NOTES
48  *     Returns version of a SHLWAPI.dll from IE5.01.
49  */
50
51 HRESULT WINAPI SHLWAPI_DllGetVersion (DLLVERSIONINFO *pdvi)
52 {
53         if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) 
54         {
55           WARN("wrong DLLVERSIONINFO size from app");
56           return E_INVALIDARG;
57         }
58
59         pdvi->dwMajorVersion = 5;
60         pdvi->dwMinorVersion = 0;
61         pdvi->dwBuildNumber = 2314;
62         pdvi->dwPlatformID = 1000;
63
64         TRACE("%lu.%lu.%lu.%lu\n",
65            pdvi->dwMajorVersion, pdvi->dwMinorVersion,
66            pdvi->dwBuildNumber, pdvi->dwPlatformID);
67
68         return S_OK;
69 }