summaryrefslogtreecommitdiff
path: root/backend/dllversion.c
blob: 50f1653a5f94e984be549a617bead02b24877b72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* Sed: http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/versions.asp */
#if defined (_WIN32) && (defined(_USRDLL) || defined(DLL_EXPORT) || defined(PIC))
#include <windows.h>
#include <shlwapi.h>

#ifdef __cplusplus
extern "C"
{
#endif

__declspec(dllexport) HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi);

#ifdef __cplusplus
}
#endif

HRESULT DllGetVersion (DLLVERSIONINFO2* pdvi)
{
	if (!pdvi || (sizeof(*pdvi) != pdvi->info1.cbSize))
		return (E_INVALIDARG);
		
	pdvi->info1.dwMajorVersion = 2;
	pdvi->info1.dwMinorVersion = 4;
	pdvi->info1.dwBuildNumber = 2;
	pdvi->info1.dwPlatformID = DLLVER_PLATFORM_WINDOWS;
	if (sizeof(DLLVERSIONINFO2) == pdvi->info1.cbSize)
		pdvi->ullVersion = MAKEDLLVERULL(2, 4, 2, 0);
	
	return S_OK;
}
#endif /* _WIN32 */