https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e358d1d2197906669e9d2…
commit e358d1d2197906669e9d20fbba55d2383a0bfe70
Author: Kyle Katarn <contact(a)kcsoftwares.com>
AuthorDate: Sat Sep 12 19:43:59 2020 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Sep 12 19:43:59 2020 +0200
[NTOBJSHEX] Localize the descriptions of the NT object and registry shell extension (#3167)
CORE-17268
---
dll/shellext/ntobjshex/lang/cs-CZ.rc | 2 ++
dll/shellext/ntobjshex/lang/de-DE.rc | 2 ++
dll/shellext/ntobjshex/lang/en-US.rc | 2 ++
dll/shellext/ntobjshex/lang/es-ES.rc | 2 ++
dll/shellext/ntobjshex/lang/fr-FR.rc | 2 ++
dll/shellext/ntobjshex/lang/hi-IN.rc | 2 ++
dll/shellext/ntobjshex/lang/it-IT.rc | 2 ++
dll/shellext/ntobjshex/lang/pl-PL.rc | 2 ++
dll/shellext/ntobjshex/lang/pt-PT.rc | 2 ++
dll/shellext/ntobjshex/lang/ro-RO.rc | 2 ++
dll/shellext/ntobjshex/lang/ru-RU.rc | 2 ++
dll/shellext/ntobjshex/lang/tr-TR.rc | 2 ++
dll/shellext/ntobjshex/lang/zh-CN.rc | 2 ++
dll/shellext/ntobjshex/lang/zh-TW.rc | 2 ++
dll/shellext/ntobjshex/resource.h | 2 ++
dll/shellext/ntobjshex/resources/rgs/ntobjectfolder.rgs | 2 +-
dll/shellext/ntobjshex/resources/rgs/regfolder.rgs | 2 +-
17 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/dll/shellext/ntobjshex/lang/cs-CZ.rc b/dll/shellext/ntobjshex/lang/cs-CZ.rc
index 5b052c31b0e..ff13875d9af 100644
--- a/dll/shellext/ntobjshex/lang/cs-CZ.rc
+++ b/dll/shellext/ntobjshex/lang/cs-CZ.rc
@@ -4,4 +4,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "Jmenný prostor NT objektů"
IDS_REGISTRY_NAME "Systémový registr"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/de-DE.rc b/dll/shellext/ntobjshex/lang/de-DE.rc
index 5fbdf00a7ee..89fdda86af2 100644
--- a/dll/shellext/ntobjshex/lang/de-DE.rc
+++ b/dll/shellext/ntobjshex/lang/de-DE.rc
@@ -4,4 +4,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "NT-Objekt-Namespace"
IDS_REGISTRY_NAME "Systemregistry"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/en-US.rc b/dll/shellext/ntobjshex/lang/en-US.rc
index e2a9234f633..6dbc206e776 100644
--- a/dll/shellext/ntobjshex/lang/en-US.rc
+++ b/dll/shellext/ntobjshex/lang/en-US.rc
@@ -4,4 +4,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "NT Object Namespace"
IDS_REGISTRY_NAME "System Registry"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/es-ES.rc b/dll/shellext/ntobjshex/lang/es-ES.rc
index d5700d4806c..d551323f7a3 100644
--- a/dll/shellext/ntobjshex/lang/es-ES.rc
+++ b/dll/shellext/ntobjshex/lang/es-ES.rc
@@ -4,4 +4,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "Espacio de nombres NT"
IDS_REGISTRY_NAME "Registro del sistema"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/fr-FR.rc b/dll/shellext/ntobjshex/lang/fr-FR.rc
index 96dc8e894c8..51e6e1dba43 100644
--- a/dll/shellext/ntobjshex/lang/fr-FR.rc
+++ b/dll/shellext/ntobjshex/lang/fr-FR.rc
@@ -4,4 +4,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "Espace de noms des objets NT"
IDS_REGISTRY_NAME "Registre système"
+ IDS_NTOBJFLD_COMMENT "Permet de naviguer dans l'espace des objets NT"
+ IDS_REGISTRY_COMMENT "Permet de naviguer dans le registre système"
END
diff --git a/dll/shellext/ntobjshex/lang/hi-IN.rc b/dll/shellext/ntobjshex/lang/hi-IN.rc
index 6847e398204..13497ca7cfc 100644
--- a/dll/shellext/ntobjshex/lang/hi-IN.rc
+++ b/dll/shellext/ntobjshex/lang/hi-IN.rc
@@ -11,4 +11,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "एनटी ऑब्जेक्ट नाम स्थान"
IDS_REGISTRY_NAME "सिस्टम रजिस्ट्री"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/it-IT.rc b/dll/shellext/ntobjshex/lang/it-IT.rc
index f26374f949e..627318286f1 100644
--- a/dll/shellext/ntobjshex/lang/it-IT.rc
+++ b/dll/shellext/ntobjshex/lang/it-IT.rc
@@ -4,4 +4,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "Oggetto Namespace NT"
IDS_REGISTRY_NAME "Registro di Sistema"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/pl-PL.rc b/dll/shellext/ntobjshex/lang/pl-PL.rc
index fadaf5641db..828b21d4fa5 100644
--- a/dll/shellext/ntobjshex/lang/pl-PL.rc
+++ b/dll/shellext/ntobjshex/lang/pl-PL.rc
@@ -4,4 +4,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "Przestrzeń nazw NT Object"
IDS_REGISTRY_NAME "Rejestr systemu"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/pt-PT.rc b/dll/shellext/ntobjshex/lang/pt-PT.rc
index c731e5d16e5..cd0f78e4b5e 100644
--- a/dll/shellext/ntobjshex/lang/pt-PT.rc
+++ b/dll/shellext/ntobjshex/lang/pt-PT.rc
@@ -4,4 +4,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "NT Espaço de nomes"
IDS_REGISTRY_NAME "Registo do sistema"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/ro-RO.rc b/dll/shellext/ntobjshex/lang/ro-RO.rc
index 864e4d6bb23..b90282b19a2 100644
--- a/dll/shellext/ntobjshex/lang/ro-RO.rc
+++ b/dll/shellext/ntobjshex/lang/ro-RO.rc
@@ -6,4 +6,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "Spațiul de nume Obiect NT"
IDS_REGISTRY_NAME "Registrul de sistem"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/ru-RU.rc b/dll/shellext/ntobjshex/lang/ru-RU.rc
index 68e7b010e1d..9d3c670773a 100644
--- a/dll/shellext/ntobjshex/lang/ru-RU.rc
+++ b/dll/shellext/ntobjshex/lang/ru-RU.rc
@@ -6,4 +6,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "Пространство имен объектов NT"
IDS_REGISTRY_NAME "Системный реестр"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/tr-TR.rc b/dll/shellext/ntobjshex/lang/tr-TR.rc
index ab48e10d00d..345d178f8e7 100644
--- a/dll/shellext/ntobjshex/lang/tr-TR.rc
+++ b/dll/shellext/ntobjshex/lang/tr-TR.rc
@@ -6,4 +6,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "NT Nesne Ad Alanı"
IDS_REGISTRY_NAME "Sistem Kayıt Kütüğü"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/zh-CN.rc b/dll/shellext/ntobjshex/lang/zh-CN.rc
index d805dbac18b..0babf22e87e 100644
--- a/dll/shellext/ntobjshex/lang/zh-CN.rc
+++ b/dll/shellext/ntobjshex/lang/zh-CN.rc
@@ -6,4 +6,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "NT 对象名称空间"
IDS_REGISTRY_NAME "系统注册表"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/lang/zh-TW.rc b/dll/shellext/ntobjshex/lang/zh-TW.rc
index 807de592099..2e8b6fd4a07 100644
--- a/dll/shellext/ntobjshex/lang/zh-TW.rc
+++ b/dll/shellext/ntobjshex/lang/zh-TW.rc
@@ -6,4 +6,6 @@ STRINGTABLE
BEGIN
IDS_NTOBJFLD_NAME "NT 物件名稱空間"
IDS_REGISTRY_NAME "系統登錄"
+ IDS_NTOBJFLD_COMMENT "Allows browsing of the NT Object Namespace"
+ IDS_REGISTRY_COMMENT "Allows browsing of the System Registry"
END
diff --git a/dll/shellext/ntobjshex/resource.h b/dll/shellext/ntobjshex/resource.h
index 876dd61177f..147803c1e3f 100644
--- a/dll/shellext/ntobjshex/resource.h
+++ b/dll/shellext/ntobjshex/resource.h
@@ -11,6 +11,8 @@
#define IDS_NTOBJFLD_NAME 101
#define IDS_REGISTRY_NAME 102
+#define IDS_NTOBJFLD_COMMENT 103
+#define IDS_REGISTRY_COMMENT 104
#define IDR_NTOBJECTFOLDER 1001
#define IDR_REGISTRYFOLDER 1002
diff --git a/dll/shellext/ntobjshex/resources/rgs/ntobjectfolder.rgs b/dll/shellext/ntobjshex/resources/rgs/ntobjectfolder.rgs
index 74cc8ad1b44..84284d1039e 100644
--- a/dll/shellext/ntobjshex/resources/rgs/ntobjectfolder.rgs
+++ b/dll/shellext/ntobjshex/resources/rgs/ntobjectfolder.rgs
@@ -19,7 +19,7 @@ HKCR
{
val ThreadingModel = s 'Both'
}
- val InfoTip = s 'Allows browsing of the NT Object Namespace'
+ val InfoTip = s '@%MODULE%,-103'
val LocalizedString = s '@%MODULE%,-101'
DefaultIcon = s '%MODULE%,0'
ShellFolder
diff --git a/dll/shellext/ntobjshex/resources/rgs/regfolder.rgs b/dll/shellext/ntobjshex/resources/rgs/regfolder.rgs
index 3e5ce4d0e8a..acad5822125 100644
--- a/dll/shellext/ntobjshex/resources/rgs/regfolder.rgs
+++ b/dll/shellext/ntobjshex/resources/rgs/regfolder.rgs
@@ -19,7 +19,7 @@ HKCR
{
val ThreadingModel = s 'Both'
}
- val InfoTip = s 'Allows browsing of the System Registry'
+ val InfoTip = s '@%MODULE%,-104'
val LocalizedString = s '@%MODULE%,-102'
DefaultIcon = s '%MODULE%,-7'
ShellFolder
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cd2eaf1e51d9afd7a21c2…
commit cd2eaf1e51d9afd7a21c2e4dfdd019174a7bc382
Author: chirsz <31474766+chirsz-ever(a)users.noreply.github.com>
AuthorDate: Sun Sep 13 00:23:05 2020 +0800
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Sep 12 18:23:05 2020 +0200
[CONSRV] Improve zh-CN translation (#3157)
The new word is more in line with PRC people's usage habits, and it
is actually used in the Simplified Chinese translation of Windows.
---
win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc b/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc
index 3509f505fb3..4552ba0471a 100644
--- a/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc
+++ b/win32ss/user/winsrv/consrv/frontends/gui/lang/zh-CN.rc
@@ -5,7 +5,7 @@ BEGIN
IDS_EDIT "编辑"
IDS_MARK "标记"
IDS_COPY "复制\tEnter"
- IDS_PASTE "黏贴"
+ IDS_PASTE "粘贴"
IDS_SELECTALL "全部选择"
IDS_SCROLL "滚动"
IDS_FIND "查找..."
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c8e3ef78943b37d1541c6…
commit c8e3ef78943b37d1541c62154bb5cf3d50f3bbd3
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Sep 10 19:03:20 2020 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Sep 10 19:03:20 2020 +0900
[SHELLFIND] Split encoding detection code (#3147)
Split encoding detection code to improve code quality. This is follow-up of #3134 (7376cde). CORE-17250
---
dll/win32/browseui/shellfind/CFindFolder.cpp | 176 +++++++++++++++++++++++----
1 file changed, 155 insertions(+), 21 deletions(-)
diff --git a/dll/win32/browseui/shellfind/CFindFolder.cpp b/dll/win32/browseui/shellfind/CFindFolder.cpp
index ec24b116c29..3517cc2e2ef 100644
--- a/dll/win32/browseui/shellfind/CFindFolder.cpp
+++ b/dll/win32/browseui/shellfind/CFindFolder.cpp
@@ -185,6 +185,137 @@ StrFindNIW(const WCHAR *lpFirst, const CStringW &lpSrch, UINT cchMax)
return StrStrN<WCHAR, CStringW, _wcsnicmp>(lpFirst, lpSrch, cchMax) != NULL;
}
+/*
+ * The following code is borrowed from base/applications/cmdutils/more/more.c .
+ */
+typedef enum
+{
+ ENCODING_ANSI = 0,
+ ENCODING_UTF16LE = 1,
+ ENCODING_UTF16BE = 2,
+ ENCODING_UTF8 = 3
+} ENCODING;
+
+static BOOL
+IsDataUnicode(
+ IN PVOID Buffer,
+ IN DWORD BufferSize,
+ OUT ENCODING* Encoding OPTIONAL,
+ OUT PDWORD SkipBytes OPTIONAL)
+{
+ PBYTE pBytes = (PBYTE)Buffer;
+ ENCODING encFile = ENCODING_ANSI;
+ DWORD dwPos = 0;
+
+ /*
+ * See http://archives.miloush.net/michkap/archive/2007/04/22/2239345.html
+ * for more details about the algorithm and the pitfalls behind it.
+ * Of course it would be actually great to make a nice function that
+ * would work, once and for all, and put it into a library.
+ */
+
+ /* Look for Byte Order Marks */
+ if ((BufferSize >= 2) && (pBytes[0] == 0xFF) && (pBytes[1] == 0xFE))
+ {
+ encFile = ENCODING_UTF16LE;
+ dwPos = 2;
+ }
+ else if ((BufferSize >= 2) && (pBytes[0] == 0xFE) && (pBytes[1] == 0xFF))
+ {
+ encFile = ENCODING_UTF16BE;
+ dwPos = 2;
+ }
+ else if ((BufferSize >= 3) && (pBytes[0] == 0xEF) && (pBytes[1] == 0xBB) && (pBytes[2] == 0xBF))
+ {
+ encFile = ENCODING_UTF8;
+ dwPos = 3;
+ }
+ else
+ {
+ /*
+ * Try using statistical analysis. Do not rely on the return value of
+ * IsTextUnicode as we can get FALSE even if the text is in UTF-16 BE
+ * (i.e. we have some of the IS_TEXT_UNICODE_REVERSE_MASK bits set).
+ * Instead, set all the tests we want to perform, then just check
+ * the passed tests and try to deduce the string properties.
+ */
+
+/*
+ * This mask contains the 3 highest bits from IS_TEXT_UNICODE_NOT_ASCII_MASK
+ * and the 1st highest bit from IS_TEXT_UNICODE_NOT_UNICODE_MASK.
+ */
+#define IS_TEXT_UNKNOWN_FLAGS_MASK ((7 << 13) | (1 << 11))
+
+ /* Flag out the unknown flags here, the passed tests will not have them either */
+ INT Tests = (IS_TEXT_UNICODE_NOT_ASCII_MASK |
+ IS_TEXT_UNICODE_NOT_UNICODE_MASK |
+ IS_TEXT_UNICODE_REVERSE_MASK | IS_TEXT_UNICODE_UNICODE_MASK)
+ & ~IS_TEXT_UNKNOWN_FLAGS_MASK;
+ INT Results;
+
+ IsTextUnicode(Buffer, BufferSize, &Tests);
+ Results = Tests;
+
+ /*
+ * As the IS_TEXT_UNICODE_NULL_BYTES or IS_TEXT_UNICODE_ILLEGAL_CHARS
+ * flags are expected to be potentially present in the result without
+ * modifying our expectations, filter them out now.
+ */
+ Results &= ~(IS_TEXT_UNICODE_NULL_BYTES | IS_TEXT_UNICODE_ILLEGAL_CHARS);
+
+ /*
+ * NOTE: The flags IS_TEXT_UNICODE_ASCII16 and
+ * IS_TEXT_UNICODE_REVERSE_ASCII16 are not reliable.
+ *
+ * NOTE2: Check for potential "bush hid the facts" effect by also
+ * checking the original results (in 'Tests') for the absence of
+ * the IS_TEXT_UNICODE_NULL_BYTES flag, as we may presumably expect
+ * that in UTF-16 text there will be at some point some NULL bytes.
+ * If not, fall back to ANSI. This shows the limitations of using the
+ * IsTextUnicode API to perform such tests, and the usage of a more
+ * improved encoding detection algorithm would be really welcome.
+ */
+ if (!(Results & IS_TEXT_UNICODE_NOT_UNICODE_MASK) &&
+ !(Results & IS_TEXT_UNICODE_REVERSE_MASK) &&
+ (Results & IS_TEXT_UNICODE_UNICODE_MASK) &&
+ (Tests & IS_TEXT_UNICODE_NULL_BYTES))
+ {
+ encFile = ENCODING_UTF16LE;
+ dwPos = (Results & IS_TEXT_UNICODE_SIGNATURE) ? 2 : 0;
+ }
+ else
+ if (!(Results & IS_TEXT_UNICODE_NOT_UNICODE_MASK) &&
+ !(Results & IS_TEXT_UNICODE_UNICODE_MASK) &&
+ (Results & IS_TEXT_UNICODE_REVERSE_MASK) &&
+ (Tests & IS_TEXT_UNICODE_NULL_BYTES))
+ {
+ encFile = ENCODING_UTF16BE;
+ dwPos = (Results & IS_TEXT_UNICODE_REVERSE_SIGNATURE) ? 2 : 0;
+ }
+ else
+ {
+ /*
+ * Either 'Results' has neither of those masks set, as it can be
+ * the case for UTF-8 text (or ANSI), or it has both as can be the
+ * case when analysing pure binary data chunk. This is therefore
+ * invalid and we fall back to ANSI encoding.
+ * FIXME: In case of failure, assume ANSI (as long as we do not have
+ * correct tests for UTF8, otherwise we should do them, and at the
+ * very end, assume ANSI).
+ */
+ encFile = ENCODING_ANSI; // ENCODING_UTF8;
+ dwPos = 0;
+ }
+ }
+
+ if (Encoding)
+ *Encoding = encFile;
+ if (SkipBytes)
+ *SkipBytes = dwPos;
+
+ return (encFile != ENCODING_ANSI);
+}
+
static BOOL SearchFile(LPCWSTR lpFilePath, _SearchData *pSearchData)
{
HANDLE hFile = CreateFileW(lpFilePath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
@@ -209,28 +340,31 @@ static BOOL SearchFile(LPCWSTR lpFilePath, _SearchData *pSearchData)
if (!pbContents)
return FALSE;
+ ENCODING encoding;
+ IsDataUnicode(pbContents, size, &encoding, NULL);
+
BOOL bFound;
- if (size >= 2 &&
- (memcmp(pbContents, "\xFF\xFE", 2) == 0 || (pbContents[0] && !pbContents[1])))
- {
- // UTF-16
- bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryW, size / sizeof(WCHAR));
- }
- else if (size >= 2 &&
- (memcmp(pbContents, "\xFE\xFF", 2) == 0 || (!pbContents[0] && pbContents[1])))
- {
- // UTF-16 BE
- bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryU16BE, size / sizeof(WCHAR));
- }
- else if (size >= 3 && memcmp(pbContents, "\xEF\xBB\xBF", 3) == 0)
- {
- // UTF-8
- bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryU8, size / sizeof(CHAR));
- }
- else
- {
- // ANSI
- bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryA, size / sizeof(CHAR));
+ switch (encoding)
+ {
+ case ENCODING_UTF16LE:
+ // UTF-16
+ bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryW, size / sizeof(WCHAR));
+ break;
+ case ENCODING_UTF16BE:
+ // UTF-16 BE
+ bFound = StrFindNIW((LPCWSTR)pbContents, pSearchData->szQueryU16BE, size / sizeof(WCHAR));
+ break;
+ case ENCODING_UTF8:
+ // UTF-8
+ bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryU8, size / sizeof(CHAR));
+ break;
+ case ENCODING_ANSI:
+ default:
+ // ANSI or UTF-8 without BOM
+ bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryA, size / sizeof(CHAR));
+ if (!bFound && pSearchData->szQueryA != pSearchData->szQueryU8)
+ bFound = StrFindNIA((LPCSTR)pbContents, pSearchData->szQueryU8, size / sizeof(CHAR));
+ break;
}
UnmapViewOfFile(pbContents);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=abbe656407b7ff56d902c…
commit abbe656407b7ff56d902c3f970d618eb269b9753
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Mon Sep 7 20:32:00 2020 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Mon Sep 7 20:32:00 2020 +0200
[SDK][NDK][PSTYPES] Fix regressions CORE-17247 & CORE-17248
By reverting the guilty rev 0.4.14-dev-1239-g
7481bda679eccdf1eba3666e500074dcb966e748
and placing a C_ASSERT() to protect us from doing the
same fault again in the future. (proposed by Mark Jansen)
This will allow again to use kernel32.dll from 2k3sp2 to
reach desktop and it will allow Google Earth to run again.
Unfortunately it will break CORE-16757 again,
but we did not ship that improvement yet
and we believe that revert to be correct.
When approaching CORE-16757 later, make sure to double-check
also CORE-17247 & CORE-17248 with your fix.
We did excessive testing here, see
https://jira.reactos.org/browse/CORE-17247?focusedCommentId=125166&page=com…
---
sdk/include/ndk/pstypes.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sdk/include/ndk/pstypes.h b/sdk/include/ndk/pstypes.h
index 55839aca37a..d10199097a3 100644
--- a/sdk/include/ndk/pstypes.h
+++ b/sdk/include/ndk/pstypes.h
@@ -910,12 +910,15 @@ typedef struct _PROCESS_SESSION_INFORMATION
#endif
-typedef struct DECLSPEC_ALIGN(4) _PROCESS_PRIORITY_CLASS
+typedef struct _PROCESS_PRIORITY_CLASS
{
BOOLEAN Foreground;
UCHAR PriorityClass;
} PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
+// Compatibility with windows, see CORE-16757, CORE-17106, CORE-17247
+C_ASSERT(sizeof(PROCESS_PRIORITY_CLASS) == 2);
+
typedef struct _PROCESS_FOREGROUND_BACKGROUND
{
BOOLEAN Foreground;
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f562f9c5c629cba3f370f…
commit f562f9c5c629cba3f370f078d12c2f13a997c8f2
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Mon Sep 7 04:57:17 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Mon Sep 7 04:57:17 2020 +0300
[NTOS:IO] Fix IRP stack location check in IoForwardIrpSynchronously
We are doing IoCallDriver here, so the valid stack location should be
CurrentLocation <= Irp->StackCount (just a check for a completly incorrect value)
&& CurrentLocation > 1 (ensure that we have a place for another call)
CORE-17189
Co-authored-by: Thomas Faber <thomas.faber(a)reactos.org>
---
ntoskrnl/io/iomgr/irp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ntoskrnl/io/iomgr/irp.c b/ntoskrnl/io/iomgr/irp.c
index 1b19d49e9a4..2de843975e0 100644
--- a/ntoskrnl/io/iomgr/irp.c
+++ b/ntoskrnl/io/iomgr/irp.c
@@ -1629,7 +1629,7 @@ IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject,
NTSTATUS Status;
/* Check if next stack location is available */
- if (Irp->CurrentLocation < Irp->StackCount)
+ if (Irp->CurrentLocation > Irp->StackCount || Irp->CurrentLocation <= 1)
{
/* No more stack location */
return FALSE;