nls.c (c7c0b09e) nls.c (5696e4ba)
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Base API Server DLL
4 * FILE: subsystems/win/basesrv/nls.c
5 * PURPOSE: National Language Support (NLS)
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8

--- 147 unchanged lines hidden (view full) ---

156
157CSR_API(BaseSrvNlsCreateSection)
158{
159 NTSTATUS Status;
160 HANDLE SectionHandle, ProcessHandle, FileHandle;
161 ULONG LocaleId;
162 UNICODE_STRING NlsSectionName;
163 PWCHAR NlsFileName;
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Base API Server DLL
4 * FILE: subsystems/win/basesrv/nls.c
5 * PURPOSE: National Language Support (NLS)
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8

--- 147 unchanged lines hidden (view full) ---

156
157CSR_API(BaseSrvNlsCreateSection)
158{
159 NTSTATUS Status;
160 HANDLE SectionHandle, ProcessHandle, FileHandle;
161 ULONG LocaleId;
162 UNICODE_STRING NlsSectionName;
163 PWCHAR NlsFileName;
164 UCHAR SecurityDescriptor[52];
164 PSECURITY_DESCRIPTOR NlsSd;
165 OBJECT_ATTRIBUTES ObjectAttributes;
166 WCHAR FileNameBuffer[32];
167 WCHAR NlsSectionNameBuffer[32];
168 PBASE_NLS_CREATE_SECTION NlsMsg = &((PBASE_API_MESSAGE)ApiMessage)->Data.NlsCreateSection;
169
170 /* Load kernel32 first and import the NLS routines */
171 Status = BaseSrvDelayLoadKernel32();
172 if (!NT_SUCCESS(Status)) return Status;

--- 93 unchanged lines hidden (view full) ---

266 Status = pOpenDataFile(&FileHandle, NlsFileName);
267 if (Status != STATUS_SUCCESS)
268 {
269 DPRINT1("NLS: Failed to open file: %lx\n", Status);
270 return Status;
271 }
272
273 /* Create an SD for the section object */
165 OBJECT_ATTRIBUTES ObjectAttributes;
166 WCHAR FileNameBuffer[32];
167 WCHAR NlsSectionNameBuffer[32];
168 PBASE_NLS_CREATE_SECTION NlsMsg = &((PBASE_API_MESSAGE)ApiMessage)->Data.NlsCreateSection;
169
170 /* Load kernel32 first and import the NLS routines */
171 Status = BaseSrvDelayLoadKernel32();
172 if (!NT_SUCCESS(Status)) return Status;

--- 93 unchanged lines hidden (view full) ---

266 Status = pOpenDataFile(&FileHandle, NlsFileName);
267 if (Status != STATUS_SUCCESS)
268 {
269 DPRINT1("NLS: Failed to open file: %lx\n", Status);
270 return Status;
271 }
272
273 /* Create an SD for the section object */
274 Status = pCreateNlsSecurityDescriptor(&SecurityDescriptor,
275 sizeof(SecurityDescriptor),
276 0x80000000);
274 Status = pCreateNlsSecurityDescriptor(&NlsSd,
275 sizeof(SECURITY_DESCRIPTOR),
276 SECTION_MAP_READ);
277 if (!NT_SUCCESS(Status))
278 {
279 DPRINT1("NLS: CreateNlsSecurityDescriptor FAILED!: %lx\n", Status);
280 NtClose(FileHandle);
281 return Status;
282 }
283
284 /* Create the section object proper */
285 InitializeObjectAttributes(&ObjectAttributes,
286 &NlsSectionName,
287 OBJ_CASE_INSENSITIVE | OBJ_PERMANENT | OBJ_OPENIF,
288 NULL,
277 if (!NT_SUCCESS(Status))
278 {
279 DPRINT1("NLS: CreateNlsSecurityDescriptor FAILED!: %lx\n", Status);
280 NtClose(FileHandle);
281 return Status;
282 }
283
284 /* Create the section object proper */
285 InitializeObjectAttributes(&ObjectAttributes,
286 &NlsSectionName,
287 OBJ_CASE_INSENSITIVE | OBJ_PERMANENT | OBJ_OPENIF,
288 NULL,
289 &SecurityDescriptor);
289 NlsSd);
290 Status = NtCreateSection(&SectionHandle,
291 SECTION_MAP_READ,
292 &ObjectAttributes,
293 0,
294 PAGE_READONLY,
295 SEC_COMMIT,
296 FileHandle);
297 NtClose(FileHandle);
290 Status = NtCreateSection(&SectionHandle,
291 SECTION_MAP_READ,
292 &ObjectAttributes,
293 0,
294 PAGE_READONLY,
295 SEC_COMMIT,
296 FileHandle);
297 NtClose(FileHandle);
298 RtlFreeHeap(RtlGetProcessHeap(), 0, NlsSd);
298 if (!NT_SUCCESS(Status))
299 {
300 DPRINT1("NLS: Failed to create section! %lx\n", Status);
301 return Status;
302 }
303
304 /* Open a handle to the calling process */
305 InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL);

--- 79 unchanged lines hidden ---
299 if (!NT_SUCCESS(Status))
300 {
301 DPRINT1("NLS: Failed to create section! %lx\n", Status);
302 return Status;
303 }
304
305 /* Open a handle to the calling process */
306 InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL);

--- 79 unchanged lines hidden ---