]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/library/os_custom.c
Remove invalid SHA-256-Digests
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / library / os_custom.c
1 /*******************************************************************************
2  * Copyright (c) 2000, 2008 IBM Corporation and others.
3  *
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/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14
15 #include "swt.h"
16 #include "os_structs.h"
17 #include "os_stats.h"
18
19 #define OS_NATIVE(func) Java_org_eclipse_swt_internal_win32_OS_##func
20
21 __declspec(dllexport) HRESULT DllGetVersion(DLLVERSIONINFO *dvi);
22 HRESULT DllGetVersion(DLLVERSIONINFO *dvi)
23 {
24         dvi->dwMajorVersion = SWT_VERSION / 1000;
25         dvi->dwMinorVersion = SWT_VERSION % 1000;
26     dvi->dwBuildNumber = SWT_REVISION;
27         dvi->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
28         return 1;
29 }
30
31 HINSTANCE g_hInstance = NULL;
32 BOOL WINAPI DllMain(HANDLE hInstDLL, DWORD dwReason, LPVOID lpvReserved)
33 {
34         if (dwReason == DLL_PROCESS_ATTACH) {
35                 if (g_hInstance == NULL) g_hInstance = hInstDLL;
36         }
37         return TRUE;
38 }
39
40 #ifndef NO_GetLibraryHandle
41 JNIEXPORT jintLong JNICALL OS_NATIVE(GetLibraryHandle)
42         (JNIEnv *env, jclass that)
43 {
44         jintLong rc;
45         OS_NATIVE_ENTER(env, that, GetLibraryHandle_FUNC)
46         rc = (jintLong)g_hInstance;
47         OS_NATIVE_EXIT(env, that, GetLibraryHandle_FUNC)
48         return rc;
49 }
50 #endif