1 /*******************************************************************************
2 * Copyright (c) 2000, 2008 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
16 #include "os_structs.h"
19 #define OS_NATIVE(func) Java_org_eclipse_swt_internal_win32_OS_##func
21 __declspec(dllexport) HRESULT DllGetVersion(DLLVERSIONINFO *dvi);
22 HRESULT DllGetVersion(DLLVERSIONINFO *dvi)
24 dvi->dwMajorVersion = SWT_VERSION / 1000;
25 dvi->dwMinorVersion = SWT_VERSION % 1000;
26 dvi->dwBuildNumber = SWT_REVISION;
27 dvi->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
31 HINSTANCE g_hInstance = NULL;
32 BOOL WINAPI DllMain(HANDLE hInstDLL, DWORD dwReason, LPVOID lpvReserved)
34 if (dwReason == DLL_PROCESS_ATTACH) {
35 if (g_hInstance == NULL) g_hInstance = hInstDLL;
40 #ifndef NO_GetLibraryHandle
41 JNIEXPORT jintLong JNICALL OS_NATIVE(GetLibraryHandle)
42 (JNIEnv *env, jclass that)
45 OS_NATIVE_ENTER(env, that, GetLibraryHandle_FUNC)
46 rc = (jintLong)g_hInstance;
47 OS_NATIVE_EXIT(env, that, GetLibraryHandle_FUNC)