[ros-diffs] [navaraf] 15945: - Use standard TLS instead of custom
TEB field.
navaraf at svn.reactos.com
navaraf at svn.reactos.com
Fri Jun 17 09:53:40 CEST 2005
- Previous message: [ros-diffs] [navaraf] 15944: Add definitions of
ACCESS_MAX_MS_V2_ACE_TYPE, ACCESS_ALLOWED_COMPOUND_ACE_TYPE,
ACCESS_MAX_MS_V3_ACE_TYPE, ACCESS_MIN_MS_OBJECT_ACE_TYPE,
ACCESS_ALLOWED_OBJECT_ACE_TYPE, ACCESS_DENIED_OBJECT_ACE_TYPE,
SYSTEM_AUDIT_OBJECT_ACE_TYPE, SYSTEM_ALARM_OBJECT_ACE_TYPE,
ACCESS_MAX_MS_OBJECT_ACE_TYPE, ACCESS_MAX_MS_V4_ACE_TYPE,
ACCESS_MAX_MS_ACE_TYPE, ACCESS_ALLOWED_CALLBACK_ACE_TYPE,
ACCESS_DENIED_CALLBACK_ACE_TYPE, ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE,
ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE, SYSTEM_AUDIT_CALLBACK_ACE_TYPE,
SYSTEM_ALARM_CALLBACK_ACE_TYPE, SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE,
SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE, ACCESS_MAX_MS_V5_ACE_TYPE,
SID_MAX_SUB_AUTHORITIES, SID_RECOMMENDED_SUB_AUTHORITIES, SE_OWNER_DEFAULTED,
SE_GROUP_DEFAULTED, SE_DACL_PRESENT, SE_DACL_DEFAULTED, SE_SACL_PRESENT,
SE_SACL_DEFAULTED, SE_DACL_UNTRUSTED, SE_SERVER_SECURITY,
SE_DACL_AUTO_INHERIT_REQ, SE_SACL_AUTO_INHERIT_REQ, SE_DACL_AUTO_INHERITED,
SE_SACL_AUTO_INHER! ITED, SE_DACL_PROT
ECTED, SE_SACL_PROTECTED, SE_RM_CONTROL_VALID and SE_SELF_RELATIVE.
- Next message: [ros-diffs] [navaraf] 15946: Use W32API.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
- Use standard TLS instead of custom TEB field.
- Use W32API.
Modified: trunk/reactos/lib/libwine/debug.c
Modified: trunk/reactos/lib/libwine/libwine.xml
_____
Modified: trunk/reactos/lib/libwine/debug.c
--- trunk/reactos/lib/libwine/debug.c 2005-06-17 07:16:01 UTC (rev
15944)
+++ trunk/reactos/lib/libwine/debug.c 2005-06-17 07:53:34 UTC (rev
15945)
@@ -29,6 +29,18 @@
/*
----------------------------------------------------------------------
*/
+static CRITICAL_SECTION WineDebugCS;
+static CRITICAL_SECTION_DEBUG critsect_debug =
+{
+ 0, 0, &WineDebugCS,
+ { &critsect_debug.ProcessLocksList,
&critsect_debug.ProcessLocksList },
+ 0, 0, { 0, 0 }
+};
+static CRITICAL_SECTION WineDebugCS = { &critsect_debug, -1, 0, 0, 0, 0
};
+static DWORD WineDebugTlsIndex = TLS_OUT_OF_INDEXES;
+
+/*
----------------------------------------------------------------------
*/
+
struct debug_info
{
char *str_pos; /* current position in strings buffer */
@@ -37,28 +49,40 @@
char output[1024]; /* current output line */
};
-static struct debug_info tmp;
+static struct debug_info tmp = { tmp.strings, tmp.output };
/* get the debug info pointer for the current thread */
static inline struct debug_info *get_info(void)
{
- struct debug_info *info = NtCurrentTeb()->WineDebugInfo;
- if (!info)
+ struct debug_info *info;
+
+ if (WineDebugTlsIndex == TLS_OUT_OF_INDEXES)
{
- if (!tmp.str_pos)
+ EnterCriticalSection(&WineDebugCS);
+ if (WineDebugTlsIndex == TLS_OUT_OF_INDEXES)
{
- tmp.str_pos = tmp.strings;
- tmp.out_pos = tmp.output;
+ DWORD NewTlsIndex = TlsAlloc();
+ if (NewTlsIndex == TLS_OUT_OF_INDEXES)
+ {
+ LeaveCriticalSection(&WineDebugCS);
+ return &tmp;
+ }
+ info = HeapAlloc(GetProcessHeap(), 0, sizeof(*info));
+ if (!info)
+ {
+ LeaveCriticalSection(&WineDebugCS);
+ TlsFree(NewTlsIndex);
+ return &tmp;
+ }
+ info->str_pos = info->strings;
+ info->out_pos = info->output;
+ TlsSetValue(NewTlsIndex, info);
+ WineDebugTlsIndex = NewTlsIndex;
}
- if (!RtlGetProcessHeap()) return &tmp;
- /* setup the temp structure in case HeapAlloc wants to print
something */
- NtCurrentTeb()->WineDebugInfo = &tmp;
- info = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(*info));
- info->str_pos = info->strings;
- info->out_pos = info->output;
- NtCurrentTeb()->WineDebugInfo = info;
+ LeaveCriticalSection(&WineDebugCS);
}
- return info;
+
+ return TlsGetValue(WineDebugTlsIndex);
}
/* allocate some tmp space for a string */
@@ -75,7 +99,11 @@
/* release extra space that we requested in gimme1() */
static inline void release(void *ptr)
{
- struct debug_info *info = NtCurrentTeb()->WineDebugInfo;
+ struct debug_info *info;
+ if (WineDebugTlsIndex == TLS_OUT_OF_INDEXES)
+ info = &tmp;
+ else
+ info = TlsGetValue(WineDebugTlsIndex);
info->str_pos = ptr;
}
_____
Modified: trunk/reactos/lib/libwine/libwine.xml
--- trunk/reactos/lib/libwine/libwine.xml 2005-06-17 07:16:01 UTC
(rev 15944)
+++ trunk/reactos/lib/libwine/libwine.xml 2005-06-17 07:53:34 UTC
(rev 15945)
@@ -1,5 +1,6 @@
<module name="wine" type="staticlibrary">
<define name="_DISABLE_TIDENTS" />
<define name="__REACTOS__" />
+ <define name="__USE_W32API" />
<file>debug.c</file>
</module>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050617/166dff7a/attachment.html
- Previous message: [ros-diffs] [navaraf] 15944: Add definitions of
ACCESS_MAX_MS_V2_ACE_TYPE, ACCESS_ALLOWED_COMPOUND_ACE_TYPE,
ACCESS_MAX_MS_V3_ACE_TYPE, ACCESS_MIN_MS_OBJECT_ACE_TYPE,
ACCESS_ALLOWED_OBJECT_ACE_TYPE, ACCESS_DENIED_OBJECT_ACE_TYPE,
SYSTEM_AUDIT_OBJECT_ACE_TYPE, SYSTEM_ALARM_OBJECT_ACE_TYPE,
ACCESS_MAX_MS_OBJECT_ACE_TYPE, ACCESS_MAX_MS_V4_ACE_TYPE,
ACCESS_MAX_MS_ACE_TYPE, ACCESS_ALLOWED_CALLBACK_ACE_TYPE,
ACCESS_DENIED_CALLBACK_ACE_TYPE, ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE,
ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE, SYSTEM_AUDIT_CALLBACK_ACE_TYPE,
SYSTEM_ALARM_CALLBACK_ACE_TYPE, SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE,
SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE, ACCESS_MAX_MS_V5_ACE_TYPE,
SID_MAX_SUB_AUTHORITIES, SID_RECOMMENDED_SUB_AUTHORITIES, SE_OWNER_DEFAULTED,
SE_GROUP_DEFAULTED, SE_DACL_PRESENT, SE_DACL_DEFAULTED, SE_SACL_PRESENT,
SE_SACL_DEFAULTED, SE_DACL_UNTRUSTED, SE_SERVER_SECURITY,
SE_DACL_AUTO_INHERIT_REQ, SE_SACL_AUTO_INHERIT_REQ, SE_DACL_AUTO_INHERITED,
SE_SACL_AUTO_INHER! ITED, SE_DACL_PROT
ECTED, SE_SACL_PROTECTED, SE_RM_CONTROL_VALID and SE_SELF_RELATIVE.
- Next message: [ros-diffs] [navaraf] 15946: Use W32API.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Ros-diffs
mailing list