[CONSRV]: One last fix to CONSRV_API_CONNECTINFO. We now have compatibility with...
authorAlex Ionescu <aionescu@gmail.com>
Sat, 31 Aug 2013 08:30:00 +0000 (08:30 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sat, 31 Aug 2013 08:30:00 +0000 (08:30 +0000)
[CONSRV]: Implement Case11 of BaseSrvNlsCreateSection, but we seem to be getting bogus locale IDs.

svn path=/trunk/; revision=59916

reactos/include/reactos/subsys/win/conmsg.h
reactos/subsystems/win/basesrv/basesrv.h
reactos/subsystems/win/basesrv/nls.c

index cf9d036..a118a7d 100644 (file)
@@ -164,7 +164,7 @@ typedef struct _CONSOLE_START_INFO
     DWORD dwHotKey;
     DWORD dwStartupFlags;
     CONSOLE_PROPERTIES;
-    BOOL ConsoleNeeded; // Used for GUI apps only.
+    BOOLEAN ConsoleNeeded; // Used for GUI apps only.
     LPTHREAD_START_ROUTINE CtrlDispatcher;
     LPTHREAD_START_ROUTINE ImeDispatcher;
     LPTHREAD_START_ROUTINE PropDispatcher;
index 9b634a4..0a38f2b 100644 (file)
@@ -43,8 +43,8 @@ typedef BOOL(*WINAPI PGET_CP_FILE_NAME_FROM_REGISTRY)(UINT    CodePage,
 typedef BOOL(*WINAPI PGET_NLS_SECTION_NAME)(UINT       CodePage,
     UINT       Base,
     ULONG      Unknown,
-    LPSTR      BaseName,
-    LPSTR      Result,
+    LPWSTR     BaseName,
+    LPWSTR     Result,
     ULONG      ResultSize
     );
 
index bdc2a45..7de779d 100644 (file)
@@ -151,6 +151,8 @@ CSR_API(BaseSrvNlsCreateSection)
     PWCHAR NlsFileName;
     UCHAR SecurityDescriptor[52];
     OBJECT_ATTRIBUTES ObjectAttributes;
+    WCHAR FileNameBuffer[32];
+    WCHAR NlsSectionNameBuffer[32];
     PBASE_NLS_CREATE_SECTION NlsMsg = &((PBASE_API_MESSAGE)ApiMessage)->Data.NlsCreateSection;
 
     /* Load kernel32 first and import the NLS routines */
@@ -211,8 +213,34 @@ CSR_API(BaseSrvNlsCreateSection)
             DPRINT1("This type not yet supported\n");
             return STATUS_NOT_IMPLEMENTED;
         case 11:
-            DPRINT1("This type not yet supported\n");
-            return STATUS_NOT_IMPLEMENTED;
+            /* Get the filename for this locale */
+            if (!pGetCPFileNameFromRegistry(NlsMsg->LocaleId,
+                                            FileNameBuffer,
+                                            RTL_NUMBER_OF(FileNameBuffer)))
+            {
+                DPRINT1("File name query failed\n");
+                return STATUS_INVALID_PARAMETER;
+            }
+
+            /* Get the name of the section for this locale */
+            DPRINT1("File name: %S\n", FileNameBuffer);
+            Status = pGetNlsSectionName(NlsMsg->LocaleId,
+                                        10,
+                                        0,
+                                        L"\\NLS\\NlsSectionCP",
+                                        NlsSectionNameBuffer,
+                                        RTL_NUMBER_OF(NlsSectionNameBuffer));
+            if (!NT_SUCCESS(Status))
+            {
+                DPRINT1("Section name query failed: %lx\n", Status);
+                return Status;
+            }
+
+            /* Setup the name and go open it */
+            NlsFileName = FileNameBuffer;
+            DPRINT1("Section name: %S\n", NlsSectionNameBuffer);
+            RtlInitUnicodeString(&NlsSectionName, NlsSectionNameBuffer);
+            break;
         case 12:
             RtlInitUnicodeString(&NlsSectionName, L"\\NLS\\NlsSectionGeo");
             NlsFileName = L"geo.nls";