{"action":"created","comment":{"url":"https://api.github.com/repos/reactos/reactos/pulls/comments/244584478","pull_request_review_id":188493885,"id":244584478,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDU4NDQ3OA==","diff_hunk":"@@ -0,0 +1,177 @@\n+/*\n+ * PROJECT:     ReactOS Timedate Control Panel\n+ * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)\n+ * PURPOSE:     Queries the NTP server\n+ * COPYRIGHT:   Copyright 2006 Ged Murphy <gedmurphy@gmail.com>\n+ */\n+\n+#include \"timedate.h\"\n+#include <winsock2.h>\n+\n+#define TIMEOUT 4000 /* 4 second timeout */\n+\n+typedef struct _INFO\n+{\n+    SOCKET Sock;\n+    SOCKADDR_IN myAddr;\n+    SOCKADDR_IN ntpAddr;\n+    NTPPACKET SendPacket;\n+    NTPPACKET RecvPacket;\n+} INFO, *PINFO;\n+\n+\n+static BOOL\n+InitConnection(PINFO pInfo, LPSTR lpAddress)\n+{\n+    WSADATA wsaData;\n+    HOSTENT *he;\n+    INT Ret;\n+\n+    Ret = WSAStartup(MAKEWORD(2, 2), &wsaData);\n+    if (Ret != 0)\n+        return FALSE;\n+\n+    pInfo->Sock = socket(AF_INET,\n+                         SOCK_DGRAM,\n+                         0);\n+    if (pInfo->Sock == INVALID_SOCKET)\n+        return FALSE;\n+\n+    /* Setup server info */\n+    he = gethostbyname(lpAddress);\n+    if (he != NULL)\n+    {\n+        /* Setup server socket info */\n+        ZeroMemory(&pInfo->ntpAddr, sizeof(SOCKADDR_IN));\n+        pInfo->ntpAddr.sin_family = AF_INET; // he->h_addrtype;\n+        pInfo->ntpAddr.sin_port = htons(NTPPORT);\n+        pInfo->ntpAddr.sin_addr = *((struct in_addr *)he->h_addr);\n+    }\n+    else\n+        return FALSE;\n+\n+    return TRUE;\n+}\n+\n+\n+static VOID\n+DestroyConnection(VOID)\n+{\n+    WSACleanup();\n+}\n+\n+\n+static BOOL\n+GetTransmitTime(PTIMEPACKET ptp)\n+{\n+    return TRUE;\n+}\n+\n+\n+/* Send some data to wake the server up */\n+static BOOL\n+SendData(PINFO pInfo)\n+{\n+    TIMEPACKET tp = { 0, 0 };\n+    INT Ret;\n+\n+    ZeroMemory(&pInfo->SendPacket, sizeof(pInfo->SendPacket));\n+    pInfo->SendPacket.LiVnMode = 27;\n+    if (!GetTransmitTime(&tp))\n+        return FALSE;\n+    pInfo->SendPacket.TransmitTimestamp = tp;\n+\n+    Ret = sendto(pInfo->Sock,\n+                 (char *)&pInfo->SendPacket,\n+                 sizeof(pInfo->SendPacket),\n+                 0,\n+                 (SOCKADDR *)&pInfo->ntpAddr,\n+                 sizeof(SOCKADDR_IN));","path":"base/services/w32time/ntpclient.c","position":87,"original_position":89,"commit_id":"34bd109a619e5f69c2896163517e7f7b0822a1d9","original_commit_id":"c6c9b1b1de6e1a53b4cac7de42bb191a691ddfd8","user":{"login":"tkreuzer","id":313067,"node_id":"MDQ6VXNlcjMxMzA2Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/313067?v=4","gravatar_id":"","url":"https://api.github.com/users/tkreuzer","html_url":"https://github.com/tkreuzer","followers_url":"https://api.github.com/users/tkreuzer/followers","following_url":"https://api.github.com/users/tkreuzer/following{/other_user}","gists_url":"https://api.github.com/users/tkreuzer/gists{/gist_id}","starred_url":"https://api.github.com/users/tkreuzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkreuzer/subscriptions","organizations_url":"https://api.github.com/users/tkreuzer/orgs","repos_url":"https://api.github.com/users/tkreuzer/repos","events_url":"https://api.github.com/users/tkreuzer/events{/privacy}","received_events_url":"https://api.github.com/users/tkreuzer/received_events","type":"User","site_admin":false},"body":"I see this duplicates the entire file. It would be better to move it to a library.","created_at":"2018-12-31T13:24:42Z","updated_at":"2018-12-31T13:37:04Z","html_url":"https://github.com/reactos/reactos/pull/373#discussion_r244584478","pull_request_url":"https://api.github.com/repos/reactos/reactos/pulls/373","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/reactos/reactos/pulls/comments/244584478"},"html":{"href":"https://github.com/reactos/reactos/pull/373#discussion_r244584478"},"pull_request":{"href":"https://api.github.com/repos/reactos/reactos/pulls/373"}},"in_reply_to_id":168716223},"pull_request":{"url":"https://api.github.com/repos/reactos/reactos/pulls/373","id":168430599,"node_id":"MDExOlB1bGxSZXF1ZXN0MTY4NDMwNTk5","html_url":"https://github.com/reactos/reactos/pull/373","diff_url":"https://github.com/reactos/reactos/pull/373.diff","patch_url":"https://github.com/reactos/reactos/pull/373.patch","issue_url":"https://api.github.com/repos/reactos/reactos/issues/373","number":373,"state":"open","locked":false,"title":"Create W32Time Service","user":{"login":"Doug-Lyons","id":32620577,"node_id":"MDQ6VXNlcjMyNjIwNTc3","avatar_url":"https://avatars3.githubusercontent.com/u/32620577?v=4","gravatar_id":"","url":"https://api.github.com/users/Doug-Lyons","html_url":"https://github.com/Doug-Lyons","followers_url":"https://api.github.com/users/Doug-Lyons/followers","following_url":"https://api.github.com/users/Doug-Lyons/following{/other_user}","gists_url":"https://api.github.com/users/Doug-Lyons/gists{/gist_id}","starred_url":"https://api.github.com/users/Doug-Lyons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doug-Lyons/subscriptions","organizations_url":"https://api.github.com/users/Doug-Lyons/orgs","repos_url":"https://api.github.com/users/Doug-Lyons/repos","events_url":"https://api.github.com/users/Doug-Lyons/events{/privacy}","received_events_url":"https://api.github.com/users/Doug-Lyons/received_events","type":"User","site_admin":false},"body":"## Add W32Time Service\r\n\r\nJIRA issue: [CORE-13001](https://jira.reactos.org/browse/CORE-13001)\r\n\r\n## Proposed changes\r\nAdd Service for W32Time.\r\nI am a novice programmer in C, so please take this into account with your comments. Thanks.\r\n\r\n","created_at":"2018-02-11T01:29:12Z","updated_at":"2018-12-31T13:37:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"43d9f3ed78285cd1330feb5ac40aa071d2896ceb","assignee":{"login":"ThFabba","id":18138474,"node_id":"MDQ6VXNlcjE4MTM4NDc0","avatar_url":"https://avatars3.githubusercontent.com/u/18138474?v=4","gravatar_id":"","url":"https://api.github.com/users/ThFabba","html_url":"https://github.com/ThFabba","followers_url":"https://api.github.com/users/ThFabba/followers","following_url":"https://api.github.com/users/ThFabba/following{/other_user}","gists_url":"https://api.github.com/users/ThFabba/gists{/gist_id}","starred_url":"https://api.github.com/users/ThFabba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThFabba/subscriptions","organizations_url":"https://api.github.com/users/ThFabba/orgs","repos_url":"https://api.github.com/users/ThFabba/repos","events_url":"https://api.github.com/users/ThFabba/events{/privacy}","received_events_url":"https://api.github.com/users/ThFabba/received_events","type":"User","site_admin":false},"assignees":[{"login":"ThFabba","id":18138474,"node_id":"MDQ6VXNlcjE4MTM4NDc0","avatar_url":"https://avatars3.githubusercontent.com/u/18138474?v=4","gravatar_id":"","url":"https://api.github.com/users/ThFabba","html_url":"https://github.com/ThFabba","followers_url":"https://api.github.com/users/ThFabba/followers","following_url":"https://api.github.com/users/ThFabba/following{/other_user}","gists_url":"https://api.github.com/users/ThFabba/gists{/gist_id}","starred_url":"https://api.github.com/users/ThFabba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThFabba/subscriptions","organizations_url":"https://api.github.com/users/ThFabba/orgs","repos_url":"https://api.github.com/users/ThFabba/repos","events_url":"https://api.github.com/users/ThFabba/events{/privacy}","received_events_url":"https://api.github.com/users/ThFabba/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":709291171,"node_id":"MDU6TGFiZWw3MDkyOTExNzE=","url":"https://api.github.com/repos/reactos/reactos/labels/enhancement","name":"enhancement","color":"59f9ac","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/reactos/reactos/pulls/373/commits","review_comments_url":"https://api.github.com/repos/reactos/reactos/pulls/373/comments","review_comment_url":"https://api.github.com/repos/reactos/reactos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reactos/reactos/issues/373/comments","statuses_url":"https://api.github.com/repos/reactos/reactos/statuses/34bd109a619e5f69c2896163517e7f7b0822a1d9","head":{"label":"Doug-Lyons:master","ref":"master","sha":"34bd109a619e5f69c2896163517e7f7b0822a1d9","user":{"login":"Doug-Lyons","id":32620577,"node_id":"MDQ6VXNlcjMyNjIwNTc3","avatar_url":"https://avatars3.githubusercontent.com/u/32620577?v=4","gravatar_id":"","url":"https://api.github.com/users/Doug-Lyons","html_url":"https://github.com/Doug-Lyons","followers_url":"https://api.github.com/users/Doug-Lyons/followers","following_url":"https://api.github.com/users/Doug-Lyons/following{/other_user}","gists_url":"https://api.github.com/users/Doug-Lyons/gists{/gist_id}","starred_url":"https://api.github.com/users/Doug-Lyons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doug-Lyons/subscriptions","organizations_url":"https://api.github.com/users/Doug-Lyons/orgs","repos_url":"https://api.github.com/users/Doug-Lyons/repos","events_url":"https://api.github.com/users/Doug-Lyons/events{/privacy}","received_events_url":"https://api.github.com/users/Doug-Lyons/received_events","type":"User","site_admin":false},"repo":{"id":115593490,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU1OTM0OTA=","name":"reactos","full_name":"Doug-Lyons/reactos","private":false,"owner":{"login":"Doug-Lyons","id":32620577,"node_id":"MDQ6VXNlcjMyNjIwNTc3","avatar_url":"https://avatars3.githubusercontent.com/u/32620577?v=4","gravatar_id":"","url":"https://api.github.com/users/Doug-Lyons","html_url":"https://github.com/Doug-Lyons","followers_url":"https://api.github.com/users/Doug-Lyons/followers","following_url":"https://api.github.com/users/Doug-Lyons/following{/other_user}","gists_url":"https://api.github.com/users/Doug-Lyons/gists{/gist_id}","starred_url":"https://api.github.com/users/Doug-Lyons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doug-Lyons/subscriptions","organizations_url":"https://api.github.com/users/Doug-Lyons/orgs","repos_url":"https://api.github.com/users/Doug-Lyons/repos","events_url":"https://api.github.com/users/Doug-Lyons/events{/privacy}","received_events_url":"https://api.github.com/users/Doug-Lyons/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Doug-Lyons/reactos","description":"A free Windows-compatible Operating System","fork":true,"url":"https://api.github.com/repos/Doug-Lyons/reactos","forks_url":"https://api.github.com/repos/Doug-Lyons/reactos/forks","keys_url":"https://api.github.com/repos/Doug-Lyons/reactos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Doug-Lyons/reactos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Doug-Lyons/reactos/teams","hooks_url":"https://api.github.com/repos/Doug-Lyons/reactos/hooks","issue_events_url":"https://api.github.com/repos/Doug-Lyons/reactos/issues/events{/number}","events_url":"https://api.github.com/repos/Doug-Lyons/reactos/events","assignees_url":"https://api.github.com/repos/Doug-Lyons/reactos/assignees{/user}","branches_url":"https://api.github.com/repos/Doug-Lyons/reactos/branches{/branch}","tags_url":"https://api.github.com/repos/Doug-Lyons/reactos/tags","blobs_url":"https://api.github.com/repos/Doug-Lyons/reactos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Doug-Lyons/reactos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Doug-Lyons/reactos/git/refs{/sha}","trees_url":"https://api.github.com/repos/Doug-Lyons/reactos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Doug-Lyons/reactos/statuses/{sha}","languages_url":"https://api.github.com/repos/Doug-Lyons/reactos/languages","stargazers_url":"https://api.github.com/repos/Doug-Lyons/reactos/stargazers","contributors_url":"https://api.github.com/repos/Doug-Lyons/reactos/contributors","subscribers_url":"https://api.github.com/repos/Doug-Lyons/reactos/subscribers","subscription_url":"https://api.github.com/repos/Doug-Lyons/reactos/subscription","commits_url":"https://api.github.com/repos/Doug-Lyons/reactos/commits{/sha}","git_commits_url":"https://api.github.com/repos/Doug-Lyons/reactos/git/commits{/sha}","comments_url":"https://api.github.com/repos/Doug-Lyons/reactos/comments{/number}","issue_comment_url":"https://api.github.com/repos/Doug-Lyons/reactos/issues/comments{/number}","contents_url":"https://api.github.com/repos/Doug-Lyons/reactos/contents/{+path}","compare_url":"https://api.github.com/repos/Doug-Lyons/reactos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Doug-Lyons/reactos/merges","archive_url":"https://api.github.com/repos/Doug-Lyons/reactos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Doug-Lyons/reactos/downloads","issues_url":"https://api.github.com/repos/Doug-Lyons/reactos/issues{/number}","pulls_url":"https://api.github.com/repos/Doug-Lyons/reactos/pulls{/number}","milestones_url":"https://api.github.com/repos/Doug-Lyons/reactos/milestones{/number}","notifications_url":"https://api.github.com/repos/Doug-Lyons/reactos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Doug-Lyons/reactos/labels{/name}","releases_url":"https://api.github.com/repos/Doug-Lyons/reactos/releases{/id}","deployments_url":"https://api.github.com/repos/Doug-Lyons/reactos/deployments","created_at":"2017-12-28T06:37:43Z","updated_at":"2018-04-02T09:43:29Z","pushed_at":"2018-04-02T09:43:26Z","git_url":"git://github.com/Doug-Lyons/reactos.git","ssh_url":"git@github.com:Doug-Lyons/reactos.git","clone_url":"https://github.com/Doug-Lyons/reactos.git","svn_url":"https://github.com/Doug-Lyons/reactos","homepage":null,"size":451498,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":0,"default_branch":"master"}},"base":{"label":"reactos:master","ref":"master","sha":"f204f24c98756c8fab033c3c6354b0e159b96048","user":{"login":"reactos","id":1056157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTYxNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1056157?v=4","gravatar_id":"","url":"https://api.github.com/users/reactos","html_url":"https://github.com/reactos","followers_url":"https://api.github.com/users/reactos/followers","following_url":"https://api.github.com/users/reactos/following{/other_user}","gists_url":"https://api.github.com/users/reactos/gists{/gist_id}","starred_url":"https://api.github.com/users/reactos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactos/subscriptions","organizations_url":"https://api.github.com/users/reactos/orgs","repos_url":"https://api.github.com/users/reactos/repos","events_url":"https://api.github.com/users/reactos/events{/privacy}","received_events_url":"https://api.github.com/users/reactos/received_events","type":"Organization","site_admin":false},"repo":{"id":105627846,"node_id":"MDEwOlJlcG9zaXRvcnkxMDU2Mjc4NDY=","name":"reactos","full_name":"reactos/reactos","private":false,"owner":{"login":"reactos","id":1056157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTYxNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1056157?v=4","gravatar_id":"","url":"https://api.github.com/users/reactos","html_url":"https://github.com/reactos","followers_url":"https://api.github.com/users/reactos/followers","following_url":"https://api.github.com/users/reactos/following{/other_user}","gists_url":"https://api.github.com/users/reactos/gists{/gist_id}","starred_url":"https://api.github.com/users/reactos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactos/subscriptions","organizations_url":"https://api.github.com/users/reactos/orgs","repos_url":"https://api.github.com/users/reactos/repos","events_url":"https://api.github.com/users/reactos/events{/privacy}","received_events_url":"https://api.github.com/users/reactos/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/reactos/reactos","description":"A free Windows-compatible Operating System","fork":false,"url":"https://api.github.com/repos/reactos/reactos","forks_url":"https://api.github.com/repos/reactos/reactos/forks","keys_url":"https://api.github.com/repos/reactos/reactos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reactos/reactos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reactos/reactos/teams","hooks_url":"https://api.github.com/repos/reactos/reactos/hooks","issue_events_url":"https://api.github.com/repos/reactos/reactos/issues/events{/number}","events_url":"https://api.github.com/repos/reactos/reactos/events","assignees_url":"https://api.github.com/repos/reactos/reactos/assignees{/user}","branches_url":"https://api.github.com/repos/reactos/reactos/branches{/branch}","tags_url":"https://api.github.com/repos/reactos/reactos/tags","blobs_url":"https://api.github.com/repos/reactos/reactos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reactos/reactos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reactos/reactos/git/refs{/sha}","trees_url":"https://api.github.com/repos/reactos/reactos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reactos/reactos/statuses/{sha}","languages_url":"https://api.github.com/repos/reactos/reactos/languages","stargazers_url":"https://api.github.com/repos/reactos/reactos/stargazers","contributors_url":"https://api.github.com/repos/reactos/reactos/contributors","subscribers_url":"https://api.github.com/repos/reactos/reactos/subscribers","subscription_url":"https://api.github.com/repos/reactos/reactos/subscription","commits_url":"https://api.github.com/repos/reactos/reactos/commits{/sha}","git_commits_url":"https://api.github.com/repos/reactos/reactos/git/commits{/sha}","comments_url":"https://api.github.com/repos/reactos/reactos/comments{/number}","issue_comment_url":"https://api.github.com/repos/reactos/reactos/issues/comments{/number}","contents_url":"https://api.github.com/repos/reactos/reactos/contents/{+path}","compare_url":"https://api.github.com/repos/reactos/reactos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reactos/reactos/merges","archive_url":"https://api.github.com/repos/reactos/reactos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reactos/reactos/downloads","issues_url":"https://api.github.com/repos/reactos/reactos/issues{/number}","pulls_url":"https://api.github.com/repos/reactos/reactos/pulls{/number}","milestones_url":"https://api.github.com/repos/reactos/reactos/milestones{/number}","notifications_url":"https://api.github.com/repos/reactos/reactos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reactos/reactos/labels{/name}","releases_url":"https://api.github.com/repos/reactos/reactos/releases{/id}","deployments_url":"https://api.github.com/repos/reactos/reactos/deployments","created_at":"2017-10-03T08:04:52Z","updated_at":"2018-12-31T13:24:24Z","pushed_at":"2018-12-31T13:24:10Z","git_url":"git://github.com/reactos/reactos.git","ssh_url":"git@github.com:reactos/reactos.git","clone_url":"https://github.com/reactos/reactos.git","svn_url":"https://github.com/reactos/reactos","homepage":null,"size":466300,"stargazers_count":5697,"watchers_count":5697,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":515,"mirror_url":null,"archived":false,"open_issues_count":93,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":515,"open_issues":93,"watchers":5697,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reactos/reactos/pulls/373"},"html":{"href":"https://github.com/reactos/reactos/pull/373"},"issue":{"href":"https://api.github.com/repos/reactos/reactos/issues/373"},"comments":{"href":"https://api.github.com/repos/reactos/reactos/issues/373/comments"},"review_comments":{"href":"https://api.github.com/repos/reactos/reactos/pulls/373/comments"},"review_comment":{"href":"https://api.github.com/repos/reactos/reactos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reactos/reactos/pulls/373/commits"},"statuses":{"href":"https://api.github.com/repos/reactos/reactos/statuses/34bd109a619e5f69c2896163517e7f7b0822a1d9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tkreuzer"}}