Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2020
- 75 participants
- 1522 messages
[PATCH V2 1/3] include: add missing defines to icm.h
by Vijay Kiran Kamuju
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
Jan. 31, 2020
[PATCH] include: Fix QITAB definition.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
include/shlwapi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/shlwapi.h b/include/shlwapi.h
index d02005763b..8d6801a94d 100644
--- a/include/shlwapi.h
+++ b/include/shlwapi.h
@@ -1139,7 +1139,7 @@ BOOL WINAPI IsOS(DWORD);
typedef struct
{
const IID *piid;
- int dwOffset;
+ DWORD dwOffset;
} QITAB, *LPQITAB;
HRESULT WINAPI QISearch(void* base, const QITAB *pqit, REFIID riid, void **ppv);
--
2.24.1
Jan. 31, 2020
Re: [PATCH 2/8] msvcrt: Share locale names between threadlocinfo instances.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=64238
Your paranoid android.
=== debian10 (32 bit report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
=== debian10 (32 bit Chinese:China report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
=== debian10 (32 bit WoW report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
=== debian10 (64 bit WoW report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
Jan. 31, 2020
[PATCH] wincodecs: Add 32RGBA -> 24BGR conversion path.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
Final Fantasy XV triggers this path.
dlls/windowscodecs/converter.c | 42 +++++++++++++++++++++-------
dlls/windowscodecs/tests/converter.c | 31 +++++++++++++-------
2 files changed, 53 insertions(+), 20 deletions(-)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
index dcc2f05693..6e4f5c5f9b 100644
--- a/dlls/windowscodecs/converter.c
+++ b/dlls/windowscodecs/converter.c
@@ -1038,6 +1038,7 @@ static HRESULT copypixels_to_24bppBGR(struct FormatConverter *This, const WICRec
case format_32bppBGR:
case format_32bppBGRA:
case format_32bppPBGRA:
+ case format_32bppRGBA:
if (prc)
{
HRESULT res;
@@ -1061,17 +1062,38 @@ static HRESULT copypixels_to_24bppBGR(struct FormatConverter *This, const WICRec
{
srcrow = srcdata;
dstrow = pbBuffer;
- for (y=0; y<prc->Height; y++) {
- srcpixel=srcrow;
- dstpixel=dstrow;
- for (x=0; x<prc->Width; x++) {
- *dstpixel++=*srcpixel++; /* blue */
- *dstpixel++=*srcpixel++; /* green */
- *dstpixel++=*srcpixel++; /* red */
- srcpixel++; /* alpha */
+
+ if (source_format == format_32bppRGBA)
+ {
+ for (y = 0; y < prc->Height; y++)
+ {
+ srcpixel = srcrow;
+ dstpixel = dstrow;
+ for (x = 0; x < prc->Width; x++) {
+ *dstpixel++ = srcpixel[2]; /* blue */
+ *dstpixel++ = srcpixel[1]; /* green */
+ *dstpixel++ = srcpixel[0]; /* red */
+ srcpixel += 4;
+ }
+ srcrow += srcstride;
+ dstrow += cbStride;
+ }
+ }
+ else
+ {
+ for (y = 0; y < prc->Height; y++)
+ {
+ srcpixel = srcrow;
+ dstpixel = dstrow;
+ for (x = 0; x < prc->Width; x++) {
+ *dstpixel++ = *srcpixel++; /* blue */
+ *dstpixel++ = *srcpixel++; /* green */
+ *dstpixel++ = *srcpixel++; /* red */
+ srcpixel++; /* alpha */
+ }
+ srcrow += srcstride;
+ dstrow += cbStride;
}
- srcrow += srcstride;
- dstrow += cbStride;
}
}
diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c
index d4c13658f4..0a7e7238aa 100644
--- a/dlls/windowscodecs/tests/converter.c
+++ b/dlls/windowscodecs/tests/converter.c
@@ -470,12 +470,22 @@ static const BYTE bits_32bppBGRA[] = {
0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255,
0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255,
0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255};
+static const BYTE bits_32bppRGBA[] = {
+ 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255, 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255,
+ 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255, 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255,
+ 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255, 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255,
+ 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255, 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255,
+ 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255, 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255,
+ 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255, 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255,
+ 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255, 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255,
+ 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255, 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255};
+
static const struct bitmap_data testdata_32bppBGRA = {
&GUID_WICPixelFormat32bppBGRA, 32, bits_32bppBGRA, 32, 2, 96.0, 96.0};
static const struct bitmap_data testdata_32bppRGBA = {
- &GUID_WICPixelFormat32bppRGBA, 32, bits_32bppBGRA, 32, 2, 96.0, 96.0};
+ &GUID_WICPixelFormat32bppRGBA, 32, bits_32bppRGBA, 32, 2, 96.0, 96.0};
static const struct bitmap_data testdata_32bppRGB = {
- &GUID_WICPixelFormat32bppRGB, 32, bits_32bppBGRA, 32, 2, 96.0, 96.0};
+ &GUID_WICPixelFormat32bppRGB, 32, bits_32bppRGBA, 32, 2, 96.0, 96.0};
static const BYTE bits_32bppPBGRA[] = {
80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80, 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80,
@@ -492,14 +502,14 @@ static const struct bitmap_data testdata_32bppPRGBA = {
&GUID_WICPixelFormat32bppPRGBA, 32, bits_32bppPBGRA, 32, 2, 96.0, 96.0};
static const BYTE bits_64bppRGBA[] = {
- 128,255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,128, 255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,
- 128,255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,128, 255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,
- 128,255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,128, 255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,
- 128,255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,128, 255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,
- 128,0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,128, 0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,
- 128,0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,128, 0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,
- 128,0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,128, 0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,
- 128,0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,128, 0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255};
+ 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255, 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255,
+ 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255, 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255,
+ 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255, 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255,
+ 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255, 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255,
+ 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255, 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255,
+ 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255, 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255,
+ 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255, 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255,
+ 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255, 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255};
static const struct bitmap_data testdata_64bppRGBA = {
&GUID_WICPixelFormat64bppRGBA, 64, bits_64bppRGBA, 32, 2, 96.0, 96.0};
@@ -1818,6 +1828,7 @@ START_TEST(converter)
test_conversion(&testdata_32bppBGR, &testdata_24bppRGB, "32bppBGR -> 24bppRGB", FALSE);
test_conversion(&testdata_24bppRGB, &testdata_32bppBGR, "24bppRGB -> 32bppBGR", FALSE);
test_conversion(&testdata_32bppBGRA, &testdata_24bppRGB, "32bppBGRA -> 24bppRGB", FALSE);
+ test_conversion(&testdata_32bppRGBA, &testdata_24bppBGR, "32bppRGBA -> 24bppBGR", FALSE);
test_conversion(&testdata_64bppRGBA, &testdata_32bppRGBA, "64bppRGBA -> 32bppRGBA", FALSE);
test_conversion(&testdata_64bppRGBA, &testdata_32bppRGB, "64bppRGBA -> 32bppRGB", FALSE);
--
2.24.1
Jan. 31, 2020
Re: [PATCH 5/8] msvcrt: Copy LC_COLLATE codepage between threadlocinfo instances.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=64241
Your paranoid android.
=== debian10 (32 bit report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
msvcrt:
string.c:2017: Test failed: d = 0,0000000000000000e+000
string.c:2019: Test failed: d = -0,0000000000000000e+000
string.c:2021: Test failed: d = 0,0000000000000000e+000
string.c:2023: Test failed: d = 0,0000000000000000e+000
string.c:2027: Test failed: d = 0,0000000000000000e+000
string.c:2044: Test failed: d = 1,000000e+000
=== debian10 (32 bit Chinese:China report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
msvcrt:
string.c:2017: Test failed: d = 0,0000000000000000e+000
string.c:2019: Test failed: d = -0,0000000000000000e+000
string.c:2021: Test failed: d = 0,0000000000000000e+000
string.c:2023: Test failed: d = 0,0000000000000000e+000
string.c:2027: Test failed: d = 0,0000000000000000e+000
string.c:2044: Test failed: d = 1,000000e+000
=== debian10 (32 bit WoW report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
msvcrt:
string.c:2017: Test failed: d = 0,0000000000000000e+000
string.c:2019: Test failed: d = -0,0000000000000000e+000
string.c:2021: Test failed: d = 0,0000000000000000e+000
string.c:2023: Test failed: d = 0,0000000000000000e+000
string.c:2027: Test failed: d = 0,0000000000000000e+000
string.c:2044: Test failed: d = 1,000000e+000
=== debian10 (64 bit WoW report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
msvcrt:
string.c:2017: Test failed: d = 0,0000000000000000e+000
string.c:2019: Test failed: d = -0,0000000000000000e+000
string.c:2021: Test failed: d = 0,0000000000000000e+000
string.c:2023: Test failed: d = 0,0000000000000000e+000
string.c:2027: Test failed: d = 0,0000000000000000e+000
string.c:2044: Test failed: d = 1,000000e+000
Jan. 31, 2020
Re: [PATCH 4/8] msvcrt: Share lconv data between threadlocinfo instances.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=64240
Your paranoid android.
=== debian10 (32 bit report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
msvcrt:
string.c:2017: Test failed: d = 0,0000000000000000e+000
string.c:2019: Test failed: d = -0,0000000000000000e+000
string.c:2021: Test failed: d = 0,0000000000000000e+000
string.c:2023: Test failed: d = 0,0000000000000000e+000
string.c:2027: Test failed: d = 0,0000000000000000e+000
string.c:2044: Test failed: d = 1,000000e+000
=== debian10 (32 bit Chinese:China report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
msvcrt:
string.c:2017: Test failed: d = 0,0000000000000000e+000
string.c:2019: Test failed: d = -0,0000000000000000e+000
string.c:2021: Test failed: d = 0,0000000000000000e+000
string.c:2023: Test failed: d = 0,0000000000000000e+000
string.c:2027: Test failed: d = 0,0000000000000000e+000
string.c:2044: Test failed: d = 1,000000e+000
=== debian10 (32 bit WoW report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
msvcrt:
string.c:2017: Test failed: d = 0,0000000000000000e+000
string.c:2019: Test failed: d = -0,0000000000000000e+000
string.c:2021: Test failed: d = 0,0000000000000000e+000
string.c:2023: Test failed: d = 0,0000000000000000e+000
string.c:2027: Test failed: d = 0,0000000000000000e+000
string.c:2044: Test failed: d = 1,000000e+000
=== debian10 (64 bit WoW report) ===
msvcr110:
msvcr110.c:108: Test failed: expected en-US, got en-us
msvcr110.c:108: Test failed: expected EN-US, got en-us
msvcrt:
string.c:2017: Test failed: d = 0,0000000000000000e+000
string.c:2019: Test failed: d = -0,0000000000000000e+000
string.c:2021: Test failed: d = 0,0000000000000000e+000
string.c:2023: Test failed: d = 0,0000000000000000e+000
string.c:2027: Test failed: d = 0,0000000000000000e+000
string.c:2044: Test failed: d = 1,000000e+000
Jan. 31, 2020
[PATCH 8/8] msvcrt: Increment refcounts for all locale data in _get_current_locale().
by Chip Davis
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
dlls/msvcr90/tests/msvcr90.c | 44 ++++++++++++++++++------------------
dlls/msvcrt/locale.c | 24 ++++++++++++++++++--
2 files changed, 44 insertions(+), 24 deletions(-)
diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c
index ec183d9be173..52e135d1e011 100644
--- a/dlls/msvcr90/tests/msvcr90.c
+++ b/dlls/msvcr90/tests/msvcr90.c
@@ -2021,14 +2021,14 @@ static void test__get_current_locale(void)
"same refcount pointers for LC_COLLATE\n");
ok(*l->locinfo->lc_category[LC_COLLATE].refcount == 1, "refcount = %d\n",
*l->locinfo->lc_category[LC_COLLATE].refcount);
- todo_wine ok(*l2->locinfo->lc_category[LC_COLLATE].refcount == 2, "refcount = %d\n",
+ ok(*l2->locinfo->lc_category[LC_COLLATE].refcount == 2, "refcount = %d\n",
*l2->locinfo->lc_category[LC_COLLATE].refcount);
for(i = LC_CTYPE; i <= LC_MAX; i++) {
ok(l->locinfo->lc_category[i].locale == l2->locinfo->lc_category[i].locale,
"different locale name pointers for category %d\n", i);
ok(l->locinfo->lc_category[i].refcount == l2->locinfo->lc_category[i].refcount,
"different refcount pointers for category %d\n", i);
- todo_wine ok(*l->locinfo->lc_category[i].refcount == 3, "refcount = %d for category %d\n",
+ ok(*l->locinfo->lc_category[i].refcount == 3, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
}
@@ -2045,23 +2045,23 @@ static void test__get_current_locale(void)
ok(l->locinfo->pclmap == l2->locinfo->pclmap, "different clmap pointers\n");
ok(l->locinfo->pcumap == l2->locinfo->pcumap, "different cumap pointers\n");
ok(l->locinfo->ctype1_refcount == l2->locinfo->ctype1_refcount, "different ctype1_refcount pointers\n");
- todo_wine ok(*l->locinfo->ctype1_refcount == 3, "refcount = %d\n", *l->locinfo->ctype1_refcount);
+ ok(*l->locinfo->ctype1_refcount == 3, "refcount = %d\n", *l->locinfo->ctype1_refcount);
ok(l->locinfo->lconv == l2->locinfo->lconv, "different lconv pointers\n");
ok(l->locinfo->lconv_intl_refcount == l2->locinfo->lconv_intl_refcount, "different lconv_intl_refcount pointers\n");
- todo_wine ok(*l->locinfo->lconv_intl_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
+ ok(*l->locinfo->lconv_intl_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
ok(l->locinfo->lconv->decimal_point == l2->locinfo->lconv->decimal_point, "different LC_NUMERIC pointers\n");
ok(l->locinfo->lconv_num_refcount == l2->locinfo->lconv_num_refcount, "different lconv_num_refcount pointers\n");
- todo_wine ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
+ ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
ok(l->locinfo->lconv->currency_symbol == l2->locinfo->lconv->currency_symbol, "different LC_MONETARY pointers\n");
ok(l->locinfo->lconv_mon_refcount == l2->locinfo->lconv_mon_refcount, "different lconv_mon_refcount pointers\n");
- todo_wine ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
+ ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
- todo_wine ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
+ ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
p__free_locale(l2);
@@ -2078,7 +2078,7 @@ static void test__get_current_locale(void)
"same refcount pointers for category %d\n", i);
ok(*l->locinfo->lc_category[i].refcount == 1, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
- todo_wine ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
+ ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
*l2->locinfo->lc_category[i].refcount, i);
}
for(i = LC_MONETARY; i <= LC_MAX; i++) {
@@ -2086,7 +2086,7 @@ static void test__get_current_locale(void)
"different locale name pointers for category %d\n", i);
ok(l->locinfo->lc_category[i].refcount == l2->locinfo->lc_category[i].refcount,
"different refcount pointers for category %d\n", i);
- todo_wine ok(*l->locinfo->lc_category[i].refcount == 3, "refcount = %d for category %d\n",
+ ok(*l->locinfo->lc_category[i].refcount == 3, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
}
@@ -2108,19 +2108,19 @@ static void test__get_current_locale(void)
ok(l->locinfo->lconv == l2->locinfo->lconv, "different lconv pointers\n");
ok(l->locinfo->lconv_intl_refcount == l2->locinfo->lconv_intl_refcount, "different lconv_intl_refcount pointers\n");
- todo_wine ok(*l->locinfo->lconv_intl_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
+ ok(*l->locinfo->lconv_intl_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
ok(l->locinfo->lconv->decimal_point == l2->locinfo->lconv->decimal_point, "different LC_NUMERIC pointers\n");
ok(l->locinfo->lconv_num_refcount == l2->locinfo->lconv_num_refcount, "different lconv_num_refcount pointers\n");
- todo_wine ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
+ ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
ok(l->locinfo->lconv->currency_symbol == l2->locinfo->lconv->currency_symbol, "different LC_MONETARY pointers\n");
ok(l->locinfo->lconv_mon_refcount == l2->locinfo->lconv_mon_refcount, "different lconv_mon_refcount pointers\n");
- todo_wine ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
+ ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
- todo_wine ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
+ ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
p__free_locale(l2);
@@ -2137,7 +2137,7 @@ static void test__get_current_locale(void)
"same refcount pointers for category %d\n", i);
ok(*l->locinfo->lc_category[i].refcount == 1, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
- todo_wine ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
+ ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
*l2->locinfo->lc_category[i].refcount, i);
}
for(i = LC_NUMERIC; i <= LC_MAX; i++) {
@@ -2145,7 +2145,7 @@ static void test__get_current_locale(void)
"different locale name pointers for category %d\n", i);
ok(l->locinfo->lc_category[i].refcount == l2->locinfo->lc_category[i].refcount,
"different refcount pointers for category %d\n", i);
- todo_wine ok(*l->locinfo->lc_category[i].refcount == 3, "refcount = %d for category %d\n",
+ ok(*l->locinfo->lc_category[i].refcount == 3, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
}
@@ -2168,11 +2168,11 @@ static void test__get_current_locale(void)
ok(l->locinfo->lconv != l2->locinfo->lconv, "same lconv pointers\n");
ok(l->locinfo->lconv_intl_refcount != l2->locinfo->lconv_intl_refcount, "same lconv_intl_refcount pointers\n");
ok(*l->locinfo->lconv_intl_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
- todo_wine ok(*l2->locinfo->lconv_intl_refcount == 2, "refcount = %d\n", *l2->locinfo->lconv_intl_refcount);
+ ok(*l2->locinfo->lconv_intl_refcount == 2, "refcount = %d\n", *l2->locinfo->lconv_intl_refcount);
ok(l->locinfo->lconv->decimal_point == l2->locinfo->lconv->decimal_point, "different LC_NUMERIC pointers\n");
ok(l->locinfo->lconv_num_refcount == l2->locinfo->lconv_num_refcount, "different lconv_num_refcount pointers\n");
- todo_wine ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
+ ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
ok(l->locinfo->lconv->currency_symbol != l2->locinfo->lconv->currency_symbol, "same LC_MONETARY pointers\n");
ok(l->locinfo->lconv_mon_refcount != l2->locinfo->lconv_mon_refcount, "same lconv_mon_refcount pointers\n");
@@ -2181,7 +2181,7 @@ static void test__get_current_locale(void)
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
- todo_wine ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
+ ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
p__free_locale(l2);
@@ -2198,14 +2198,14 @@ static void test__get_current_locale(void)
"same refcount pointers for category %d\n", i);
ok(*l->locinfo->lc_category[i].refcount == 1, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
- todo_wine ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
+ ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
*l2->locinfo->lc_category[i].refcount, i);
}
ok(l->locinfo->lc_category[LC_TIME].locale == l2->locinfo->lc_category[LC_TIME].locale,
"different locale name pointers for LC_TIME\n");
ok(l->locinfo->lc_category[LC_TIME].refcount == l2->locinfo->lc_category[LC_TIME].refcount,
"different refcount pointers for LC_TIME\n");
- todo_wine ok(*l->locinfo->lc_category[LC_TIME].refcount == 3, "refcount = %d\n",
+ ok(*l->locinfo->lc_category[LC_TIME].refcount == 3, "refcount = %d\n",
*l->locinfo->lc_category[LC_TIME].refcount);
ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
@@ -2241,7 +2241,7 @@ static void test__get_current_locale(void)
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
- todo_wine ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
+ ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
p__free_locale(l2);
@@ -2258,7 +2258,7 @@ static void test__get_current_locale(void)
"same refcount pointers for category %d\n", i);
ok(*l->locinfo->lc_category[i].refcount == 1, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
- todo_wine ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
+ ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
*l2->locinfo->lc_category[i].refcount, i);
}
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 1c7a5ef21f63..2e195b08e0be 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -918,6 +918,27 @@ int CDECL ___lc_collate_cp_func(void)
return get_locinfo()->lc_collate_cp;
}
+/* INTERNAL: increases all reference counts in threadlocinfo struct */
+MSVCRT_pthreadlocinfo grab_locinfo(MSVCRT_pthreadlocinfo locinfo)
+{
+ int i;
+
+ InterlockedIncrement(&locinfo->refcount);
+ for(i=LC_MIN+1; i<=LC_MAX; i++)
+ InterlockedIncrement(locinfo->lc_category[i].refcount);
+ if(locinfo->lconv_intl_refcount)
+ InterlockedIncrement(locinfo->lconv_intl_refcount);
+ if(locinfo->lconv_num_refcount)
+ InterlockedIncrement(locinfo->lconv_num_refcount);
+ if(locinfo->lconv_mon_refcount)
+ InterlockedIncrement(locinfo->lconv_mon_refcount);
+ if(locinfo->ctype1_refcount)
+ InterlockedIncrement(locinfo->ctype1_refcount);
+ InterlockedIncrement(&locinfo->lc_time_curr->refcount);
+
+ return locinfo;
+}
+
/* INTERNAL: frees MSVCRT_pthreadlocinfo struct */
void free_locinfo(MSVCRT_pthreadlocinfo locinfo)
{
@@ -1012,9 +1033,8 @@ MSVCRT__locale_t CDECL MSVCRT__get_current_locale(void)
if(!loc)
return NULL;
- loc->locinfo = get_locinfo();
+ loc->locinfo = grab_locinfo(get_locinfo());
loc->mbcinfo = get_mbcinfo();
- InterlockedIncrement(&loc->locinfo->refcount);
InterlockedIncrement(&loc->mbcinfo->refcount);
return loc;
}
--
2.24.0
Jan. 31, 2020
[PATCH 7/8] msvcrt: Swap the threadlocinfo pointers in setlocale().
by Chip Davis
Do this instead of swapping their contents. This way, the result of
_get_current_locale(), which references the current threadlocinfo, won't
change after a setlocale() call.
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
dlls/msvcr90/tests/msvcr90.c | 334 +++++++++++++----------------------
dlls/msvcrt/locale.c | 179 ++-----------------
2 files changed, 132 insertions(+), 381 deletions(-)
diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c
index 664ab49317a9..ec183d9be173 100644
--- a/dlls/msvcr90/tests/msvcr90.c
+++ b/dlls/msvcr90/tests/msvcr90.c
@@ -1994,16 +1994,14 @@ static void test__get_current_locale(void)
ok(l->locinfo->refcount == 3, "refcount = %d\n", l->locinfo->refcount);
p_setlocale(LC_ALL, "english");
- todo_wine {
- lc_str(LC_COLLATE, "C");
- lc_str(LC_CTYPE, "C");
- lc_str(LC_MONETARY, "C");
- lc_str(LC_NUMERIC, "C");
- lc_str(LC_TIME, "C");
- }
+ lc_str(LC_COLLATE, "C");
+ lc_str(LC_CTYPE, "C");
+ lc_str(LC_MONETARY, "C");
+ lc_str(LC_NUMERIC, "C");
+ lc_str(LC_TIME, "C");
#undef lc_str
- todo_wine ok(l->locinfo->refcount == 2, "refcount = %d\n", l->locinfo->refcount);
+ ok(l->locinfo->refcount == 2, "refcount = %d\n", l->locinfo->refcount);
ok(l->locinfo == l2->locinfo, "different locinfo pointers\n");
ok(l->mbcinfo == l2->mbcinfo, "different mbcinfo pointers\n");
@@ -2014,17 +2012,13 @@ static void test__get_current_locale(void)
p_setlocale(LC_COLLATE, "C");
l2 = p__get_current_locale();
- todo_wine {
- ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
- ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
- }
+ ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
+ ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
- todo_wine {
- ok(l->locinfo->lc_category[LC_COLLATE].locale != l2->locinfo->lc_category[LC_COLLATE].locale,
- "same locale name pointers for LC_COLLATE\n");
- ok(l->locinfo->lc_category[LC_COLLATE].refcount != l2->locinfo->lc_category[LC_COLLATE].refcount,
- "same refcount pointers for LC_COLLATE\n");
- }
+ ok(l->locinfo->lc_category[LC_COLLATE].locale != l2->locinfo->lc_category[LC_COLLATE].locale,
+ "same locale name pointers for LC_COLLATE\n");
+ ok(l->locinfo->lc_category[LC_COLLATE].refcount != l2->locinfo->lc_category[LC_COLLATE].refcount,
+ "same refcount pointers for LC_COLLATE\n");
ok(*l->locinfo->lc_category[LC_COLLATE].refcount == 1, "refcount = %d\n",
*l->locinfo->lc_category[LC_COLLATE].refcount);
todo_wine ok(*l2->locinfo->lc_category[LC_COLLATE].refcount == 2, "refcount = %d\n",
@@ -2038,7 +2032,7 @@ static void test__get_current_locale(void)
*l->locinfo->lc_category[i].refcount, i);
}
- todo_wine ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
+ ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
l->locinfo->lc_collate_cp, l2->locinfo->lc_collate_cp);
ok(l->locinfo->lc_codepage == l2->locinfo->lc_codepage, "different lc_codepages %u, %u\n",
@@ -2055,21 +2049,15 @@ static void test__get_current_locale(void)
ok(l->locinfo->lconv == l2->locinfo->lconv, "different lconv pointers\n");
ok(l->locinfo->lconv_intl_refcount == l2->locinfo->lconv_intl_refcount, "different lconv_intl_refcount pointers\n");
- todo_wine ok(l->locinfo->lconv_intl_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_intl_refcount)
- todo_wine ok(*l->locinfo->lconv_intl_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
+ todo_wine ok(*l->locinfo->lconv_intl_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
ok(l->locinfo->lconv->decimal_point == l2->locinfo->lconv->decimal_point, "different LC_NUMERIC pointers\n");
ok(l->locinfo->lconv_num_refcount == l2->locinfo->lconv_num_refcount, "different lconv_num_refcount pointers\n");
- todo_wine ok(l->locinfo->lconv_num_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_num_refcount)
- todo_wine ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
+ todo_wine ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
ok(l->locinfo->lconv->currency_symbol == l2->locinfo->lconv->currency_symbol, "different LC_MONETARY pointers\n");
ok(l->locinfo->lconv_mon_refcount == l2->locinfo->lconv_mon_refcount, "different lconv_mon_refcount pointers\n");
- todo_wine ok(l->locinfo->lconv_mon_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_mon_refcount)
- todo_wine ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
+ todo_wine ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
@@ -2080,18 +2068,14 @@ static void test__get_current_locale(void)
p_setlocale(LC_CTYPE, "C");
l2 = p__get_current_locale();
- todo_wine {
- ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
- ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
- }
+ ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
+ ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
for(i = LC_COLLATE; i < LC_MONETARY; i++) {
- todo_wine {
- ok(l->locinfo->lc_category[i].locale != l2->locinfo->lc_category[i].locale,
- "same locale name pointers for category %d\n", i);
- ok(l->locinfo->lc_category[i].refcount != l2->locinfo->lc_category[i].refcount,
- "same refcount pointers for category %d\n", i);
- }
+ ok(l->locinfo->lc_category[i].locale != l2->locinfo->lc_category[i].locale,
+ "same locale name pointers for category %d\n", i);
+ ok(l->locinfo->lc_category[i].refcount != l2->locinfo->lc_category[i].refcount,
+ "same refcount pointers for category %d\n", i);
ok(*l->locinfo->lc_category[i].refcount == 1, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
todo_wine ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
@@ -2106,45 +2090,33 @@ static void test__get_current_locale(void)
*l->locinfo->lc_category[i].refcount, i);
}
- todo_wine {
- ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
- l->locinfo->lc_collate_cp, l2->locinfo->lc_collate_cp);
+ ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
+ l->locinfo->lc_collate_cp, l2->locinfo->lc_collate_cp);
- ok(l->locinfo->lc_codepage != l2->locinfo->lc_codepage, "same lc_codepages %u, %u\n",
- l->locinfo->lc_codepage, l2->locinfo->lc_codepage);
- ok(l->locinfo->lc_clike != l2->locinfo->lc_clike, "same lc_clike values %d, %d\n",
- l->locinfo->lc_clike, l2->locinfo->lc_clike);
- ok(l->locinfo->lc_clike, "non-C locale is C-like\n");
- }
+ ok(l->locinfo->lc_codepage != l2->locinfo->lc_codepage, "same lc_codepages %u, %u\n",
+ l->locinfo->lc_codepage, l2->locinfo->lc_codepage);
+ ok(l->locinfo->lc_clike != l2->locinfo->lc_clike, "same lc_clike values %d, %d\n",
+ l->locinfo->lc_clike, l2->locinfo->lc_clike);
+ ok(l->locinfo->lc_clike, "non-C locale is C-like\n");
ok(!l2->locinfo->lc_clike, "C locale is not C-like\n");
- todo_wine {
- ok(l->locinfo->ctype1 != l2->locinfo->ctype1, "same ctype1 pointers\n");
- ok(l->locinfo->pclmap != l2->locinfo->pclmap, "same clmap pointers\n");
- ok(l->locinfo->pcumap != l2->locinfo->pcumap, "same cumap pointers\n");
- ok(l->locinfo->ctype1_refcount != l2->locinfo->ctype1_refcount, "same ctype1_refcount pointers\n");
- ok(l->locinfo->ctype1_refcount, "null refcount pointer for non-C locale\n");
- if(l->locinfo->ctype1_refcount)
- ok(*l->locinfo->ctype1_refcount == 1, "refcount = %d\n", *l->locinfo->ctype1_refcount);
- }
+ ok(l->locinfo->ctype1 != l2->locinfo->ctype1, "same ctype1 pointers\n");
+ ok(l->locinfo->pclmap != l2->locinfo->pclmap, "same clmap pointers\n");
+ ok(l->locinfo->pcumap != l2->locinfo->pcumap, "same cumap pointers\n");
+ ok(l->locinfo->ctype1_refcount != l2->locinfo->ctype1_refcount, "same ctype1_refcount pointers\n");
+ ok(*l->locinfo->ctype1_refcount == 1, "refcount = %d\n", *l->locinfo->ctype1_refcount);
ok(!l2->locinfo->ctype1_refcount, "nonnull refcount pointer for C locale\n");
ok(l->locinfo->lconv == l2->locinfo->lconv, "different lconv pointers\n");
ok(l->locinfo->lconv_intl_refcount == l2->locinfo->lconv_intl_refcount, "different lconv_intl_refcount pointers\n");
- todo_wine ok(l->locinfo->lconv_intl_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_intl_refcount)
- todo_wine ok(*l->locinfo->lconv_intl_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
+ todo_wine ok(*l->locinfo->lconv_intl_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
ok(l->locinfo->lconv->decimal_point == l2->locinfo->lconv->decimal_point, "different LC_NUMERIC pointers\n");
ok(l->locinfo->lconv_num_refcount == l2->locinfo->lconv_num_refcount, "different lconv_num_refcount pointers\n");
- todo_wine ok(l->locinfo->lconv_num_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_num_refcount)
- todo_wine ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
+ todo_wine ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
ok(l->locinfo->lconv->currency_symbol == l2->locinfo->lconv->currency_symbol, "different LC_MONETARY pointers\n");
ok(l->locinfo->lconv_mon_refcount == l2->locinfo->lconv_mon_refcount, "different lconv_mon_refcount pointers\n");
- todo_wine ok(l->locinfo->lconv_mon_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_mon_refcount)
- todo_wine ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
+ todo_wine ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
@@ -2155,18 +2127,14 @@ static void test__get_current_locale(void)
p_setlocale(LC_MONETARY, "C");
l2 = p__get_current_locale();
- todo_wine {
- ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
- ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
- }
+ ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
+ ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
for(i = LC_COLLATE; i <= LC_MONETARY; i++) {
- todo_wine {
- ok(l->locinfo->lc_category[i].locale != l2->locinfo->lc_category[i].locale,
- "same locale name pointers for category %d\n", i);
- ok(l->locinfo->lc_category[i].refcount != l2->locinfo->lc_category[i].refcount,
- "same refcount pointers for category %d\n", i);
- }
+ ok(l->locinfo->lc_category[i].locale != l2->locinfo->lc_category[i].locale,
+ "same locale name pointers for category %d\n", i);
+ ok(l->locinfo->lc_category[i].refcount != l2->locinfo->lc_category[i].refcount,
+ "same refcount pointers for category %d\n", i);
ok(*l->locinfo->lc_category[i].refcount == 1, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
todo_wine ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
@@ -2181,52 +2149,34 @@ static void test__get_current_locale(void)
*l->locinfo->lc_category[i].refcount, i);
}
- todo_wine {
- ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
- l->locinfo->lc_collate_cp, l2->locinfo->lc_collate_cp);
+ ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
+ l->locinfo->lc_collate_cp, l2->locinfo->lc_collate_cp);
- ok(l->locinfo->lc_codepage != l2->locinfo->lc_codepage, "same lc_codepages %u, %u\n",
- l->locinfo->lc_codepage, l2->locinfo->lc_codepage);
- ok(l->locinfo->lc_clike != l2->locinfo->lc_clike, "same lc_clike values %d, %d\n",
- l->locinfo->lc_clike, l2->locinfo->lc_clike);
- ok(l->locinfo->lc_clike, "non-C locale is C-like\n");
- }
+ ok(l->locinfo->lc_codepage != l2->locinfo->lc_codepage, "same lc_codepages %u, %u\n",
+ l->locinfo->lc_codepage, l2->locinfo->lc_codepage);
+ ok(l->locinfo->lc_clike != l2->locinfo->lc_clike, "same lc_clike values %d, %d\n",
+ l->locinfo->lc_clike, l2->locinfo->lc_clike);
+ ok(l->locinfo->lc_clike, "non-C locale is C-like\n");
ok(!l2->locinfo->lc_clike, "C locale is not C-like\n");
- todo_wine {
- ok(l->locinfo->ctype1 != l2->locinfo->ctype1, "same ctype1 pointers\n");
- ok(l->locinfo->pclmap != l2->locinfo->pclmap, "same clmap pointers\n");
- ok(l->locinfo->pcumap != l2->locinfo->pcumap, "same cumap pointers\n");
- ok(l->locinfo->ctype1_refcount != l2->locinfo->ctype1_refcount, "same ctype1_refcount pointers\n");
- ok(l->locinfo->ctype1_refcount, "null refcount pointer for non-C locale\n");
- if(l->locinfo->ctype1_refcount)
- ok(*l->locinfo->ctype1_refcount == 1, "refcount = %d\n", *l->locinfo->ctype1_refcount);
- }
+ ok(l->locinfo->ctype1 != l2->locinfo->ctype1, "same ctype1 pointers\n");
+ ok(l->locinfo->pclmap != l2->locinfo->pclmap, "same clmap pointers\n");
+ ok(l->locinfo->pcumap != l2->locinfo->pcumap, "same cumap pointers\n");
+ ok(l->locinfo->ctype1_refcount != l2->locinfo->ctype1_refcount, "same ctype1_refcount pointers\n");
+ ok(*l->locinfo->ctype1_refcount == 1, "refcount = %d\n", *l->locinfo->ctype1_refcount);
ok(!l2->locinfo->ctype1_refcount, "nonnull refcount pointer for C locale\n");
- todo_wine {
- ok(l->locinfo->lconv != l2->locinfo->lconv, "same lconv pointers\n");
- ok(l->locinfo->lconv_intl_refcount != l2->locinfo->lconv_intl_refcount, "same lconv_intl_refcount pointers\n");
- ok(l->locinfo->lconv_intl_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_intl_refcount)
- ok(*l->locinfo->lconv_intl_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
- ok(l2->locinfo->lconv_intl_refcount, "null refcount pointer for C locale\n");
- if(l2->locinfo->lconv_intl_refcount)
- ok(*l2->locinfo->lconv_intl_refcount == 2, "refcount = %d\n", *l2->locinfo->lconv_intl_refcount);
- }
+ ok(l->locinfo->lconv != l2->locinfo->lconv, "same lconv pointers\n");
+ ok(l->locinfo->lconv_intl_refcount != l2->locinfo->lconv_intl_refcount, "same lconv_intl_refcount pointers\n");
+ ok(*l->locinfo->lconv_intl_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
+ todo_wine ok(*l2->locinfo->lconv_intl_refcount == 2, "refcount = %d\n", *l2->locinfo->lconv_intl_refcount);
ok(l->locinfo->lconv->decimal_point == l2->locinfo->lconv->decimal_point, "different LC_NUMERIC pointers\n");
ok(l->locinfo->lconv_num_refcount == l2->locinfo->lconv_num_refcount, "different lconv_num_refcount pointers\n");
- todo_wine ok(l->locinfo->lconv_num_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_num_refcount)
- todo_wine ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
-
- todo_wine {
- ok(l->locinfo->lconv->currency_symbol != l2->locinfo->lconv->currency_symbol, "same LC_MONETARY pointers\n");
- ok(l->locinfo->lconv_mon_refcount != l2->locinfo->lconv_mon_refcount, "same lconv_mon_refcount pointers\n");
- ok(l->locinfo->lconv_mon_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_mon_refcount)
- ok(*l->locinfo->lconv_mon_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
- }
+ todo_wine ok(*l->locinfo->lconv_num_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
+
+ ok(l->locinfo->lconv->currency_symbol != l2->locinfo->lconv->currency_symbol, "same LC_MONETARY pointers\n");
+ ok(l->locinfo->lconv_mon_refcount != l2->locinfo->lconv_mon_refcount, "same lconv_mon_refcount pointers\n");
+ ok(*l->locinfo->lconv_mon_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
ok(!l2->locinfo->lconv_mon_refcount, "nonnull refcount pointer for C locale\n");
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
@@ -2238,18 +2188,14 @@ static void test__get_current_locale(void)
p_setlocale(LC_NUMERIC, "C");
l2 = p__get_current_locale();
- todo_wine {
- ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
- ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
- }
+ ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
+ ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
for(i = LC_COLLATE; i <= LC_NUMERIC; i++) {
- todo_wine {
- ok(l->locinfo->lc_category[i].locale != l2->locinfo->lc_category[i].locale,
- "same locale name pointers for category %d\n", i);
- ok(l->locinfo->lc_category[i].refcount != l2->locinfo->lc_category[i].refcount,
- "same refcount pointers for category %d\n", i);
- }
+ ok(l->locinfo->lc_category[i].locale != l2->locinfo->lc_category[i].locale,
+ "same locale name pointers for category %d\n", i);
+ ok(l->locinfo->lc_category[i].refcount != l2->locinfo->lc_category[i].refcount,
+ "same refcount pointers for category %d\n", i);
ok(*l->locinfo->lc_category[i].refcount == 1, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
todo_wine ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
@@ -2262,53 +2208,35 @@ static void test__get_current_locale(void)
todo_wine ok(*l->locinfo->lc_category[LC_TIME].refcount == 3, "refcount = %d\n",
*l->locinfo->lc_category[LC_TIME].refcount);
- todo_wine {
- ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
- l->locinfo->lc_collate_cp, l2->locinfo->lc_collate_cp);
+ ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
+ l->locinfo->lc_collate_cp, l2->locinfo->lc_collate_cp);
- ok(l->locinfo->lc_codepage != l2->locinfo->lc_codepage, "same lc_codepages %u, %u\n",
- l->locinfo->lc_codepage, l2->locinfo->lc_codepage);
- ok(l->locinfo->lc_clike != l2->locinfo->lc_clike, "same lc_clike values %d, %d\n",
- l->locinfo->lc_clike, l2->locinfo->lc_clike);
- ok(l->locinfo->lc_clike, "non-C locale is C-like\n");
- }
+ ok(l->locinfo->lc_codepage != l2->locinfo->lc_codepage, "same lc_codepages %u, %u\n",
+ l->locinfo->lc_codepage, l2->locinfo->lc_codepage);
+ ok(l->locinfo->lc_clike != l2->locinfo->lc_clike, "same lc_clike values %d, %d\n",
+ l->locinfo->lc_clike, l2->locinfo->lc_clike);
+ ok(l->locinfo->lc_clike, "non-C locale is C-like\n");
ok(!l2->locinfo->lc_clike, "C locale is not C-like\n");
- todo_wine {
- ok(l->locinfo->ctype1 != l2->locinfo->ctype1, "same ctype1 pointers\n");
- ok(l->locinfo->pclmap != l2->locinfo->pclmap, "same clmap pointers\n");
- ok(l->locinfo->pcumap != l2->locinfo->pcumap, "same cumap pointers\n");
- ok(l->locinfo->ctype1_refcount != l2->locinfo->ctype1_refcount, "same ctype1_refcount pointers\n");
- ok(l->locinfo->ctype1_refcount, "null refcount pointer for non-C locale\n");
- if(l->locinfo->ctype1_refcount)
- ok(*l->locinfo->ctype1_refcount == 1, "refcount = %d\n", *l->locinfo->ctype1_refcount);
- }
+ ok(l->locinfo->ctype1 != l2->locinfo->ctype1, "same ctype1 pointers\n");
+ ok(l->locinfo->pclmap != l2->locinfo->pclmap, "same clmap pointers\n");
+ ok(l->locinfo->pcumap != l2->locinfo->pcumap, "same cumap pointers\n");
+ ok(l->locinfo->ctype1_refcount != l2->locinfo->ctype1_refcount, "same ctype1_refcount pointers\n");
+ ok(*l->locinfo->ctype1_refcount == 1, "refcount = %d\n", *l->locinfo->ctype1_refcount);
ok(!l2->locinfo->ctype1_refcount, "nonnull refcount pointer for C locale\n");
- todo_wine {
- ok(l->locinfo->lconv != l2->locinfo->lconv, "same lconv pointers\n");
- ok(l->locinfo->lconv_intl_refcount != l2->locinfo->lconv_intl_refcount, "same lconv_intl_refcount pointers\n");
- ok(l->locinfo->lconv_intl_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_intl_refcount)
- ok(*l->locinfo->lconv_intl_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
- }
+ ok(l->locinfo->lconv != l2->locinfo->lconv, "same lconv pointers\n");
+ ok(l->locinfo->lconv_intl_refcount != l2->locinfo->lconv_intl_refcount, "same lconv_intl_refcount pointers\n");
+ ok(*l->locinfo->lconv_intl_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
ok(!l2->locinfo->lconv_intl_refcount, "nonnull refcount pointer for C locale\n");
- todo_wine {
- ok(l->locinfo->lconv->decimal_point != l2->locinfo->lconv->decimal_point, "same LC_NUMERIC pointers\n");
- ok(l->locinfo->lconv_num_refcount != l2->locinfo->lconv_num_refcount, "same lconv_num_refcount pointers\n");
- ok(l->locinfo->lconv_num_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_num_refcount)
- ok(*l->locinfo->lconv_num_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
- }
+ ok(l->locinfo->lconv->decimal_point != l2->locinfo->lconv->decimal_point, "same LC_NUMERIC pointers\n");
+ ok(l->locinfo->lconv_num_refcount != l2->locinfo->lconv_num_refcount, "same lconv_num_refcount pointers\n");
+ ok(*l->locinfo->lconv_num_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
ok(!l2->locinfo->lconv_num_refcount, "nonnull refcount pointer for C locale\n");
- todo_wine {
- ok(l->locinfo->lconv->currency_symbol != l2->locinfo->lconv->currency_symbol, "same LC_MONETARY pointers\n");
- ok(l->locinfo->lconv_mon_refcount != l2->locinfo->lconv_mon_refcount, "same lconv_mon_refcount pointers\n");
- ok(l->locinfo->lconv_mon_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_mon_refcount)
- ok(*l->locinfo->lconv_mon_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
- }
+ ok(l->locinfo->lconv->currency_symbol != l2->locinfo->lconv->currency_symbol, "same LC_MONETARY pointers\n");
+ ok(l->locinfo->lconv_mon_refcount != l2->locinfo->lconv_mon_refcount, "same lconv_mon_refcount pointers\n");
+ ok(*l->locinfo->lconv_mon_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
ok(!l2->locinfo->lconv_mon_refcount, "nonnull refcount pointer for C locale\n");
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
@@ -2320,76 +2248,54 @@ static void test__get_current_locale(void)
p_setlocale(LC_TIME, "C");
l2 = p__get_current_locale();
- todo_wine {
- ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
- ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
- }
+ ok(l->locinfo->refcount == 1, "refcount = %d\n", l->locinfo->refcount);
+ ok(l2->locinfo->refcount == 2, "refcount = %d\n", l2->locinfo->refcount);
for(i = LC_MIN+1; i <= LC_MAX; i++) {
- todo_wine {
- ok(l->locinfo->lc_category[i].locale != l2->locinfo->lc_category[i].locale,
- "same locale name pointers for category %d\n", i);
- ok(l->locinfo->lc_category[i].refcount != l2->locinfo->lc_category[i].refcount,
- "same refcount pointers for category %d\n", i);
- }
+ ok(l->locinfo->lc_category[i].locale != l2->locinfo->lc_category[i].locale,
+ "same locale name pointers for category %d\n", i);
+ ok(l->locinfo->lc_category[i].refcount != l2->locinfo->lc_category[i].refcount,
+ "same refcount pointers for category %d\n", i);
ok(*l->locinfo->lc_category[i].refcount == 1, "refcount = %d for category %d\n",
*l->locinfo->lc_category[i].refcount, i);
todo_wine ok(*l2->locinfo->lc_category[i].refcount == 2, "refcount = %d for category %d\n",
*l2->locinfo->lc_category[i].refcount, i);
}
- todo_wine {
- ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
- l->locinfo->lc_collate_cp, l2->locinfo->lc_collate_cp);
+ ok(l->locinfo->lc_collate_cp != l2->locinfo->lc_collate_cp, "same lc_collate_cp %u, %u\n",
+ l->locinfo->lc_collate_cp, l2->locinfo->lc_collate_cp);
- ok(l->locinfo->lc_codepage != l2->locinfo->lc_codepage, "same lc_codepages %u, %u\n",
- l->locinfo->lc_codepage, l2->locinfo->lc_codepage);
- ok(l->locinfo->lc_clike != l2->locinfo->lc_clike, "same lc_clike values %d, %d\n",
- l->locinfo->lc_clike, l2->locinfo->lc_clike);
- ok(l->locinfo->lc_clike, "non-C locale is C-like\n");
- }
+ ok(l->locinfo->lc_codepage != l2->locinfo->lc_codepage, "same lc_codepages %u, %u\n",
+ l->locinfo->lc_codepage, l2->locinfo->lc_codepage);
+ ok(l->locinfo->lc_clike != l2->locinfo->lc_clike, "same lc_clike values %d, %d\n",
+ l->locinfo->lc_clike, l2->locinfo->lc_clike);
+ ok(l->locinfo->lc_clike, "non-C locale is C-like\n");
ok(!l2->locinfo->lc_clike, "C locale is not C-like\n");
- todo_wine {
- ok(l->locinfo->ctype1 != l2->locinfo->ctype1, "same ctype1 pointers\n");
- ok(l->locinfo->pclmap != l2->locinfo->pclmap, "same clmap pointers\n");
- ok(l->locinfo->pcumap != l2->locinfo->pcumap, "same cumap pointers\n");
- ok(l->locinfo->ctype1_refcount != l2->locinfo->ctype1_refcount, "same ctype1_refcount pointers\n");
- ok(l->locinfo->ctype1_refcount, "null refcount pointer for non-C locale\n");
- if(l->locinfo->ctype1_refcount)
- ok(*l->locinfo->ctype1_refcount == 1, "refcount = %d\n", *l->locinfo->ctype1_refcount);
- }
+ ok(l->locinfo->ctype1 != l2->locinfo->ctype1, "same ctype1 pointers\n");
+ ok(l->locinfo->pclmap != l2->locinfo->pclmap, "same clmap pointers\n");
+ ok(l->locinfo->pcumap != l2->locinfo->pcumap, "same cumap pointers\n");
+ ok(l->locinfo->ctype1_refcount != l2->locinfo->ctype1_refcount, "same ctype1_refcount pointers\n");
+ ok(*l->locinfo->ctype1_refcount == 1, "refcount = %d\n", *l->locinfo->ctype1_refcount);
ok(!l2->locinfo->ctype1_refcount, "nonnull refcount pointer for C locale\n");
- todo_wine {
- ok(l->locinfo->lconv != l2->locinfo->lconv, "same lconv pointers\n");
- ok(l->locinfo->lconv_intl_refcount != l2->locinfo->lconv_intl_refcount, "same lconv_intl_refcount pointers\n");
- ok(l->locinfo->lconv_intl_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_intl_refcount)
- ok(*l->locinfo->lconv_intl_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
- }
+ ok(l->locinfo->lconv != l2->locinfo->lconv, "same lconv pointers\n");
+ ok(l->locinfo->lconv_intl_refcount != l2->locinfo->lconv_intl_refcount, "same lconv_intl_refcount pointers\n");
+ ok(*l->locinfo->lconv_intl_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_intl_refcount);
ok(!l2->locinfo->lconv_intl_refcount, "nonnull refcount pointer for C locale\n");
- todo_wine {
- ok(l->locinfo->lconv->decimal_point != l2->locinfo->lconv->decimal_point, "same LC_NUMERIC pointers\n");
- ok(l->locinfo->lconv_num_refcount != l2->locinfo->lconv_num_refcount, "same lconv_num_refcount pointers\n");
- ok(l->locinfo->lconv_num_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_num_refcount)
- ok(*l->locinfo->lconv_num_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
- }
+ ok(l->locinfo->lconv->decimal_point != l2->locinfo->lconv->decimal_point, "same LC_NUMERIC pointers\n");
+ ok(l->locinfo->lconv_num_refcount != l2->locinfo->lconv_num_refcount, "same lconv_num_refcount pointers\n");
+ ok(*l->locinfo->lconv_num_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_num_refcount);
ok(!l2->locinfo->lconv_num_refcount, "nonnull refcount pointer for C locale\n");
- todo_wine {
- ok(l->locinfo->lconv->currency_symbol != l2->locinfo->lconv->currency_symbol, "same LC_MONETARY pointers\n");
- ok(l->locinfo->lconv_mon_refcount != l2->locinfo->lconv_mon_refcount, "same lconv_mon_refcount pointers\n");
- ok(l->locinfo->lconv_mon_refcount, "null refcount pointer in non-C locale\n");
- if(l->locinfo->lconv_mon_refcount)
- ok(*l->locinfo->lconv_mon_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
- }
+ ok(l->locinfo->lconv->currency_symbol != l2->locinfo->lconv->currency_symbol, "same LC_MONETARY pointers\n");
+ ok(l->locinfo->lconv_mon_refcount != l2->locinfo->lconv_mon_refcount, "same lconv_mon_refcount pointers\n");
+ ok(*l->locinfo->lconv_mon_refcount == 1, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
ok(!l2->locinfo->lconv_mon_refcount, "nonnull refcount pointer for C locale\n");
- todo_wine ok(l->locinfo->lc_time_curr != l2->locinfo->lc_time_curr, "same lc_time_curr pointers\n");
+ ok(l->locinfo->lc_time_curr != l2->locinfo->lc_time_curr, "same lc_time_curr pointers\n");
ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
- todo_wine ok(l->locinfo->lc_time_curr->refcount == 1, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
+ ok(l->locinfo->lc_time_curr->refcount == 1, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
ok(l2->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l2->locinfo->lc_time_curr->unk);
ok(l2->locinfo->lc_time_curr->refcount == 3 || l2->locinfo->lc_time_curr->refcount == 2,
"refcount = %d\n", l2->locinfo->lc_time_curr->refcount);
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 5894990f55e4..1c7a5ef21f63 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -513,17 +513,22 @@ static inline void swap_pointers(void **p1, void **p2) {
*p2 = hlp;
}
-/* INTERNAL: returns pthreadlocinfo struct */
-MSVCRT_pthreadlocinfo get_locinfo(void) {
+/* INTERNAL: returns pointer to pointer to threadlocinfo struct */
+static MSVCRT_pthreadlocinfo *get_locinfo_ptr(void) {
thread_data_t *data = msvcrt_get_thread_data();
if(!data || !data->have_locale)
- return MSVCRT_locale->locinfo;
+ return &MSVCRT_locale->locinfo;
+
+ return &data->locinfo;
+}
- return data->locinfo;
+/* INTERNAL: returns threadlocinfo struct */
+MSVCRT_pthreadlocinfo get_locinfo(void) {
+ return *get_locinfo_ptr();
}
-/* INTERNAL: returns pthreadlocinfo struct */
+/* INTERNAL: returns threadmbcinfo struct */
MSVCRT_pthreadmbcinfo get_mbcinfo(void) {
thread_data_t *data = msvcrt_get_thread_data();
@@ -1939,168 +1944,8 @@ char* CDECL MSVCRT_setlocale(int category, const char* locale)
if(locale[0] != 'C' || locale[1] != '\0')
initial_locale = FALSE;
- if(locinfo->lc_handle[MSVCRT_LC_COLLATE]!=newlocinfo->lc_handle[MSVCRT_LC_COLLATE]
- || locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage) {
- locinfo->lc_collate_cp = newlocinfo->lc_collate_cp;
- locinfo->lc_handle[MSVCRT_LC_COLLATE] =
- newlocinfo->lc_handle[MSVCRT_LC_COLLATE];
- locinfo->lc_id[MSVCRT_LC_COLLATE] =
- newlocinfo->lc_id[MSVCRT_LC_COLLATE];
-
-#if _MSVCR_VER >= 110
- swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_COLLATE],
- (void**)&newlocinfo->lc_name[MSVCRT_LC_COLLATE]);
-#endif
- }
- if(newlocinfo->lc_category[MSVCRT_LC_COLLATE].locale) {
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_COLLATE].locale,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_COLLATE].locale);
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_COLLATE].refcount,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_COLLATE].refcount);
- }
-
- if(locinfo->lc_handle[MSVCRT_LC_CTYPE]!=newlocinfo->lc_handle[MSVCRT_LC_CTYPE]
- || locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage) {
- locinfo->lc_handle[MSVCRT_LC_CTYPE] =
- newlocinfo->lc_handle[MSVCRT_LC_CTYPE];
- locinfo->lc_id[MSVCRT_LC_CTYPE] =
- newlocinfo->lc_id[MSVCRT_LC_CTYPE];
-
- locinfo->lc_codepage = newlocinfo->lc_codepage;
- locinfo->lc_clike = newlocinfo->lc_clike;
- locinfo->mb_cur_max = newlocinfo->mb_cur_max;
-
- swap_pointers((void**)&locinfo->ctype1_refcount,
- (void**)&newlocinfo->ctype1_refcount);
- swap_pointers((void**)&locinfo->ctype1, (void**)&newlocinfo->ctype1);
- swap_pointers((void**)&locinfo->pctype, (void**)&newlocinfo->pctype);
- swap_pointers((void**)&locinfo->pclmap, (void**)&newlocinfo->pclmap);
- swap_pointers((void**)&locinfo->pcumap, (void**)&newlocinfo->pcumap);
-
-#if _MSVCR_VER >= 110
- swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_CTYPE],
- (void**)&newlocinfo->lc_name[MSVCRT_LC_CTYPE]);
-#endif
- }
- if(newlocinfo->lc_category[MSVCRT_LC_CTYPE].locale) {
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_CTYPE].locale,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_CTYPE].locale);
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_CTYPE].refcount,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_CTYPE].refcount);
- }
-
- if(locinfo->lc_handle[MSVCRT_LC_MONETARY]!=newlocinfo->lc_handle[MSVCRT_LC_MONETARY]
- || locinfo->lc_id[MSVCRT_LC_MONETARY].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_MONETARY].wCodePage) {
- locinfo->lc_handle[MSVCRT_LC_MONETARY] =
- newlocinfo->lc_handle[MSVCRT_LC_MONETARY];
- locinfo->lc_id[MSVCRT_LC_MONETARY] =
- newlocinfo->lc_id[MSVCRT_LC_MONETARY];
-
- swap_pointers((void**)&locinfo->lconv->int_curr_symbol,
- (void**)&newlocinfo->lconv->int_curr_symbol);
- swap_pointers((void**)&locinfo->lconv->currency_symbol,
- (void**)&newlocinfo->lconv->currency_symbol);
- swap_pointers((void**)&locinfo->lconv->mon_decimal_point,
- (void**)&newlocinfo->lconv->mon_decimal_point);
- swap_pointers((void**)&locinfo->lconv->mon_thousands_sep,
- (void**)&newlocinfo->lconv->mon_thousands_sep);
- swap_pointers((void**)&locinfo->lconv->mon_grouping,
- (void**)&newlocinfo->lconv->mon_grouping);
- swap_pointers((void**)&locinfo->lconv->positive_sign,
- (void**)&newlocinfo->lconv->positive_sign);
- swap_pointers((void**)&locinfo->lconv->negative_sign,
- (void**)&newlocinfo->lconv->negative_sign);
-
-#if _MSVCR_VER >= 100
- swap_pointers((void**)&locinfo->lconv->_W_int_curr_symbol,
- (void**)&newlocinfo->lconv->_W_int_curr_symbol);
- swap_pointers((void**)&locinfo->lconv->_W_currency_symbol,
- (void**)&newlocinfo->lconv->_W_currency_symbol);
- swap_pointers((void**)&locinfo->lconv->_W_mon_decimal_point,
- (void**)&newlocinfo->lconv->_W_mon_decimal_point);
- swap_pointers((void**)&locinfo->lconv->_W_mon_thousands_sep,
- (void**)&newlocinfo->lconv->_W_mon_thousands_sep);
- swap_pointers((void**)&locinfo->lconv->_W_positive_sign,
- (void**)&newlocinfo->lconv->_W_positive_sign);
- swap_pointers((void**)&locinfo->lconv->_W_negative_sign,
- (void**)&newlocinfo->lconv->_W_negative_sign);
-#endif
-
- locinfo->lconv->int_frac_digits = newlocinfo->lconv->int_frac_digits;
- locinfo->lconv->frac_digits = newlocinfo->lconv->frac_digits;
- locinfo->lconv->p_cs_precedes = newlocinfo->lconv->p_cs_precedes;
- locinfo->lconv->p_sep_by_space = newlocinfo->lconv->p_sep_by_space;
- locinfo->lconv->n_cs_precedes = newlocinfo->lconv->n_cs_precedes;
- locinfo->lconv->n_sep_by_space = newlocinfo->lconv->n_sep_by_space;
- locinfo->lconv->p_sign_posn = newlocinfo->lconv->p_sign_posn;
- locinfo->lconv->n_sign_posn = newlocinfo->lconv->n_sign_posn;
-
-#if _MSVCR_VER >= 110
- swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_MONETARY],
- (void**)&newlocinfo->lc_name[MSVCRT_LC_MONETARY]);
-#endif
- }
- if(newlocinfo->lc_category[MSVCRT_LC_MONETARY].locale) {
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_MONETARY].locale,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_MONETARY].locale);
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_MONETARY].refcount,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_MONETARY].refcount);
- }
-
- if(locinfo->lc_handle[MSVCRT_LC_NUMERIC]!=newlocinfo->lc_handle[MSVCRT_LC_NUMERIC]
- || locinfo->lc_id[MSVCRT_LC_NUMERIC].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_NUMERIC].wCodePage) {
- locinfo->lc_handle[MSVCRT_LC_NUMERIC] =
- newlocinfo->lc_handle[MSVCRT_LC_NUMERIC];
- locinfo->lc_id[MSVCRT_LC_NUMERIC] =
- newlocinfo->lc_id[MSVCRT_LC_NUMERIC];
-
- swap_pointers((void**)&locinfo->lconv->decimal_point,
- (void**)&newlocinfo->lconv->decimal_point);
- swap_pointers((void**)&locinfo->lconv->thousands_sep,
- (void**)&newlocinfo->lconv->thousands_sep);
- swap_pointers((void**)&locinfo->lconv->grouping,
- (void**)&newlocinfo->lconv->grouping);
-
-#if _MSVCR_VER >= 100
- swap_pointers((void**)&locinfo->lconv->_W_decimal_point,
- (void**)&newlocinfo->lconv->_W_decimal_point);
- swap_pointers((void**)&locinfo->lconv->_W_thousands_sep,
- (void**)&newlocinfo->lconv->_W_thousands_sep);
-#endif
-
-#if _MSVCR_VER >= 110
- swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_NUMERIC],
- (void**)&newlocinfo->lc_name[MSVCRT_LC_NUMERIC]);
-#endif
- }
- if(newlocinfo->lc_category[MSVCRT_LC_NUMERIC].locale) {
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_NUMERIC].locale,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_NUMERIC].locale);
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_NUMERIC].refcount,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_NUMERIC].refcount);
- }
-
- if(locinfo->lc_handle[MSVCRT_LC_TIME]!=newlocinfo->lc_handle[MSVCRT_LC_TIME]
- || locinfo->lc_id[MSVCRT_LC_TIME].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_TIME].wCodePage) {
- locinfo->lc_handle[MSVCRT_LC_TIME] =
- newlocinfo->lc_handle[MSVCRT_LC_TIME];
- locinfo->lc_id[MSVCRT_LC_TIME] =
- newlocinfo->lc_id[MSVCRT_LC_TIME];
- swap_pointers((void**)&locinfo->lc_time_curr,
- (void**)&newlocinfo->lc_time_curr);
-
-#if _MSVCR_VER >= 110
- swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_TIME],
- (void**)&newlocinfo->lc_name[MSVCRT_LC_TIME]);
-#endif
- }
- if(newlocinfo->lc_category[MSVCRT_LC_TIME].locale) {
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_TIME].locale,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_TIME].locale);
- swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_TIME].refcount,
- (void**)&newlocinfo->lc_category[MSVCRT_LC_TIME].refcount);
- }
-
+ locinfo = newlocinfo;
+ swap_pointers(get_locinfo_ptr(), &newlocinfo);
free_locinfo(newlocinfo);
_unlock_locales();
--
2.24.0
Jan. 31, 2020
[PATCH 6/8] msvcrt: Share __lc_time_data between threadlocinfo instances.
by Chip Davis
My testing shows that unk[1] is some sort of refcount. I've updated a
few places with this knowledge.
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
dlls/msvcr90/tests/msvcr90.c | 10 +++++-----
dlls/msvcrt/locale.c | 10 ++++++++--
dlls/msvcrt/msvcrt.h | 3 ++-
dlls/msvcrt/tests/time.c | 7 ++++---
4 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c
index 4e28cafea0d8..664ab49317a9 100644
--- a/dlls/msvcr90/tests/msvcr90.c
+++ b/dlls/msvcr90/tests/msvcr90.c
@@ -2072,7 +2072,7 @@ static void test__get_current_locale(void)
todo_wine ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
- todo_wine ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
+ ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
todo_wine ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
p__free_locale(l2);
@@ -2147,7 +2147,7 @@ static void test__get_current_locale(void)
todo_wine ok(*l->locinfo->lconv_mon_refcount == 3, "refcount = %d\n", *l->locinfo->lconv_mon_refcount);
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
- todo_wine ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
+ ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
todo_wine ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
p__free_locale(l2);
@@ -2230,7 +2230,7 @@ static void test__get_current_locale(void)
ok(!l2->locinfo->lconv_mon_refcount, "nonnull refcount pointer for C locale\n");
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
- todo_wine ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
+ ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
todo_wine ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
p__free_locale(l2);
@@ -2312,7 +2312,7 @@ static void test__get_current_locale(void)
ok(!l2->locinfo->lconv_mon_refcount, "nonnull refcount pointer for C locale\n");
ok(l->locinfo->lc_time_curr == l2->locinfo->lc_time_curr, "different lc_time_curr pointers\n");
- todo_wine ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
+ ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
todo_wine ok(l->locinfo->lc_time_curr->refcount == 3, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
p__free_locale(l2);
@@ -2391,7 +2391,7 @@ static void test__get_current_locale(void)
ok(l->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l->locinfo->lc_time_curr->unk);
todo_wine ok(l->locinfo->lc_time_curr->refcount == 1, "refcount = %d\n", l->locinfo->lc_time_curr->refcount);
ok(l2->locinfo->lc_time_curr->unk == 1, "unk = %d\n", l2->locinfo->lc_time_curr->unk);
- todo_wine ok(l2->locinfo->lc_time_curr->refcount == 3 || l2->locinfo->lc_time_curr->refcount == 2,
+ ok(l2->locinfo->lc_time_curr->refcount == 3 || l2->locinfo->lc_time_curr->refcount == 2,
"refcount = %d\n", l2->locinfo->lc_time_curr->refcount);
p__free_locale(l2);
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index de77c83cbdea..5894990f55e4 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -131,7 +131,7 @@ MSVCRT___lc_time_data cloc_time_data =
#if _MSVCR_VER < 110
MAKELCID(LANG_ENGLISH, SORT_DEFAULT),
#endif
- {1, 0},
+ 1, 1,
{{sun, mon, tue, wed, thu, fri, sat,
sunday, monday, tuesday, wednesday, thursday, friday, saturday,
jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec,
@@ -979,7 +979,8 @@ void free_locinfo(MSVCRT_pthreadlocinfo locinfo)
MSVCRT_free(locinfo->ctype1);
}
- if(locinfo->lc_time_curr != &cloc_time_data)
+ if(!InterlockedDecrement(&locinfo->lc_time_curr->refcount)
+ && locinfo->lc_time_curr != &cloc_time_data)
MSVCRT_free(locinfo->lc_time_curr);
MSVCRT_free(locinfo);
@@ -1120,6 +1121,8 @@ static MSVCRT___lc_time_data* create_time_data(LCID lcid)
#else
cur->lcid = lcid;
#endif
+ cur->unk = 1;
+ cur->refcount = 1;
return cur;
}
@@ -1803,6 +1806,8 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
if(!category_needs_update(MSVCRT_LC_TIME, category, old_locinfo,
lcid[MSVCRT_LC_TIME], cp[MSVCRT_LC_TIME])) {
copy_threadlocinfo_category(locinfo, old_locinfo, MSVCRT_LC_TIME);
+ locinfo->lc_time_curr = old_locinfo->lc_time_curr;
+ InterlockedIncrement(&locinfo->lc_time_curr->refcount);
} else if(lcid[MSVCRT_LC_TIME] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_TIME)) {
if(!update_threadlocinfo_category(lcid[MSVCRT_LC_TIME],
cp[MSVCRT_LC_TIME], locinfo, MSVCRT_LC_TIME)) {
@@ -1826,6 +1831,7 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
return NULL;
}
locinfo->lc_time_curr = &cloc_time_data;
+ InterlockedIncrement(&locinfo->lc_time_curr->refcount);
}
return locinfo;
diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index 244df7d23ccc..e5a22c68ee8b 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -146,7 +146,8 @@ typedef struct {
#if _MSVCR_VER < 110
LCID lcid;
#endif
- int unk[2];
+ int unk;
+ int refcount;
union {
const MSVCRT_wchar_t *wstr[43];
struct {
diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c
index 45ed971ca89a..20212d19bfa5 100644
--- a/dlls/msvcrt/tests/time.c
+++ b/dlls/msvcrt/tests/time.c
@@ -47,7 +47,8 @@ typedef struct {
const char *date;
const char *time;
LCID lcid;
- int unk[2];
+ int unk;
+ int refcount;
} __lc_time_data;
static __time32_t (__cdecl *p_mkgmtime32)(struct tm*);
@@ -824,8 +825,8 @@ static void test_strftime(void)
return;
}
- /* TODO: find meaning of unk[0] */
- time_data.unk[0] = 1;
+ /* TODO: find meaning of unk */
+ time_data.unk = 1;
for (i=0; i<ARRAY_SIZE(tests_td); i++)
{
time_data.short_date = tests_td[i].short_date;
--
2.24.0
Jan. 31, 2020
[PATCH 5/8] msvcrt: Copy LC_COLLATE codepage between threadlocinfo instances.
by Chip Davis
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
dlls/msvcrt/locale.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 6370b7e3a9a7..de77c83cbdea 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -1248,6 +1248,7 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
if(!category_needs_update(MSVCRT_LC_COLLATE, category, old_locinfo,
lcid[MSVCRT_LC_COLLATE], cp[MSVCRT_LC_COLLATE])) {
copy_threadlocinfo_category(locinfo, old_locinfo, MSVCRT_LC_COLLATE);
+ locinfo->lc_collate_cp = old_locinfo->lc_collate_cp;
} else if(lcid[MSVCRT_LC_COLLATE] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_COLLATE)) {
if(!update_threadlocinfo_category(lcid[MSVCRT_LC_COLLATE],
cp[MSVCRT_LC_COLLATE], locinfo, MSVCRT_LC_COLLATE)) {
--
2.24.0
Jan. 31, 2020