<AWT Dev> RFR: 6508941: java.awt.Desktop.open causes VM to crash with video files sporadically

Sergey Bylokhov serb at openjdk.java.net
Sat Nov 21 22:23:15 UTC 2020


The report of this bug quite outdated so can be closed but I found that in the documentation:
https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea

> Because ShellExecute can delegate execution to Shell extensions (data sources, context menu handlers, verb implementations) that are activated using Component Object Model (COM), COM should be initialized before ShellExecute is called. Some Shell extensions require the COM single-threaded apartment (STA) type. In that case, COM should be initialized as shown here: CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)

But this CoInitializeEx is missed in the Desktop class. Absent of this initialization caused some other crashes in past, see JDK-6950553 for example:
https://bugs.openjdk.java.net/browse/JDK-6950553

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

Commit messages:
 - Initial fix

Changes: https://git.openjdk.java.net/jdk/pull/1369/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1369&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-6508941
  Stats: 14 lines in 1 file changed: 11 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1369.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1369/head:pull/1369

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


More information about the awt-dev mailing list