Author: hbelusca
Date: Wed Mar 15 00:06:42 2017
New Revision: 74172
URL:
http://svn.reactos.org/svn/reactos?rev=74172&view=rev
Log:
[NDK]: No, the NDK applications do not have to use UNICODE.
Indeed the RTL/NDK/whatever always explicitely uses ANSI and/or UNICODE string types where
needed (and do not depend on tchar.h stuff).
It is up to the given application to explicitely specify (in its CMakeLists.txt or
elsewhere) whether it wants to define UNICODE or not.
--> Fix the problem of having the UNICODE define magically being defined after
including some NDK header.
[DNSAPI][USER32_APITEST]: Explicitely use UNICODE functions where needed (and as was
already done in other parts of the code).
Modified:
trunk/reactos/dll/win32/dnsapi/dnsapi/query.c
trunk/reactos/sdk/include/ndk/umtypes.h
trunk/rostests/apitests/user32/RegisterClassEx.c
Modified: trunk/reactos/dll/win32/dnsapi/dnsapi/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dnsapi/dnsapi/qu…
==============================================================================
--- trunk/reactos/dll/win32/dnsapi/dnsapi/query.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/dnsapi/dnsapi/query.c [iso-8859-1] Wed Mar 15 00:06:42 2017
@@ -303,25 +303,25 @@
{
/* Use defalt path */
GetSystemDirectoryW(ExpandedPath, MAX_PATH);
- StringCchLength(ExpandedPath, MAX_PATH, &StringLength);
+ StringCchLengthW(ExpandedPath, MAX_PATH, &StringLength);
if (ExpandedPath[StringLength - 1] != L'\\')
{
/* It isn't, so add it ourselves */
- StringCchCat(ExpandedPath, MAX_PATH, L"\\");
- }
- StringCchCat(ExpandedPath, MAX_PATH, L"DRIVERS\\ETC\\");
+ StringCchCatW(ExpandedPath, MAX_PATH, L"\\");
+ }
+ StringCchCatW(ExpandedPath, MAX_PATH, L"DRIVERS\\ETC\\");
}
/* Make sure that the path is backslash-terminated */
- StringCchLength(ExpandedPath, MAX_PATH, &StringLength);
+ StringCchLengthW(ExpandedPath, MAX_PATH, &StringLength);
if (ExpandedPath[StringLength - 1] != L'\\')
{
/* It isn't, so add it ourselves */
- StringCchCat(ExpandedPath, MAX_PATH, L"\\");
+ StringCchCatW(ExpandedPath, MAX_PATH, L"\\");
}
/* Add the database name */
- StringCchCat(ExpandedPath, MAX_PATH, Name);
+ StringCchCatW(ExpandedPath, MAX_PATH, Name);
/* Return a handle to the file */
ret = CreateFileW(ExpandedPath,
Modified: trunk/reactos/sdk/include/ndk/umtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/ndk/umtypes.h?…
==============================================================================
--- trunk/reactos/sdk/include/ndk/umtypes.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/ndk/umtypes.h [iso-8859-1] Wed Mar 15 00:06:42 2017
@@ -26,13 +26,6 @@
#include <sal.h>
#if (_SAL_VERSION < 20)
#include <no_sal2.h>
-#endif
-
-//
-// NDK Applications must use Unicode
-//
-#ifndef UNICODE
-#define UNICODE
#endif
//
Modified: trunk/rostests/apitests/user32/RegisterClassEx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/RegisterC…
==============================================================================
--- trunk/rostests/apitests/user32/RegisterClassEx.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/RegisterClassEx.c [iso-8859-1] Wed Mar 15 00:06:42
2017
@@ -79,7 +79,7 @@
a = _GetClassAtom(L"TestClass1", hmod);
b = _RegisterClass(L"TestClass1", hmod, 0, DefWindowProcW);
c = _GetClassAtom(L"TestClass1", hmod);
- UnregisterClass(L"TestClass1", hmod);
+ UnregisterClassW(L"TestClass1", hmod);
d = _GetClassAtom(L"TestClass1", hmod);
ok( a == 0, "\n");
ok( b != 0, "\n");
@@ -90,7 +90,7 @@
a = _GetClassAtom(L"TestClass2", hmod);
b = _RegisterClass(L"TestClass2", hmod, CS_GLOBALCLASS, DefWindowProcW);
c = _GetClassAtom(L"TestClass2", hmod);
- UnregisterClass(L"TestClass2", hmod);
+ UnregisterClassW(L"TestClass2", hmod);
d = _GetClassAtom(L"TestClass2", hmod);
ok( a == 0, "\n");
ok( b != 0, "\n");
@@ -101,7 +101,7 @@
a = _RegisterClass(L"TestClass3", hmod, 0, DefWindowProcW);
b = _RegisterClass(L"TestClass3", hmod, 0, DefWindowProcW);
c = _RegisterClass(L"TestClass3", hmod, CS_GLOBALCLASS, DefWindowProcW);
- UnregisterClass(L"TestClass3", hmod);
+ UnregisterClassW(L"TestClass3", hmod);
d = _GetClassAtom(L"TestClass3", hmod);
ok( a != 0, "\n");
ok( b == 0, "\n");
@@ -111,9 +111,9 @@
a = _RegisterClass(L"TestClass4", hmod, CS_GLOBALCLASS, DefWindowProcW);
b = _RegisterClass(L"TestClass4", hmod, 0, DefWindowProcW);
c = _RegisterClass(L"TestClass4", hmod, 0, DefWindowProcW);
- UnregisterClass(L"TestClass4", hmod);
+ UnregisterClassW(L"TestClass4", hmod);
d = _GetClassAtom(L"TestClass4", hmod);
- UnregisterClass(L"TestClass4", hmod);
+ UnregisterClassW(L"TestClass4", hmod);
e = _GetClassAtom(L"TestClass4", hmod);
ok( a != 0, "\n");
ok( b != 0, "\n");
@@ -124,9 +124,9 @@
a = _GetClassAtom(L"ComboBox", hmod);
b = _RegisterClass(L"ComboBox", hmod, 0, DefWindowProcW);
c = _RegisterClass(L"ComboBox", hmod, CS_GLOBALCLASS, DefWindowProcW);
- UnregisterClass(L"ComboBox", hmod);
+ UnregisterClassW(L"ComboBox", hmod);
d = _GetClassAtom(L"ComboBox", hmod);
- UnregisterClass(L"TestClass4", hmod);
+ UnregisterClassW(L"TestClass4", hmod);
e = _GetClassAtom(L"TestClass4", hmod);
ok( a != 0, "\n");
ok( b != 0, "\n");
@@ -135,7 +135,7 @@
ok( e == 0, "\n");
a = _GetClassAtom(L"ScrollBar", hmod);
- UnregisterClass(L"ScrollBar", hmod);
+ UnregisterClassW(L"ScrollBar", hmod);
b = _GetClassAtom(L"ScrollBar", hmod);
c = _RegisterClass(L"ScrollBar", hmod, CS_GLOBALCLASS, DefWindowProcW);
d = _GetClassAtom(L"ScrollBar", hmod);
@@ -147,14 +147,14 @@
ok( a == d, "\n"); /* In Windows 10 the last 4 tests fail */
a = _GetClassAtom(L"ListBox", (HMODULE)0xdead);
- UnregisterClass(L"ListBox", (HMODULE)0xdead);
+ UnregisterClassW(L"ListBox", (HMODULE)0xdead);
b = _GetClassAtom(L"ListBox", (HMODULE)0xdead);
ok( a != 0, "\n");
ok( b == 0, "\n");
a = _RegisterClass(L"TestClass5", (HMODULE)0xdead, CS_GLOBALCLASS,
DefWindowProcW);
b = _GetClassAtom(L"TestClass5", hmod);
- UnregisterClass(L"TestClass5", hmod);
+ UnregisterClassW(L"TestClass5", hmod);
c = _GetClassAtom(L"TestClass5", (HMODULE)0xdead);
d = _GetClassAtom(L"TestClass5", hmod);
ok( a != 0, "\n");