Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8240518: Incorrect JNU_ReleaseStringPlatformChars in Windows Print
Reviewed-by: serb, pbansal, psadhukhan
  • Loading branch information
Toshio Nakamura committed Mar 9, 2020
1 parent 315635e commit 15a838d31204ac5e526f67125e1c0e67935c90e5
Showing with 5 additions and 4 deletions.
  1. +3 −3 src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp
  2. +2 −1 src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -661,7 +661,7 @@ Java_sun_print_Win32PrintService_getAllResolutions(JNIEnv *env,
}

JNU_ReleaseStringPlatformChars(env, printer, printerName);
JNU_ReleaseStringPlatformChars(env, printer, printerPort);
JNU_ReleaseStringPlatformChars(env, port, printerPort);
return resolutionArray;
}

@@ -804,7 +804,7 @@ Java_sun_print_Win32PrintService_getCapabilities(JNIEnv *env,

RESTORE_CONTROLWORD
JNU_ReleaseStringPlatformChars(env, printer, printerName);
JNU_ReleaseStringPlatformChars(env, printer, printerPort);
JNU_ReleaseStringPlatformChars(env, port, printerPort);
return ret;
}

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -696,6 +696,7 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env,
}
::GlobalUnlock(pd.hDevNames);
}
JNU_ReleaseStringPlatformChars(env, printerName, getName);

if (!samePrinter) {
LPTSTR foundPrinter = NULL;

0 comments on commit 15a838d

Please sign in to comment.