Alexandre Julliard : ntdll: Make it possible to use RtlGetNtGlobalFlags before the TEB is initialized.

Alexandre Julliard julliard at winehq.org
Fri Jan 22 08:26:53 CST 2010


Module: wine
Branch: master
Commit: e7810c8bc6ba41851e38e69baf133226188faa3b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e7810c8bc6ba41851e38e69baf133226188faa3b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jan 22 12:32:40 2010 +0100

ntdll: Make it possible to use RtlGetNtGlobalFlags before the TEB is initialized.

---

 dlls/ntdll/process.c |    9 ---------
 dlls/ntdll/thread.c  |   12 +++++++++++-
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index aaf8315..ba51df5 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -73,15 +73,6 @@ PEB * WINAPI RtlGetCurrentPeb(void)
     return NtCurrentTeb()->Peb;
 }
 
-/******************************************************************************
- *  RtlGetNtGlobalFlags  [NTDLL.@]
- *
- */
-ULONG WINAPI RtlGetNtGlobalFlags(void)
-{
-    return NtCurrentTeb()->Peb->NtGlobalFlag;
-}
-
 /***********************************************************************
  *           __wine_make_process_system   (NTDLL.@)
  *
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index ef9183a..65fc737 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -57,6 +57,7 @@ struct startup_info
     void                           *entry_arg;
 };
 
+static PEB *peb;
 static PEB_LDR_DATA ldr;
 static RTL_USER_PROCESS_PARAMETERS params;  /* default parameters if no parent */
 static WCHAR current_dir[MAX_NT_PATH_LENGTH];
@@ -191,7 +192,6 @@ done:
  */
 HANDLE thread_init(void)
 {
-    PEB *peb;
     TEB *teb;
     void *addr;
     SIZE_T size, info_size;
@@ -522,6 +522,16 @@ error:
 }
 
 
+/******************************************************************************
+ *              RtlGetNtGlobalFlags   (NTDLL.@)
+ */
+ULONG WINAPI RtlGetNtGlobalFlags(void)
+{
+    if (!peb) return 0;  /* init not done yet */
+    return peb->NtGlobalFlag;
+}
+
+
 /***********************************************************************
  *              NtOpenThread   (NTDLL.@)
  *              ZwOpenThread   (NTDLL.@)




More information about the wine-cvs mailing list