{"action":"created","comment":{"url":"https://api.github.com/repos/AArnott/pinvoke/pulls/comments/44951629","id":44951629,"diff_hunk":"@@ -684,5 +684,67 @@ public static partial class Kernel32\n         /// </returns>\n         [DllImport(nameof(Kernel32), SetLastError = true)]\n         public static extern bool IsWow64Process(SafeObjectHandle hProcess, out bool Wow64Process);\n+\n+        /// <summary>Retrieves the window handle used by the console associated with the calling process.</summary>\n+        /// <returns>\n+        ///     The return value is a handle to the window used by the console associated with the calling process or\n+        ///     <see cref=\"IntPtr.Zero\" /> if there is no such associated console.\n+        /// </returns>\n+        [DllImport(nameof(Kernel32))]\n+        public static extern IntPtr GetConsoleWindow();","path":"src/Kernel32.Desktop/Kernel32.cs","position":11,"original_position":11,"commit_id":"44313d87a946a85e88d1af3dc731bfa8ae7fa9c6","original_commit_id":"44313d87a946a85e88d1af3dc731bfa8ae7fa9c6","user":{"login":"AArnott","id":3548,"avatar_url":"https://avatars.githubusercontent.com/u/3548?v=3","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false},"body":"@ffMathy (since we were talking about this on #56) This is an example of an IntPtr that does represent a handle, but shouldn't be closed by the caller. A typical `SafeHandle` would \"own\" this and want to close it later, which would be a problem.\r\nSo we can leave it as `IntPtr` to avoid the problem. However if all other APIs that would want to consume this handle from its caller take `SafeHandle`, that can make it more difficult. In which case, I wonder if we could create a `SafeUnownedHandle` and type it as that. This type's constructor would assume the handle isn't owned so that Close isn't called, yet it would still be typed as a `SafeHandle`-derived class so other APIs could accept it.","created_at":"2015-11-16T17:10:25Z","updated_at":"2015-11-16T17:10:25Z","html_url":"https://github.com/AArnott/pinvoke/pull/65#discussion_r44951629","pull_request_url":"https://api.github.com/repos/AArnott/pinvoke/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/AArnott/pinvoke/pulls/comments/44951629"},"html":{"href":"https://github.com/AArnott/pinvoke/pull/65#discussion_r44951629"},"pull_request":{"href":"https://api.github.com/repos/AArnott/pinvoke/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/AArnott/pinvoke/pulls/65","id":50826093,"html_url":"https://github.com/AArnott/pinvoke/pull/65","diff_url":"https://github.com/AArnott/pinvoke/pull/65.diff","patch_url":"https://github.com/AArnott/pinvoke/pull/65.patch","issue_url":"https://api.github.com/repos/AArnott/pinvoke/issues/65","number":65,"state":"open","locked":false,"title":"More from kernel32 & advapi32","user":{"login":"vbfox","id":131878,"avatar_url":"https://avatars.githubusercontent.com/u/131878?v=3","gravatar_id":"","url":"https://api.github.com/users/vbfox","html_url":"https://github.com/vbfox","followers_url":"https://api.github.com/users/vbfox/followers","following_url":"https://api.github.com/users/vbfox/following{/other_user}","gists_url":"https://api.github.com/users/vbfox/gists{/gist_id}","starred_url":"https://api.github.com/users/vbfox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbfox/subscriptions","organizations_url":"https://api.github.com/users/vbfox/orgs","repos_url":"https://api.github.com/users/vbfox/repos","events_url":"https://api.github.com/users/vbfox/events{/privacy}","received_events_url":"https://api.github.com/users/vbfox/received_events","type":"User","site_admin":false},"body":"Added :\r\n\r\n* `AdvApi32.OpenProcessToken`\r\n* `AdvApi32.GetTokenInformation`\r\n* `AdvApi32.QueryServiceObjectSecurity`\r\n* `AdvApi32.SetServiceObjectSecurity`\r\n* `Kernel32.GetConsoleWindow`\r\n* `Kernel32.LoadLibrary`\r\n* `Kernel32.FreeLibrary`","created_at":"2015-11-16T15:45:50Z","updated_at":"2015-11-16T17:10:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc4ba6f0421d78b23b650c198aeee7ef663510bf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AArnott/pinvoke/pulls/65/commits","review_comments_url":"https://api.github.com/repos/AArnott/pinvoke/pulls/65/comments","review_comment_url":"https://api.github.com/repos/AArnott/pinvoke/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AArnott/pinvoke/issues/65/comments","statuses_url":"https://api.github.com/repos/AArnott/pinvoke/statuses/44313d87a946a85e88d1af3dc731bfa8ae7fa9c6","head":{"label":"vbfox:more_from_kernel32_advapi32","ref":"more_from_kernel32_advapi32","sha":"44313d87a946a85e88d1af3dc731bfa8ae7fa9c6","user":{"login":"vbfox","id":131878,"avatar_url":"https://avatars.githubusercontent.com/u/131878?v=3","gravatar_id":"","url":"https://api.github.com/users/vbfox","html_url":"https://github.com/vbfox","followers_url":"https://api.github.com/users/vbfox/followers","following_url":"https://api.github.com/users/vbfox/following{/other_user}","gists_url":"https://api.github.com/users/vbfox/gists{/gist_id}","starred_url":"https://api.github.com/users/vbfox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbfox/subscriptions","organizations_url":"https://api.github.com/users/vbfox/orgs","repos_url":"https://api.github.com/users/vbfox/repos","events_url":"https://api.github.com/users/vbfox/events{/privacy}","received_events_url":"https://api.github.com/users/vbfox/received_events","type":"User","site_admin":false},"repo":{"id":44984410,"name":"pinvoke","full_name":"vbfox/pinvoke","owner":{"login":"vbfox","id":131878,"avatar_url":"https://avatars.githubusercontent.com/u/131878?v=3","gravatar_id":"","url":"https://api.github.com/users/vbfox","html_url":"https://github.com/vbfox","followers_url":"https://api.github.com/users/vbfox/followers","following_url":"https://api.github.com/users/vbfox/following{/other_user}","gists_url":"https://api.github.com/users/vbfox/gists{/gist_id}","starred_url":"https://api.github.com/users/vbfox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbfox/subscriptions","organizations_url":"https://api.github.com/users/vbfox/orgs","repos_url":"https://api.github.com/users/vbfox/repos","events_url":"https://api.github.com/users/vbfox/events{/privacy}","received_events_url":"https://api.github.com/users/vbfox/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vbfox/pinvoke","description":"A library containing all PInvoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.","fork":true,"url":"https://api.github.com/repos/vbfox/pinvoke","forks_url":"https://api.github.com/repos/vbfox/pinvoke/forks","keys_url":"https://api.github.com/repos/vbfox/pinvoke/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vbfox/pinvoke/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vbfox/pinvoke/teams","hooks_url":"https://api.github.com/repos/vbfox/pinvoke/hooks","issue_events_url":"https://api.github.com/repos/vbfox/pinvoke/issues/events{/number}","events_url":"https://api.github.com/repos/vbfox/pinvoke/events","assignees_url":"https://api.github.com/repos/vbfox/pinvoke/assignees{/user}","branches_url":"https://api.github.com/repos/vbfox/pinvoke/branches{/branch}","tags_url":"https://api.github.com/repos/vbfox/pinvoke/tags","blobs_url":"https://api.github.com/repos/vbfox/pinvoke/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vbfox/pinvoke/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vbfox/pinvoke/git/refs{/sha}","trees_url":"https://api.github.com/repos/vbfox/pinvoke/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vbfox/pinvoke/statuses/{sha}","languages_url":"https://api.github.com/repos/vbfox/pinvoke/languages","stargazers_url":"https://api.github.com/repos/vbfox/pinvoke/stargazers","contributors_url":"https://api.github.com/repos/vbfox/pinvoke/contributors","subscribers_url":"https://api.github.com/repos/vbfox/pinvoke/subscribers","subscription_url":"https://api.github.com/repos/vbfox/pinvoke/subscription","commits_url":"https://api.github.com/repos/vbfox/pinvoke/commits{/sha}","git_commits_url":"https://api.github.com/repos/vbfox/pinvoke/git/commits{/sha}","comments_url":"https://api.github.com/repos/vbfox/pinvoke/comments{/number}","issue_comment_url":"https://api.github.com/repos/vbfox/pinvoke/issues/comments{/number}","contents_url":"https://api.github.com/repos/vbfox/pinvoke/contents/{+path}","compare_url":"https://api.github.com/repos/vbfox/pinvoke/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vbfox/pinvoke/merges","archive_url":"https://api.github.com/repos/vbfox/pinvoke/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vbfox/pinvoke/downloads","issues_url":"https://api.github.com/repos/vbfox/pinvoke/issues{/number}","pulls_url":"https://api.github.com/repos/vbfox/pinvoke/pulls{/number}","milestones_url":"https://api.github.com/repos/vbfox/pinvoke/milestones{/number}","notifications_url":"https://api.github.com/repos/vbfox/pinvoke/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vbfox/pinvoke/labels{/name}","releases_url":"https://api.github.com/repos/vbfox/pinvoke/releases{/id}","created_at":"2015-10-26T17:09:31Z","updated_at":"2015-11-01T21:11:46Z","pushed_at":"2015-11-16T16:09:06Z","git_url":"git://github.com/vbfox/pinvoke.git","ssh_url":"git@github.com:vbfox/pinvoke.git","clone_url":"https://github.com/vbfox/pinvoke.git","svn_url":"https://github.com/vbfox/pinvoke","homepage":null,"size":950,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"AArnott:master","ref":"master","sha":"63f9ed2511b68d5917be1e4dc284452355329f1c","user":{"login":"AArnott","id":3548,"avatar_url":"https://avatars.githubusercontent.com/u/3548?v=3","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false},"repo":{"id":44758360,"name":"pinvoke","full_name":"AArnott/pinvoke","owner":{"login":"AArnott","id":3548,"avatar_url":"https://avatars.githubusercontent.com/u/3548?v=3","gravatar_id":"","url":"https://api.github.com/users/AArnott","html_url":"https://github.com/AArnott","followers_url":"https://api.github.com/users/AArnott/followers","following_url":"https://api.github.com/users/AArnott/following{/other_user}","gists_url":"https://api.github.com/users/AArnott/gists{/gist_id}","starred_url":"https://api.github.com/users/AArnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AArnott/subscriptions","organizations_url":"https://api.github.com/users/AArnott/orgs","repos_url":"https://api.github.com/users/AArnott/repos","events_url":"https://api.github.com/users/AArnott/events{/privacy}","received_events_url":"https://api.github.com/users/AArnott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AArnott/pinvoke","description":"A library containing all PInvoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.","fork":false,"url":"https://api.github.com/repos/AArnott/pinvoke","forks_url":"https://api.github.com/repos/AArnott/pinvoke/forks","keys_url":"https://api.github.com/repos/AArnott/pinvoke/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AArnott/pinvoke/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AArnott/pinvoke/teams","hooks_url":"https://api.github.com/repos/AArnott/pinvoke/hooks","issue_events_url":"https://api.github.com/repos/AArnott/pinvoke/issues/events{/number}","events_url":"https://api.github.com/repos/AArnott/pinvoke/events","assignees_url":"https://api.github.com/repos/AArnott/pinvoke/assignees{/user}","branches_url":"https://api.github.com/repos/AArnott/pinvoke/branches{/branch}","tags_url":"https://api.github.com/repos/AArnott/pinvoke/tags","blobs_url":"https://api.github.com/repos/AArnott/pinvoke/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AArnott/pinvoke/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AArnott/pinvoke/git/refs{/sha}","trees_url":"https://api.github.com/repos/AArnott/pinvoke/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AArnott/pinvoke/statuses/{sha}","languages_url":"https://api.github.com/repos/AArnott/pinvoke/languages","stargazers_url":"https://api.github.com/repos/AArnott/pinvoke/stargazers","contributors_url":"https://api.github.com/repos/AArnott/pinvoke/contributors","subscribers_url":"https://api.github.com/repos/AArnott/pinvoke/subscribers","subscription_url":"https://api.github.com/repos/AArnott/pinvoke/subscription","commits_url":"https://api.github.com/repos/AArnott/pinvoke/commits{/sha}","git_commits_url":"https://api.github.com/repos/AArnott/pinvoke/git/commits{/sha}","comments_url":"https://api.github.com/repos/AArnott/pinvoke/comments{/number}","issue_comment_url":"https://api.github.com/repos/AArnott/pinvoke/issues/comments{/number}","contents_url":"https://api.github.com/repos/AArnott/pinvoke/contents/{+path}","compare_url":"https://api.github.com/repos/AArnott/pinvoke/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AArnott/pinvoke/merges","archive_url":"https://api.github.com/repos/AArnott/pinvoke/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AArnott/pinvoke/downloads","issues_url":"https://api.github.com/repos/AArnott/pinvoke/issues{/number}","pulls_url":"https://api.github.com/repos/AArnott/pinvoke/pulls{/number}","milestones_url":"https://api.github.com/repos/AArnott/pinvoke/milestones{/number}","notifications_url":"https://api.github.com/repos/AArnott/pinvoke/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AArnott/pinvoke/labels{/name}","releases_url":"https://api.github.com/repos/AArnott/pinvoke/releases{/id}","created_at":"2015-10-22T16:28:01Z","updated_at":"2015-11-12T22:09:54Z","pushed_at":"2015-11-16T16:44:04Z","git_url":"git://github.com/AArnott/pinvoke.git","ssh_url":"git@github.com:AArnott/pinvoke.git","clone_url":"https://github.com/AArnott/pinvoke.git","svn_url":"https://github.com/AArnott/pinvoke","homepage":null,"size":1384,"stargazers_count":17,"watchers_count":17,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":10,"forks":5,"open_issues":10,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AArnott/pinvoke/pulls/65"},"html":{"href":"https://github.com/AArnott/pinvoke/pull/65"},"issue":{"href":"https://api.github.com/repos/AArnott/pinvoke/issues/65"},"comments":{"href":"https://api.github.com/repos/AArnott/pinvoke/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/AArnott/pinvoke/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/AArnott/pinvoke/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AArnott/pinvoke/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/AArnott/pinvoke/statuses/44313d87a946a85e88d1af3dc731bfa8ae7fa9c6"}}}}