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
December 2019
- 73 participants
- 1394 messages
[PATCH 6/9] dmloader: Get rid of the 'dmdump' debug channel
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/container.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c
index f7c7f3e951..075843ad32 100644
--- a/dlls/dmloader/container.c
+++ b/dlls/dmloader/container.c
@@ -22,7 +22,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-WINE_DECLARE_DEBUG_CHANNEL(dmdump);
#define DMUS_MAX_CATEGORY_SIZE DMUS_MAX_CATEGORY*sizeof(WCHAR)
#define DMUS_MAX_NAME_SIZE DMUS_MAX_NAME*sizeof(WCHAR)
@@ -298,9 +297,8 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
TRACE_(dmfile)(": %s chunk (size = 0x%08X)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_CONTAINER_CHUNK: {
- TRACE_(dmfile)(": container header chunk\n");
IStream_Read (pStm, &This->Header, Chunk.dwSize, NULL);
- TRACE_(dmdump)(": container header chunk:\n%s\n", debugstr_DMUS_IO_CONTAINER_HEADER(&This->Header));
+ TRACE_(dmfile)(": container header chunk:\n%s\n", debugstr_DMUS_IO_CONTAINER_HEADER(&This->Header));
break;
}
case DMUS_FOURCC_GUID_CHUNK: {
@@ -403,14 +401,13 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
TRACE_(dmfile)(": alias chunk\n");
pNewEntry->wszAlias = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, Chunk.dwSize);
IStream_Read (pStm, pNewEntry->wszAlias, Chunk.dwSize, NULL);
- TRACE_(dmdump)(": alias: %s\n", debugstr_w(pNewEntry->wszAlias));
+ TRACE_(dmfile)(": alias: %s\n", debugstr_w(pNewEntry->wszAlias));
break;
}
case DMUS_FOURCC_CONTAINED_OBJECT_CHUNK: {
DMUS_IO_CONTAINED_OBJECT_HEADER tmpObjectHeader;
- TRACE_(dmfile)(": contained object header chunk\n");
IStream_Read (pStm, &tmpObjectHeader, Chunk.dwSize, NULL);
- TRACE_(dmdump)(": contained object header:\n%s\n", debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER(&tmpObjectHeader));
+ TRACE_(dmfile)(": contained object header:\n%s\n", debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER(&tmpObjectHeader));
/* copy guidClass */
pNewEntry->Desc.dwValidData |= DMUS_OBJ_CLASS;
pNewEntry->Desc.guidClass = tmpObjectHeader.guidClassID;
--
2.23.0
Dec. 12, 2019
[PATCH 5/9] dmloader: Just use dump_DMUS_OBJECTDESC()
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/container.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c
index 39b105a159..f7c7f3e951 100644
--- a/dlls/dmloader/container.c
+++ b/dlls/dmloader/container.c
@@ -307,23 +307,20 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
TRACE_(dmfile)(": GUID chunk\n");
IStream_Read (pStm, &This->dmobj.desc.guidObject, Chunk.dwSize, NULL);
This->dmobj.desc.dwValidData |= DMUS_OBJ_OBJECT;
- TRACE_(dmdump)(": GUID: %s\n", debugstr_guid(&This->dmobj.desc.guidObject));
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
IStream_Read (pStm, &This->dmobj.desc.vVersion, Chunk.dwSize, NULL);
This->dmobj.desc.dwValidData |= DMUS_OBJ_VERSION;
- TRACE_(dmdump)(": version: %s\n", debugstr_dmversion(&This->dmobj.desc.vVersion));
break;
}
case DMUS_FOURCC_DATE_CHUNK: {
TRACE_(dmfile)(": date chunk\n");
IStream_Read (pStm, &This->dmobj.desc.ftDate, Chunk.dwSize, NULL);
This->dmobj.desc.dwValidData |= DMUS_OBJ_DATE;
- TRACE_(dmdump)(": date: %s\n", debugstr_filetime(&This->dmobj.desc.ftDate));
break;
- }
+ }
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
/* if it happens that string is too long,
@@ -336,7 +333,6 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
IStream_Read (pStm, This->dmobj.desc.wszCategory, Chunk.dwSize, NULL);
}
This->dmobj.desc.dwValidData |= DMUS_OBJ_CATEGORY;
- TRACE_(dmdump)(": category: %s\n", debugstr_w(This->dmobj.desc.wszCategory));
break;
}
case FOURCC_LIST: {
@@ -367,7 +363,6 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
IStream_Read (pStm, This->dmobj.desc.wszName, Chunk.dwSize, NULL);
}
This->dmobj.desc.dwValidData |= DMUS_OBJ_NAME;
- TRACE_(dmdump)(": name: %s\n", debugstr_w(This->dmobj.desc.wszName));
break;
}
default: {
@@ -606,6 +601,7 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
}
TRACE_(dmfile)(": reading finished\n");
This->dmobj.desc.dwValidData |= DMUS_OBJ_LOADED;
+ dump_DMUS_OBJECTDESC(&This->dmobj.desc);
break;
}
default: {
--
2.23.0
Dec. 12, 2019
[PATCH 4/9] dmband: Simplify dump_DMUS_OBJECTDESC() and move it to dmobject.c
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmband/band.c | 2 +-
dlls/dmband/dmobject.c | 53 ++++++++++++++++++++++
dlls/dmband/dmobject.h | 1 +
dlls/dmband/dmutils.c | 100 +----------------------------------------
dlls/dmband/dmutils.h | 14 ------
5 files changed, 56 insertions(+), 114 deletions(-)
diff --git a/dlls/dmband/band.c b/dlls/dmband/band.c
index 53f407c1a4..901f5a69ee 100644
--- a/dlls/dmband/band.c
+++ b/dlls/dmband/band.c
@@ -158,7 +158,7 @@ static HRESULT WINAPI band_IDirectMusicObject_ParseDescriptor(IDirectMusicObject
}
TRACE("returning descriptor:\n");
- debug_DMUS_OBJECTDESC(desc);
+ dump_DMUS_OBJECTDESC(desc);
return S_OK;
}
diff --git a/dlls/dmband/dmobject.c b/dlls/dmband/dmobject.c
index e0b7eafe25..9ea31ab32a 100644
--- a/dlls/dmband/dmobject.c
+++ b/dlls/dmband/dmobject.c
@@ -219,6 +219,59 @@ const char *debugstr_dmguid(const GUID *id) {
return debugstr_guid(id);
}
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
+{
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
+}
+
/* RIFF format parsing */
#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
diff --git a/dlls/dmband/dmobject.h b/dlls/dmband/dmobject.h
index 1354553665..d347020691 100644
--- a/dlls/dmband/dmobject.h
+++ b/dlls/dmband/dmobject.h
@@ -108,6 +108,7 @@ HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
/* Debugging helpers */
const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
static inline const char *debugstr_fourcc(DWORD fourcc)
{
diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
index 39d6358211..c676775d35 100644
--- a/dlls/dmband/dmutils.c
+++ b/dlls/dmband/dmutils.c
@@ -44,84 +44,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmfile);
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- static char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++) {
- if ((flags & names[i].val)) {
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- ptr = &buffer[0];
- return ptr;
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-/* month number into month name (for debugstr_filetime) */
-static const char *debugstr_month (DWORD dwMonth) {
- switch (dwMonth) {
- case 1: return "January";
- case 2: return "February";
- case 3: return "March";
- case 4: return "April";
- case 5: return "May";
- case 6: return "June";
- case 7: return "July";
- case 8: return "August";
- case 9: return "September";
- case 10: return "October";
- case 11: return "November";
- case 12: return "December";
- default: return "Invalid";
- }
-}
-
-/* FILETIME struct to string conversion for debug messages */
-static const char *debugstr_filetime (const FILETIME *time) {
- SYSTEMTIME sysTime;
-
- if (!time) return "'null'";
-
- FileTimeToSystemTime (time, &sysTime);
-
- return wine_dbg_sprintf ("\'%02i. %s %04i %02i:%02i:%02i\'",
- sysTime.wDay, debugstr_month(sysTime.wMonth), sysTime.wYear,
- sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion (const DMUS_VERSION *version) {
- if (!version) return "'null'";
- return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
- HIWORD(version->dwVersionMS),LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) {
switch (pChunk->fccID) {
@@ -278,7 +200,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
TRACE("** DM Reference Begin of Load ***\n");
TRACE("With Desc:\n");
- debug_DMUS_OBJECTDESC(&ref_desc);
+ dump_DMUS_OBJECTDESC(&ref_desc);
{
LPDIRECTMUSICGETLOADER pGetLoader = NULL;
@@ -295,23 +217,3 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-
-void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
- if (pDesc) {
- TRACE("DMUS_OBJECTDESC (%p):\n", pDesc);
- TRACE(" - dwSize = %d\n", pDesc->dwSize);
- TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
- if (pDesc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(pDesc->wszName));
- if (pDesc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
- if (pDesc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
- if (pDesc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = %s\n", debugstr_filetime(&pDesc->ftDate));
- if (pDesc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
- if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
- if (pDesc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
- if (pDesc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", pDesc->pStream);
- } else {
- TRACE("(NULL)\n");
- }
-}
diff --git a/dlls/dmband/dmutils.h b/dlls/dmband/dmutils.h
index dfa8ac46d6..2f13c4b1f4 100644
--- a/dlls/dmband/dmutils.h
+++ b/dlls/dmband/dmutils.h
@@ -34,18 +34,4 @@ extern HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_C
extern HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
extern HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicObject** ppObject) DECLSPEC_HIDDEN;
-/**
- * Debug utilities
- */
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-/* used for initialising structs */
-#define FE(x) { x, #x }
-
-extern void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DMUTILS_H */
--
2.23.0
Dec. 12, 2019
[PATCH 3/9] dmband: Use only the 'dmfile' debug channel in dmutils.c
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmband/dmutils.c | 45 +++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 23 deletions(-)
diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
index 1309c7c318..39d6358211 100644
--- a/dlls/dmband/dmutils.c
+++ b/dlls/dmband/dmutils.c
@@ -42,8 +42,7 @@
#include "dmutils.h"
#include "dmobject.h"
-WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
-WINE_DECLARE_DEBUG_CHANNEL(dmfile);
+WINE_DEFAULT_DEBUG_CHANNEL(dmfile);
/* generic flag-dumping function */
static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
@@ -127,37 +126,37 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* p
switch (pChunk->fccID) {
case DMUS_FOURCC_GUID_CHUNK: {
- TRACE_(dmfile)(": GUID chunk\n");
+ TRACE(": GUID chunk\n");
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStm, &pDesc->guidObject, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_DATE_CHUNK: {
- TRACE_(dmfile)(": file date chunk\n");
+ TRACE(": file date chunk\n");
pDesc->dwValidData |= DMUS_OBJ_DATE;
IStream_Read (pStm, &pDesc->ftDate, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_NAME_CHUNK: {
- TRACE_(dmfile)(": name chunk\n");
+ TRACE(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStm, pDesc->wszName, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_FILE_CHUNK: {
- TRACE_(dmfile)(": file name chunk\n");
+ TRACE(": file name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_FILENAME;
IStream_Read (pStm, pDesc->wszFileName, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
- TRACE_(dmfile)(": version chunk\n");
+ TRACE(": version chunk\n");
pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStm, &pDesc->vVersion, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
- TRACE_(dmfile)(": category chunk\n");
+ TRACE(": category chunk\n");
pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStm, pDesc->wszCategory, pChunk->dwSize, NULL);
break;
@@ -182,37 +181,37 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* p
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
- TRACE_(dmfile)(": name chunk\n");
+ TRACE(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStm, pDesc->wszName, pChunk->dwSize, NULL);
- TRACE_(dmfile)(" - wszName: %s\n", debugstr_w(pDesc->wszName));
+ TRACE(" - wszName: %s\n", debugstr_w(pDesc->wszName));
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
- TRACE_(dmfile)(": artist chunk (ignored)\n");
+ TRACE(": artist chunk (ignored)\n");
liMove.QuadPart = pChunk->dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
- TRACE_(dmfile)(": copyright chunk (ignored)\n");
+ TRACE(": copyright chunk (ignored)\n");
liMove.QuadPart = pChunk->dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
- TRACE_(dmfile)(": subject chunk (ignored)\n");
+ TRACE(": subject chunk (ignored)\n");
liMove.QuadPart = pChunk->dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
- TRACE_(dmfile)(": comment chunk (ignored)\n");
+ TRACE(": comment chunk (ignored)\n");
liMove.QuadPart = pChunk->dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
@@ -248,7 +247,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
do {
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
- TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
+ TRACE(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, &ref_desc);
if (FAILED(hr)) return hr;
@@ -256,29 +255,29 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
if (hr == S_FALSE) {
switch (Chunk.fccID) {
case DMUS_FOURCC_REF_CHUNK: {
- TRACE_(dmfile)(": Reference chunk\n");
+ TRACE(": Reference chunk\n");
if (Chunk.dwSize != sizeof(DMUS_IO_REFERENCE)) return E_FAIL;
IStream_Read (pStm, &ref, sizeof(DMUS_IO_REFERENCE), NULL);
- TRACE_(dmfile)(" - guidClassID: %s\n", debugstr_dmguid(&ref.guidClassID));
- TRACE_(dmfile)(" - dwValidData: %u\n", ref.dwValidData);
+ TRACE(" - guidClassID: %s\n", debugstr_dmguid(&ref.guidClassID));
+ TRACE(" - dwValidData: %u\n", ref.dwValidData);
break;
}
default: {
- TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n");
+ TRACE(": unknown chunk (irrelevant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
}
- TRACE_(dmfile)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]);
+ TRACE(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
ref_desc.dwValidData |= DMUS_OBJ_CLASS;
ref_desc.guidClass = ref.guidClassID;
- TRACE_(dmfile)("** DM Reference Begin of Load ***\n");
- TRACE_(dmfile)("With Desc:\n");
+ TRACE("** DM Reference Begin of Load ***\n");
+ TRACE("With Desc:\n");
debug_DMUS_OBJECTDESC(&ref_desc);
{
@@ -292,7 +291,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
hr = IDirectMusicLoader_GetObject (pLoader, &ref_desc, &IID_IDirectMusicObject, (LPVOID*)ppObject);
IDirectMusicLoader_Release (pLoader); /* release loader */
}
- TRACE_(dmfile)("** DM Reference End of Load ***\n");
+ TRACE("** DM Reference End of Load ***\n");
return hr;
}
--
2.23.0
Dec. 12, 2019
[PATCH 2/9] dmband: Move debugstr_dmguid() to dmobject.c
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmband/dmband_main.c | 1 +
dlls/dmband/dmobject.c | 189 ++++++++++++++++++++++++++++++++++++++
dlls/dmband/dmobject.h | 1 +
dlls/dmband/dmutils.c | 184 -------------------------------------
dlls/dmband/dmutils.h | 9 --
5 files changed, 191 insertions(+), 193 deletions(-)
diff --git a/dlls/dmband/dmband_main.c b/dlls/dmband/dmband_main.c
index e63678c831..baf36a3d6a 100644
--- a/dlls/dmband/dmband_main.c
+++ b/dlls/dmband/dmband_main.c
@@ -19,6 +19,7 @@
#include "dmband_private.h"
#include "rpcproxy.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmband);
diff --git a/dlls/dmband/dmobject.c b/dlls/dmband/dmobject.c
index 3b71a2719c..e0b7eafe25 100644
--- a/dlls/dmband/dmobject.c
+++ b/dlls/dmband/dmobject.c
@@ -25,12 +25,201 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
+
+
/* RIFF format parsing */
#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
diff --git a/dlls/dmband/dmobject.h b/dlls/dmband/dmobject.h
index 9e287a4126..1354553665 100644
--- a/dlls/dmband/dmobject.h
+++ b/dlls/dmband/dmobject.h
@@ -107,6 +107,7 @@ HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
/* Debugging helpers */
const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
static inline const char *debugstr_fourcc(DWORD fourcc)
{
diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
index 2401b20a60..1309c7c318 100644
--- a/dlls/dmband/dmutils.c
+++ b/dlls/dmband/dmutils.c
@@ -297,190 +297,6 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
-
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-
void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
TRACE("DMUS_OBJECTDESC (%p):\n", pDesc);
diff --git a/dlls/dmband/dmutils.h b/dlls/dmband/dmutils.h
index 5a845a81a8..dfa8ac46d6 100644
--- a/dlls/dmband/dmutils.h
+++ b/dlls/dmband/dmutils.h
@@ -43,17 +43,8 @@ typedef struct {
const char* name;
} flag_info;
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
/* used for initialising structs */
#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
extern void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
--
2.23.0
Dec. 12, 2019
[PATCH 1/9] dmband: Move debugstr_fourcc() to dmobject.h
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmband/dmobject.c | 7 -------
dlls/dmband/dmobject.h | 12 ++++++++++--
dlls/dmband/dmutils.c | 9 +--------
dlls/dmband/dmutils.h | 2 --
4 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/dlls/dmband/dmobject.c b/dlls/dmband/dmobject.c
index 25f3198d2b..3b71a2719c 100644
--- a/dlls/dmband/dmobject.c
+++ b/dlls/dmband/dmobject.c
@@ -34,13 +34,6 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/* RIFF format parsing */
#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
-static inline const char *debugstr_fourcc(DWORD fourcc)
-{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmband/dmobject.h b/dlls/dmband/dmobject.h
index 4a721cc152..9e287a4126 100644
--- a/dlls/dmband/dmobject.h
+++ b/dlls/dmband/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,13 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
index af24054bf4..2401b20a60 100644
--- a/dlls/dmband/dmutils.c
+++ b/dlls/dmband/dmutils.c
@@ -40,6 +40,7 @@
#include "dmusics.h"
#include "dmutils.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@@ -296,14 +297,6 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
/* returns name of given GUID */
const char *debugstr_dmguid (const GUID *id) {
static const guid_info guids[] = {
diff --git a/dlls/dmband/dmutils.h b/dlls/dmband/dmutils.h
index bb93e05c2b..5a845a81a8 100644
--- a/dlls/dmband/dmutils.h
+++ b/dlls/dmband/dmutils.h
@@ -52,8 +52,6 @@ typedef struct {
#define FE(x) { x, #x }
#define GE(x) { &x, #x }
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
/* returns name of given GUID */
extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
--
2.23.0
Dec. 12, 2019
[PATCH v3] ucrtbase: Fix handling of tab and non-breaking space in iswctype().
by Chip Davis
It's just these two that are handled specially AFAICT.
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
Notes:
v2: Fix build.
v3: Fix sign extension bug.
dlls/msvcr100/msvcr100.spec | 2 +-
dlls/msvcr110/msvcr110.spec | 2 +-
dlls/msvcr110/tests/msvcr110.c | 30 +++++++++++++++++++++++++
dlls/msvcr120/msvcr120.spec | 2 +-
dlls/msvcr70/msvcr70.spec | 2 +-
dlls/msvcr71/msvcr71.spec | 2 +-
dlls/msvcr80/msvcr80.spec | 2 +-
dlls/msvcr90/msvcr90.spec | 2 +-
dlls/msvcrt/msvcrt.spec | 2 +-
dlls/msvcrt/tests/string.c | 28 +++++++++++++++++++++++
dlls/msvcrt/wcs.c | 29 +++++++++++++++++-------
dlls/ucrtbase/tests/misc.c | 41 +++++++++++++++++++++++++++++-----
dlls/ucrtbase/ucrtbase.spec | 2 +-
13 files changed, 123 insertions(+), 23 deletions(-)
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 560e14b33b8..177b67298b2 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -1719,7 +1719,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index 2316535e5d1..376c36cd159 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -2077,7 +2077,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr110/tests/msvcr110.c b/dlls/msvcr110/tests/msvcr110.c
index 09876131f07..862d2bfce74 100644
--- a/dlls/msvcr110/tests/msvcr110.c
+++ b/dlls/msvcr110/tests/msvcr110.c
@@ -33,6 +33,7 @@
static char* (CDECL *p_setlocale)(int category, const char* locale);
static size_t (CDECL *p___strncnt)(const char *str, size_t count);
+static int (CDECL *p_iswctype)(wchar_t, wctype_t);
static unsigned int (CDECL *p_CurrentScheduler_GetNumberOfVirtualProcessors)(void);
static unsigned int (CDECL *p__CurrentScheduler__GetNumberOfVirtualProcessors)(void);
@@ -52,6 +53,7 @@ static BOOL init(void)
p_setlocale = (void*)GetProcAddress(module, "setlocale");
p___strncnt = (void*)GetProcAddress(module, "__strncnt");
+ p_iswctype = (void*)GetProcAddress(module, "iswctype");
p_CurrentScheduler_GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?GetNumberOfVirtualProcessors(a)CurrentScheduler@Concurrency@@SAIXZ");
p__CurrentScheduler__GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?_GetNumberOfVirtualProcessors(a)_CurrentScheduler@details(a)Concurrency@@SAIXZ");
p_CurrentScheduler_Id = (void*)GetProcAddress(module, "?Id(a)CurrentScheduler@Concurrency@@SAIXZ");
@@ -143,10 +145,38 @@ static void test___strncnt(void)
}
}
+static void test_iswctype(void)
+{
+ static const struct {
+ WCHAR c;
+ int t;
+ int r;
+ } tests[] = {
+ { '0', C1_DIGIT, C1_DIGIT },
+ { '9', C1_DIGIT, C1_DIGIT },
+ { 'a', C1_DIGIT, 0 },
+ { 'a', C1_LOWER, C1_LOWER },
+ { 0xa0, C1_BLANK, C1_BLANK },
+ { 0xe0, _ALPHA, C1_ALPHA|C1_LOWER },
+ { 0xff16, C1_DIGIT, C1_DIGIT },
+ { 0x0660, C1_DIGIT, C1_DIGIT },
+ { 0x0ce6, C1_DIGIT, C1_DIGIT }
+ };
+ int i, r;
+
+ p_setlocale(LC_ALL, "C");
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
+ {
+ r = p_iswctype(tests[i].c, tests[i].t);
+ ok(r == tests[i].r, "iswctype returned %x for %x\n", r, tests[i].c);
+ }
+}
+
START_TEST(msvcr110)
{
if (!init()) return;
test_CurrentScheduler(); /* MUST be first (at least among Concurrency tests) */
test_setlocale();
test___strncnt();
+ test_iswctype();
}
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index 903f4b7ce38..f04a0ec3494 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -2230,7 +2230,7 @@
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswblank(long) MSVCRT_iswblank
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec
index a014cf50365..d1457e8a32e 100644
--- a/dlls/msvcr70/msvcr70.spec
+++ b/dlls/msvcr70/msvcr70.spec
@@ -754,7 +754,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec
index 21b73d3a75c..72f292e64f0 100644
--- a/dlls/msvcr71/msvcr71.spec
+++ b/dlls/msvcr71/msvcr71.spec
@@ -750,7 +750,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index 402e6efc109..9e5f03685ce 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -1401,7 +1401,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index 8a079abe254..8c54c5f762d 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -1374,7 +1374,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index b3b9cca0b97..0d6b17eb6d8 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -1340,7 +1340,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index 1be4dcb129c..5b215728ad4 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -4024,6 +4024,33 @@ static void test_iswdigit(void)
}
}
+static void test_iswctype(void)
+{
+ static const struct {
+ WCHAR c;
+ int t;
+ int r;
+ } tests[] = {
+ { '0', C1_DIGIT, C1_DIGIT },
+ { '9', C1_DIGIT, C1_DIGIT },
+ { 'a', C1_DIGIT, 0 },
+ { 'a', C1_LOWER, C1_LOWER },
+ { 0xa0, C1_BLANK, C1_BLANK },
+ { 0xe0, _ALPHA, C1_ALPHA|C1_LOWER },
+ { 0xff16, C1_DIGIT, C1_DIGIT },
+ { 0x0660, C1_DIGIT, C1_DIGIT },
+ { 0x0ce6, C1_DIGIT, C1_DIGIT }
+ };
+ int i, r;
+
+ setlocale(LC_ALL, "C");
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
+ {
+ r = iswctype(tests[i].c, tests[i].t);
+ ok(r == tests[i].r, "iswctype returned %x for %x\n", r, tests[i].c);
+ }
+}
+
START_TEST(string)
{
char mem[100];
@@ -4167,4 +4194,5 @@ START_TEST(string)
test_C_locale();
test_strstr();
test_iswdigit();
+ test_iswctype();
}
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index 1ae292423c0..e54e2bb8d1f 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -1845,6 +1845,27 @@ MSVCRT_size_t CDECL MSVCRT_wcrtomb( char *dst, MSVCRT_wchar_t ch, MSVCRT_mbstate
return MSVCRT_wctomb(dst, ch);
}
+/*********************************************************************
+ * _iswctype_l (MSVCRT.@)
+ */
+int CDECL MSVCRT__iswctype_l(MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__locale_t locale)
+{
+ int ret = (get_char_typeW(wc) & 0xffff) & type;
+
+#if _MSVCR_VER >= 140
+ if (wc == '\t' || wc == 0x00a0) ret &= ~MSVCRT__BLANK;
+#endif
+ return ret;
+}
+
+/*********************************************************************
+ * iswctype (MSVCRT.@)
+ */
+int CDECL MSVCRT_iswctype(MSVCRT_wchar_t wc, MSVCRT_wctype_t type)
+{
+ return MSVCRT__iswctype_l( wc, type, NULL );
+}
+
/*********************************************************************
* iswalnum (MSVCRT.@)
*/
@@ -2021,14 +2042,6 @@ int CDECL MSVCRT__iswxdigit_l( MSVCRT_wchar_t wc, MSVCRT__locale_t locale )
return isxdigitW( wc );
}
-/*********************************************************************
- * _iswctype_l (MSVCRT.@)
- */
-INT CDECL MSVCRT__iswctype_l( MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__locale_t locale )
-{
- return (get_char_typeW(wc) & 0xffff) & type;
-}
-
/*********************************************************************
* _iswblank_l (MSVCRT.@)
*/
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c
index f637997a0d1..c9b04b7dd47 100644
--- a/dlls/ucrtbase/tests/misc.c
+++ b/dlls/ucrtbase/tests/misc.c
@@ -33,6 +33,7 @@
#include <windef.h>
#include <winbase.h>
+#include <winnls.h>
#include "wine/test.h"
#define DEFINE_EXPECT(func) \
@@ -154,6 +155,7 @@ static MSVCRT_lldiv_t* (CDECL *p_lldiv)(MSVCRT_lldiv_t*,LONGLONG,LONGLONG);
static int (CDECL *p__isctype)(int,int);
static int (CDECL *p_isblank)(int);
static int (CDECL *p__isblank_l)(int,_locale_t);
+static int (CDECL *p_iswctype)(int,int);
static int (CDECL *p__iswctype_l)(int,int,_locale_t);
static int (CDECL *p_iswblank)(int);
static int (CDECL *p__iswblank_l)(wint_t,_locale_t);
@@ -531,6 +533,7 @@ static BOOL init(void)
p__isctype = (void*)GetProcAddress(module, "_isctype");
p_isblank = (void*)GetProcAddress(module, "isblank");
p__isblank_l = (void*)GetProcAddress(module, "_isblank_l");
+ p_iswctype = (void*)GetProcAddress(module, "iswctype");
p__iswctype_l = (void*)GetProcAddress(module, "_iswctype_l");
p_iswblank = (void*)GetProcAddress(module, "iswblank");
p__iswblank_l = (void*)GetProcAddress(module, "_iswblank_l");
@@ -647,21 +650,46 @@ static void test_isblank(void)
for(c = 0; c <= 0xffff; c++) {
if(c == '\t' || c == ' ' || c == 0x3000 || c == 0xfeff) {
if(c == '\t')
- todo_wine ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n");
+ ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n");
else
ok(p__iswctype_l(c, _BLANK, NULL), "%d should be blank\n", c);
ok(p_iswblank(c), "%d should be blank\n", c);
ok(p__iswblank_l(c, NULL), "%d should be blank\n", c);
} else {
- todo_wine_if(c == 0xa0) {
- ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c);
- ok(!p_iswblank(c), "%d shouldn't be blank\n", c);
- ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c);
- }
+ ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c);
+ ok(!p_iswblank(c), "%d shouldn't be blank\n", c);
+ ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c);
}
}
}
+static void test_iswctype(void)
+{
+ static const struct {
+ WCHAR c;
+ int t;
+ int r;
+ } tests[] = {
+ { '0', C1_DIGIT, C1_DIGIT },
+ { '9', C1_DIGIT, C1_DIGIT },
+ { 'a', C1_DIGIT, 0 },
+ { 'a', C1_LOWER, C1_LOWER },
+ { 0xa0, C1_BLANK, 0 },
+ { 0xe0, _ALPHA, C1_ALPHA|C1_LOWER },
+ { 0xff16, C1_DIGIT, C1_DIGIT },
+ { 0x0660, C1_DIGIT, C1_DIGIT },
+ { 0x0ce6, C1_DIGIT, C1_DIGIT }
+ };
+ int i, r;
+
+ p_setlocale(LC_ALL, "C");
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
+ {
+ r = p_iswctype(tests[i].c, tests[i].t);
+ ok(r == tests[i].r, "iswctype returned %x for %x\n", r, tests[i].c);
+ }
+}
+
static struct MSVCRT__exception exception;
static int CDECL matherr_callback(struct MSVCRT__exception *e)
@@ -1460,6 +1488,7 @@ START_TEST(misc)
test__sopen_s();
test_lldiv();
test_isblank();
+ test_iswctype();
test_math_errors();
test_asctime();
test_strftime();
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
index 1293dd62f16..ca474dce9f9 100644
--- a/dlls/ucrtbase/ucrtbase.spec
+++ b/dlls/ucrtbase/ucrtbase.spec
@@ -2364,7 +2364,7 @@
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswblank(long) MSVCRT_iswblank
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
--
2.21.0
Dec. 11, 2019
Re: [PATCH v2] ucrtbase: Fix handling of tab and non-breaking space in iswctype().
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=61968
Your paranoid android.
=== debian10 (32 bit report) ===
ucrtbase:
misc.c:659: Test failed: 160 shouldn't be blank
misc.c:660: Test failed: 160 shouldn't be blank
misc.c:661: Test failed: 160 shouldn't be blank
misc.c:689: Test failed: iswctype returned 40 for a0
=== debian10 (32 bit French report) ===
ucrtbase:
misc.c:659: Test failed: 160 shouldn't be blank
misc.c:660: Test failed: 160 shouldn't be blank
misc.c:661: Test failed: 160 shouldn't be blank
misc.c:689: Test failed: iswctype returned 40 for a0
=== debian10 (32 bit Japanese:Japan report) ===
ucrtbase:
misc.c:659: Test failed: 160 shouldn't be blank
misc.c:660: Test failed: 160 shouldn't be blank
misc.c:661: Test failed: 160 shouldn't be blank
misc.c:689: Test failed: iswctype returned 40 for a0
=== debian10 (32 bit Chinese:China report) ===
ucrtbase:
misc.c:659: Test failed: 160 shouldn't be blank
misc.c:660: Test failed: 160 shouldn't be blank
misc.c:661: Test failed: 160 shouldn't be blank
misc.c:689: Test failed: iswctype returned 40 for a0
=== debian10 (32 bit WoW report) ===
ucrtbase:
misc.c:659: Test failed: 160 shouldn't be blank
misc.c:660: Test failed: 160 shouldn't be blank
misc.c:661: Test failed: 160 shouldn't be blank
misc.c:689: Test failed: iswctype returned 40 for a0
=== debian10 (64 bit WoW report) ===
ucrtbase:
misc.c:659: Test failed: 160 shouldn't be blank
misc.c:660: Test failed: 160 shouldn't be blank
misc.c:661: Test failed: 160 shouldn't be blank
misc.c:689: Test failed: iswctype returned 40 for a0
Dec. 11, 2019
[PATCH v2] ucrtbase: Fix handling of tab and non-breaking space in iswctype().
by Chip Davis
It's just these two that are handled specially AFAICT.
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
v2: Fix build.
dlls/msvcr100/msvcr100.spec | 2 +-
dlls/msvcr110/msvcr110.spec | 2 +-
dlls/msvcr110/tests/msvcr110.c | 30 +++++++++++++++++++++++++
dlls/msvcr120/msvcr120.spec | 2 +-
dlls/msvcr70/msvcr70.spec | 2 +-
dlls/msvcr71/msvcr71.spec | 2 +-
dlls/msvcr80/msvcr80.spec | 2 +-
dlls/msvcr90/msvcr90.spec | 2 +-
dlls/msvcrt/msvcrt.spec | 2 +-
dlls/msvcrt/tests/string.c | 28 +++++++++++++++++++++++
dlls/msvcrt/wcs.c | 29 +++++++++++++++++-------
dlls/ucrtbase/tests/misc.c | 41 +++++++++++++++++++++++++++++-----
dlls/ucrtbase/ucrtbase.spec | 2 +-
13 files changed, 123 insertions(+), 23 deletions(-)
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 560e14b33b8..177b67298b2 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -1719,7 +1719,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index 2316535e5d1..376c36cd159 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -2077,7 +2077,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr110/tests/msvcr110.c b/dlls/msvcr110/tests/msvcr110.c
index 09876131f07..862d2bfce74 100644
--- a/dlls/msvcr110/tests/msvcr110.c
+++ b/dlls/msvcr110/tests/msvcr110.c
@@ -33,6 +33,7 @@
static char* (CDECL *p_setlocale)(int category, const char* locale);
static size_t (CDECL *p___strncnt)(const char *str, size_t count);
+static int (CDECL *p_iswctype)(wchar_t, wctype_t);
static unsigned int (CDECL *p_CurrentScheduler_GetNumberOfVirtualProcessors)(void);
static unsigned int (CDECL *p__CurrentScheduler__GetNumberOfVirtualProcessors)(void);
@@ -52,6 +53,7 @@ static BOOL init(void)
p_setlocale = (void*)GetProcAddress(module, "setlocale");
p___strncnt = (void*)GetProcAddress(module, "__strncnt");
+ p_iswctype = (void*)GetProcAddress(module, "iswctype");
p_CurrentScheduler_GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?GetNumberOfVirtualProcessors(a)CurrentScheduler@Concurrency@@SAIXZ");
p__CurrentScheduler__GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?_GetNumberOfVirtualProcessors(a)_CurrentScheduler@details(a)Concurrency@@SAIXZ");
p_CurrentScheduler_Id = (void*)GetProcAddress(module, "?Id(a)CurrentScheduler@Concurrency@@SAIXZ");
@@ -143,10 +145,38 @@ static void test___strncnt(void)
}
}
+static void test_iswctype(void)
+{
+ static const struct {
+ WCHAR c;
+ int t;
+ int r;
+ } tests[] = {
+ { '0', C1_DIGIT, C1_DIGIT },
+ { '9', C1_DIGIT, C1_DIGIT },
+ { 'a', C1_DIGIT, 0 },
+ { 'a', C1_LOWER, C1_LOWER },
+ { 0xa0, C1_BLANK, C1_BLANK },
+ { 0xe0, _ALPHA, C1_ALPHA|C1_LOWER },
+ { 0xff16, C1_DIGIT, C1_DIGIT },
+ { 0x0660, C1_DIGIT, C1_DIGIT },
+ { 0x0ce6, C1_DIGIT, C1_DIGIT }
+ };
+ int i, r;
+
+ p_setlocale(LC_ALL, "C");
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
+ {
+ r = p_iswctype(tests[i].c, tests[i].t);
+ ok(r == tests[i].r, "iswctype returned %x for %x\n", r, tests[i].c);
+ }
+}
+
START_TEST(msvcr110)
{
if (!init()) return;
test_CurrentScheduler(); /* MUST be first (at least among Concurrency tests) */
test_setlocale();
test___strncnt();
+ test_iswctype();
}
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index 903f4b7ce38..f04a0ec3494 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -2230,7 +2230,7 @@
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswblank(long) MSVCRT_iswblank
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec
index a014cf50365..d1457e8a32e 100644
--- a/dlls/msvcr70/msvcr70.spec
+++ b/dlls/msvcr70/msvcr70.spec
@@ -754,7 +754,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec
index 21b73d3a75c..72f292e64f0 100644
--- a/dlls/msvcr71/msvcr71.spec
+++ b/dlls/msvcr71/msvcr71.spec
@@ -750,7 +750,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index 402e6efc109..9e5f03685ce 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -1401,7 +1401,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index 8a079abe254..8c54c5f762d 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -1374,7 +1374,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index b3b9cca0b97..0d6b17eb6d8 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -1340,7 +1340,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index 1be4dcb129c..5b215728ad4 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -4024,6 +4024,33 @@ static void test_iswdigit(void)
}
}
+static void test_iswctype(void)
+{
+ static const struct {
+ WCHAR c;
+ int t;
+ int r;
+ } tests[] = {
+ { '0', C1_DIGIT, C1_DIGIT },
+ { '9', C1_DIGIT, C1_DIGIT },
+ { 'a', C1_DIGIT, 0 },
+ { 'a', C1_LOWER, C1_LOWER },
+ { 0xa0, C1_BLANK, C1_BLANK },
+ { 0xe0, _ALPHA, C1_ALPHA|C1_LOWER },
+ { 0xff16, C1_DIGIT, C1_DIGIT },
+ { 0x0660, C1_DIGIT, C1_DIGIT },
+ { 0x0ce6, C1_DIGIT, C1_DIGIT }
+ };
+ int i, r;
+
+ setlocale(LC_ALL, "C");
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
+ {
+ r = iswctype(tests[i].c, tests[i].t);
+ ok(r == tests[i].r, "iswctype returned %x for %x\n", r, tests[i].c);
+ }
+}
+
START_TEST(string)
{
char mem[100];
@@ -4167,4 +4194,5 @@ START_TEST(string)
test_C_locale();
test_strstr();
test_iswdigit();
+ test_iswctype();
}
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index 1ae292423c0..16e28606bc1 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -1845,6 +1845,27 @@ MSVCRT_size_t CDECL MSVCRT_wcrtomb( char *dst, MSVCRT_wchar_t ch, MSVCRT_mbstate
return MSVCRT_wctomb(dst, ch);
}
+/*********************************************************************
+ * _iswctype_l (MSVCRT.@)
+ */
+int CDECL MSVCRT__iswctype_l(MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__locale_t locale)
+{
+ int ret = (get_char_typeW(wc) & 0xffff) & type;
+
+#if _MSVCR_VER >= 140
+ if (wc == '\t' || wc == '\xa0') ret &= ~MSVCRT__BLANK;
+#endif
+ return ret;
+}
+
+/*********************************************************************
+ * iswctype (MSVCRT.@)
+ */
+int CDECL MSVCRT_iswctype(MSVCRT_wchar_t wc, MSVCRT_wctype_t type)
+{
+ return MSVCRT__iswctype_l( wc, type, NULL );
+}
+
/*********************************************************************
* iswalnum (MSVCRT.@)
*/
@@ -2021,14 +2042,6 @@ int CDECL MSVCRT__iswxdigit_l( MSVCRT_wchar_t wc, MSVCRT__locale_t locale )
return isxdigitW( wc );
}
-/*********************************************************************
- * _iswctype_l (MSVCRT.@)
- */
-INT CDECL MSVCRT__iswctype_l( MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__locale_t locale )
-{
- return (get_char_typeW(wc) & 0xffff) & type;
-}
-
/*********************************************************************
* _iswblank_l (MSVCRT.@)
*/
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c
index f637997a0d1..c9b04b7dd47 100644
--- a/dlls/ucrtbase/tests/misc.c
+++ b/dlls/ucrtbase/tests/misc.c
@@ -33,6 +33,7 @@
#include <windef.h>
#include <winbase.h>
+#include <winnls.h>
#include "wine/test.h"
#define DEFINE_EXPECT(func) \
@@ -154,6 +155,7 @@ static MSVCRT_lldiv_t* (CDECL *p_lldiv)(MSVCRT_lldiv_t*,LONGLONG,LONGLONG);
static int (CDECL *p__isctype)(int,int);
static int (CDECL *p_isblank)(int);
static int (CDECL *p__isblank_l)(int,_locale_t);
+static int (CDECL *p_iswctype)(int,int);
static int (CDECL *p__iswctype_l)(int,int,_locale_t);
static int (CDECL *p_iswblank)(int);
static int (CDECL *p__iswblank_l)(wint_t,_locale_t);
@@ -531,6 +533,7 @@ static BOOL init(void)
p__isctype = (void*)GetProcAddress(module, "_isctype");
p_isblank = (void*)GetProcAddress(module, "isblank");
p__isblank_l = (void*)GetProcAddress(module, "_isblank_l");
+ p_iswctype = (void*)GetProcAddress(module, "iswctype");
p__iswctype_l = (void*)GetProcAddress(module, "_iswctype_l");
p_iswblank = (void*)GetProcAddress(module, "iswblank");
p__iswblank_l = (void*)GetProcAddress(module, "_iswblank_l");
@@ -647,21 +650,46 @@ static void test_isblank(void)
for(c = 0; c <= 0xffff; c++) {
if(c == '\t' || c == ' ' || c == 0x3000 || c == 0xfeff) {
if(c == '\t')
- todo_wine ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n");
+ ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n");
else
ok(p__iswctype_l(c, _BLANK, NULL), "%d should be blank\n", c);
ok(p_iswblank(c), "%d should be blank\n", c);
ok(p__iswblank_l(c, NULL), "%d should be blank\n", c);
} else {
- todo_wine_if(c == 0xa0) {
- ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c);
- ok(!p_iswblank(c), "%d shouldn't be blank\n", c);
- ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c);
- }
+ ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c);
+ ok(!p_iswblank(c), "%d shouldn't be blank\n", c);
+ ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c);
}
}
}
+static void test_iswctype(void)
+{
+ static const struct {
+ WCHAR c;
+ int t;
+ int r;
+ } tests[] = {
+ { '0', C1_DIGIT, C1_DIGIT },
+ { '9', C1_DIGIT, C1_DIGIT },
+ { 'a', C1_DIGIT, 0 },
+ { 'a', C1_LOWER, C1_LOWER },
+ { 0xa0, C1_BLANK, 0 },
+ { 0xe0, _ALPHA, C1_ALPHA|C1_LOWER },
+ { 0xff16, C1_DIGIT, C1_DIGIT },
+ { 0x0660, C1_DIGIT, C1_DIGIT },
+ { 0x0ce6, C1_DIGIT, C1_DIGIT }
+ };
+ int i, r;
+
+ p_setlocale(LC_ALL, "C");
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
+ {
+ r = p_iswctype(tests[i].c, tests[i].t);
+ ok(r == tests[i].r, "iswctype returned %x for %x\n", r, tests[i].c);
+ }
+}
+
static struct MSVCRT__exception exception;
static int CDECL matherr_callback(struct MSVCRT__exception *e)
@@ -1460,6 +1488,7 @@ START_TEST(misc)
test__sopen_s();
test_lldiv();
test_isblank();
+ test_iswctype();
test_math_errors();
test_asctime();
test_strftime();
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
index 1293dd62f16..ca474dce9f9 100644
--- a/dlls/ucrtbase/ucrtbase.spec
+++ b/dlls/ucrtbase/ucrtbase.spec
@@ -2364,7 +2364,7 @@
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswblank(long) MSVCRT_iswblank
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
--
2.21.0
Dec. 11, 2019
Re: [PATCH] ucrtbase: Fix handling of tab and non-breaking space in iswctype().
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=61965
Your paranoid android.
=== debian10 (build log) ===
../../../wine/dlls/ucrtbase/../msvcrt/wcs.c:1856:45: error: ‘_BLANK’ undeclared (first use in this function); did you mean ‘C1_BLANK’?
Task: The win32 build failed
=== debian10 (build log) ===
../../../wine/dlls/ucrtbase/../msvcrt/wcs.c:1856:45: error: ‘_BLANK’ undeclared (first use in this function); did you mean ‘C1_BLANK’?
Task: The wow64 build failed
Dec. 11, 2019
[PATCH v2] msvcrt: Correct return value of ___mb_cur_max_l_func().
by Chip Davis
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
v2: Fix hang on old Windows.
dlls/msvcr90/tests/msvcr90.c | 26 ++++++++++++++++++++++++++
dlls/msvcrt/mbcs.c | 4 ++--
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c
index 050699e4857..26a8dd466ec 100644
--- a/dlls/msvcr90/tests/msvcr90.c
+++ b/dlls/msvcr90/tests/msvcr90.c
@@ -136,6 +136,9 @@ static int (__cdecl *p__memicmp_l)(const char*, const char*, size_t, _locale_t);
static int (__cdecl *p__vsnwprintf)(wchar_t *buffer,size_t count, const wchar_t *format, __ms_va_list valist);
static size_t (__cdecl *p___strncnt)(const char *str, size_t count);
static int (__cdecl *p_swscanf)(const wchar_t *str, const wchar_t* format, ...);
+static int (__cdecl *p____mb_cur_max_l_func)(_locale_t locale);
+static _locale_t (__cdecl *p__create_locale)(int, const char*);
+static void (__cdecl *p__free_locale)(_locale_t);
/* make sure we use the correct errno */
#undef errno
@@ -407,6 +410,9 @@ static BOOL init(void)
SET(p__vsnwprintf, "_vsnwprintf");
SET(p___strncnt, "__strncnt");
SET(p_swscanf, "swscanf");
+ SET(p____mb_cur_max_l_func, "___mb_cur_max_l_func");
+ SET(p__create_locale, "_create_locale");
+ SET(p__free_locale, "_free_locale");
if (sizeof(void *) == 8)
{
@@ -1938,6 +1944,25 @@ static void test_swscanf(void)
ok( ret == (short)WEOF, "ret = %d\n", ret );
}
+static void test____mb_cur_max_l_func(void)
+{
+ int ret;
+ _locale_t l;
+
+ ret = p____mb_cur_max_l_func(NULL);
+ ok( ret == 1, "MB_CUR_MAX_L(NULL) = %d\n", ret );
+
+ l = p__create_locale(LC_ALL, "chinese-traditional");
+ if (!l)
+ {
+ skip("DBCS locale not available\n");
+ return;
+ }
+ ret = p____mb_cur_max_l_func(l);
+ ok( ret == 2, "MB_CUR_MAX_L(cht) = %d\n", ret );
+ p__free_locale(l);
+}
+
START_TEST(msvcr90)
{
if(!init())
@@ -1977,4 +2002,5 @@ START_TEST(msvcr90)
#endif
test___strncnt();
test_swscanf();
+ test____mb_cur_max_l_func();
}
diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c
index a9dbcfff661..39f94b17a36 100644
--- a/dlls/msvcrt/mbcs.c
+++ b/dlls/msvcrt/mbcs.c
@@ -184,7 +184,7 @@ int CDECL MSVCRT____mb_cur_max_func(void)
/*********************************************************************
* ___mb_cur_max_l_func (MSVCR80.@)
*/
-int* CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale)
+int CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale)
{
MSVCRT_pthreadlocinfo locinfo;
@@ -193,7 +193,7 @@ int* CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale)
else
locinfo = locale->locinfo;
- return &locinfo->mb_cur_max;
+ return locinfo->mb_cur_max;
}
#endif
--
2.24.0
Dec. 11, 2019
[PATCH] ucrtbase: Fix handling of tab and non-breaking space in iswctype().
by Chip Davis
It's just these two that are handled specially AFAICT.
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
dlls/msvcr100/msvcr100.spec | 2 +-
dlls/msvcr110/msvcr110.spec | 2 +-
dlls/msvcr110/tests/msvcr110.c | 30 +++++++++++++++++++++++++
dlls/msvcr120/msvcr120.spec | 2 +-
dlls/msvcr70/msvcr70.spec | 2 +-
dlls/msvcr71/msvcr71.spec | 2 +-
dlls/msvcr80/msvcr80.spec | 2 +-
dlls/msvcr90/msvcr90.spec | 2 +-
dlls/msvcrt/msvcrt.spec | 2 +-
dlls/msvcrt/tests/string.c | 28 +++++++++++++++++++++++
dlls/msvcrt/wcs.c | 29 +++++++++++++++++-------
dlls/ucrtbase/tests/misc.c | 41 +++++++++++++++++++++++++++++-----
dlls/ucrtbase/ucrtbase.spec | 2 +-
13 files changed, 123 insertions(+), 23 deletions(-)
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 560e14b33b8..177b67298b2 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -1719,7 +1719,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index 2316535e5d1..376c36cd159 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -2077,7 +2077,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr110/tests/msvcr110.c b/dlls/msvcr110/tests/msvcr110.c
index 09876131f07..862d2bfce74 100644
--- a/dlls/msvcr110/tests/msvcr110.c
+++ b/dlls/msvcr110/tests/msvcr110.c
@@ -33,6 +33,7 @@
static char* (CDECL *p_setlocale)(int category, const char* locale);
static size_t (CDECL *p___strncnt)(const char *str, size_t count);
+static int (CDECL *p_iswctype)(wchar_t, wctype_t);
static unsigned int (CDECL *p_CurrentScheduler_GetNumberOfVirtualProcessors)(void);
static unsigned int (CDECL *p__CurrentScheduler__GetNumberOfVirtualProcessors)(void);
@@ -52,6 +53,7 @@ static BOOL init(void)
p_setlocale = (void*)GetProcAddress(module, "setlocale");
p___strncnt = (void*)GetProcAddress(module, "__strncnt");
+ p_iswctype = (void*)GetProcAddress(module, "iswctype");
p_CurrentScheduler_GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?GetNumberOfVirtualProcessors(a)CurrentScheduler@Concurrency@@SAIXZ");
p__CurrentScheduler__GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?_GetNumberOfVirtualProcessors(a)_CurrentScheduler@details(a)Concurrency@@SAIXZ");
p_CurrentScheduler_Id = (void*)GetProcAddress(module, "?Id(a)CurrentScheduler@Concurrency@@SAIXZ");
@@ -143,10 +145,38 @@ static void test___strncnt(void)
}
}
+static void test_iswctype(void)
+{
+ static const struct {
+ WCHAR c;
+ int t;
+ int r;
+ } tests[] = {
+ { '0', C1_DIGIT, C1_DIGIT },
+ { '9', C1_DIGIT, C1_DIGIT },
+ { 'a', C1_DIGIT, 0 },
+ { 'a', C1_LOWER, C1_LOWER },
+ { 0xa0, C1_BLANK, C1_BLANK },
+ { 0xe0, _ALPHA, C1_ALPHA|C1_LOWER },
+ { 0xff16, C1_DIGIT, C1_DIGIT },
+ { 0x0660, C1_DIGIT, C1_DIGIT },
+ { 0x0ce6, C1_DIGIT, C1_DIGIT }
+ };
+ int i, r;
+
+ p_setlocale(LC_ALL, "C");
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
+ {
+ r = p_iswctype(tests[i].c, tests[i].t);
+ ok(r == tests[i].r, "iswctype returned %x for %x\n", r, tests[i].c);
+ }
+}
+
START_TEST(msvcr110)
{
if (!init()) return;
test_CurrentScheduler(); /* MUST be first (at least among Concurrency tests) */
test_setlocale();
test___strncnt();
+ test_iswctype();
}
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index 903f4b7ce38..f04a0ec3494 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -2230,7 +2230,7 @@
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswblank(long) MSVCRT_iswblank
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec
index a014cf50365..d1457e8a32e 100644
--- a/dlls/msvcr70/msvcr70.spec
+++ b/dlls/msvcr70/msvcr70.spec
@@ -754,7 +754,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec
index 21b73d3a75c..72f292e64f0 100644
--- a/dlls/msvcr71/msvcr71.spec
+++ b/dlls/msvcr71/msvcr71.spec
@@ -750,7 +750,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index 402e6efc109..9e5f03685ce 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -1401,7 +1401,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index 8a079abe254..8c54c5f762d 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -1374,7 +1374,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index b3b9cca0b97..0d6b17eb6d8 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -1340,7 +1340,7 @@
@ cdecl iswalpha(long) ntdll.iswalpha
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index 1be4dcb129c..5b215728ad4 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -4024,6 +4024,33 @@ static void test_iswdigit(void)
}
}
+static void test_iswctype(void)
+{
+ static const struct {
+ WCHAR c;
+ int t;
+ int r;
+ } tests[] = {
+ { '0', C1_DIGIT, C1_DIGIT },
+ { '9', C1_DIGIT, C1_DIGIT },
+ { 'a', C1_DIGIT, 0 },
+ { 'a', C1_LOWER, C1_LOWER },
+ { 0xa0, C1_BLANK, C1_BLANK },
+ { 0xe0, _ALPHA, C1_ALPHA|C1_LOWER },
+ { 0xff16, C1_DIGIT, C1_DIGIT },
+ { 0x0660, C1_DIGIT, C1_DIGIT },
+ { 0x0ce6, C1_DIGIT, C1_DIGIT }
+ };
+ int i, r;
+
+ setlocale(LC_ALL, "C");
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
+ {
+ r = iswctype(tests[i].c, tests[i].t);
+ ok(r == tests[i].r, "iswctype returned %x for %x\n", r, tests[i].c);
+ }
+}
+
START_TEST(string)
{
char mem[100];
@@ -4167,4 +4194,5 @@ START_TEST(string)
test_C_locale();
test_strstr();
test_iswdigit();
+ test_iswctype();
}
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index 1ae292423c0..9e47f5cf6e5 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -1845,6 +1845,27 @@ MSVCRT_size_t CDECL MSVCRT_wcrtomb( char *dst, MSVCRT_wchar_t ch, MSVCRT_mbstate
return MSVCRT_wctomb(dst, ch);
}
+/*********************************************************************
+ * _iswctype_l (MSVCRT.@)
+ */
+int CDECL MSVCRT__iswctype_l(MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__locale_t locale)
+{
+ int ret = (get_char_typeW(wc) & 0xffff) & type;
+
+#if _MSVCR_VER >= 140
+ if (wc == '\t' || wc == '\xa0') ret &= ~_BLANK;
+#endif
+ return ret;
+}
+
+/*********************************************************************
+ * iswctype (MSVCRT.@)
+ */
+int CDECL MSVCRT_iswctype(MSVCRT_wchar_t wc, MSVCRT_wctype_t type)
+{
+ return MSVCRT__iswctype_l( wc, type, NULL );
+}
+
/*********************************************************************
* iswalnum (MSVCRT.@)
*/
@@ -2021,14 +2042,6 @@ int CDECL MSVCRT__iswxdigit_l( MSVCRT_wchar_t wc, MSVCRT__locale_t locale )
return isxdigitW( wc );
}
-/*********************************************************************
- * _iswctype_l (MSVCRT.@)
- */
-INT CDECL MSVCRT__iswctype_l( MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__locale_t locale )
-{
- return (get_char_typeW(wc) & 0xffff) & type;
-}
-
/*********************************************************************
* _iswblank_l (MSVCRT.@)
*/
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c
index f637997a0d1..c9b04b7dd47 100644
--- a/dlls/ucrtbase/tests/misc.c
+++ b/dlls/ucrtbase/tests/misc.c
@@ -33,6 +33,7 @@
#include <windef.h>
#include <winbase.h>
+#include <winnls.h>
#include "wine/test.h"
#define DEFINE_EXPECT(func) \
@@ -154,6 +155,7 @@ static MSVCRT_lldiv_t* (CDECL *p_lldiv)(MSVCRT_lldiv_t*,LONGLONG,LONGLONG);
static int (CDECL *p__isctype)(int,int);
static int (CDECL *p_isblank)(int);
static int (CDECL *p__isblank_l)(int,_locale_t);
+static int (CDECL *p_iswctype)(int,int);
static int (CDECL *p__iswctype_l)(int,int,_locale_t);
static int (CDECL *p_iswblank)(int);
static int (CDECL *p__iswblank_l)(wint_t,_locale_t);
@@ -531,6 +533,7 @@ static BOOL init(void)
p__isctype = (void*)GetProcAddress(module, "_isctype");
p_isblank = (void*)GetProcAddress(module, "isblank");
p__isblank_l = (void*)GetProcAddress(module, "_isblank_l");
+ p_iswctype = (void*)GetProcAddress(module, "iswctype");
p__iswctype_l = (void*)GetProcAddress(module, "_iswctype_l");
p_iswblank = (void*)GetProcAddress(module, "iswblank");
p__iswblank_l = (void*)GetProcAddress(module, "_iswblank_l");
@@ -647,21 +650,46 @@ static void test_isblank(void)
for(c = 0; c <= 0xffff; c++) {
if(c == '\t' || c == ' ' || c == 0x3000 || c == 0xfeff) {
if(c == '\t')
- todo_wine ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n");
+ ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n");
else
ok(p__iswctype_l(c, _BLANK, NULL), "%d should be blank\n", c);
ok(p_iswblank(c), "%d should be blank\n", c);
ok(p__iswblank_l(c, NULL), "%d should be blank\n", c);
} else {
- todo_wine_if(c == 0xa0) {
- ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c);
- ok(!p_iswblank(c), "%d shouldn't be blank\n", c);
- ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c);
- }
+ ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c);
+ ok(!p_iswblank(c), "%d shouldn't be blank\n", c);
+ ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c);
}
}
}
+static void test_iswctype(void)
+{
+ static const struct {
+ WCHAR c;
+ int t;
+ int r;
+ } tests[] = {
+ { '0', C1_DIGIT, C1_DIGIT },
+ { '9', C1_DIGIT, C1_DIGIT },
+ { 'a', C1_DIGIT, 0 },
+ { 'a', C1_LOWER, C1_LOWER },
+ { 0xa0, C1_BLANK, 0 },
+ { 0xe0, _ALPHA, C1_ALPHA|C1_LOWER },
+ { 0xff16, C1_DIGIT, C1_DIGIT },
+ { 0x0660, C1_DIGIT, C1_DIGIT },
+ { 0x0ce6, C1_DIGIT, C1_DIGIT }
+ };
+ int i, r;
+
+ p_setlocale(LC_ALL, "C");
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
+ {
+ r = p_iswctype(tests[i].c, tests[i].t);
+ ok(r == tests[i].r, "iswctype returned %x for %x\n", r, tests[i].c);
+ }
+}
+
static struct MSVCRT__exception exception;
static int CDECL matherr_callback(struct MSVCRT__exception *e)
@@ -1460,6 +1488,7 @@ START_TEST(misc)
test__sopen_s();
test_lldiv();
test_isblank();
+ test_iswctype();
test_math_errors();
test_asctime();
test_strftime();
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
index 1293dd62f16..ca474dce9f9 100644
--- a/dlls/ucrtbase/ucrtbase.spec
+++ b/dlls/ucrtbase/ucrtbase.spec
@@ -2364,7 +2364,7 @@
@ cdecl iswascii(long) MSVCRT_iswascii
@ cdecl iswblank(long) MSVCRT_iswblank
@ cdecl iswcntrl(long) MSVCRT_iswcntrl
-@ cdecl iswctype(long long) ntdll.iswctype
+@ cdecl iswctype(long long) MSVCRT_iswctype
@ cdecl iswdigit(long) MSVCRT_iswdigit
@ cdecl iswgraph(long) MSVCRT_iswgraph
@ cdecl iswlower(long) MSVCRT_iswlower
--
2.24.0
Dec. 11, 2019
[PATCH] winetest: Remove superfluous cast to self
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
programs/winetest/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 60cb49d139..9d6a318e9c 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -202,7 +202,7 @@ static BOOL running_on_visible_desktop (void)
HWINSTA wstation;
USEROBJECTFLAGS uoflags;
- wstation = (HWINSTA)pGetProcessWindowStation();
+ wstation = pGetProcessWindowStation();
assert(pGetUserObjectInformationA(wstation, UOI_FLAGS, &uoflags, sizeof(uoflags), &len));
return (uoflags.dwFlags & WSF_VISIBLE) != 0;
}
--
2.23.0
Dec. 11, 2019
[PATCH] mountmgr.sys: Use the ARRAY_SIZE() macro
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/mountmgr.sys/device.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index 3369a92922..0ca2d42517 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -704,19 +704,19 @@ static HKEY get_scsi_device_lun_key( SCSI_ADDRESS *scsi_addr )
if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, scsi_keyW, 0, KEY_READ|KEY_WRITE, &scsi_key )) return NULL;
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), scsi_port_keyW, scsi_addr->PortNumber );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), scsi_port_keyW, scsi_addr->PortNumber );
if (RegCreateKeyExW( scsi_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &port_key, NULL )) return NULL;
RegCloseKey( scsi_key );
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), scsi_bus_keyW, scsi_addr->PathId );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), scsi_bus_keyW, scsi_addr->PathId );
if (RegCreateKeyExW( port_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &bus_key, NULL )) return NULL;
RegCloseKey( port_key );
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), target_id_keyW, scsi_addr->TargetId );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), target_id_keyW, scsi_addr->TargetId );
if (RegCreateKeyExW( bus_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &target_key, NULL )) return NULL;
RegCloseKey( bus_key );
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), lun_keyW, scsi_addr->Lun );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), lun_keyW, scsi_addr->Lun );
if (RegCreateKeyExW( target_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &lun_key, NULL )) return NULL;
RegCloseKey( target_key );
@@ -746,7 +746,7 @@ void create_scsi_entry( SCSI_ADDRESS *scsi_addr, UINT init_id, const char *drive
if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, scsi_keyW, 0, KEY_READ|KEY_WRITE, &scsi_key )) return;
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), scsi_port_keyW, scsi_addr->PortNumber );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), scsi_port_keyW, scsi_addr->PortNumber );
if (RegCreateKeyExW( scsi_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &port_key, NULL )) return;
RegCloseKey( scsi_key );
@@ -757,19 +757,19 @@ void create_scsi_entry( SCSI_ADDRESS *scsi_addr, UINT init_id, const char *drive
value = 0;
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), scsi_bus_keyW, scsi_addr->PathId );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), scsi_bus_keyW, scsi_addr->PathId );
if (RegCreateKeyExW( port_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &bus_key, NULL )) return;
RegCloseKey( port_key );
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), init_id_keyW, init_id );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), init_id_keyW, init_id );
if (RegCreateKeyExW( bus_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &target_key, NULL )) return;
RegCloseKey( target_key );
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), target_id_keyW, scsi_addr->TargetId );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), target_id_keyW, scsi_addr->TargetId );
if (RegCreateKeyExW( bus_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &target_key, NULL )) return;
RegCloseKey( bus_key );
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), lun_keyW, scsi_addr->Lun );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), lun_keyW, scsi_addr->Lun );
if (RegCreateKeyExW( target_key, dataW, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &lun_key, NULL )) return;
RegCloseKey( target_key );
@@ -811,7 +811,7 @@ void create_scsi_entry( SCSI_ADDRESS *scsi_addr, UINT init_id, const char *drive
}
else if (type == SCSI_TAPE_PERIPHERAL)
{
- snprintfW( dataW, sizeof(dataW)/sizeof(*dataW), tapeW, tape_no++ );
+ snprintfW( dataW, ARRAY_SIZE( dataW ), tapeW, tape_no++ );
RegSetValueExW( lun_key, devnameW, 0, REG_SZ, (const BYTE *)dataW, strlenW( dataW ) );
}
--
2.23.0
Dec. 11, 2019
Re: [PATCH] dmime/tests: Fix the spelling of a performance ok() message.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
On 12/11/19 2:57 AM, Francois Gouget wrote:
> Signed-off-by: Francois Gouget <fgouget(a)free.fr>
> ---
> dlls/dmime/tests/performance.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dlls/dmime/tests/performance.c b/dlls/dmime/tests/performance.c
> index 073625f04b1..1d17e5200e5 100644
> --- a/dlls/dmime/tests/performance.c
> +++ b/dlls/dmime/tests/performance.c
> @@ -472,7 +472,7 @@ static void test_notification_type(void)
> IDirectMusicPerformance8_FreePMsg(perf, (DMUS_PMSG*)msg);
> }
> todo_wine ok(prime_segment8 == segment8, "Wrong end segment\n");
> - todo_wine ok(found_end, "Didn't recieve DMUS_NOTIFICATION_SEGEND message\n");
> + todo_wine ok(found_end, "Didn't receive DMUS_NOTIFICATION_SEGEND message\n");
>
> CloseHandle(messages);
>
>
Dec. 11, 2019
win32 on macOS
by Fabian Maurer
Hello wine-devel,
is there any documentation on how the CodeWeavers solution for 32bit
Applications on Catalina works?
I'm interested in the technical details of this miracle, but there don't seem
to be many details out there. What I found was either on the superficial
level, or a bunch of speculation.
Regards,
Fabian Maurer
Dec. 11, 2019
[PATCH] msvcrt: Fix the btowc() function.
by Chip Davis
This function returns WEOF on conversion failure. It should only operate
on single-byte characters in the C locale. Finally, it should use the
current locale's codepage, instead of the current locale itself, to do
conversions.
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
Notes:
v2: Actually run the tests. Add new tests. Make them pass.
dlls/msvcrt/locale.c | 8 +++--
dlls/msvcrt/tests/string.c | 61 ++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 11ad9ed5f5f..c2dd10667f7 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -787,9 +787,11 @@ MSVCRT_wint_t CDECL MSVCRT_btowc(int c)
unsigned char letter = c;
MSVCRT_wchar_t ret;
- if(!MultiByteToWideChar(get_locinfo()->lc_handle[MSVCRT_LC_CTYPE],
- 0, (LPCSTR)&letter, 1, &ret, 1))
- return 0;
+ if(!get_locinfo()->lc_codepage)
+ return c <= 255 ? c : MSVCRT_WEOF;
+ if(!MultiByteToWideChar(get_locinfo()->lc_codepage,
+ MB_ERR_INVALID_CHARS, (LPCSTR)&letter, 1, &ret, 1))
+ return MSVCRT_WEOF;
return ret;
}
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index f4c4657791c..1be4dcb129c 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -87,6 +87,7 @@ static int (__cdecl *p_wcslwr_s)(wchar_t*,size_t);
static errno_t (__cdecl *p_mbsupr_s)(unsigned char *str, size_t numberOfElements);
static errno_t (__cdecl *p_mbslwr_s)(unsigned char *str, size_t numberOfElements);
static int (__cdecl *p_wctob)(wint_t);
+static wint_t (__cdecl *p_btowc)(int);
static size_t (__cdecl *p_wcrtomb)(char*, wchar_t, mbstate_t*);
static int (__cdecl *p_wcrtomb_s)(size_t*, char*, size_t, wchar_t, mbstate_t*);
static int (__cdecl *p_tolower)(int);
@@ -2829,6 +2830,64 @@ static void test_wctob(void)
_setmbcp(cp);
}
+static void test_btowc(void)
+{
+ wint_t ret;
+ int cp = _getmbcp();
+
+ if(!p_btowc || !setlocale(LC_ALL, "chinese-traditional")) {
+ win_skip("Skipping btowc tests\n");
+ return;
+ }
+
+ ret = p_btowc(0x61);
+ ok(ret == 0x61, "ret = %x\n", ret);
+
+ ret = p_btowc(0x81);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ ret = p_btowc(0xe0);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ _setmbcp(1250);
+ ret = p_btowc(0x61);
+ ok(ret == 0x61, "ret = %x\n", ret);
+
+ ret = p_btowc(0x81);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ ret = p_btowc(0xe0);
+ ok(ret == WEOF, "ret = %x\n", ret);
+
+ setlocale(LC_ALL, "C");
+ ret = p_btowc(0x61);
+ ok(ret == 0x61, "ret = %x\n", ret);
+
+ ret = p_btowc(0x81);
+ ok(ret == 0x81, "ret = %x\n", ret);
+
+ ret = p_btowc(0x9f);
+ ok(ret == 0x9f, "ret = %x\n", ret);
+
+ ret = p_btowc(0xe0);
+ ok(ret == 0xe0, "ret = %x\n", ret);
+
+ _setmbcp(0);
+ ret = p_btowc(0x61);
+ ok(ret == 0x61, "ret = %x\n", ret);
+
+ ret = p_btowc(0x81);
+ ok(ret == 0x81, "ret = %x\n", ret);
+
+ ret = p_btowc(0x9f);
+ ok(ret == 0x9f, "ret = %x\n", ret);
+
+ ret = p_btowc(0xe0);
+ ok(ret == 0xe0, "ret = %x\n", ret);
+
+ _setmbcp(cp);
+}
+
static void test_wctomb(void)
{
mbstate_t state;
@@ -4007,6 +4066,7 @@ START_TEST(string)
p_wcslwr_s = (void*)GetProcAddress(hMsvcrt, "_wcslwr_s");
p_mbsupr_s = (void*)GetProcAddress(hMsvcrt, "_mbsupr_s");
p_mbslwr_s = (void*)GetProcAddress(hMsvcrt, "_mbslwr_s");
+ p_btowc = (void*)GetProcAddress(hMsvcrt, "btowc");
p_wctob = (void*)GetProcAddress(hMsvcrt, "wctob");
p_wcrtomb = (void*)GetProcAddress(hMsvcrt, "wcrtomb");
p_wcrtomb_s = (void*)GetProcAddress(hMsvcrt, "wcrtomb_s");
@@ -4083,6 +4143,7 @@ START_TEST(string)
test__mbsupr_s();
test__mbslwr_s();
test_wctob();
+ test_btowc();
test_wctomb();
test__atodbl();
test__stricmp();
--
2.24.0
Dec. 11, 2019
[PATCH] winemac: Only manipulate an NSOpenGLContext's view on the main thread.
by Chip Davis
From: Ken Thomases <ken(a)codeweavers.com>
I was seeing a crash due to an assert about manipulating it on a
background thread. I can't recall where I was seeing that. I think it's
new in Catalina.
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
Chip's notes: I have also seen this on Mojave.
dlls/winemac.drv/cocoa_opengl.m | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_opengl.m b/dlls/winemac.drv/cocoa_opengl.m
index 5a097a12d26..e60b0b388b8 100644
--- a/dlls/winemac.drv/cocoa_opengl.m
+++ b/dlls/winemac.drv/cocoa_opengl.m
@@ -79,8 +79,10 @@ - (void) resetSurfaceIfBackingSizeChanged
macdrv_set_view_backing_size((macdrv_view)self.view, view_backing);
NSView* save = self.view;
- [super clearDrawable];
- [super setView:save];
+ OnMainThread(^{
+ [super clearDrawable];
+ [super setView:save];
+ });
shouldClearToBlack = TRUE;
}
}
@@ -122,7 +124,11 @@ - (void) wine_updateBackingSize:(const CGSize*)size
- (void) setView:(NSView*)newView
{
NSView* oldView = [self view];
- [super setView:newView];
+ if ([NSThread isMainThread])
+ [super setView:newView];
+ else OnMainThread(^{
+ [super setView:newView];
+ });
[newView retain];
[oldView release];
}
@@ -130,7 +136,11 @@ - (void) setView:(NSView*)newView
- (void) clearDrawable
{
NSView* oldView = [self view];
- [super clearDrawable];
+ if ([NSThread isMainThread])
+ [super clearDrawable];
+ else OnMainThread(^{
+ [super clearDrawable];
+ });
[oldView release];
[self wine_updateBackingSize:NULL];
--
2.24.0
Dec. 11, 2019
Re: [PATCH] msvcrt: Correct return value of ___mb_cur_max_l_func().
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=61916
Your paranoid android.
=== wxppro (32 bit report) ===
msvcr90:
msvcr90: Timeout
=== w2003std (task log) ===
Task errors:
The task timed out
=== wvistau64 (32 bit report) ===
msvcr90:
msvcr90: Timeout
=== w2008s64 (32 bit report) ===
msvcr90:
msvcr90: Timeout
=== w7u (32 bit report) ===
msvcr90:
msvcr90: Timeout
=== wvistau64 (64 bit report) ===
msvcr90:
msvcr90: Timeout
=== w2008s64 (64 bit report) ===
msvcr90:
msvcr90: Timeout
Dec. 11, 2019
Re: [PATCH v3 01/11] jscript: Keep a pointer to the bytecode in function_code_t.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Dec. 11, 2019
Re: [PATCH v3 03/11] jscript: Store the necessary function and variable info in the TypeInfo.
by Jacek Caban
On 12/11/19 3:08 PM, Gabriel Ivăncescu wrote:
> + pos = cur->bucket_next;
> + }
> +
> + if (is_function_prop(prop))
> + {
> + if (Function_get_code(impl_from_IDispatchEx((IDispatchEx*)get_object(prop->u.val))))
Please use as_jsdisp() instead of all those casts.
Thanks,
Jacek
Dec. 11, 2019
Re: [PATCH v3 02/11] jscript: Add a getter to obtain the function's code, if available.
by Jacek Caban
On 12/11/19 3:08 PM, Gabriel Ivăncescu wrote:
> diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c
> index 7a44f50..3c3098f 100644
> --- a/dlls/jscript/function.c
> +++ b/dlls/jscript/function.c
> @@ -37,6 +37,7 @@ typedef struct {
> struct _function_vtbl_t {
> HRESULT (*call)(script_ctx_t*,FunctionInstance*,IDispatch*,unsigned,unsigned,jsval_t*,jsval_t*);
> HRESULT (*toString)(FunctionInstance*,jsstr_t**);
> + function_code_t* (*get_code)(FunctionInstance*);
> void (*destructor)(FunctionInstance*);
> };
>
> @@ -524,6 +525,13 @@ static HRESULT Function_get_arguments(script_ctx_t *ctx, jsdisp_t *jsthis, jsval
> return S_OK;
> }
>
> +function_code_t *Function_get_code(jsdisp_t *jsthis)
> +{
> + FunctionInstance *function = function_from_jsdisp(jsthis);
> +
> + return function->vtbl->get_code(function);
> +}
An assert with is_class() would be nice here. And more importantly, this
patch introduces a dead code, please send it together with code actually
using it.
Thanks,
Jacek
Dec. 11, 2019
Re: Suppressing Wine prefix configuration message window?
by Sebastian M. Ernst
Am 11.12.19 um 15:56 schrieb Andrew Eikum:
> You can run Wine with DISPLAY unset. It will complain that it can't
> show a window, but the prefix update should still function.
Thanks. The following does indeed work:
user(a)comp:~/Desktop/test5> DISPLAY= wine wineboot -i
Dec. 11, 2019
[PATCH 11/11] vbscript/tests: Add more tests for the script TypeInfo.
by Jacek Caban
From: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/vbscript/tests/vbscript.c | 126 ++++++++++++++++++++++++++++++++-
1 file changed, 125 insertions(+), 1 deletion(-)
Dec. 11, 2019
[PATCH 10/11] vbscript: Implement ScriptTypeInfo_GetMops.
by Jacek Caban
From: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/vbscript/vbdisp.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
Dec. 11, 2019