[SDK] Improve definition of (RTL_)CRITICAL_SECTION_DEBUG

This commit is contained in:
Timo Kreuzer 2024-12-13 17:03:29 +02:00
parent a444572c3e
commit c7eba0c5c7
5 changed files with 40 additions and 14 deletions

View file

@ -103,7 +103,7 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
{ {
0, 0, &PROFILE_CritSect, 0, 0, &PROFILE_CritSect,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, 0 0, 0, { 0 }
}; };
static RTL_CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 }; static RTL_CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 };

View file

@ -126,11 +126,7 @@ static CRITICAL_SECTION_DEBUG NLS_FormatsCS_debug =
0, 0, &NLS_FormatsCS, 0, 0, &NLS_FormatsCS,
{ &NLS_FormatsCS_debug.ProcessLocksList, { &NLS_FormatsCS_debug.ProcessLocksList,
&NLS_FormatsCS_debug.ProcessLocksList }, &NLS_FormatsCS_debug.ProcessLocksList },
#ifdef __REACTOS__
0, 0, 0
#else
0, 0, { (DWORD_PTR)(__FILE__ ": NLS_Formats") } 0, 0, { (DWORD_PTR)(__FILE__ ": NLS_Formats") }
#endif
}; };
static CRITICAL_SECTION NLS_FormatsCS = { &NLS_FormatsCS_debug, -1, 0, 0, 0, 0 }; static CRITICAL_SECTION NLS_FormatsCS = { &NLS_FormatsCS_debug, -1, 0, 0, 0, 0 };

View file

@ -1423,9 +1423,25 @@ typedef struct _RTL_CRITICAL_SECTION_DEBUG
LIST_ENTRY ProcessLocksList; LIST_ENTRY ProcessLocksList;
ULONG EntryCount; ULONG EntryCount;
ULONG ContentionCount; ULONG ContentionCount;
ULONG Spare[2]; union
{
ULONG_PTR WineDebugString;
ULONG_PTR Spare[1];
struct
{
ULONG Flags;
USHORT CreatorBackTraceIndexHigh;
USHORT SpareWORD;
};
};
} RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG; } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
#ifdef _WIN64
C_ASSERT(sizeof(RTL_CRITICAL_SECTION_DEBUG) == 0x30);
#else
C_ASSERT(sizeof(RTL_CRITICAL_SECTION_DEBUG) == 0x20);
#endif
typedef struct _RTL_CRITICAL_SECTION typedef struct _RTL_CRITICAL_SECTION
{ {
PRTL_CRITICAL_SECTION_DEBUG DebugInfo; PRTL_CRITICAL_SECTION_DEBUG DebugInfo;

View file

@ -908,11 +908,17 @@ typedef struct _CRITICAL_SECTION_DEBUG {
LIST_ENTRY ProcessLocksList; LIST_ENTRY ProcessLocksList;
DWORD EntryCount; DWORD EntryCount;
DWORD ContentionCount; DWORD ContentionCount;
//#ifdef __WINESRC__ //not all wine code is marked so union
DWORD_PTR Spare[8/sizeof(DWORD_PTR)];/* in Wine they store a string here */ {
//#else DWORD_PTR WineDebugString;
//WORD SpareWORD; DWORD_PTR Spare[1];
//#endif struct
{
DWORD Flags;
WORD CreatorBackTraceIndexHigh;
WORD SpareWORD;
};
};
} CRITICAL_SECTION_DEBUG,*PCRITICAL_SECTION_DEBUG,*LPCRITICAL_SECTION_DEBUG; } CRITICAL_SECTION_DEBUG,*PCRITICAL_SECTION_DEBUG,*LPCRITICAL_SECTION_DEBUG;
typedef struct _CRITICAL_SECTION { typedef struct _CRITICAL_SECTION {

View file

@ -2791,9 +2791,17 @@ typedef struct _RTL_CRITICAL_SECTION_DEBUG {
LIST_ENTRY ProcessLocksList; LIST_ENTRY ProcessLocksList;
DWORD EntryCount; DWORD EntryCount;
DWORD ContentionCount; DWORD ContentionCount;
union
{
DWORD_PTR WineDebugString;
DWORD_PTR Spare[1];
struct
{
DWORD Flags; DWORD Flags;
WORD CreatorBackTraceIndexHigh; WORD CreatorBackTraceIndexHigh;
WORD SpareWORD; WORD SpareWORD;
};
};
} RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG; } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
#include "pshpack8.h" #include "pshpack8.h"