https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3768f0893dd69e5a43bcb…
commit 3768f0893dd69e5a43bcb4fdead7b1d90785c4d2
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Feb 23 21:26:12 2024 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Feb 23 21:26:12 2024 +0900
[WIN32SS] Fix const-ness of registry helper functions (#6525)
Improve code quality.
JIRA issue: CORE-19360
- Fix const-ness of the arguments
of win32k registry helper functions.
- Compact UserIsIMMEnabled function.
---
win32ss/gdi/ntgdi/misc.h | 8 ++++----
win32ss/user/ntuser/metric.c | 4 +---
win32ss/user/ntuser/misc/registry.c | 9 ++++-----
3 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/win32ss/gdi/ntgdi/misc.h b/win32ss/gdi/ntgdi/misc.h
index 6b0e2f022b0..da0b043a1f5 100644
--- a/win32ss/gdi/ntgdi/misc.h
+++ b/win32ss/gdi/ntgdi/misc.h
@@ -46,19 +46,19 @@ RegQueryValue(
VOID
NTAPI
-RegWriteSZ(HKEY hkey, PWSTR pwszValue, PWSTR pwszData);
+RegWriteSZ(HKEY hkey, PCWSTR pwszValue, PWSTR pwszData);
VOID
NTAPI
-RegWriteDWORD(HKEY hkey, PWSTR pwszValue, DWORD dwData);
+RegWriteDWORD(HKEY hkey, PCWSTR pwszValue, DWORD dwData);
BOOL
NTAPI
-RegReadDWORD(HKEY hkey, PWSTR pwszValue, PDWORD pdwData);
+RegReadDWORD(HKEY hkey, PCWSTR pwszValue, PDWORD pdwData);
DWORD
NTAPI
-RegGetSectionDWORD(LPCWSTR pszSection, LPWSTR pszValue, DWORD dwDefault);
+RegGetSectionDWORD(LPCWSTR pszSection, PCWSTR pszValue, DWORD dwDefault);
VOID
FASTCALL
diff --git a/win32ss/user/ntuser/metric.c b/win32ss/user/ntuser/metric.c
index a72e1856edf..b5024013e10 100644
--- a/win32ss/user/ntuser/metric.c
+++ b/win32ss/user/ntuser/metric.c
@@ -21,12 +21,10 @@ BOOL FASTCALL UserIsDBCSEnabled(VOID)
BOOL FASTCALL UserIsIMMEnabled(VOID)
{
- static WCHAR s_szLoadIMM[] = L"LoadIMM";
-
if (NLS_MB_CODE_PAGE_TAG)
return TRUE;
- return !!RegGetSectionDWORD(L"IMM", s_szLoadIMM, TRUE);
+ return !!RegGetSectionDWORD(L"IMM", L"LoadIMM", FALSE);
}
BOOL FASTCALL UserIsCiceroEnabled(VOID)
diff --git a/win32ss/user/ntuser/misc/registry.c b/win32ss/user/ntuser/misc/registry.c
index 2d7ca4a3d0b..8a1cf574981 100644
--- a/win32ss/user/ntuser/misc/registry.c
+++ b/win32ss/user/ntuser/misc/registry.c
@@ -120,12 +120,11 @@ RegQueryValue(
ExFreePoolWithTag(pInfo, TAG_TEMP);
return Status;
-
}
VOID
NTAPI
-RegWriteSZ(HKEY hkey, PWSTR pwszValue, PWSTR pwszData)
+RegWriteSZ(HKEY hkey, PCWSTR pwszValue, PWSTR pwszData)
{
UNICODE_STRING ustrValue;
UNICODE_STRING ustrData;
@@ -137,7 +136,7 @@ RegWriteSZ(HKEY hkey, PWSTR pwszValue, PWSTR pwszData)
VOID
NTAPI
-RegWriteDWORD(HKEY hkey, PWSTR pwszValue, DWORD dwData)
+RegWriteDWORD(HKEY hkey, PCWSTR pwszValue, DWORD dwData)
{
UNICODE_STRING ustrValue;
@@ -147,7 +146,7 @@ RegWriteDWORD(HKEY hkey, PWSTR pwszValue, DWORD dwData)
BOOL
NTAPI
-RegReadDWORD(HKEY hkey, PWSTR pwszValue, PDWORD pdwData)
+RegReadDWORD(HKEY hkey, PCWSTR pwszValue, PDWORD pdwData)
{
NTSTATUS Status;
ULONG cbSize = sizeof(DWORD);
@@ -170,7 +169,7 @@ RegOpenSectionKey(
DWORD
NTAPI
-RegGetSectionDWORD(LPCWSTR pszSection, LPWSTR pszValue, DWORD dwDefault)
+RegGetSectionDWORD(LPCWSTR pszSection, PCWSTR pszValue, DWORD dwDefault)
{
HKEY hKey;
DWORD dwValue;