[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.
This commit is contained in:
Katayama Hirofumi MZ 2024-02-23 21:26:12 +09:00 committed by GitHub
parent febb589e00
commit 3768f0893d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 12 deletions

View file

@ -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

View file

@ -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)

View file

@ -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;