public void testSHGetDesktopFolder() { PointerByReference ppshf = new PointerByReference(); WinNT.HRESULT hr = Shell32.INSTANCE.SHGetDesktopFolder(ppshf); assertTrue(W32Errors.SUCCEEDED(hr.intValue())); assertTrue(ppshf.getValue() != null); // should release the interface, but we need Com4JNA to do that. }
/** * New Win32 exception from an error code, usually obtained from GetLastError. * * @param code Error code. */ public Win32Exception(int code) { this(W32Errors.HRESULT_FROM_WIN32(code)); }