Remove rosrtl string macros
authorAlex Ionescu <aionescu@gmail.com>
Mon, 20 Jun 2005 04:18:03 +0000 (04:18 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Mon, 20 Jun 2005 04:18:03 +0000 (04:18 +0000)
svn path=/trunk/; revision=16135

reactos/lib/kernel32/file/find.c
reactos/lib/kernel32/k32.h
reactos/lib/kernel32/misc/comm.c
reactos/lib/kernel32/misc/computername.c
reactos/lib/kernel32/misc/dllmain.c
reactos/lib/kernel32/misc/lang.c

index 02fa156..b1d7b2b 100644 (file)
@@ -94,7 +94,7 @@ InternalFindFirstFile (
        PKERNEL32_FIND_FILE_DATA IData;
        IO_STATUS_BLOCK IoStatusBlock;
        UNICODE_STRING NtPathU;
-       UNICODE_STRING PatternStr;
+       UNICODE_STRING PatternStr = RTL_CONSTANT_STRING(L"*");
        NTSTATUS Status;
        PWSTR e1, e2;
        WCHAR CurrentDir[256];
@@ -234,11 +234,7 @@ InternalFindFirstFile (
        }
 
        /* change pattern: "*.*" --> "*" */
-       if (!wcscmp (SearchPattern, L"*.*"))
-       {
-           RtlRosInitUnicodeStringFromLiteral(&PatternStr, L"*");
-       }
-       else
+       if (wcscmp (SearchPattern, L"*.*"))
        {
            RtlInitUnicodeString(&PatternStr, SearchPattern);
        }
index a957322..38cd3b0 100755 (executable)
@@ -34,7 +34,6 @@
 
 /* FIXME: KILL ROSRTL */
 #include <rosrtl/thread.h>
-#include <rosrtl/string.h>
 #include <rosrtl/registry.h>
 
 /* Internal Kernel32 Header */
index 45de5e5..58ce8c0 100644 (file)
@@ -210,8 +210,8 @@ COMMDCB_ParseBool(LPWSTR *StrTail,
     BOOL bRetVal;
     ULONG_PTR nValue;
     static COMMDCB_PARAM_STRFLAG a_BoolFlags[] = {
-       { ROS_STRING_INITIALIZER(L"off"), FALSE },
-       { ROS_STRING_INITIALIZER(L"on"),  TRUE }
+       { RTL_CONSTANT_STRING(L"off"), FALSE },
+       { RTL_CONSTANT_STRING(L"on"),  TRUE }
     };
 
     /* try to recognize the next flag as a boolean */
@@ -339,9 +339,9 @@ COMMDCB_PARAM_HANDLER(dtr)
     BOOL bRetVal;
     ULONG_PTR nValue;
     static COMMDCB_PARAM_STRFLAG a_DTRFlags[] = {
-        { ROS_STRING_INITIALIZER(L"hs"),  DTR_CONTROL_HANDSHAKE },
-        { ROS_STRING_INITIALIZER(L"off"), DTR_CONTROL_DISABLE },
-        { ROS_STRING_INITIALIZER(L"on"),  DTR_CONTROL_ENABLE }
+        { RTL_CONSTANT_STRING(L"hs"),  DTR_CONTROL_HANDSHAKE },
+        { RTL_CONSTANT_STRING(L"off"), DTR_CONTROL_DISABLE },
+        { RTL_CONSTANT_STRING(L"on"),  DTR_CONTROL_ENABLE }
     };
 
     (void)Timeouts;
@@ -450,10 +450,10 @@ COMMDCB_PARAM_HANDLER(rts)
     DWORD nRetVal;
     ULONG_PTR nValue;
     static COMMDCB_PARAM_STRFLAG a_RTSFlags[] = {
-        { ROS_STRING_INITIALIZER(L"hs"),  RTS_CONTROL_HANDSHAKE },
-        { ROS_STRING_INITIALIZER(L"off"), RTS_CONTROL_DISABLE },
-        { ROS_STRING_INITIALIZER(L"on"),  RTS_CONTROL_ENABLE },
-        { ROS_STRING_INITIALIZER(L"tg"),  RTS_CONTROL_TOGGLE }
+        { RTL_CONSTANT_STRING(L"hs"),  RTS_CONTROL_HANDSHAKE },
+        { RTL_CONSTANT_STRING(L"off"), RTS_CONTROL_DISABLE },
+        { RTL_CONSTANT_STRING(L"on"),  RTS_CONTROL_ENABLE },
+        { RTL_CONSTANT_STRING(L"tg"),  RTS_CONTROL_TOGGLE }
     };
 
     (void)Timeouts;
@@ -480,9 +480,9 @@ COMMDCB_PARAM_HANDLER(stop)
     BOOL bRetVal;
     ULONG_PTR nValue;
     static COMMDCB_PARAM_STRFLAG a_StopFlags[] = {
-        { ROS_STRING_INITIALIZER(L"1"),   ONESTOPBIT },
-        { ROS_STRING_INITIALIZER(L"1.5"), ONE5STOPBITS },
-        { ROS_STRING_INITIALIZER(L"2"),   TWOSTOPBITS }
+        { RTL_CONSTANT_STRING(L"1"),   ONESTOPBIT },
+        { RTL_CONSTANT_STRING(L"1.5"), ONE5STOPBITS },
+        { RTL_CONSTANT_STRING(L"2"),   TWOSTOPBITS }
     };
 
     (void)Timeouts;
@@ -572,7 +572,7 @@ COMMDCB_PARAM_HANDLER(xon)
 /* FUNCTIONS */
 #define COMMDCB_PARAM(__P__) \
  { \
-  ROS_STRING_INITIALIZER( L""#__P__ ), \
+  RTL_CONSTANT_STRING( L""#__P__ ), \
   (ULONG_PTR)&COMMDCB_ ## __P__ ## Param \
  }
 
index 3e100cc..92962ec 100644 (file)
@@ -144,7 +144,9 @@ GetComputerNameExW (
 
     case ComputerNameDnsFullyQualified:
        RtlInitUnicodeString(&Dot,L".");
-       RosInitializeString(&ResultString,0,*nSize * sizeof(WCHAR),lpBuffer);
+       RtlInitUnicodeString(&ResultString, NULL);
+    ResultString.Length = *nSize * sizeof(WCHAR);
+    ResultString.MaximumLength = *nSize * sizeof(WCHAR);
        RtlInitUnicodeString(&RegKey,
                             L"\\Registry\\Machine\\System"
                             L"\\CurrentControlSet\\Services\\Tcpip"
index 7aa6df0..e0b3f9a 100644 (file)
@@ -47,7 +47,7 @@ static NTSTATUS
 OpenBaseDirectory(PHANDLE DirHandle)
 {
   OBJECT_ATTRIBUTES ObjectAttributes;
-  UNICODE_STRING Name = ROS_STRING_INITIALIZER(L"\\BaseNamedObjects");
+  UNICODE_STRING Name = RTL_CONSTANT_STRING(L"\\BaseNamedObjects");
   NTSTATUS Status;
 
   InitializeObjectAttributes(&ObjectAttributes,
index c030e8c..f6686d1 100644 (file)
@@ -293,7 +293,8 @@ EnumSystemLocalesW (
 {
        NTSTATUS result;
        HANDLE langKey;
-       UNICODE_STRING langKeyName;
+       UNICODE_STRING langKeyName = RTL_CONSTANT_STRING(
+    L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Locale");
        OBJECT_ATTRIBUTES objectAttributes;
        ULONG index, length;
        unsigned char fullInfo[sizeof(KEY_VALUE_FULL_INFORMATION)+255*2]; //FIXME: MAX_PATH*2
@@ -314,9 +315,6 @@ EnumSystemLocalesW (
        // Open language registry key
        //FIXME: Should we use critical section here?
 
-       RtlRosInitUnicodeStringFromLiteral(&langKeyName,
-               L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Locale");
-
        InitializeObjectAttributes(&objectAttributes,
                             &langKeyName,
                             OBJ_CASE_INSENSITIVE,