{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/osquery/pulls/comments/77022528","id":77022528,"diff_hunk":"@@ -89,36 +89,95 @@ std::string WmiResultItem::GetString(const std::string& name) const {\n   return BSTR_to_string(value.bstrVal);\n }\n \n+// Returns a pair with the first value indicating success of the query\n+// and the second value being the data obtained from the query.\n+std::pair<bool, bool> WmiResultItem::GetBool(const std::string& name) const {\n+  std::wstring property_name = string_to_wstring(name);\n+\n+  VARIANT value;\n+  HRESULT hr = result_->Get(property_name.c_str(), 0, &value, nullptr, nullptr);\n+\n+  if (hr != S_OK || value.vt != VT_BOOL) {\n+    return std::make_pair(false, false);\n+  }\n+  return std::make_pair(true, value.boolVal);\n+}\n+\n+std::vector<std::string> WmiResultItem::GetVectorOfStrings(","path":"osquery/tables/system/windows/system_util.cpp","position":37,"original_position":37,"commit_id":"ff81662ff0a429abaa982c0e308f04169cff7c2a","original_commit_id":"ff81662ff0a429abaa982c0e308f04169cff7c2a","user":{"login":"PoppySeedPlehzr","id":1328916,"avatar_url":"https://avatars.githubusercontent.com/u/1328916?v=3","gravatar_id":"","url":"https://api.github.com/users/PoppySeedPlehzr","html_url":"https://github.com/PoppySeedPlehzr","followers_url":"https://api.github.com/users/PoppySeedPlehzr/followers","following_url":"https://api.github.com/users/PoppySeedPlehzr/following{/other_user}","gists_url":"https://api.github.com/users/PoppySeedPlehzr/gists{/gist_id}","starred_url":"https://api.github.com/users/PoppySeedPlehzr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoppySeedPlehzr/subscriptions","organizations_url":"https://api.github.com/users/PoppySeedPlehzr/orgs","repos_url":"https://api.github.com/users/PoppySeedPlehzr/repos","events_url":"https://api.github.com/users/PoppySeedPlehzr/events{/privacy}","received_events_url":"https://api.github.com/users/PoppySeedPlehzr/received_events","type":"User","site_admin":false},"body":"On the note of the above, would it be better to have all of these WMI functions return a status, and pass in a reference to something they add to? So, each of these functions possibly takes a Row or something, adds data to that, and then returns a status?","created_at":"2016-08-31T16:32:32Z","updated_at":"2016-08-31T16:32:32Z","html_url":"https://github.com/facebook/osquery/pull/2430#discussion_r77022528","pull_request_url":"https://api.github.com/repos/facebook/osquery/pulls/2430","_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments/77022528"},"html":{"href":"https://github.com/facebook/osquery/pull/2430#discussion_r77022528"},"pull_request":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2430"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/osquery/pulls/2430","id":83330145,"html_url":"https://github.com/facebook/osquery/pull/2430","diff_url":"https://github.com/facebook/osquery/pull/2430.diff","patch_url":"https://github.com/facebook/osquery/pull/2430.patch","issue_url":"https://api.github.com/repos/facebook/osquery/issues/2430","number":2430,"state":"open","locked":false,"title":"Adding Bool and String Array WMI Wrapper functions","user":{"login":"PoppySeedPlehzr","id":1328916,"avatar_url":"https://avatars.githubusercontent.com/u/1328916?v=3","gravatar_id":"","url":"https://api.github.com/users/PoppySeedPlehzr","html_url":"https://github.com/PoppySeedPlehzr","followers_url":"https://api.github.com/users/PoppySeedPlehzr/followers","following_url":"https://api.github.com/users/PoppySeedPlehzr/following{/other_user}","gists_url":"https://api.github.com/users/PoppySeedPlehzr/gists{/gist_id}","starred_url":"https://api.github.com/users/PoppySeedPlehzr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoppySeedPlehzr/subscriptions","organizations_url":"https://api.github.com/users/PoppySeedPlehzr/orgs","repos_url":"https://api.github.com/users/PoppySeedPlehzr/repos","events_url":"https://api.github.com/users/PoppySeedPlehzr/events{/privacy}","received_events_url":"https://api.github.com/users/PoppySeedPlehzr/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-30T19:16:40Z","updated_at":"2016-08-31T16:32:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"baec27958b4f06a79bd9485945c6ed003ebfc1a5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/osquery/pulls/2430/commits","review_comments_url":"https://api.github.com/repos/facebook/osquery/pulls/2430/comments","review_comment_url":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/2430/comments","statuses_url":"https://api.github.com/repos/facebook/osquery/statuses/ff81662ff0a429abaa982c0e308f04169cff7c2a","head":{"label":"PoppySeedPlehzr:windows-wmi-bool-str-wrappers","ref":"windows-wmi-bool-str-wrappers","sha":"ff81662ff0a429abaa982c0e308f04169cff7c2a","user":{"login":"PoppySeedPlehzr","id":1328916,"avatar_url":"https://avatars.githubusercontent.com/u/1328916?v=3","gravatar_id":"","url":"https://api.github.com/users/PoppySeedPlehzr","html_url":"https://github.com/PoppySeedPlehzr","followers_url":"https://api.github.com/users/PoppySeedPlehzr/followers","following_url":"https://api.github.com/users/PoppySeedPlehzr/following{/other_user}","gists_url":"https://api.github.com/users/PoppySeedPlehzr/gists{/gist_id}","starred_url":"https://api.github.com/users/PoppySeedPlehzr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoppySeedPlehzr/subscriptions","organizations_url":"https://api.github.com/users/PoppySeedPlehzr/orgs","repos_url":"https://api.github.com/users/PoppySeedPlehzr/repos","events_url":"https://api.github.com/users/PoppySeedPlehzr/events{/privacy}","received_events_url":"https://api.github.com/users/PoppySeedPlehzr/received_events","type":"User","site_admin":false},"repo":{"id":55729085,"name":"osquery","full_name":"PoppySeedPlehzr/osquery","owner":{"login":"PoppySeedPlehzr","id":1328916,"avatar_url":"https://avatars.githubusercontent.com/u/1328916?v=3","gravatar_id":"","url":"https://api.github.com/users/PoppySeedPlehzr","html_url":"https://github.com/PoppySeedPlehzr","followers_url":"https://api.github.com/users/PoppySeedPlehzr/followers","following_url":"https://api.github.com/users/PoppySeedPlehzr/following{/other_user}","gists_url":"https://api.github.com/users/PoppySeedPlehzr/gists{/gist_id}","starred_url":"https://api.github.com/users/PoppySeedPlehzr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PoppySeedPlehzr/subscriptions","organizations_url":"https://api.github.com/users/PoppySeedPlehzr/orgs","repos_url":"https://api.github.com/users/PoppySeedPlehzr/repos","events_url":"https://api.github.com/users/PoppySeedPlehzr/events{/privacy}","received_events_url":"https://api.github.com/users/PoppySeedPlehzr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PoppySeedPlehzr/osquery","description":"SQL powered operating system instrumentation, monitoring, and analytics.","fork":true,"url":"https://api.github.com/repos/PoppySeedPlehzr/osquery","forks_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/forks","keys_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/teams","hooks_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/hooks","issue_events_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/issues/events{/number}","events_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/events","assignees_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/assignees{/user}","branches_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/branches{/branch}","tags_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/tags","blobs_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/statuses/{sha}","languages_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/languages","stargazers_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/stargazers","contributors_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/contributors","subscribers_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/subscribers","subscription_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/subscription","commits_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/contents/{+path}","compare_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/merges","archive_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/downloads","issues_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/issues{/number}","pulls_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/pulls{/number}","milestones_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/milestones{/number}","notifications_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/labels{/name}","releases_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/releases{/id}","deployments_url":"https://api.github.com/repos/PoppySeedPlehzr/osquery/deployments","created_at":"2016-04-07T21:23:03Z","updated_at":"2016-08-05T00:17:45Z","pushed_at":"2016-08-30T22:03:55Z","git_url":"git://github.com/PoppySeedPlehzr/osquery.git","ssh_url":"git@github.com:PoppySeedPlehzr/osquery.git","clone_url":"https://github.com/PoppySeedPlehzr/osquery.git","svn_url":"https://github.com/PoppySeedPlehzr/osquery","homepage":"https://osquery.io","size":8906,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"080bc5ed88877f7952fb56259829b3f2a4ca0dd1","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","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://avatars.githubusercontent.com/u/69631?v=3","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":"2016-08-31T16:17:10Z","pushed_at":"2016-08-30T20:04:10Z","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":12774,"stargazers_count":6613,"watchers_count":6613,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":723,"mirror_url":null,"open_issues_count":70,"forks":723,"open_issues":70,"watchers":6613,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2430"},"html":{"href":"https://github.com/facebook/osquery/pull/2430"},"issue":{"href":"https://api.github.com/repos/facebook/osquery/issues/2430"},"comments":{"href":"https://api.github.com/repos/facebook/osquery/issues/2430/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2430/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/osquery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/osquery/pulls/2430/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/osquery/statuses/ff81662ff0a429abaa982c0e308f04169cff7c2a"}}}}
{"actor":{"display_login":"PoppySeedPlehzr"}}