Commit Graph

17 Commits

Author SHA1 Message Date
Ateeq Sharfuddin
f79d7e32ee
Define UNICODE and _UNICODE preprocessors for windows (#6338) 2020-07-23 21:23:23 -04:00
Ateeq Sharfuddin
2303e1bbd0 Fix Issue#6173: Update WmiRequest constructor to wstring from BSTR (#6175) 2020-01-16 23:05:16 -05:00
mark m
826d1f3b44 core/windows/wmi: Add ability to exec methods on WMI results (#5504) 2019-12-31 19:09:47 -05:00
Mark Mossberg
7a20236297 core/windows/wmi: Refactor to use smart pointers (#5492)
Summary:
Hi!

This PR refactors the WmiRequest and WmiResultItem classes to use smart pointers to manage their WMI objects. Previously, this code used raw pointers for these objects. The destructors needed to ensure to free these objects, and the move constructors needed to manually transfer the pointer, and set the src pointer to `nullptr`.

Now, `unique_ptr`s are used for most of the objects. `shared_ptr` is used for the `IWbemServices` pointer in preparation for a future PR which will add an identical shared services pointer to the `WmiResultItem` class, for implementing some new functionality there. For reference, you can see that future PR here at https://github.com/trailofbits/osquery-pr/pull/8/.

Conversion to smart pointers for these types requires a custom deleter, so there are some extra `using` statements and custom deletion functions that you'll find. With smart pointers in place, the destructors can be simplified to completely remove the free'ing logic, and the move constructor can be simplified to simply use `std::move`.

Apart from these, the only other part of this PR is adjusting some of the logic in the `WmiRequest` constructor to adjust to these new smart pointers. Specifically, we introduce some locals which are use for the winapi calls, and then `reset` the smart pointers using those locals.

Thanks!
Pull Request resolved: https://github.com/facebook/osquery/pull/5492

Differential Revision: D14368418

Pulled By: akindyakov

fbshipit-source-id: 5a6755aada6ee937f4b6b7cfef6dfd4863bc40fb
2019-03-08 09:30:36 -08:00
Mark Mossberg
e65551d751 core/windows: Fix spelling issues (#5471)
Summary:
Super tiny PR to fix some spelling. This is the first of a few incremental PRs for some improvements to WMI!
Pull Request resolved: https://github.com/facebook/osquery/pull/5471

Reviewed By: marekcirkos

Differential Revision: D14240440

Pulled By: jessek

fbshipit-source-id: 9a6c23c3aa31bda15972dc79bbad07640727d19a
2019-03-01 03:37:03 -08:00
Jesse Kornblum
c7355b19aa Update osquery licensing wording (#5452)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5452

As suggested in another diff, this diff updates the language we use to describe the osquery licensing terms. We are changing all instances of

//This source code is licensed as defined on the LICENSE file found in the root directory of this source tree.//

to

//This source code is licensed in accordance with the terms specified in the LICENSE file found in the root directory of this source tree.//

We accomplish this with a codemod:

  $ codemod -md xplat/osquery/oss --extensions cpp,h,in,py,sh,mm,ps1 "(.\s+)This source code is licensed as defined on the LICENSE file found in the(.*)root directory of this source tree\." "\1This source code is licensed in accordance with the terms specified in\2the LICENSE file found in the root directory of this source tree."

Reviewed By: fmanco

Differential Revision: D14131290

fbshipit-source-id: 52c90da342263e2a80f5a678ecd760c19cf7513e
2019-02-19 10:59:48 -08:00
Filipe Manco
a67525fae1 Fix LICENSE information on file headers (#5375)
Summary:
Pull Request resolved: https://github.com/facebook/osquery/pull/5375

LICENSE is now defined in a single file on the root of the project, update the
header to contain that information.

**Project LICENSE did not change.**

Reviewed By: akindyakov

Differential Revision: D13750575

fbshipit-source-id: 1e608a81b260b8395f9d008fc67f463160c1fc2b
2019-01-21 11:51:54 -08:00
George Guliashvili
971bee4441 Move build system to BUCK
fbshipit-source-id: 8ffef5e6a393ac67ce56dcb74845402e43d964a0
2018-12-07 16:12:35 +00:00
yying
6e9f23a0e2 Add ReleaseDate to table for platform_info queries on Windows (#5182) 2018-09-10 17:05:44 -07:00
narendhar15
40f1320bfa Add constness for the methods of class WmiRequest (#4807) 2018-08-09 10:16:49 +01:00
Teddy Reed
00040c6c1a
feature: URI parsing from folly (#4035) 2018-01-06 20:26:36 -08:00
Teddy Reed
f6d077cbf7
license: Change license to Apache 2.0 and GPLv2 (#4007) 2017-12-18 16:04:06 -08:00
Dan Sedlacek
1d604fc1af [windows] arp_cache virtual table (#2839) 2017-01-10 19:09:46 -08:00
Teddy Reed
0e9733f94c Simplify Registry and plugin concepts (#2887) 2017-01-07 12:21:35 -08:00
Phil Christensen
1c21fe4208 C++ conformance fixes (MSVC /permissive-) (#2860) 2016-12-12 00:23:08 -08:00
Nick Anderson
616d9f5953 Adding support for Windows platform_info table (#2611) 2016-10-12 09:01:32 -07:00
Nick Anderson
3a351ebf43 Adding windows system_info virtual table (#2521) 2016-09-26 11:08:57 -07:00