| 200 | } |
| 201 | |
| 202 | DWORD RegistrySearcher::DoSearch() { |
| 203 | if ((_options & (FindOptions::SearchStdRegistry | FindOptions::SearchSelected)) == FindOptions::SearchStdRegistry) { |
| 204 | for (auto key : Registry::Keys) { |
| 205 | FindNextWorker(key.hKey, key.text); |
| 206 | if (_cancel) |
| 207 | break; |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | if (!_cancel && (_options & (FindOptions::SearchRealRegistry | FindOptions::SearchSelected)) == FindOptions::SearchRealRegistry) { |
| 212 | FindNextWorker(Registry::OpenRealRegistryKey(), L"\\REGISTRY"); |
| 213 | } |
| 214 | if (!_cancel && (_options & FindOptions::SearchSelected) == FindOptions::SearchSelected) { |
| 215 | FindNextWorker(Registry::OpenKey(_startKey, KEY_READ).Get(), _startKey); |
| 216 | } |
| 217 | |
| 218 | _cb(nullptr, nullptr, nullptr); |
| 219 | ::SetEvent(_hDoneEvent.get()); |
| 220 | _inProgress = false; |
| 221 | |
| 222 | return 0; |
| 223 | } |