aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/windows/src/native/winutil.c
blob: 93606dddc258c26f2b3f38ca00d9ea453b9e4e73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * %W% %E%
 *
 * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

#include "winutil.h"

jbyteArray wrapGUID(JNIEnv *env, const GUID *guid) {
	jbyteArray guid_array = (*env)->NewByteArray(env, sizeof(GUID));
	if (guid_array == NULL)
		return NULL;
	(*env)->SetByteArrayRegion(env, guid_array, 0, sizeof(GUID), (jbyte *)guid);
	return guid_array;
}

void unwrapGUID(JNIEnv *env, const jobjectArray byte_array, GUID *guid) {
	(*env)->GetByteArrayRegion(env, byte_array, 0, sizeof(GUID), (jbyte *)guid);
}