diff --git a/reactos/lib/ntdll/csr/lpc.c b/reactos/lib/ntdll/csr/lpc.c index 0625d48b6ed..5f49355d314 100644 --- a/reactos/lib/ntdll/csr/lpc.c +++ b/reactos/lib/ntdll/csr/lpc.c @@ -104,7 +104,7 @@ CsrClientCallServer(PCSRSS_API_REQUEST Request, return (STATUS_UNSUCCESSFUL); } - Request->Header.DataSize = Length - sizeof(LPC_MESSAGE); + Request->Header.DataSize = Length - LPC_MESSAGE_BASE_SIZE; Request->Header.MessageSize = Length; Status = NtRequestWaitReplyPort(WindowsApiPort, diff --git a/reactos/lib/ntdll/dbg/debug.c b/reactos/lib/ntdll/dbg/debug.c index 4d4b0b93813..c10351aa10e 100644 --- a/reactos/lib/ntdll/dbg/debug.c +++ b/reactos/lib/ntdll/dbg/debug.c @@ -12,6 +12,7 @@ /* INCLUDES *****************************************************************/ #include +#include #include #include #include diff --git a/reactos/lib/ntdll/ldr/res.c b/reactos/lib/ntdll/ldr/res.c index 546ee4da19e..49054223a5e 100644 --- a/reactos/lib/ntdll/ldr/res.c +++ b/reactos/lib/ntdll/ldr/res.c @@ -25,11 +25,12 @@ #include #include +#include +#include #include #include #include #include -#include #define NDEBUG #include diff --git a/reactos/lib/ntdll/ldr/startup.c b/reactos/lib/ntdll/ldr/startup.c index f76e6c2c7d9..91293c4823d 100644 --- a/reactos/lib/ntdll/ldr/startup.c +++ b/reactos/lib/ntdll/ldr/startup.c @@ -32,8 +32,8 @@ VOID LdrpInitLoader(VOID); extern unsigned int _image_base__; -static CRITICAL_SECTION PebLock; -static CRITICAL_SECTION LoaderLock; +static RTL_CRITICAL_SECTION PebLock; +static RTL_CRITICAL_SECTION LoaderLock; static RTL_BITMAP TlsBitMap; PLDR_MODULE ExeModule; diff --git a/reactos/lib/ntdll/ldr/utils.c b/reactos/lib/ntdll/ldr/utils.c index 093b75bce0b..9ceef9d716e 100644 --- a/reactos/lib/ntdll/ldr/utils.c +++ b/reactos/lib/ntdll/ldr/utils.c @@ -21,11 +21,12 @@ #include #include +#include #include #include #include #include -#include +#include #define LDRP_PROCESS_CREATION_TIME 0x8000000 @@ -264,7 +265,7 @@ LdrpInitializeTlsForProccess(VOID) TRUE, IMAGE_DIRECTORY_ENTRY_TLS, NULL); - assert(Module->TlsIndex < LdrpTlsCount); + ASSERT(Module->TlsIndex < LdrpTlsCount); TlsData = &LdrpTlsArray[Module->TlsIndex]; TlsData->StartAddressOfRawData = (PVOID)TlsDirectory->StartAddressOfRawData; TlsData->TlsDataSize = TlsDirectory->EndAddressOfRawData - TlsDirectory->StartAddressOfRawData; @@ -466,7 +467,7 @@ LdrAddModuleEntry(PVOID ImageBase, PLDR_MODULE Module; Module = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof (LDR_MODULE)); - assert(Module); + ASSERT(Module); memset(Module, 0, sizeof(LDR_MODULE)); Module->BaseAddress = (PVOID)ImageBase; Module->EntryPoint = NTHeaders->OptionalHeader.AddressOfEntryPoint; @@ -2076,7 +2077,7 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL, DPRINT("Mapped %wZ at %x\n", &FullDosName, ImageBase); if (MappedAsDataFile) { - assert(NULL != BaseAddress); + ASSERT(NULL != BaseAddress); if (NULL != BaseAddress) { *BaseAddress = (PVOID) ((char *) *BaseAddress + 1); diff --git a/reactos/lib/ntdll/ntdll.xml b/reactos/lib/ntdll/ntdll.xml index d4fde463359..c9c07692ce5 100644 --- a/reactos/lib/ntdll/ntdll.xml +++ b/reactos/lib/ntdll/ntdll.xml @@ -3,6 +3,9 @@ + + 0x0502 + rtl rosrtl string diff --git a/reactos/lib/ntdll/rtl/apc.c b/reactos/lib/ntdll/rtl/apc.c index 09184c904cb..313073d0d52 100644 --- a/reactos/lib/ntdll/rtl/apc.c +++ b/reactos/lib/ntdll/rtl/apc.c @@ -26,7 +26,7 @@ /* INCLUDES *****************************************************************/ -#include +#include #include #include diff --git a/reactos/lib/ntdll/rtl/atom.c b/reactos/lib/ntdll/rtl/atom.c index e61ce506cdb..7a2952022d1 100644 --- a/reactos/lib/ntdll/rtl/atom.c +++ b/reactos/lib/ntdll/rtl/atom.c @@ -11,7 +11,7 @@ /* INCLUDES *****************************************************************/ -#include +#include #include #include @@ -653,11 +653,11 @@ RtlpInitAtomTableLock(PRTL_ATOM_TABLE AtomTable) { AtomTable->Lock = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(CRITICAL_SECTION)); + sizeof(RTL_CRITICAL_SECTION)); if (AtomTable->Lock == NULL) return STATUS_NO_MEMORY; - RtlInitializeCriticalSection((PCRITICAL_SECTION)AtomTable->Lock); + RtlInitializeCriticalSection((PRTL_CRITICAL_SECTION)AtomTable->Lock); return STATUS_SUCCESS; } @@ -668,7 +668,7 @@ RtlpDestroyAtomTableLock(PRTL_ATOM_TABLE AtomTable) { if (AtomTable->Lock) { - RtlDeleteCriticalSection((PCRITICAL_SECTION)AtomTable->Lock); + RtlDeleteCriticalSection((PRTL_CRITICAL_SECTION)AtomTable->Lock); RtlFreeHeap(RtlGetProcessHeap(), 0, AtomTable->Lock); @@ -680,7 +680,7 @@ RtlpDestroyAtomTableLock(PRTL_ATOM_TABLE AtomTable) static BOOLEAN RtlpLockAtomTable(PRTL_ATOM_TABLE AtomTable) { - RtlEnterCriticalSection((PCRITICAL_SECTION)AtomTable->Lock); + RtlEnterCriticalSection((PRTL_CRITICAL_SECTION)AtomTable->Lock); return TRUE; } @@ -688,7 +688,7 @@ RtlpLockAtomTable(PRTL_ATOM_TABLE AtomTable) static VOID RtlpUnlockAtomTable(PRTL_ATOM_TABLE AtomTable) { - RtlLeaveCriticalSection((PCRITICAL_SECTION)AtomTable->Lock); + RtlLeaveCriticalSection((PRTL_CRITICAL_SECTION)AtomTable->Lock); } diff --git a/reactos/lib/ntdll/rtl/callback.c b/reactos/lib/ntdll/rtl/callback.c index a9c8436b9f2..f2e6ccfebeb 100644 --- a/reactos/lib/ntdll/rtl/callback.c +++ b/reactos/lib/ntdll/rtl/callback.c @@ -9,15 +9,15 @@ /* INCLUDES *****************************************************************/ -#include +#include #include #include /* TYPES *********************************************************************/ -typedef NTSTATUS STDCALL_FUNC (*CALLBACK_FUNCTION)(PVOID Argument, - ULONG ArgumentLength); +typedef NTSTATUS (STDCALL *KERNEL_CALLBACK_FUNCTION)(PVOID Argument, + ULONG ArgumentLength); /* FUNCTIONS *****************************************************************/ @@ -28,10 +28,10 @@ KiUserCallbackDispatcher(ULONG RoutineIndex, { PPEB Peb; NTSTATUS Status; - CALLBACK_FUNCTION Callback; + KERNEL_CALLBACK_FUNCTION Callback; Peb = NtCurrentPeb(); - Callback = (CALLBACK_FUNCTION)Peb->KernelCallbackTable[RoutineIndex]; + Callback = (KERNEL_CALLBACK_FUNCTION)Peb->KernelCallbackTable[RoutineIndex]; Status = Callback(Argument, ArgumentLength); ZwCallbackReturn(NULL, 0, Status); } diff --git a/reactos/lib/ntdll/rtl/critical.c b/reactos/lib/ntdll/rtl/critical.c index da3de89097e..895b38639e8 100644 --- a/reactos/lib/ntdll/rtl/critical.c +++ b/reactos/lib/ntdll/rtl/critical.c @@ -12,9 +12,9 @@ /* INCLUDES ******************************************************************/ -#include +#include +#include #include -#include #define NDEBUG #include diff --git a/reactos/lib/ntdll/rtl/dbgbuffer.c b/reactos/lib/ntdll/rtl/dbgbuffer.c index 443cb3d5953..4c0523698dc 100644 --- a/reactos/lib/ntdll/rtl/dbgbuffer.c +++ b/reactos/lib/ntdll/rtl/dbgbuffer.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include diff --git a/reactos/lib/ntdll/rtl/exception.c b/reactos/lib/ntdll/rtl/exception.c index 2e4811e3fed..2cfc4e5725b 100644 --- a/reactos/lib/ntdll/rtl/exception.c +++ b/reactos/lib/ntdll/rtl/exception.c @@ -14,15 +14,16 @@ /* INCLUDES *****************************************************************/ -#include +#include #include #include +#include #include #define NDEBUG #include -static CRITICAL_SECTION RtlpVectoredExceptionLock; +static RTL_CRITICAL_SECTION RtlpVectoredExceptionLock; static LIST_ENTRY RtlpVectoredExceptionHead; typedef struct _RTL_VECTORED_EXCEPTION_HANDLER diff --git a/reactos/lib/ntdll/rtl/libsupp.c b/reactos/lib/ntdll/rtl/libsupp.c index bca664e3878..4a50fc11109 100644 --- a/reactos/lib/ntdll/rtl/libsupp.c +++ b/reactos/lib/ntdll/rtl/libsupp.c @@ -9,7 +9,7 @@ * */ -#include +#include #include #include #include diff --git a/reactos/lib/ntdll/rtl/message.c b/reactos/lib/ntdll/rtl/message.c index 1354055f4c8..9a0891f2260 100644 --- a/reactos/lib/ntdll/rtl/message.c +++ b/reactos/lib/ntdll/rtl/message.c @@ -11,7 +11,9 @@ /* INCLUDES *****************************************************************/ -#include +#include +#include +#include #define NDEBUG #include diff --git a/reactos/lib/ntdll/rtl/misc.c b/reactos/lib/ntdll/rtl/misc.c index 373bb9835d6..12bbc8a9d4b 100644 --- a/reactos/lib/ntdll/rtl/misc.c +++ b/reactos/lib/ntdll/rtl/misc.c @@ -12,7 +12,7 @@ /* INCLUDES *****************************************************************/ #include -#include +#include #include #define NDEBUG diff --git a/reactos/lib/ntdll/rtl/path.c b/reactos/lib/ntdll/rtl/path.c index dc792698a91..4544798b075 100644 --- a/reactos/lib/ntdll/rtl/path.c +++ b/reactos/lib/ntdll/rtl/path.c @@ -10,14 +10,12 @@ /* INCLUDES ******************************************************************/ -#include +#include #include #include #include #include #include -#include -#include #define NDEBUG #include diff --git a/reactos/lib/ntdll/rtl/process.c b/reactos/lib/ntdll/rtl/process.c index 02751cc68eb..f26a42026ba 100644 --- a/reactos/lib/ntdll/rtl/process.c +++ b/reactos/lib/ntdll/rtl/process.c @@ -11,7 +11,7 @@ /* INCLUDES ****************************************************************/ -#include +#include #include #include #include diff --git a/reactos/lib/ntdll/rtl/rangelist.c b/reactos/lib/ntdll/rtl/rangelist.c index b83e4902c1b..6aba4c84f36 100644 --- a/reactos/lib/ntdll/rtl/rangelist.c +++ b/reactos/lib/ntdll/rtl/rangelist.c @@ -26,7 +26,8 @@ /* INCLUDES ****************************************************************/ -#include +#include +#include #define NDEBUG #include diff --git a/reactos/lib/ntdll/rtl/resource.c b/reactos/lib/ntdll/rtl/resource.c index 913b7aaf8eb..07933e9f56b 100644 --- a/reactos/lib/ntdll/rtl/resource.c +++ b/reactos/lib/ntdll/rtl/resource.c @@ -18,9 +18,8 @@ * The code is based on information published in WDJ January 1999 issue. */ -#include +#include #include -#include #define NDEBUG #include diff --git a/reactos/lib/ntdll/stdio/sscanf.c b/reactos/lib/ntdll/stdio/sscanf.c index 88b7b2affa5..2dd6af361e4 100644 --- a/reactos/lib/ntdll/stdio/sscanf.c +++ b/reactos/lib/ntdll/stdio/sscanf.c @@ -1,8 +1,8 @@ /**/ #include -#include -#include +#include +#include #define NDEBUG #include diff --git a/reactos/lib/ntdll/stdlib/mbstowcs.c b/reactos/lib/ntdll/stdlib/mbstowcs.c index 5d2cbb76d8f..17e1d9184f1 100644 --- a/reactos/lib/ntdll/stdlib/mbstowcs.c +++ b/reactos/lib/ntdll/stdlib/mbstowcs.c @@ -6,7 +6,7 @@ * PURPOSE: converts a multi byte string to a unicode string */ -#include +#include #include #include diff --git a/reactos/lib/ntdll/stdlib/wcstombs.c b/reactos/lib/ntdll/stdlib/wcstombs.c index a9690c77ba4..f0b068799d3 100644 --- a/reactos/lib/ntdll/stdlib/wcstombs.c +++ b/reactos/lib/ntdll/stdlib/wcstombs.c @@ -6,7 +6,7 @@ * PURPOSE: converts a unicode string to a multi byte string */ -#include +#include #include #include