MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / Export

Method Export

WinArk/RegExportImport.cpp:5–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "Registry.h"
4
5bool RegExportImport::Export(PCWSTR keyPath, PCWSTR path) const {
6 auto hFile = ::CreateFile(path, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr);
7 if (hFile == INVALID_HANDLE_VALUE)
8 return false;
9
10 WriteString(hFile, L"Windows Registry Editor Version 5.00\n\n");
11
12 auto key = Registry::OpenKey(keyPath, KEY_READ);
13 if (!key)
14 return false;
15
16 bool success = ExportKeys(key, hFile, keyPath);
17 ::CloseHandle(hFile);
18 return success;
19}
20
21bool RegExportImport::ExportKeys(HKEY hKey, HANDLE hFile, PCWSTR section) const {
22 ExportKey(hKey, hFile, section);

Callers 1

OnExportMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected