[BASESRV]

- Fix header formatting plus windows headers inclusion.
- RtlCreateUnicodeString returns booleans, not ntstatuses, so fix the code appropriately.

svn path=/trunk/; revision=60012
This commit is contained in:
Hermès Bélusca-Maïto 2013-09-10 20:45:53 +00:00
parent f50a1754a6
commit 179f3eb806
2 changed files with 33 additions and 25 deletions

View file

@ -12,11 +12,19 @@
#pragma once
/* PSDK/NDK Headers */
#include <stdarg.h>
#define WIN32_NO_STATUS
#include <windows.h>
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
/* PSEH for SEH Support */
#include <pseh/pseh2.h>
/* CSRSS Header */
#include <csr/csrsrv.h>
@ -31,25 +39,24 @@ typedef struct _BASESRV_KERNEL_IMPORTS
} BASESRV_KERNEL_IMPORTS, *PBASESRV_KERNEL_IMPORTS;
/* FIXME: BASENLS.H */
typedef NTSTATUS(*WINAPI POPEN_DATA_FILE) (HANDLE hFile,
PWCHAR FileName
);
typedef NTSTATUS(*WINAPI POPEN_DATA_FILE)(HANDLE hFile,
PWCHAR FileName);
typedef BOOL(*WINAPI PGET_CP_FILE_NAME_FROM_REGISTRY)(UINT CodePage,
LPWSTR FileName,
ULONG FileNameSize
);
typedef BOOL(*WINAPI PGET_CP_FILE_NAME_FROM_REGISTRY)(UINT CodePage,
LPWSTR FileName,
ULONG FileNameSize);
typedef BOOL(*WINAPI PGET_NLS_SECTION_NAME)(UINT CodePage,
UINT Base,
ULONG Unknown,
LPWSTR BaseName,
LPWSTR Result,
ULONG ResultSize
);
typedef BOOL(*WINAPI PGET_NLS_SECTION_NAME)(UINT CodePage,
UINT Base,
ULONG Unknown,
LPWSTR BaseName,
LPWSTR Result,
ULONG ResultSize);
typedef BOOL(*WINAPI PVALIDATE_LOCALE)(IN ULONG LocaleId);
typedef NTSTATUS(*WINAPI PCREATE_NLS_SECURTY_DESCRIPTOR)(IN PVOID Buffer, IN ULONG BufferSize, IN ULONG AceType);
typedef NTSTATUS(*WINAPI PCREATE_NLS_SECURTY_DESCRIPTOR)(IN PVOID Buffer,
IN ULONG BufferSize,
IN ULONG AceType);
/* Globals */
extern HANDLE BaseSrvHeap;

View file

@ -280,6 +280,7 @@ NTAPI
BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
{
NTSTATUS Status;
BOOLEAN Success;
WCHAR Buffer[MAX_PATH];
PWCHAR HeapBuffer;
UNICODE_STRING SystemRootString;
@ -327,21 +328,21 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
/* Create the base directory */
Buffer[SystemRootString.Length / sizeof(WCHAR)] = UNICODE_NULL;
Status = RtlCreateUnicodeString(&BaseSrvWindowsDirectory,
SystemRootString.Buffer);
ASSERT(NT_SUCCESS(Status));
Success = RtlCreateUnicodeString(&BaseSrvWindowsDirectory,
SystemRootString.Buffer);
ASSERT(Success);
/* Create the system directory */
wcscat(SystemRootString.Buffer, L"\\System32");
Status = RtlCreateUnicodeString(&BaseSrvWindowsSystemDirectory,
SystemRootString.Buffer);
ASSERT(NT_SUCCESS(Status));
Success = RtlCreateUnicodeString(&BaseSrvWindowsSystemDirectory,
SystemRootString.Buffer);
ASSERT(Success);
/* Create the kernel32 path */
wcscat(SystemRootString.Buffer, L"\\kernel32.dll");
Status = RtlCreateUnicodeString(&BaseSrvKernel32DllPath,
SystemRootString.Buffer);
ASSERT(NT_SUCCESS(Status));
Success = RtlCreateUnicodeString(&BaseSrvKernel32DllPath,
SystemRootString.Buffer);
ASSERT(Success);
/* FIXME: Check Session ID */
wcscpy(Buffer, L"\\BaseNamedObjects");