Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
jlib
Commits
c08333ef
Commit
c08333ef
authored
Aug 15, 2018
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update winreg
parent
73faa990
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1329 additions
and
5 deletions
+1329
-5
Registry.hpp
jlib/3rdparty/win32/Registry.hpp
+5
-5
WinReg.hpp
jlib/3rdparty/win32/WinReg.hpp
+1324
-0
No files found.
jlib/3rdparty/win32/Registry.hpp
View file @
c08333ef
...
@@ -437,7 +437,7 @@ inline std::wstring RegGetString(HKEY hKey, const std::wstring& subKey, const st
...
@@ -437,7 +437,7 @@ inline std::wstring RegGetString(HKEY hKey, const std::wstring& subKey, const st
}
}
//
//
// On return, RegGetValue() writes in dataSize the actual size of the string, in bytes.
// On return, RegGetValue
W
() writes in dataSize the actual size of the string, in bytes.
// We must resize the wstring object to the proper string size.
// We must resize the wstring object to the proper string size.
// Note that dataSize is expressed in bytes, and includes the terminating NUL; so we have to
// Note that dataSize is expressed in bytes, and includes the terminating NUL; so we have to
// subtract the NUL from the total string length, as wstring objects are already NUL-terminated.
// subtract the NUL from the total string length, as wstring objects are already NUL-terminated.
...
@@ -631,11 +631,11 @@ inline std::vector<std::pair<std::wstring, DWORD>> RegEnumValues(HKEY hKey)
...
@@ -631,11 +631,11 @@ inline std::vector<std::pair<std::wstring, DWORD>> RegEnumValues(HKEY hKey)
nullptr
// no data size
nullptr
// no data size
);
);
if
(
retCode
!=
ERROR_SUCCESS
)
{
if
(
retCode
!=
ERROR_SUCCESS
)
{
throw
RegistryError
{
"Cannot enumerate values: RegEnumValue failed."
,
retCode
};
throw
RegistryError
{
"Cannot enumerate values: RegEnumValue
W
failed."
,
retCode
};
}
}
//
//
// On success, the RegEnumValue API writes the length of the
// On success, the RegEnumValue
W
API writes the length of the
// value name in the valueNameLen output parameter
// value name in the valueNameLen output parameter
// (not including the terminating NUL).
// (not including the terminating NUL).
// So we can build a wstring based on that length.
// So we can build a wstring based on that length.
...
@@ -714,11 +714,11 @@ inline std::vector<std::wstring> RegEnumSubKeys(HKEY hKey)
...
@@ -714,11 +714,11 @@ inline std::vector<std::wstring> RegEnumSubKeys(HKEY hKey)
nullptr
// no last write time
nullptr
// no last write time
);
);
if
(
retCode
!=
ERROR_SUCCESS
)
{
if
(
retCode
!=
ERROR_SUCCESS
)
{
throw
RegistryError
{
"Cannot enumerate subkeys: RegEnumKeyEx failed."
,
retCode
};
throw
RegistryError
{
"Cannot enumerate subkeys: RegEnumKeyEx
W
failed."
,
retCode
};
}
}
//
//
// On success, the ::RegEnumKeyEx API writes the length of the
// On success, the ::RegEnumKeyEx
W
API writes the length of the
// subkey name in the subKeyNameLen output parameter
// subkey name in the subKeyNameLen output parameter
// (not including the terminating NUL).
// (not including the terminating NUL).
// So I can build a wstring based on that length.
// So I can build a wstring based on that length.
...
...
jlib/3rdparty/win32/WinReg.hpp
0 → 100644
View file @
c08333ef
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment