Fix hacks from last night and properly share the code

svn path=/trunk/; revision=13128
This commit is contained in:
Alex Ionescu 2005-01-19 01:11:43 +00:00
parent 662d94147e
commit dfb0ecac30
4 changed files with 59 additions and 27 deletions

View file

@ -30,6 +30,27 @@
/* FUNCTIONS ****************************************************************/
/*
* @implemented
*/
VOID STDCALL
RtlAcquirePebLock(VOID)
{
PPEB Peb = NtCurrentPeb ();
Peb->FastPebLockRoutine (Peb->FastPebLock);
}
/*
* @implemented
*/
VOID STDCALL
RtlReleasePebLock(VOID)
{
PPEB Peb = NtCurrentPeb ();
Peb->FastPebUnlockRoutine (Peb->FastPebLock);
}
static inline VOID
RtlpCopyParameterString(PWCHAR *Ptr,
PUNICODE_STRING Destination,

View file

@ -48,6 +48,13 @@ static NTSTATUS RtlpCreateFirstThread
);
}
PPEB
STDCALL
RtlpCurrentPeb(VOID)
{
return NtCurrentPeb();
}
static NTSTATUS
RtlpMapFile(PUNICODE_STRING ImageFileName,
PRTL_USER_PROCESS_PARAMETERS Ppb,

View file

@ -20,30 +20,9 @@
#define NDEBUG
#include <ntdll/ntdll.h>
PPEB STDCALL RtlpCurrentPeb(VOID);
/* FUNCTIONS *****************************************************************/
/* FIXME: Added here temporarly until I fix this properly tomorrow */
/*
* @implemented
*/
VOID STDCALL
RtlAcquirePebLock(VOID)
{
PPEB Peb = NtCurrentPeb ();
Peb->FastPebLockRoutine (Peb->FastPebLock);
}
/* FIXME: Added here temporarly until I fix this properly tomorrow */
/*
* @implemented
*/
VOID STDCALL
RtlReleasePebLock(VOID)
{
PPEB Peb = NtCurrentPeb ();
Peb->FastPebUnlockRoutine (Peb->FastPebLock);
}
/*
* @implemented
*/
@ -533,12 +512,11 @@ RtlQueryEnvironmentVariable_U(PWSTR Environment,
if (Environment == NULL)
{
if (NtCurrentPeb() == NULL)
{
return(STATUS_VARIABLE_NOT_FOUND);
PPEB Peb = RtlpCurrentPeb();
if (Peb) {
Environment = Peb->ProcessParameters->Environment;
SysEnvUsed = TRUE;
}
Environment = NtCurrentPeb()->ProcessParameters->Environment;
SysEnvUsed = TRUE;
}
if (Environment == NULL)

View file

@ -11,6 +11,7 @@
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
#include <internal/ps.h>
#define NDEBUG
#include <internal/debug.h>
@ -19,6 +20,31 @@
/* FUNCTIONS *****************************************************************/
/*
* @implemented
*/
VOID STDCALL
RtlAcquirePebLock(VOID)
{
}
/*
* @implemented
*/
VOID STDCALL
RtlReleasePebLock(VOID)
{
}
PPEB
STDCALL
RtlpCurrentPeb(VOID)
{
return ((PEPROCESS)(KeGetCurrentThread()->ApcState.Process))->Peb;
}
NTSTATUS
STDCALL
RtlDeleteCriticalSection(