{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/226316566","pull_request_review_id":166108678,"id":226316566,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjMxNjU2Ng==","diff_hunk":"@@ -11,21 +13,57 @@ internal partial class NtDll\n         [DllImport(Libraries.NtDll, ExactSpelling=true)]\n         private static extern int RtlGetVersion(ref RTL_OSVERSIONINFOEX lpVersionInformation);\n \n-        internal static unsafe string RtlGetVersion()\n+        private static unsafe Tuple<uint, uint, uint, string> RtlGetVersionInternal()\n         {\n             var osvi = new RTL_OSVERSIONINFOEX();\n             osvi.dwOSVersionInfoSize = (uint)sizeof(RTL_OSVERSIONINFOEX);\n-            const string version = \"Microsoft Windows\";\n+            \n             if (RtlGetVersion(ref osvi) == 0)\n             {\n                 return osvi.szCSDVersion[0] != '\\0' ?\n-                    string.Format(\"{0} {1}.{2}.{3} {4}\", version, osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber, new string(&(osvi.szCSDVersion[0]))) :\n-                    string.Format(\"{0} {1}.{2}.{3}\", version, osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber);\n+                    new Tuple<uint, uint, uint, string>(osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber, new string(&(osvi.szCSDVersion[0]))) :\n+                    new Tuple<uint, uint, uint, string>(osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber, null);\n             }\n             else\n             {\n-                return version;\n+                return null;\n+            }\n+        } \n+\n+        internal static string RtlGetVersion()\n+        {\n+            var sb = new StringBuilder();\n+            const string version = \"Microsoft Windows\";\n+            sb.Append(version);\n+            Tuple<uint, uint, uint, string> info = RtlGetVersionInternal();\n+            if (info != null)\n+            {\n+                sb.AppendFormat(\" {0}.{1}.{2}\", info.Item1, info.Item2, info.Item3);\n+                if (info.Item4 != null)\n+                {\n+                    sb.AppendFormat(\" {0}\", info.Item4);\n+                }\n             }\n+\n+            return sb.ToString();\n+        }","path":"src/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs","position":null,"original_position":52,"commit_id":"491cbde5cfaf282b8bcd90115daa9baf186b419a","original_commit_id":"5000b993dea2b32d27df1ea8db9afe497ad928c7","user":{"login":"artkpv","id":3657998,"node_id":"MDQ6VXNlcjM2NTc5OTg=","avatar_url":"https://avatars1.githubusercontent.com/u/3657998?v=4","gravatar_id":"","url":"https://api.github.com/users/artkpv","html_url":"https://github.com/artkpv","followers_url":"https://api.github.com/users/artkpv/followers","following_url":"https://api.github.com/users/artkpv/following{/other_user}","gists_url":"https://api.github.com/users/artkpv/gists{/gist_id}","starred_url":"https://api.github.com/users/artkpv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artkpv/subscriptions","organizations_url":"https://api.github.com/users/artkpv/orgs","repos_url":"https://api.github.com/users/artkpv/repos","events_url":"https://api.github.com/users/artkpv/events{/privacy}","received_events_url":"https://api.github.com/users/artkpv/received_events","type":"User","site_admin":false},"body":"Thanks for the comment. I've reverted it back and added a method with `out` param. Initially I thought about some encapsulation for `NtDll` when saw `extern` is `private` but i image it is not handy to do this for Interop.","created_at":"2018-10-18T14:01:04Z","updated_at":"2018-10-18T14:01:04Z","html_url":"https://github.com/dotnet/corefx/pull/32867#discussion_r226316566","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/32867","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/226316566"},"html":{"href":"https://github.com/dotnet/corefx/pull/32867#discussion_r226316566"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/32867"}},"in_reply_to_id":225993457},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/32867","id":223654323,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNjU0MzIz","html_url":"https://github.com/dotnet/corefx/pull/32867","diff_url":"https://github.com/dotnet/corefx/pull/32867.diff","patch_url":"https://github.com/dotnet/corefx/pull/32867.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/32867","number":32867,"state":"open","locked":false,"title":"Removing duplicate interop structures","user":{"login":"artkpv","id":3657998,"node_id":"MDQ6VXNlcjM2NTc5OTg=","avatar_url":"https://avatars1.githubusercontent.com/u/3657998?v=4","gravatar_id":"","url":"https://api.github.com/users/artkpv","html_url":"https://github.com/artkpv","followers_url":"https://api.github.com/users/artkpv/followers","following_url":"https://api.github.com/users/artkpv/following{/other_user}","gists_url":"https://api.github.com/users/artkpv/gists{/gist_id}","starred_url":"https://api.github.com/users/artkpv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artkpv/subscriptions","organizations_url":"https://api.github.com/users/artkpv/orgs","repos_url":"https://api.github.com/users/artkpv/repos","events_url":"https://api.github.com/users/artkpv/events{/privacy}","received_events_url":"https://api.github.com/users/artkpv/received_events","type":"User","site_admin":false},"body":"Refs #32438 . Not duplicated structures remain (`kernel32.GetProductInfo` and `kernel32.GetCurrentApplicationUserModelId`)","created_at":"2018-10-17T15:37:41Z","updated_at":"2018-10-18T14:01:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cee843f5e2c6be87125834ad1638082939773bcb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/32867/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/32867/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/32867/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/491cbde5cfaf282b8bcd90115daa9baf186b419a","head":{"label":"artkpv:duplicates-32438","ref":"duplicates-32438","sha":"491cbde5cfaf282b8bcd90115daa9baf186b419a","user":{"login":"artkpv","id":3657998,"node_id":"MDQ6VXNlcjM2NTc5OTg=","avatar_url":"https://avatars1.githubusercontent.com/u/3657998?v=4","gravatar_id":"","url":"https://api.github.com/users/artkpv","html_url":"https://github.com/artkpv","followers_url":"https://api.github.com/users/artkpv/followers","following_url":"https://api.github.com/users/artkpv/following{/other_user}","gists_url":"https://api.github.com/users/artkpv/gists{/gist_id}","starred_url":"https://api.github.com/users/artkpv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artkpv/subscriptions","organizations_url":"https://api.github.com/users/artkpv/orgs","repos_url":"https://api.github.com/users/artkpv/repos","events_url":"https://api.github.com/users/artkpv/events{/privacy}","received_events_url":"https://api.github.com/users/artkpv/received_events","type":"User","site_admin":false},"repo":{"id":113455503,"node_id":"MDEwOlJlcG9zaXRvcnkxMTM0NTU1MDM=","name":"corefx","full_name":"artkpv/corefx","private":false,"owner":{"login":"artkpv","id":3657998,"node_id":"MDQ6VXNlcjM2NTc5OTg=","avatar_url":"https://avatars1.githubusercontent.com/u/3657998?v=4","gravatar_id":"","url":"https://api.github.com/users/artkpv","html_url":"https://github.com/artkpv","followers_url":"https://api.github.com/users/artkpv/followers","following_url":"https://api.github.com/users/artkpv/following{/other_user}","gists_url":"https://api.github.com/users/artkpv/gists{/gist_id}","starred_url":"https://api.github.com/users/artkpv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artkpv/subscriptions","organizations_url":"https://api.github.com/users/artkpv/orgs","repos_url":"https://api.github.com/users/artkpv/repos","events_url":"https://api.github.com/users/artkpv/events{/privacy}","received_events_url":"https://api.github.com/users/artkpv/received_events","type":"User","site_admin":false},"html_url":"https://github.com/artkpv/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.","fork":true,"url":"https://api.github.com/repos/artkpv/corefx","forks_url":"https://api.github.com/repos/artkpv/corefx/forks","keys_url":"https://api.github.com/repos/artkpv/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artkpv/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artkpv/corefx/teams","hooks_url":"https://api.github.com/repos/artkpv/corefx/hooks","issue_events_url":"https://api.github.com/repos/artkpv/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/artkpv/corefx/events","assignees_url":"https://api.github.com/repos/artkpv/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/artkpv/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/artkpv/corefx/tags","blobs_url":"https://api.github.com/repos/artkpv/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artkpv/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artkpv/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/artkpv/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artkpv/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/artkpv/corefx/languages","stargazers_url":"https://api.github.com/repos/artkpv/corefx/stargazers","contributors_url":"https://api.github.com/repos/artkpv/corefx/contributors","subscribers_url":"https://api.github.com/repos/artkpv/corefx/subscribers","subscription_url":"https://api.github.com/repos/artkpv/corefx/subscription","commits_url":"https://api.github.com/repos/artkpv/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/artkpv/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/artkpv/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/artkpv/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/artkpv/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/artkpv/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artkpv/corefx/merges","archive_url":"https://api.github.com/repos/artkpv/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artkpv/corefx/downloads","issues_url":"https://api.github.com/repos/artkpv/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/artkpv/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/artkpv/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/artkpv/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artkpv/corefx/labels{/name}","releases_url":"https://api.github.com/repos/artkpv/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/artkpv/corefx/deployments","created_at":"2017-12-07T13:42:00Z","updated_at":"2018-10-16T14:06:51Z","pushed_at":"2018-10-18T13:56:02Z","git_url":"git://github.com/artkpv/corefx.git","ssh_url":"git@github.com:artkpv/corefx.git","clone_url":"https://github.com/artkpv/corefx.git","svn_url":"https://github.com/artkpv/corefx","homepage":"https://github.com/dotnet/core","size":188102,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"b0f6ef48cca9ae70b0e8d81ffa640cbdd1b26f55","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"node_id":"MDEwOlJlcG9zaXRvcnkyNjI5NTM0NQ==","name":"corefx","full_name":"dotnet/corefx","private":false,"owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2018-10-18T11:16:36Z","pushed_at":"2018-10-18T13:58:14Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"https://github.com/dotnet/core","size":189682,"stargazers_count":14969,"watchers_count":14969,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4393,"mirror_url":null,"archived":false,"open_issues_count":2552,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4393,"open_issues":2552,"watchers":14969,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/32867"},"html":{"href":"https://github.com/dotnet/corefx/pull/32867"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/32867"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/32867/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/32867/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/32867/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/491cbde5cfaf282b8bcd90115daa9baf186b419a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"artkpv"}}