[OpenJDK 2D-Dev] RFR: 8262829: Native crash in Win32PrintServiceLookup.getAllPrinterNames()

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Fri Mar 5 03:51:47 UTC 2021


On Fri, 5 Mar 2021 03:42:29 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp line 136:
>> 
>>> 134: 
>>> 135:     try {
>>> 136:         ::EnumPrinters(flags, NULL, 4, NULL,
>> 
>> Don't we need to check that this method call succeeds? Probably it is a crash reason when the EnumPrinters fails but we use cbNeeded anyway for array allocation?
>
> I guess since we are changing this method anyway, can we use PRINTER_ENUM_CONNECTIONS flag instead of hardcoded 4 so that it is more informative!!

ok, it is for flags and not for level. please ignore

-------------

PR: https://git.openjdk.java.net/jdk/pull/2836


More information about the 2d-dev mailing list