From 0a79700b0dec7cd0c76cc96b76f252b28501009c Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sat, 31 Aug 2013 08:30:00 +0000 Subject: [PATCH] [CONSRV]: One last fix to CONSRV_API_CONNECTINFO. We now have compatibility with Windows and kernel32 is much much happier. [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 | 2 +- reactos/subsystems/win/basesrv/basesrv.h | 4 +-- reactos/subsystems/win/basesrv/nls.c | 32 +++++++++++++++++++-- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/reactos/include/reactos/subsys/win/conmsg.h b/reactos/include/reactos/subsys/win/conmsg.h index cf9d03689c4..a118a7df86c 100644 --- a/reactos/include/reactos/subsys/win/conmsg.h +++ b/reactos/include/reactos/subsys/win/conmsg.h @@ -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; diff --git a/reactos/subsystems/win/basesrv/basesrv.h b/reactos/subsystems/win/basesrv/basesrv.h index 9b634a4007c..0a38f2bc506 100644 --- a/reactos/subsystems/win/basesrv/basesrv.h +++ b/reactos/subsystems/win/basesrv/basesrv.h @@ -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 ); diff --git a/reactos/subsystems/win/basesrv/nls.c b/reactos/subsystems/win/basesrv/nls.c index bdc2a450677..7de779de0e3 100644 --- a/reactos/subsystems/win/basesrv/nls.c +++ b/reactos/subsystems/win/basesrv/nls.c @@ -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";