{"action":"created","comment":{"url":"https://api.github.com/repos/java-native-access/jna/pulls/comments/44872838","id":44872838,"diff_hunk":"@@ -131,16 +135,89 @@ public void testResizeDesktopFromTop() throws InterruptedException {\n \n     }\n \n-    public void testSHGetKnownFolderPath()\n-    {\n-        int flags = ShlObj.KNOWN_FOLDER_FLAG.NONE.getFlag();\n-        PointerByReference outPath = new PointerByReference();\n-        HANDLE token = null;\n-        GUID guid = KnownFolders.FOLDERID_Fonts;\n-        HRESULT hr = Shell32.INSTANCE.SHGetKnownFolderPath(guid, flags, token, outPath);\n-\n-        Ole32.INSTANCE.CoTaskMemFree(outPath.getValue());\n-\n-        assertTrue(W32Errors.SUCCEEDED(hr.intValue()));\n-    }\n+\tpublic void testSHGetKnownFolderPath() {\n+\t\tint flags = ShlObj.KNOWN_FOLDER_FLAG.NONE.getFlag();\n+\t\tPointerByReference outPath = new PointerByReference();\n+\t\tHANDLE token = null;\n+\t\tGUID guid = KnownFolders.FOLDERID_Fonts;\n+\t\tHRESULT hr = Shell32.INSTANCE.SHGetKnownFolderPath(guid, flags, token, outPath);\n+\n+\t\tOle32.INSTANCE.CoTaskMemFree(outPath.getValue());\n+\n+\t\tassertTrue(W32Errors.SUCCEEDED(hr.intValue()));\n+\t}\n+\n+\tpublic void testSHEmptyRecycleBin() {\n+\t\tFile file = new File(System.getProperty(\"java.io.tmpdir\") + System.nanoTime() + \".txt\");\n+\t\ttry {\n+\t\t\t// Create a file and immediately send it to the recycle bin.\n+\t\t\ttry {\n+\t\t\t\tfillTempFile(file);\n+\t\t\t\tW32FileUtils.getInstance().moveToTrash(new File[] { file });\n+\t\t\t} catch (IOException e) {\n+\t\t\t\tthrow new RuntimeException(e);\n+\t\t\t}\n+\n+\t\t\tint result = Shell32.INSTANCE.SHEmptyRecycleBin(null, null,\n+\t\t\t\t\tShell32.SHERB_NOCONFIRMATION | Shell32.SHERB_NOPROGRESSUI | Shell32.SHERB_NOSOUND);\n+\t\t\t// for reasons I can not find documented, the function returns the\n+\t\t\t// following:\n+\t\t\t// -2147418113 when the recycle bin has no items in it\n+\t\t\t// 0 when the recycle bin has items in it\n+\t\t\tassertTrue(\"Result should have been 0 when emptying Recycle Bin - there should have been a file in it.\",\n+\t\t\t\t\tresult == 0);","path":"contrib/platform/test/com/sun/jna/platform/win32/Shell32Test.java","position":73,"original_position":73,"commit_id":"d8876fcd6043c4a62dc574fb5fea17e33c89d2b3","original_commit_id":"d8876fcd6043c4a62dc574fb5fea17e33c89d2b3","user":{"login":"lgoldstein","id":1436205,"avatar_url":"https://avatars.githubusercontent.com/u/1436205?v=3","gravatar_id":"","url":"https://api.github.com/users/lgoldstein","html_url":"https://github.com/lgoldstein","followers_url":"https://api.github.com/users/lgoldstein/followers","following_url":"https://api.github.com/users/lgoldstein/following{/other_user}","gists_url":"https://api.github.com/users/lgoldstein/gists{/gist_id}","starred_url":"https://api.github.com/users/lgoldstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgoldstein/subscriptions","organizations_url":"https://api.github.com/users/lgoldstein/orgs","repos_url":"https://api.github.com/users/lgoldstein/repos","events_url":"https://api.github.com/users/lgoldstein/events{/privacy}","received_events_url":"https://api.github.com/users/lgoldstein/received_events","type":"User","site_admin":false},"body":"Use _assertEquals_ in case the non-zero value can help diagnose why the test failed.","created_at":"2015-11-15T15:11:06Z","updated_at":"2015-11-15T15:11:06Z","html_url":"https://github.com/java-native-access/jna/pull/535#discussion_r44872838","pull_request_url":"https://api.github.com/repos/java-native-access/jna/pulls/535","_links":{"self":{"href":"https://api.github.com/repos/java-native-access/jna/pulls/comments/44872838"},"html":{"href":"https://github.com/java-native-access/jna/pull/535#discussion_r44872838"},"pull_request":{"href":"https://api.github.com/repos/java-native-access/jna/pulls/535"}}},"pull_request":{"url":"https://api.github.com/repos/java-native-access/jna/pulls/535","id":50712450,"html_url":"https://github.com/java-native-access/jna/pull/535","diff_url":"https://github.com/java-native-access/jna/pull/535.diff","patch_url":"https://github.com/java-native-access/jna/pull/535.patch","issue_url":"https://api.github.com/repos/java-native-access/jna/issues/535","number":535,"state":"open","locked":false,"title":"6 Win32 function stubs, 8 constants, 1 structure, and 1 helper function","user":{"login":"mlfreeman2","id":5781383,"avatar_url":"https://avatars.githubusercontent.com/u/5781383?v=3","gravatar_id":"","url":"https://api.github.com/users/mlfreeman2","html_url":"https://github.com/mlfreeman2","followers_url":"https://api.github.com/users/mlfreeman2/followers","following_url":"https://api.github.com/users/mlfreeman2/following{/other_user}","gists_url":"https://api.github.com/users/mlfreeman2/gists{/gist_id}","starred_url":"https://api.github.com/users/mlfreeman2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlfreeman2/subscriptions","organizations_url":"https://api.github.com/users/mlfreeman2/orgs","repos_url":"https://api.github.com/users/mlfreeman2/repos","events_url":"https://api.github.com/users/mlfreeman2/events{/privacy}","received_events_url":"https://api.github.com/users/mlfreeman2/received_events","type":"User","site_admin":false},"body":"* Advapi32\r\n\t* Added LOGON_WITH_PROFILE constant\r\n\t* Added LOGON_NETCREDENTIALS_ONLY constant\r\n\t* Added CreateProcessWithLogonW(String, String, String, int, String, String, int, Pointer, String, STARTUPINFO, PROCESS_INFORMATION)\r\n\t\t* No Unit Test - I would have to make it create a user to be 100% able to run a process as another user and that would be a security issue I figure.\r\n* Crypt32\r\n\t* Added CertAddEncodedCertificateToSystemStore(String, Pointer, DWORD)\r\n\t\t* No Unit Test - I doubt anyone would want the security risk of a unit test installing a root certificate.\r\n* GDI32\r\n\t* Added SRCCOPY constant\r\n\t* Added BitBlt(HDC, int, int, int, int, HDC, int, int, int)\r\n\t\t* No direct unit test - the test for GDI32Util.getScreenshot() seemed to cover it just fine.\r\n\t* Added GDI32Util.getScreenshot(HWND)\r\n\t\t* Added unit test as GDI32UtilTest.testGetScreenshot()\r\n* Shell32\r\n\t* Added SHERB_NOCONFIRMATION constant\r\n\t* Added SHERB_NOPROGRESSUI constant\r\n\t* Added SHERB_NOSOUND constant\r\n\t* Added SEE_MASK_NOCLOSEPROCESS constant\r\n\t* Added SHEmptyRecycleBin(HANDLE, String, int)\r\n\t\t* No unit test - no idea how to tell if the recycle bin is empty afterwards\r\n\t* Added ShellExecuteEx(SHELLEXECUTEINFO)\r\n\t\t* No unit test - there are a bunch of cases where the hProcess member in SHELLEXECUTEINFO isn't set - not sure how to control for that\r\n* ShellAPI\r\n\t* Added SHELLEXECUTEINFO structure\r\n* User32\r\n\t* Added GetDesktopWindow()\r\n\t\t* Added test as User32Test.testGetDesktopWindow()\r\n* WinGDI\r\n\t* Added HGDI_ERROR\r\n\t* Removed superfluous \"public\" and \"public final\" from WinGDI\r\n\r\n==================================\r\n\r\nHopefully this is more manageable and more acceptable than my last way-too-large pull request","created_at":"2015-11-14T01:39:20Z","updated_at":"2015-11-15T15:11:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ae889b364d00420d5f9c386abf5d75a8530577e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/java-native-access/jna/pulls/535/commits","review_comments_url":"https://api.github.com/repos/java-native-access/jna/pulls/535/comments","review_comment_url":"https://api.github.com/repos/java-native-access/jna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/java-native-access/jna/issues/535/comments","statuses_url":"https://api.github.com/repos/java-native-access/jna/statuses/d8876fcd6043c4a62dc574fb5fea17e33c89d2b3","head":{"label":"mlfreeman2:master","ref":"master","sha":"d8876fcd6043c4a62dc574fb5fea17e33c89d2b3","user":{"login":"mlfreeman2","id":5781383,"avatar_url":"https://avatars.githubusercontent.com/u/5781383?v=3","gravatar_id":"","url":"https://api.github.com/users/mlfreeman2","html_url":"https://github.com/mlfreeman2","followers_url":"https://api.github.com/users/mlfreeman2/followers","following_url":"https://api.github.com/users/mlfreeman2/following{/other_user}","gists_url":"https://api.github.com/users/mlfreeman2/gists{/gist_id}","starred_url":"https://api.github.com/users/mlfreeman2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlfreeman2/subscriptions","organizations_url":"https://api.github.com/users/mlfreeman2/orgs","repos_url":"https://api.github.com/users/mlfreeman2/repos","events_url":"https://api.github.com/users/mlfreeman2/events{/privacy}","received_events_url":"https://api.github.com/users/mlfreeman2/received_events","type":"User","site_admin":false},"repo":{"id":26344047,"name":"jna","full_name":"mlfreeman2/jna","owner":{"login":"mlfreeman2","id":5781383,"avatar_url":"https://avatars.githubusercontent.com/u/5781383?v=3","gravatar_id":"","url":"https://api.github.com/users/mlfreeman2","html_url":"https://github.com/mlfreeman2","followers_url":"https://api.github.com/users/mlfreeman2/followers","following_url":"https://api.github.com/users/mlfreeman2/following{/other_user}","gists_url":"https://api.github.com/users/mlfreeman2/gists{/gist_id}","starred_url":"https://api.github.com/users/mlfreeman2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlfreeman2/subscriptions","organizations_url":"https://api.github.com/users/mlfreeman2/orgs","repos_url":"https://api.github.com/users/mlfreeman2/repos","events_url":"https://api.github.com/users/mlfreeman2/events{/privacy}","received_events_url":"https://api.github.com/users/mlfreeman2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mlfreeman2/jna","description":"Java Native Access","fork":true,"url":"https://api.github.com/repos/mlfreeman2/jna","forks_url":"https://api.github.com/repos/mlfreeman2/jna/forks","keys_url":"https://api.github.com/repos/mlfreeman2/jna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mlfreeman2/jna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mlfreeman2/jna/teams","hooks_url":"https://api.github.com/repos/mlfreeman2/jna/hooks","issue_events_url":"https://api.github.com/repos/mlfreeman2/jna/issues/events{/number}","events_url":"https://api.github.com/repos/mlfreeman2/jna/events","assignees_url":"https://api.github.com/repos/mlfreeman2/jna/assignees{/user}","branches_url":"https://api.github.com/repos/mlfreeman2/jna/branches{/branch}","tags_url":"https://api.github.com/repos/mlfreeman2/jna/tags","blobs_url":"https://api.github.com/repos/mlfreeman2/jna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mlfreeman2/jna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mlfreeman2/jna/git/refs{/sha}","trees_url":"https://api.github.com/repos/mlfreeman2/jna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mlfreeman2/jna/statuses/{sha}","languages_url":"https://api.github.com/repos/mlfreeman2/jna/languages","stargazers_url":"https://api.github.com/repos/mlfreeman2/jna/stargazers","contributors_url":"https://api.github.com/repos/mlfreeman2/jna/contributors","subscribers_url":"https://api.github.com/repos/mlfreeman2/jna/subscribers","subscription_url":"https://api.github.com/repos/mlfreeman2/jna/subscription","commits_url":"https://api.github.com/repos/mlfreeman2/jna/commits{/sha}","git_commits_url":"https://api.github.com/repos/mlfreeman2/jna/git/commits{/sha}","comments_url":"https://api.github.com/repos/mlfreeman2/jna/comments{/number}","issue_comment_url":"https://api.github.com/repos/mlfreeman2/jna/issues/comments{/number}","contents_url":"https://api.github.com/repos/mlfreeman2/jna/contents/{+path}","compare_url":"https://api.github.com/repos/mlfreeman2/jna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mlfreeman2/jna/merges","archive_url":"https://api.github.com/repos/mlfreeman2/jna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mlfreeman2/jna/downloads","issues_url":"https://api.github.com/repos/mlfreeman2/jna/issues{/number}","pulls_url":"https://api.github.com/repos/mlfreeman2/jna/pulls{/number}","milestones_url":"https://api.github.com/repos/mlfreeman2/jna/milestones{/number}","notifications_url":"https://api.github.com/repos/mlfreeman2/jna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mlfreeman2/jna/labels{/name}","releases_url":"https://api.github.com/repos/mlfreeman2/jna/releases{/id}","created_at":"2014-11-08T00:09:59Z","updated_at":"2015-10-31T14:24:51Z","pushed_at":"2015-11-15T12:37:15Z","git_url":"git://github.com/mlfreeman2/jna.git","ssh_url":"git@github.com:mlfreeman2/jna.git","clone_url":"https://github.com/mlfreeman2/jna.git","svn_url":"https://github.com/mlfreeman2/jna","homepage":"","size":243817,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"java-native-access:master","ref":"master","sha":"23ef0b4072469978769e01d00c8e1ebc93087fcb","user":{"login":"java-native-access","id":13812895,"avatar_url":"https://avatars.githubusercontent.com/u/13812895?v=3","gravatar_id":"","url":"https://api.github.com/users/java-native-access","html_url":"https://github.com/java-native-access","followers_url":"https://api.github.com/users/java-native-access/followers","following_url":"https://api.github.com/users/java-native-access/following{/other_user}","gists_url":"https://api.github.com/users/java-native-access/gists{/gist_id}","starred_url":"https://api.github.com/users/java-native-access/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/java-native-access/subscriptions","organizations_url":"https://api.github.com/users/java-native-access/orgs","repos_url":"https://api.github.com/users/java-native-access/repos","events_url":"https://api.github.com/users/java-native-access/events{/privacy}","received_events_url":"https://api.github.com/users/java-native-access/received_events","type":"Organization","site_admin":false},"repo":{"id":1680733,"name":"jna","full_name":"java-native-access/jna","owner":{"login":"java-native-access","id":13812895,"avatar_url":"https://avatars.githubusercontent.com/u/13812895?v=3","gravatar_id":"","url":"https://api.github.com/users/java-native-access","html_url":"https://github.com/java-native-access","followers_url":"https://api.github.com/users/java-native-access/followers","following_url":"https://api.github.com/users/java-native-access/following{/other_user}","gists_url":"https://api.github.com/users/java-native-access/gists{/gist_id}","starred_url":"https://api.github.com/users/java-native-access/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/java-native-access/subscriptions","organizations_url":"https://api.github.com/users/java-native-access/orgs","repos_url":"https://api.github.com/users/java-native-access/repos","events_url":"https://api.github.com/users/java-native-access/events{/privacy}","received_events_url":"https://api.github.com/users/java-native-access/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/java-native-access/jna","description":"Java Native Access","fork":false,"url":"https://api.github.com/repos/java-native-access/jna","forks_url":"https://api.github.com/repos/java-native-access/jna/forks","keys_url":"https://api.github.com/repos/java-native-access/jna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/java-native-access/jna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/java-native-access/jna/teams","hooks_url":"https://api.github.com/repos/java-native-access/jna/hooks","issue_events_url":"https://api.github.com/repos/java-native-access/jna/issues/events{/number}","events_url":"https://api.github.com/repos/java-native-access/jna/events","assignees_url":"https://api.github.com/repos/java-native-access/jna/assignees{/user}","branches_url":"https://api.github.com/repos/java-native-access/jna/branches{/branch}","tags_url":"https://api.github.com/repos/java-native-access/jna/tags","blobs_url":"https://api.github.com/repos/java-native-access/jna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/java-native-access/jna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/java-native-access/jna/git/refs{/sha}","trees_url":"https://api.github.com/repos/java-native-access/jna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/java-native-access/jna/statuses/{sha}","languages_url":"https://api.github.com/repos/java-native-access/jna/languages","stargazers_url":"https://api.github.com/repos/java-native-access/jna/stargazers","contributors_url":"https://api.github.com/repos/java-native-access/jna/contributors","subscribers_url":"https://api.github.com/repos/java-native-access/jna/subscribers","subscription_url":"https://api.github.com/repos/java-native-access/jna/subscription","commits_url":"https://api.github.com/repos/java-native-access/jna/commits{/sha}","git_commits_url":"https://api.github.com/repos/java-native-access/jna/git/commits{/sha}","comments_url":"https://api.github.com/repos/java-native-access/jna/comments{/number}","issue_comment_url":"https://api.github.com/repos/java-native-access/jna/issues/comments{/number}","contents_url":"https://api.github.com/repos/java-native-access/jna/contents/{+path}","compare_url":"https://api.github.com/repos/java-native-access/jna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/java-native-access/jna/merges","archive_url":"https://api.github.com/repos/java-native-access/jna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/java-native-access/jna/downloads","issues_url":"https://api.github.com/repos/java-native-access/jna/issues{/number}","pulls_url":"https://api.github.com/repos/java-native-access/jna/pulls{/number}","milestones_url":"https://api.github.com/repos/java-native-access/jna/milestones{/number}","notifications_url":"https://api.github.com/repos/java-native-access/jna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/java-native-access/jna/labels{/name}","releases_url":"https://api.github.com/repos/java-native-access/jna/releases{/id}","created_at":"2011-04-29T13:30:29Z","updated_at":"2015-11-15T12:43:10Z","pushed_at":"2015-11-15T12:37:16Z","git_url":"git://github.com/java-native-access/jna.git","ssh_url":"git@github.com:java-native-access/jna.git","clone_url":"https://github.com/java-native-access/jna.git","svn_url":"https://github.com/java-native-access/jna","homepage":"","size":260406,"stargazers_count":1970,"watchers_count":1970,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":580,"mirror_url":null,"open_issues_count":84,"forks":580,"open_issues":84,"watchers":1970,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/java-native-access/jna/pulls/535"},"html":{"href":"https://github.com/java-native-access/jna/pull/535"},"issue":{"href":"https://api.github.com/repos/java-native-access/jna/issues/535"},"comments":{"href":"https://api.github.com/repos/java-native-access/jna/issues/535/comments"},"review_comments":{"href":"https://api.github.com/repos/java-native-access/jna/pulls/535/comments"},"review_comment":{"href":"https://api.github.com/repos/java-native-access/jna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/java-native-access/jna/pulls/535/commits"},"statuses":{"href":"https://api.github.com/repos/java-native-access/jna/statuses/d8876fcd6043c4a62dc574fb5fea17e33c89d2b3"}}}}