Skip to content

Commit c7eba0c

Browse files
committed
[SDK] Improve definition of (RTL_)CRITICAL_SECTION_DEBUG
1 parent a444572 commit c7eba0c

File tree

5 files changed

+40
-14
lines changed

5 files changed

+40
-14
lines changed

dll/win32/kernel32/wine/profile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
103103
{
104104
0, 0, &PROFILE_CritSect,
105105
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
106-
0, 0, 0
106+
0, 0, { 0 }
107107
};
108108
static RTL_CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 };
109109

dll/win32/kernel32/winnls/string/lcformat.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,7 @@ static CRITICAL_SECTION_DEBUG NLS_FormatsCS_debug =
126126
0, 0, &NLS_FormatsCS,
127127
{ &NLS_FormatsCS_debug.ProcessLocksList,
128128
&NLS_FormatsCS_debug.ProcessLocksList },
129-
#ifdef __REACTOS__
130-
0, 0, 0
131-
#else
132129
0, 0, { (DWORD_PTR)(__FILE__ ": NLS_Formats") }
133-
#endif
134130
};
135131
static CRITICAL_SECTION NLS_FormatsCS = { &NLS_FormatsCS_debug, -1, 0, 0, 0, 0 };
136132

sdk/include/ndk/rtltypes.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,9 +1423,25 @@ typedef struct _RTL_CRITICAL_SECTION_DEBUG
14231423
LIST_ENTRY ProcessLocksList;
14241424
ULONG EntryCount;
14251425
ULONG ContentionCount;
1426-
ULONG Spare[2];
1426+
union
1427+
{
1428+
ULONG_PTR WineDebugString;
1429+
ULONG_PTR Spare[1];
1430+
struct
1431+
{
1432+
ULONG Flags;
1433+
USHORT CreatorBackTraceIndexHigh;
1434+
USHORT SpareWORD;
1435+
};
1436+
};
14271437
} RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
14281438

1439+
#ifdef _WIN64
1440+
C_ASSERT(sizeof(RTL_CRITICAL_SECTION_DEBUG) == 0x30);
1441+
#else
1442+
C_ASSERT(sizeof(RTL_CRITICAL_SECTION_DEBUG) == 0x20);
1443+
#endif
1444+
14291445
typedef struct _RTL_CRITICAL_SECTION
14301446
{
14311447
PRTL_CRITICAL_SECTION_DEBUG DebugInfo;

sdk/include/psdk/winbase.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -908,11 +908,17 @@ typedef struct _CRITICAL_SECTION_DEBUG {
908908
LIST_ENTRY ProcessLocksList;
909909
DWORD EntryCount;
910910
DWORD ContentionCount;
911-
//#ifdef __WINESRC__ //not all wine code is marked so
912-
DWORD_PTR Spare[8/sizeof(DWORD_PTR)];/* in Wine they store a string here */
913-
//#else
914-
//WORD SpareWORD;
915-
//#endif
911+
union
912+
{
913+
DWORD_PTR WineDebugString;
914+
DWORD_PTR Spare[1];
915+
struct
916+
{
917+
DWORD Flags;
918+
WORD CreatorBackTraceIndexHigh;
919+
WORD SpareWORD;
920+
};
921+
};
916922
} CRITICAL_SECTION_DEBUG,*PCRITICAL_SECTION_DEBUG,*LPCRITICAL_SECTION_DEBUG;
917923

918924
typedef struct _CRITICAL_SECTION {

sdk/include/xdk/winnt_old.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,9 +2791,17 @@ typedef struct _RTL_CRITICAL_SECTION_DEBUG {
27912791
LIST_ENTRY ProcessLocksList;
27922792
DWORD EntryCount;
27932793
DWORD ContentionCount;
2794-
DWORD Flags;
2795-
WORD CreatorBackTraceIndexHigh;
2796-
WORD SpareWORD;
2794+
union
2795+
{
2796+
DWORD_PTR WineDebugString;
2797+
DWORD_PTR Spare[1];
2798+
struct
2799+
{
2800+
DWORD Flags;
2801+
WORD CreatorBackTraceIndexHigh;
2802+
WORD SpareWORD;
2803+
};
2804+
};
27972805
} RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
27982806

27992807
#include "pshpack8.h"

0 commit comments

Comments
 (0)