]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.procore.server.environment/native/msijni.c
Merge "Move debugging options under DevelopmentKeys"
[simantics/platform.git] / bundles / org.simantics.db.procore.server.environment / native / msijni.c
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 #define WIN32_LEAN_AND_MEAN
13 #include <windows.h>
14 #include <Msi.h>
15 #include "jni.h"
16
17 JNIEXPORT jint JNICALL Java_org_simantics_db_procore_server_environment_windows_Msi_MsiQueryProductState0(
18                 JNIEnv* env, jclass clazz, jstring productCode
19 ) {
20         int result;
21         const jchar* lpProductCode;
22
23         lpProductCode = (*env)->GetStringChars(env, productCode, NULL);
24         if (lpProductCode == 0)
25                 return 0;
26
27         result = MsiQueryProductState((LPCTSTR) lpProductCode);
28
29         (*env)->ReleaseStringChars(env, productCode, lpProductCode);
30
31         return (jint) result;
32 }