GitHub PullRequestReviewCommentEvent at 2014-11-24 22:13:36
Repository: PerMonitorDpi
Actor: paulcbetts
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/comments/20826888","id":20826888,"diff_hunk":"@@ -104,6 +107,37 @@ static class SafeNativeMethods\n \n         [DllImport(\"shcore.dll\")]\n         internal static extern uint GetDpiForMonitor(IntPtr hmonitor, MonitorDpiType dpiType, out uint dpiX, out uint dpiY);\n+\n+\n+        // Note: this methods are taken from https://raw.githubusercontent.com/Microsoft/referencesource/9da503f9ef21e8d1f2905c78d4e3e5cbb3d6f85a/mscorlib/microsoft/win32/win32native.cs\n+\n+        // Note - do NOT use this to call methods.  Use P/Invoke, which will\n+        // do much better things w.r.t. marshaling, pinning memory, security \n+        // stuff, better interactions with thread aborts, etc.  This is used\n+        // solely by DoesWin32MethodExist for avoiding try/catch EntryPointNotFoundException\n+        // in scenarios where an OS Version check is insufficient\n+        [DllImport(\"kernel32.dll\", CharSet = CharSet.Ansi, BestFitMapping = false, SetLastError = true, ExactSpelling = true)]\n+        [ResourceExposure(ResourceScope.None)]\n+        private static extern IntPtr GetProcAddress(IntPtr hModule, String methodName);\n+\n+        [DllImport(\"kernel32.dll\", CharSet = CharSet.Auto, BestFitMapping = false, SetLastError = true)]\n+        [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]\n+        [ResourceExposure(ResourceScope.Process)]  // Is your module side-by-side?\n+        private static extern IntPtr GetModuleHandle(String moduleName);\n+\n+        [System.Security.SecurityCritical]  // auto-generated\n+        internal static bool DoesWin32MethodExist(String moduleName, String methodName)\n+        {\n+            // GetModuleHandle does not increment the module's ref count, so we don't need to call FreeLibrary.\n+            IntPtr hModule = GetModuleHandle(moduleName);","path":"SafeNativeMethods.cs","position":37,"original_position":37,"commit_id":"76dcdd7bc315b2acac9eb91ee6d8bbef754c6485","original_commit_id":"76dcdd7bc315b2acac9eb91ee6d8bbef754c6485","user":{"login":"paulcbetts","id":1396,"avatar_url":"https://avatars.githubusercontent.com/u/1396?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcbetts","html_url":"https://github.com/paulcbetts","followers_url":"https://api.github.com/users/paulcbetts/followers","following_url":"https://api.github.com/users/paulcbetts/following{/other_user}","gists_url":"https://api.github.com/users/paulcbetts/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcbetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcbetts/subscriptions","organizations_url":"https://api.github.com/users/paulcbetts/orgs","repos_url":"https://api.github.com/users/paulcbetts/repos","events_url":"https://api.github.com/users/paulcbetts/events{/privacy}","received_events_url":"https://api.github.com/users/paulcbetts/received_events","type":"User","site_admin":false},"body":"Why would we be guaranteed that `shcore.dll` is loaded on startup in every version of Windows going forward? Maybe OS version compatibility isn't so easy :stuck_out_tongue: ","created_at":"2014-11-24T22:13:36Z","updated_at":"2014-11-24T22:13:36Z","html_url":"https://github.com/paulcbetts/PerMonitorDpi/pull/4#discussion_r20826888","pull_request_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/comments/20826888"},"html":{"href":"https://github.com/paulcbetts/PerMonitorDpi/pull/4#discussion_r20826888"},"pull_request":{"href":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/4","id":24960657,"html_url":"https://github.com/paulcbetts/PerMonitorDpi/pull/4","diff_url":"https://github.com/paulcbetts/PerMonitorDpi/pull/4.diff","patch_url":"https://github.com/paulcbetts/PerMonitorDpi/pull/4.patch","issue_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/issues/4","number":4,"state":"open","locked":false,"title":"Check for API's existence instead of relying on version numbers","user":{"login":"onovotny","id":1427284,"avatar_url":"https://avatars.githubusercontent.com/u/1427284?v=3","gravatar_id":"","url":"https://api.github.com/users/onovotny","html_url":"https://github.com/onovotny","followers_url":"https://api.github.com/users/onovotny/followers","following_url":"https://api.github.com/users/onovotny/following{/other_user}","gists_url":"https://api.github.com/users/onovotny/gists{/gist_id}","starred_url":"https://api.github.com/users/onovotny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onovotny/subscriptions","organizations_url":"https://api.github.com/users/onovotny/orgs","repos_url":"https://api.github.com/users/onovotny/repos","events_url":"https://api.github.com/users/onovotny/events{/privacy}","received_events_url":"https://api.github.com/users/onovotny/received_events","type":"User","site_admin":false},"body":"PR to get rid of version checking in a super gross way","created_at":"2014-11-24T20:21:06Z","updated_at":"2014-11-24T22:13:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d315347781a2eab3adda8fac8074adbaa94e0496","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/4/commits","review_comments_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/4/comments","review_comment_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/comments/{number}","comments_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/issues/4/comments","statuses_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/statuses/76dcdd7bc315b2acac9eb91ee6d8bbef754c6485","head":{"label":"onovotny:less-hacky-fix","ref":"less-hacky-fix","sha":"76dcdd7bc315b2acac9eb91ee6d8bbef754c6485","user":{"login":"onovotny","id":1427284,"avatar_url":"https://avatars.githubusercontent.com/u/1427284?v=3","gravatar_id":"","url":"https://api.github.com/users/onovotny","html_url":"https://github.com/onovotny","followers_url":"https://api.github.com/users/onovotny/followers","following_url":"https://api.github.com/users/onovotny/following{/other_user}","gists_url":"https://api.github.com/users/onovotny/gists{/gist_id}","starred_url":"https://api.github.com/users/onovotny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onovotny/subscriptions","organizations_url":"https://api.github.com/users/onovotny/orgs","repos_url":"https://api.github.com/users/onovotny/repos","events_url":"https://api.github.com/users/onovotny/events{/privacy}","received_events_url":"https://api.github.com/users/onovotny/received_events","type":"User","site_admin":false},"repo":{"id":27092792,"name":"PerMonitorDpi","full_name":"onovotny/PerMonitorDpi","owner":{"login":"onovotny","id":1427284,"avatar_url":"https://avatars.githubusercontent.com/u/1427284?v=3","gravatar_id":"","url":"https://api.github.com/users/onovotny","html_url":"https://github.com/onovotny","followers_url":"https://api.github.com/users/onovotny/followers","following_url":"https://api.github.com/users/onovotny/following{/other_user}","gists_url":"https://api.github.com/users/onovotny/gists{/gist_id}","starred_url":"https://api.github.com/users/onovotny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onovotny/subscriptions","organizations_url":"https://api.github.com/users/onovotny/orgs","repos_url":"https://api.github.com/users/onovotny/repos","events_url":"https://api.github.com/users/onovotny/events{/privacy}","received_events_url":"https://api.github.com/users/onovotny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/onovotny/PerMonitorDpi","description":"Enable Windows 8.1+ Per-Monitor DPI support for Desktop WPF Apps","fork":true,"url":"https://api.github.com/repos/onovotny/PerMonitorDpi","forks_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/forks","keys_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/teams","hooks_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/hooks","issue_events_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/issues/events{/number}","events_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/events","assignees_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/assignees{/user}","branches_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/branches{/branch}","tags_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/tags","blobs_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/git/refs{/sha}","trees_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/statuses/{sha}","languages_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/languages","stargazers_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/stargazers","contributors_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/contributors","subscribers_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/subscribers","subscription_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/subscription","commits_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/commits{/sha}","git_commits_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/git/commits{/sha}","comments_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/comments{/number}","issue_comment_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/issues/comments/{number}","contents_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/contents/{+path}","compare_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/merges","archive_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/downloads","issues_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/issues{/number}","pulls_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/pulls{/number}","milestones_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/milestones{/number}","notifications_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/labels{/name}","releases_url":"https://api.github.com/repos/onovotny/PerMonitorDpi/releases{/id}","created_at":"2014-11-24T20:04:31Z","updated_at":"2014-11-24T20:04:31Z","pushed_at":"2014-11-24T20:20:39Z","git_url":"git://github.com/onovotny/PerMonitorDpi.git","ssh_url":"git@github.com:onovotny/PerMonitorDpi.git","clone_url":"https://github.com/onovotny/PerMonitorDpi.git","svn_url":"https://github.com/onovotny/PerMonitorDpi","homepage":null,"size":333,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"paulcbetts:master","ref":"master","sha":"0c6f50f3303b660b8cd32a95d59fbcb10ed86ab2","user":{"login":"paulcbetts","id":1396,"avatar_url":"https://avatars.githubusercontent.com/u/1396?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcbetts","html_url":"https://github.com/paulcbetts","followers_url":"https://api.github.com/users/paulcbetts/followers","following_url":"https://api.github.com/users/paulcbetts/following{/other_user}","gists_url":"https://api.github.com/users/paulcbetts/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcbetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcbetts/subscriptions","organizations_url":"https://api.github.com/users/paulcbetts/orgs","repos_url":"https://api.github.com/users/paulcbetts/repos","events_url":"https://api.github.com/users/paulcbetts/events{/privacy}","received_events_url":"https://api.github.com/users/paulcbetts/received_events","type":"User","site_admin":false},"repo":{"id":17532228,"name":"PerMonitorDpi","full_name":"paulcbetts/PerMonitorDpi","owner":{"login":"paulcbetts","id":1396,"avatar_url":"https://avatars.githubusercontent.com/u/1396?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcbetts","html_url":"https://github.com/paulcbetts","followers_url":"https://api.github.com/users/paulcbetts/followers","following_url":"https://api.github.com/users/paulcbetts/following{/other_user}","gists_url":"https://api.github.com/users/paulcbetts/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcbetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcbetts/subscriptions","organizations_url":"https://api.github.com/users/paulcbetts/orgs","repos_url":"https://api.github.com/users/paulcbetts/repos","events_url":"https://api.github.com/users/paulcbetts/events{/privacy}","received_events_url":"https://api.github.com/users/paulcbetts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulcbetts/PerMonitorDpi","description":"Enable Windows 8.1+ Per-Monitor DPI support for Desktop WPF Apps","fork":false,"url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi","forks_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/forks","keys_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/teams","hooks_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/hooks","issue_events_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/issues/events{/number}","events_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/events","assignees_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/assignees{/user}","branches_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/branches{/branch}","tags_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/tags","blobs_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/statuses/{sha}","languages_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/languages","stargazers_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/stargazers","contributors_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/contributors","subscribers_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/subscribers","subscription_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/subscription","commits_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/issues/comments/{number}","contents_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/contents/{+path}","compare_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/merges","archive_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/downloads","issues_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/issues{/number}","pulls_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls{/number}","milestones_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/milestones{/number}","notifications_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/labels{/name}","releases_url":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/releases{/id}","created_at":"2014-03-08T01:07:10Z","updated_at":"2014-11-19T12:03:25Z","pushed_at":"2014-05-01T00:05:47Z","git_url":"git://github.com/paulcbetts/PerMonitorDpi.git","ssh_url":"git@github.com:paulcbetts/PerMonitorDpi.git","clone_url":"https://github.com/paulcbetts/PerMonitorDpi.git","svn_url":"https://github.com/paulcbetts/PerMonitorDpi","homepage":null,"size":420,"stargazers_count":18,"watchers_count":18,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/4"},"html":{"href":"https://github.com/paulcbetts/PerMonitorDpi/pull/4"},"issue":{"href":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/issues/4"},"comments":{"href":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/paulcbetts/PerMonitorDpi/statuses/76dcdd7bc315b2acac9eb91ee6d8bbef754c6485"}}}}