diff --git a/contrib/platform/test/com/sun/jna/platform/win32/COM/IShellFolderTest.java b/contrib/platform/test/com/sun/jna/platform/win32/COM/IShellFolderTest.java index 99df41ea25..24b2467bad 100644 --- a/contrib/platform/test/com/sun/jna/platform/win32/COM/IShellFolderTest.java +++ b/contrib/platform/test/com/sun/jna/platform/win32/COM/IShellFolderTest.java @@ -27,13 +27,19 @@ */ import com.sun.jna.Pointer; -import junit.framework.TestCase; - -import com.sun.jna.platform.win32.*; +import com.sun.jna.platform.win32.Guid; import com.sun.jna.platform.win32.Guid.REFIID; +import com.sun.jna.platform.win32.Ole32; import com.sun.jna.platform.win32.ShTypes.STRRET; +import com.sun.jna.platform.win32.Shell32; +import com.sun.jna.platform.win32.ShlObj; +import com.sun.jna.platform.win32.Shlwapi; +import com.sun.jna.platform.win32.WinNT; +import com.sun.jna.ptr.IntByReference; import com.sun.jna.ptr.PointerByReference; +import junit.framework.TestCase; + public class IShellFolderTest extends TestCase { static { ClassLoader.getSystemClassLoader().setDefaultAssertionStatus(true); @@ -102,4 +108,20 @@ public void testEnumObjects() throws Exception { peidl.Release(); assertTrue(sawNames); // We should see at least one item with a name } + + public void testParseDisplayName() throws Exception { + String directory = System.getenv("WinDir"); + + IntByReference pchEaten = new IntByReference(); + PointerByReference ppidl = new PointerByReference(); + IntByReference pdwAttributes = new IntByReference(); + PointerByReference desktopFolder = new PointerByReference(); + + WinNT.HRESULT hResult = Shell32.INSTANCE.SHGetDesktopFolder(desktopFolder); + assertEquals(COMUtils.S_OK, hResult.intValue()); + + IShellFolder shellFolder = IShellFolder.Converter.PointerToIShellFolder(desktopFolder); + hResult = shellFolder.ParseDisplayName(null, null, directory, pchEaten, ppidl, pdwAttributes); + assertEquals(COMUtils.S_OK, hResult.intValue()); + } } \ No newline at end of file