mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:53:40 +00:00
Fix hacks from last night and properly share the code
svn path=/trunk/; revision=13128
This commit is contained in:
parent
662d94147e
commit
dfb0ecac30
4 changed files with 59 additions and 27 deletions
|
@ -30,6 +30,27 @@
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* 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
|
static inline VOID
|
||||||
RtlpCopyParameterString(PWCHAR *Ptr,
|
RtlpCopyParameterString(PWCHAR *Ptr,
|
||||||
PUNICODE_STRING Destination,
|
PUNICODE_STRING Destination,
|
||||||
|
|
|
@ -48,6 +48,13 @@ static NTSTATUS RtlpCreateFirstThread
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PPEB
|
||||||
|
STDCALL
|
||||||
|
RtlpCurrentPeb(VOID)
|
||||||
|
{
|
||||||
|
return NtCurrentPeb();
|
||||||
|
}
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
RtlpMapFile(PUNICODE_STRING ImageFileName,
|
RtlpMapFile(PUNICODE_STRING ImageFileName,
|
||||||
PRTL_USER_PROCESS_PARAMETERS Ppb,
|
PRTL_USER_PROCESS_PARAMETERS Ppb,
|
||||||
|
|
|
@ -20,30 +20,9 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <ntdll/ntdll.h>
|
#include <ntdll/ntdll.h>
|
||||||
|
|
||||||
|
PPEB STDCALL RtlpCurrentPeb(VOID);
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* 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
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -533,13 +512,12 @@ RtlQueryEnvironmentVariable_U(PWSTR Environment,
|
||||||
|
|
||||||
if (Environment == NULL)
|
if (Environment == NULL)
|
||||||
{
|
{
|
||||||
if (NtCurrentPeb() == NULL)
|
PPEB Peb = RtlpCurrentPeb();
|
||||||
{
|
if (Peb) {
|
||||||
return(STATUS_VARIABLE_NOT_FOUND);
|
Environment = Peb->ProcessParameters->Environment;
|
||||||
}
|
|
||||||
Environment = NtCurrentPeb()->ProcessParameters->Environment;
|
|
||||||
SysEnvUsed = TRUE;
|
SysEnvUsed = TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Environment == NULL)
|
if (Environment == NULL)
|
||||||
return(STATUS_VARIABLE_NOT_FOUND);
|
return(STATUS_VARIABLE_NOT_FOUND);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
#include <ntoskrnl.h>
|
#include <ntoskrnl.h>
|
||||||
|
#include <internal/ps.h>
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
|
|
||||||
|
@ -19,6 +20,31 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID STDCALL
|
||||||
|
RtlAcquirePebLock(VOID)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID STDCALL
|
||||||
|
RtlReleasePebLock(VOID)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
PPEB
|
||||||
|
STDCALL
|
||||||
|
RtlpCurrentPeb(VOID)
|
||||||
|
{
|
||||||
|
return ((PEPROCESS)(KeGetCurrentThread()->ApcState.Process))->Peb;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
RtlDeleteCriticalSection(
|
RtlDeleteCriticalSection(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue