[NDK]: No, the NDK applications do not have to use UNICODE.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 15 Mar 2017 00:06:42 +0000 (00:06 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Wed, 15 Mar 2017 00:06:42 +0000 (00:06 +0000)
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).

svn path=/trunk/; revision=74172

reactos/dll/win32/dnsapi/dnsapi/query.c
reactos/sdk/include/ndk/umtypes.h
rostests/apitests/user32/RegisterClassEx.c

index bac50a1..38f25d3 100644 (file)
@@ -303,25 +303,25 @@ OpenNetworkDatabase(LPCWSTR Name)
     {
         /* 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"\\");
+            StringCchCatW(ExpandedPath, MAX_PATH, L"\\");
         }
-        StringCchCat(ExpandedPath, MAX_PATH, L"DRIVERS\\ETC\\");
+        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,
index 39c70cc..e9d192a 100644 (file)
@@ -28,13 +28,6 @@ Author:
 #include <no_sal2.h>
 #endif
 
-//
-// NDK Applications must use Unicode
-//
-#ifndef UNICODE
-#define UNICODE
-#endif
-
 //
 // Don't use the SDK status values
 //
index 00cb046..8134b98 100644 (file)
@@ -79,7 +79,7 @@ VOID TestGlobalClasses(VOID)
     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 @@ VOID TestGlobalClasses(VOID)
     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 @@ VOID TestGlobalClasses(VOID)
     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 @@ VOID TestGlobalClasses(VOID)
     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 @@ VOID TestGlobalClasses(VOID)
     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 @@ VOID TestGlobalClasses(VOID)
     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 @@ VOID TestGlobalClasses(VOID)
     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");