Skip to content

Commit

Permalink
adjust native code
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Nov 22, 2024
1 parent cc516dc commit b000879
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <jni.h>
#include <windows.h>
#include <wincrypt.h>
#include <dpapi.h>
#include "org_cryptomator_windows_keychain_WinDataProtection_Native.h"

JNIEXPORT jbyteArray JNICALL Java_org_cryptomator_windows_keychain_WinDataProtection_00024Native_protect(JNIEnv *env, jobject thisObj, jbyteArray cleartext, jbyteArray salt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void throwIllegalStateException(JNIEnv *env, const char* message) {
JNIEXPORT jint JNICALL Java_org_cryptomator_windows_uiappearance_WinAppearance_00024Native_getCurrentTheme (JNIEnv *env, jobject thisObject){
DWORD data{};
DWORD dataSize = sizeof(data);
LSTATUS status = RegGetValueW(HKEY_CURRENT_USER, L"(Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize)", L"AppsUseLightTheme", RRF_RT_DWORD, NULL, &data, &dataSize);
LSTATUS status = RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", L"AppsUseLightTheme", RRF_RT_DWORD, NULL, &data, &dataSize);
if(status != ERROR_SUCCESS){
char msg[50];
sprintf_s(msg, 50, "Failed to read registry value (status %d)", (int) status);
Expand All @@ -28,7 +28,7 @@ JNIEXPORT jint JNICALL Java_org_cryptomator_windows_uiappearance_WinAppearance_0

JNIEXPORT void JNICALL Java_org_cryptomator_windows_uiappearance_WinAppearance_00024Native_waitForNextThemeChange(JNIEnv *env, jobject thisObj){
HKEY key;
LSTATUS status = RegOpenKeyExW(HKEY_CURRENT_USER, L"(Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize)", 0, KEY_READ, &key);
LSTATUS status = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 0, KEY_READ, &key);
if (status != ERROR_SUCCESS) {
char msg[50];
sprintf_s(msg, 50,"Failed to open registry key (status %d)", (int) status);
Expand Down

0 comments on commit b000879

Please sign in to comment.