{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/osquery/pulls/comments/173519681","pull_request_review_id":102730785,"id":173519681,"diff_hunk":"@@ -0,0 +1,63 @@\n+/**\n+ *  Copyright (c) 2014-present, Facebook, Inc.\n+ *  All rights reserved.\n+ *\n+ *  This source code is licensed under both the Apache 2.0 license (found in the\n+ *  LICENSE file in the root directory of this source tree) and the GPLv2 (found\n+ *  in the COPYING file in the root directory of this source tree).\n+ *  You may select, at your option, one of the above-listed licenses.\n+ */\n+\n+#include <osquery/sql.h>\n+#include <osquery/system.h>\n+#include <osquery/tables.h>\n+\n+#include \"osquery/core/conversions.h\"\n+#include \"osquery/core/windows/wmi.h\"\n+\n+namespace osquery {\n+namespace tables {\n+\n+QueryData genDiskInfo(QueryContext& context) {\n+  Row r;\n+  QueryData results;\n+\n+  WmiRequest wmiSystemReq(\"select * from Win32_DiskDrive\");\n+  std::vector<WmiResultItem>& wmiResults = wmiSystemReq.results();\n+  if (!wmiResults.empty()) {","path":"osquery/tables/system/windows/disk_info.cpp","position":27,"original_position":27,"commit_id":"04e0ab0a4fafea992b0e56648fe65881e7ebd2c0","original_commit_id":"04e0ab0a4fafea992b0e56648fe65881e7ebd2c0","user":{"login":"jjerger","id":35977367,"avatar_url":"https://avatars0.githubusercontent.com/u/35977367?v=4","gravatar_id":"","url":"https://api.github.com/users/jjerger","html_url":"https://github.com/jjerger","followers_url":"https://api.github.com/users/jjerger/followers","following_url":"https://api.github.com/users/jjerger/following{/other_user}","gists_url":"https://api.github.com/users/jjerger/gists{/gist_id}","starred_url":"https://api.github.com/users/jjerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjerger/subscriptions","organizations_url":"https://api.github.com/users/jjerger/orgs","repos_url":"https://api.github.com/users/jjerger/repos","events_url":"https://api.github.com/users/jjerger/events{/privacy}","received_events_url":"https://api.github.com/users/jjerger/received_events","type":"User","site_admin":false},"body":"That could do, though I do have a question regarding that. Since most other Windows tables return -1 on all values if there is an error, would it be better to keep it for consistency between cpp files? If that's not a concern, then I can change it to write out a message instead.","created_at":"2018-03-09T17:48:12Z","updated_at":"2018-03-09T17:48:12Z","html_url":"https://github.com/facebook/osquery/pull/4177#discussion_r173519681","pull_request_url":"https://api.github.com/repos/facebook/osquery/pulls/4177","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments/173519681"},"html":{"href":"https://github.com/facebook/osquery/pull/4177#discussion_r173519681"},"pull_request":{"href":"https://api.github.com/repos/facebook/osquery/pulls/4177"}},"in_reply_to_id":173502121},"pull_request":{"url":"https://api.github.com/repos/facebook/osquery/pulls/4177","id":173816454,"html_url":"https://github.com/facebook/osquery/pull/4177","diff_url":"https://github.com/facebook/osquery/pull/4177.diff","patch_url":"https://github.com/facebook/osquery/pull/4177.patch","issue_url":"https://api.github.com/repos/facebook/osquery/issues/4177","number":4177,"state":"open","locked":false,"title":"Add disk_info table","user":{"login":"jjerger","id":35977367,"avatar_url":"https://avatars0.githubusercontent.com/u/35977367?v=4","gravatar_id":"","url":"https://api.github.com/users/jjerger","html_url":"https://github.com/jjerger","followers_url":"https://api.github.com/users/jjerger/followers","following_url":"https://api.github.com/users/jjerger/following{/other_user}","gists_url":"https://api.github.com/users/jjerger/gists{/gist_id}","starred_url":"https://api.github.com/users/jjerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjerger/subscriptions","organizations_url":"https://api.github.com/users/jjerger/orgs","repos_url":"https://api.github.com/users/jjerger/repos","events_url":"https://api.github.com/users/jjerger/events{/privacy}","received_events_url":"https://api.github.com/users/jjerger/received_events","type":"User","site_admin":false},"body":"Created a table to query basic information about the hard disk(s) installed on a system.","created_at":"2018-03-08T18:40:21Z","updated_at":"2018-03-09T17:48:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06c0d0e6f18a0afdb97e05cd25998450e55521e2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":337332432,"url":"https://api.github.com/repos/facebook/osquery/labels/Windows","name":"Windows","color":"d4c5f9","default":false},{"id":196858822,"url":"https://api.github.com/repos/facebook/osquery/labels/cla%20signed","name":"cla signed","color":"ededed","default":false},{"id":118805314,"url":"https://api.github.com/repos/facebook/osquery/labels/virtual%20tables","name":"virtual tables","color":"207de5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/osquery/pulls/4177/commits","review_comments_url":"https://api.github.com/repos/facebook/osquery/pulls/4177/comments","review_comment_url":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/4177/comments","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/04e0ab0a4fafea992b0e56648fe65881e7ebd2c0","head":{"label":"jjerger:disk_info","ref":"disk_info","sha":"04e0ab0a4fafea992b0e56648fe65881e7ebd2c0","user":{"login":"jjerger","id":35977367,"avatar_url":"https://avatars0.githubusercontent.com/u/35977367?v=4","gravatar_id":"","url":"https://api.github.com/users/jjerger","html_url":"https://github.com/jjerger","followers_url":"https://api.github.com/users/jjerger/followers","following_url":"https://api.github.com/users/jjerger/following{/other_user}","gists_url":"https://api.github.com/users/jjerger/gists{/gist_id}","starred_url":"https://api.github.com/users/jjerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjerger/subscriptions","organizations_url":"https://api.github.com/users/jjerger/orgs","repos_url":"https://api.github.com/users/jjerger/repos","events_url":"https://api.github.com/users/jjerger/events{/privacy}","received_events_url":"https://api.github.com/users/jjerger/received_events","type":"User","site_admin":false},"repo":{"id":119602319,"name":"osquery","full_name":"jjerger/osquery","owner":{"login":"jjerger","id":35977367,"avatar_url":"https://avatars0.githubusercontent.com/u/35977367?v=4","gravatar_id":"","url":"https://api.github.com/users/jjerger","html_url":"https://github.com/jjerger","followers_url":"https://api.github.com/users/jjerger/followers","following_url":"https://api.github.com/users/jjerger/following{/other_user}","gists_url":"https://api.github.com/users/jjerger/gists{/gist_id}","starred_url":"https://api.github.com/users/jjerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjerger/subscriptions","organizations_url":"https://api.github.com/users/jjerger/orgs","repos_url":"https://api.github.com/users/jjerger/repos","events_url":"https://api.github.com/users/jjerger/events{/privacy}","received_events_url":"https://api.github.com/users/jjerger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jjerger/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":true,"url":"https://api.github.com/repos/jjerger/osquery","forks_url":"https://api.github.com/repos/jjerger/osquery/forks","keys_url":"https://api.github.com/repos/jjerger/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jjerger/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jjerger/osquery/teams","hooks_url":"https://api.github.com/repos/jjerger/osquery/hooks","issue_events_url":"https://api.github.com/repos/jjerger/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/jjerger/osquery/events","assignees_url":"https://api.github.com/repos/jjerger/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/jjerger/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/jjerger/osquery/tags","blobs_url":"https://api.github.com/repos/jjerger/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jjerger/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jjerger/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/jjerger/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jjerger/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/jjerger/osquery/languages","stargazers_url":"https://api.github.com/repos/jjerger/osquery/stargazers","contributors_url":"https://api.github.com/repos/jjerger/osquery/contributors","subscribers_url":"https://api.github.com/repos/jjerger/osquery/subscribers","subscription_url":"https://api.github.com/repos/jjerger/osquery/subscription","commits_url":"https://api.github.com/repos/jjerger/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/jjerger/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/jjerger/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/jjerger/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/jjerger/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/jjerger/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jjerger/osquery/merges","archive_url":"https://api.github.com/repos/jjerger/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jjerger/osquery/downloads","issues_url":"https://api.github.com/repos/jjerger/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/jjerger/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/jjerger/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/jjerger/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jjerger/osquery/labels{/name}","releases_url":"https://api.github.com/repos/jjerger/osquery/releases{/id}","deployments_url":"https://api.github.com/repos/jjerger/osquery/deployments","created_at":"2018-01-30T22:25:35Z","updated_at":"2018-01-30T22:25:39Z","pushed_at":"2018-03-08T18:38:50Z","git_url":"git://github.com/jjerger/osquery.git","ssh_url":"git@github.com:jjerger/osquery.git","clone_url":"https://github.com/jjerger/osquery.git","svn_url":"https://github.com/jjerger/osquery","homepage":"https://osquery.io","size":14400,"stargazers_count":0,"watchers_count":0,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"ca2e33b3ad250b996a41b584b3a6a82349577e5d","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":22394357,"name":"osquery","full_name":"facebook/osquery","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":false,"url":"https://api.github.com/repos/facebook/osquery","forks_url":"https://api.github.com/repos/facebook/osquery/forks","keys_url":"https://api.github.com/repos/facebook/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/osquery/teams","hooks_url":"https://api.github.com/repos/facebook/osquery/hooks","issue_events_url":"https://api.github.com/repos/facebook/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/osquery/events","assignees_url":"https://api.github.com/repos/facebook/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/osquery/tags","blobs_url":"https://api.github.com/repos/facebook/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/osquery/languages","stargazers_url":"https://api.github.com/repos/facebook/osquery/stargazers","contributors_url":"https://api.github.com/repos/facebook/osquery/contributors","subscribers_url":"https://api.github.com/repos/facebook/osquery/subscribers","subscription_url":"https://api.github.com/repos/facebook/osquery/subscription","commits_url":"https://api.github.com/repos/facebook/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/osquery/merges","archive_url":"https://api.github.com/repos/facebook/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/osquery/downloads","issues_url":"https://api.github.com/repos/facebook/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/osquery/labels{/name}","releases_url":"https://api.github.com/repos/facebook/osquery/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/osquery/deployments","created_at":"2014-07-29T20:27:33Z","updated_at":"2018-03-09T17:48:12Z","pushed_at":"2018-03-09T17:02:48Z","git_url":"git://github.com/facebook/osquery.git","ssh_url":"git@github.com:facebook/osquery.git","clone_url":"https://github.com/facebook/osquery.git","svn_url":"https://github.com/facebook/osquery","homepage":"https://osquery.io","size":14400,"stargazers_count":11891,"watchers_count":11891,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1304,"mirror_url":null,"archived":false,"open_issues_count":172,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1304,"open_issues":172,"watchers":11891,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/4177"},"html":{"href":"https://github.com/facebook/osquery/pull/4177"},"issue":{"href":"https://api.github.com/repos/facebook/osquery/issues/4177"},"comments":{"href":"https://api.github.com/repos/facebook/osquery/issues/4177/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/osquery/pulls/4177/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/osquery/pulls/4177/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/osquery/statuses/04e0ab0a4fafea992b0e56648fe65881e7ebd2c0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jjerger"}}