diff options
Diffstat (limited to 'backend/dllversion.c')
-rw-r--r-- | backend/dllversion.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/backend/dllversion.c b/backend/dllversion.c new file mode 100644 index 0000000..50f1653 --- /dev/null +++ b/backend/dllversion.c @@ -0,0 +1,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 */ |