Commit e73b8b84 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Wrapped some strings in a debugstr_* call.

Replaced some calls to debugstr_{a,w} by debugstr_{a,w}n. Removed redundant 'L's for Unicode strings. Tried to harmonize the traces a little bit.
parent bdceab65
......@@ -152,7 +152,7 @@ TOOLTIPS_GetTipText (HWND hwnd, TOOLTIPS_INFO *infoPtr, INT nTool)
infoPtr->szTipText[0] = L'\0';
}
TRACE("\"%s\"\n", debugstr_w(infoPtr->szTipText));
TRACE("%s\n", debugstr_w(infoPtr->szTipText));
}
......@@ -170,7 +170,7 @@ TOOLTIPS_CalcTipSize (HWND hwnd, TOOLTIPS_INFO *infoPtr, LPSIZE lpSize)
}
if (GetWindowLongA (hwnd, GWL_STYLE) & TTS_NOPREFIX)
uFlags |= DT_NOPREFIX;
TRACE("\"%s\"\n", debugstr_w(infoPtr->szTipText));
TRACE("%s\n", debugstr_w(infoPtr->szTipText));
hdc = GetDC (hwnd);
hOldFont = SelectObject (hdc, infoPtr->hFont);
......@@ -219,7 +219,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
SendMessageA (toolPtr->hwnd, WM_NOTIFY,
(WPARAM)toolPtr->uId, (LPARAM)&hdr);
TRACE("\"%s\"\n", debugstr_w(infoPtr->szTipText));
TRACE("%s\n", debugstr_w(infoPtr->szTipText));
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
TRACE("size %d - %d\n", size.cx, size.cy);
......@@ -340,7 +340,7 @@ TOOLTIPS_TrackShow (HWND hwnd, TOOLTIPS_INFO *infoPtr)
SendMessageA (toolPtr->hwnd, WM_NOTIFY,
(WPARAM)toolPtr->uId, (LPARAM)&hdr);
TRACE("\"%s\"\n", debugstr_w(infoPtr->szTipText));
TRACE("%s\n", debugstr_w(infoPtr->szTipText));
TOOLTIPS_CalcTipSize (hwnd, infoPtr, &size);
TRACE("size %d - %d\n", size.cx, size.cy);
......@@ -728,7 +728,7 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
else {
INT len = lstrlenW (lpToolInfo->lpszText);
TRACE("add text \"%s\"!\n",
TRACE("add text %s!\n",
debugstr_w(lpToolInfo->lpszText));
toolPtr->lpszText = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
lstrcpyW (toolPtr->lpszText, lpToolInfo->lpszText);
......
......@@ -761,7 +761,7 @@ LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPSTR lpszPath)
LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPWSTR lpszPath)
{
char lpszTemp[MAX_PATH];
TRACE("path=L%s\n",debugstr_w(lpszPath));
TRACE("path=%s\n",debugstr_w(lpszPath));
WideCharToLocal(lpszTemp, lpszPath, MAX_PATH);
......
......@@ -203,13 +203,13 @@ int WINAPI SHShellFolderView_Message(HWND hwndCabinet,UINT uMsg,LPARAM lParam)
*/
BOOL WINAPI OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle)
{
TRACE("%p %x %s %x\n", lpStr, nStr, debugstr_w(lpOle), nOle);
TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle);
return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL);
}
BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle)
{
TRACE("%p %x %s %x\n", lpwStr, nwStr, debugstr_w(lpOle), nOle);
TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle);
if (lstrcpynW ( lpwStr, lpOle, nwStr))
{ return lstrlenW (lpwStr);
......@@ -231,12 +231,12 @@ BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn)
*/
BOOL WINAPI StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr)
{
TRACE("%p %x %s %x\n", lpWide, nWide, lpStrA, nStr);
TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr);
return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide);
}
BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr)
{
TRACE("%p %x %s %x\n", lpWide, nWide, debugstr_w(lpStrW), nStr);
TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr);
if (lstrcpynW (lpWide, lpStrW, nWide))
{ return lstrlenW (lpWide);
......@@ -1364,15 +1364,15 @@ DWORD WINAPI RLBuildListOfPaths (void)
*/
int WINAPI StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString)
{
TRACE("%p %p(%s)\n",
lpWideCharStr, lpMultiByteString, lpMultiByteString);
TRACE("(%p, %p %s)\n",
lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString));
return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH);
}
int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
{
TRACE("%p %p(%s)\n",
TRACE("(%p, %p %s)\n",
lpWideCharStr, lpWString, debugstr_w(lpWString));
if (lstrcpyW (lpWideCharStr, lpWString ))
......@@ -1404,13 +1404,13 @@ HRESULT WINAPI SHValidateUNC (DWORD x, DWORD y, DWORD z)
*/
HRESULT WINAPI DoEnvironmentSubstA(LPSTR x, LPSTR y)
{
FIXME("%p(%s) %p(%s) stub\n", x, x, y, y);
FIXME("(%p %s, %p %s) stub\n", x, debugstr_a(x), y, debugstr_a(y));
return 0;
}
HRESULT WINAPI DoEnvironmentSubstW(LPWSTR x, LPWSTR y)
{
FIXME("%p(%s) %p(%s) stub\n", x, debugstr_w(x), y, debugstr_w(y));
FIXME("(%p %s, %p %s) stub\n", x, debugstr_w(x), y, debugstr_w(y));
return 0;
}
......
......@@ -93,7 +93,7 @@ LPCSTR WINAPI PathFindExtensionA(LPCSTR path)
}
LPCWSTR WINAPI PathFindExtensionW(LPCWSTR path)
{ LPCWSTR lastpoint = NULL;
TRACE("%p L%s\n",path,debugstr_w(path));
TRACE("(%p %s)\n",path,debugstr_w(path));
while (*path)
{ if (*path==(WCHAR)'\\'||*path==(WCHAR)' ')
lastpoint=NULL;
......@@ -213,7 +213,7 @@ LPCWSTR WINAPI PathFindFilenameW(LPCWSTR wptr)
{ LPCWSTR wslash;
wslash = wptr;
TRACE("L%s\n",debugstr_w(wslash));
TRACE("%s\n",debugstr_w(wslash));
while (wptr[0])
{ if (((wptr[0]=='\\') || (wptr[0]==':')) && wptr[1] && wptr[1]!='\\')
wslash = wptr+1;
......@@ -582,7 +582,7 @@ LPCSTR WINAPI PathGetArgsA(LPCSTR cmdline)
LPCWSTR WINAPI PathGetArgsW(LPCWSTR cmdline)
{ BOOL qflag = FALSE;
TRACE("%sL\n",debugstr_w(cmdline));
TRACE("%s\n",debugstr_w(cmdline));
while (*cmdline)
{ if ((*cmdline==' ') && !qflag)
......@@ -610,7 +610,7 @@ LPSTR WINAPI PathQuoteSpacesA(LPCSTR aptr)
}
LPWSTR WINAPI PathQuoteSpacesW(LPCWSTR wptr)
{ FIXME("L%s\n",debugstr_w(wptr));
{ FIXME("%s\n",debugstr_w(wptr));
return 0;
}
LPVOID WINAPI PathQuoteSpacesAW (LPCVOID fn)
......@@ -719,7 +719,7 @@ LPCSTR WINAPI PathGetExtensionA(LPCSTR path,DWORD y,DWORD z)
return *path?(path+1):path;
}
LPCWSTR WINAPI PathGetExtensionW(LPCWSTR path,DWORD y,DWORD z)
{ TRACE("(L%s,%08lx,%08lx)\n",debugstr_w(path),y,z);
{ TRACE("(%s, %08lx, %08lx)\n",debugstr_w(path),y,z);
path = PathFindExtensionW(path);
return *path?(path+1):path;
}
......@@ -735,13 +735,13 @@ LPCVOID WINAPI PathGetExtensionAW(LPCVOID path,DWORD y,DWORD z)
*/
DWORD WINAPI PathCleanupSpecA(LPSTR x, LPSTR y)
{
FIXME("%p(%s) %p(%s) stub\n",x,x,y,y);
FIXME("(%p %s, %p %s) stub\n",x,debugstr_a(x),y,debugstr_a(y));
return TRUE;
}
DWORD WINAPI PathCleanupSpecW(LPWSTR x, LPWSTR y)
{
FIXME("%p(%s) %p(%s) stub\n",x,debugstr_w(x),y,debugstr_w(y));
FIXME("(%p %s, %p %s) stub\n",x,debugstr_w(x),y,debugstr_w(y));
return TRUE;
}
......@@ -783,7 +783,7 @@ HRESULT WINAPI PathProcessCommandA (LPSTR lpCommand, LPSTR v, DWORD w, DWORD x)
HRESULT WINAPI PathProcessCommandW (LPWSTR lpCommand, LPSTR v, DWORD w, DWORD x)
{
FIXME("%p(%s) %p 0x%04lx 0x%04lx stub\n",
FIXME("(%p %s, %p, 0x%04lx, 0x%04lx) stub\n",
lpCommand, debugstr_w(lpCommand), v, w,x );
return 0;
}
......
......@@ -100,7 +100,7 @@ static HRESULT SHELL32_ParseNextElement(
LPITEMIDLIST pidlOut, pidlTemp = NULL;
IShellFolder *psfChild;
TRACE("(%p %p %s)\n",psf, pidlInOut? *pidlInOut: NULL, debugstr_w(szNext));
TRACE("(%p, %p, %s)\n",psf, pidlInOut? *pidlInOut: "(null)", debugstr_w(szNext));
/* get the shellfolder for the child pidl and let it analyse further */
......
......@@ -171,7 +171,7 @@ INT WINAPI lstrcmpA( LPCSTR str1, LPCSTR str2 )
*/
INT WINAPI lstrcmpW( LPCWSTR str1, LPCWSTR str2 )
{
TRACE("L%s and L%s\n",
TRACE("%s and %s\n",
debugstr_w (str1), debugstr_w (str2));
if (!str1 || !str2) {
SetLastError(ERROR_INVALID_PARAMETER);
......@@ -210,7 +210,7 @@ INT WINAPI lstrcmpiW( LPCWSTR str1, LPCWSTR str2 )
#if 0
/* Too much! (From registry loading.) */
TRACE("strcmpi L%s and L%s\n",
TRACE("strcmpi %s and %s\n",
debugstr_w (str1), debugstr_w (str2));
#endif
if (!str1 || !str2) {
......@@ -299,8 +299,7 @@ SEGPTR WINAPI lstrcpyn16( SEGPTR dst, LPCSTR src, INT16 n )
LPSTR WINAPI lstrcpynA( LPSTR dst, LPCSTR src, INT n )
{
LPSTR p = dst;
TRACE("strcpyn %s for %d chars\n",
debugstr_an (src,n), n);
TRACE("(%p, %s, %i)\n", dst, debugstr_an(src,n), n);
/* In real windows the whole function is protected by an exception handler
* that returns ERROR_INVALID_PARAMETER on faulty parameters
* We currently just check for NULL.
......@@ -323,8 +322,7 @@ LPSTR WINAPI lstrcpynA( LPSTR dst, LPCSTR src, INT n )
LPWSTR WINAPI lstrcpynW( LPWSTR dst, LPCWSTR src, INT n )
{
LPWSTR p = dst;
TRACE("strcpyn L%s for %d chars\n",
debugstr_wn (src,n), n);
TRACE("(%p, %s, %i)\n", dst, debugstr_wn(src,n), n);
/* In real windows the whole function is protected by an exception handler
* that returns ERROR_INVALID_PARAMETER on faulty parameters
* We currently just check for NULL.
......@@ -395,7 +393,7 @@ LPWSTR WINAPI lstrcpyAtoW( LPWSTR dst, LPCSTR src )
{
register LPWSTR p = dst;
TRACE("%s\n",src);
TRACE("(%p, %s)\n", dst, debugstr_a(src));
while ((*p++ = (WCHAR)(unsigned char)*src++));
return dst;
......@@ -409,7 +407,7 @@ LPSTR WINAPI lstrcpyWtoA( LPSTR dst, LPCWSTR src )
{
register LPSTR p = dst;
TRACE("L%s\n",debugstr_w(src));
TRACE("(%p, %s)\n", dst, debugstr_w(src));
while ((*p++ = (CHAR)*src++));
return dst;
......@@ -425,7 +423,7 @@ LPWSTR WINAPI lstrcpynAtoW( LPWSTR dst, LPCSTR src, INT n )
{
LPWSTR p = dst;
TRACE("%s %i\n",src, n);
TRACE("(%p, %s, %i)\n", dst, debugstr_an(src,n), n);
while ((n-- > 1) && *src) *p++ = (WCHAR)(unsigned char)*src++;
if (n >= 0) *p = 0;
......@@ -446,6 +444,7 @@ LPSTR WINAPI lstrcpynWtoA( LPSTR dst, LPCWSTR src, INT n )
{
if (--n >= 0)
{
TRACE("(%p, %s, %i)\n", dst, debugstr_wn(src,n), n);
n = CRTDLL_wcstombs( dst, src, n );
if(n<0)
n=0;
......@@ -583,7 +582,7 @@ BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d )
{
LPSTR oldd = d;
if (!s || !d) return TRUE;
TRACE("CharToOem L%s\n", debugstr_w (s));
TRACE("CharToOem %s\n", debugstr_w (s));
while ((*d++ = ANSI_TO_OEM(*s++)));
TRACE(" to %s\n", debugstr_a (oldd));
return TRUE;
......@@ -647,7 +646,7 @@ INT WINAPI WideCharToLocal(
LPCWSTR pWide,
INT dwChars)
{ *pLocal = 0;
TRACE("(%p, %s, %i)\n", pLocal, debugstr_w(pWide),dwChars);
TRACE("(%p, %s, %i)\n", pLocal, debugstr_wn(pWide,dwChars), dwChars);
WideCharToMultiByte(CP_ACP,0,pWide,-1,pLocal,dwChars,NULL,NULL);
return strlen(pLocal);
}
......@@ -663,7 +662,7 @@ INT WINAPI LocalToWideChar(
LPCSTR pLocal,
INT dwChars)
{ *pWide = 0;
TRACE("(%p, %s, %i)\n",pWide, pLocal, dwChars);
TRACE("(%p, %s, %i)\n", pWide, debugstr_an(pLocal,dwChars), dwChars);
MultiByteToWideChar(CP_ACP,0,pLocal,-1,pWide,dwChars);
return lstrlenW(pWide);
}
......@@ -672,7 +671,7 @@ INT WINAPI LocalToWideChar(
/***********************************************************************
* lstrrchr (Not a Windows API)
*
* This is the implementation meant to be invoked form within
* This is the implementation meant to be invoked from within
* COMCTL32_StrRChrA and shell32(TODO)...
*
* Return a pointer to the last occurence of wMatch in lpStart
......@@ -682,7 +681,7 @@ LPSTR WINAPI lstrrchr( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch )
{
LPCSTR lpGotIt = NULL;
TRACE("(%s, %s)\n", lpStart, lpEnd);
TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
if (!lpEnd) lpEnd = lpStart + strlen(lpStart);
......@@ -714,7 +713,7 @@ LPWSTR WINAPI lstrrchrw( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch )
{
LPCWSTR lpGotIt = NULL;
TRACE("(%p, %p, %c)\n", lpStart, lpEnd, wMatch);
TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
if (!lpEnd) lpEnd = lpStart + lstrlenW(lpStart);
for(; lpStart < lpEnd; lpStart = CharNextW(lpStart))
......
......@@ -73,7 +73,7 @@ static inline void RELAY_PrintArgs( int *args, int nb_args, unsigned int typemas
if ((typemask & 3) && HIWORD(*args))
{
if (typemask & 2)
DPRINTF( "%08x L%s", *args, debugstr_w((LPWSTR)*args) );
DPRINTF( "%08x %s", *args, debugstr_w((LPWSTR)*args) );
else
DPRINTF( "%08x %s", *args, debugstr_a((LPCSTR)*args) );
}
......
......@@ -209,11 +209,10 @@ SNOOP_PrintArg(DWORD x) {
sprintf(buf,"%08lx",x);
return buf;
}
i=0;nostring=0;
if (!IsBadStringPtrA((LPSTR)x,80)) {
LPBYTE s=(LPBYTE)x;
i=0;nostring=0;
while (i<80) {
LPBYTE s=(LPBYTE)x;
if (s[i]==0) break;
if (s[i]<0x20) {nostring=1;break;}
if (s[i]>=0x80) {nostring=1;break;}
......@@ -221,18 +220,15 @@ SNOOP_PrintArg(DWORD x) {
}
if (!nostring) {
if (i>5) {
sprintf(buf,"%08lx \"",x);
strncat(buf,(LPSTR)x,198-strlen(buf)-2);
strcat(buf,"\"");
wsnprintfA(buf,sizeof(buf),"%08lx %s",x,debugstr_an((LPSTR)x,sizeof(buf)-10));
return buf;
}
}
}
i=0;nostring=0;
if (!IsBadStringPtrW((LPWSTR)x,80)) {
LPWSTR s=(LPWSTR)x;
i=0;nostring=0;
while (i<80) {
LPWSTR s=(LPWSTR)x;
if (s[i]==0) break;
if (s[i]<0x20) {nostring=1;break;}
if (s[i]>0x100) {nostring=1;break;}
......@@ -240,8 +236,7 @@ SNOOP_PrintArg(DWORD x) {
}
if (!nostring) {
if (i>5) {
sprintf(buf,"%08lx L",x);
strcat(buf,debugstr_wn((LPWSTR)x,198-strlen(buf)-2));
wsnprintfA(buf,sizeof(buf),"%08lx %s",x,debugstr_wn((LPWSTR)x,sizeof(buf)-10));
return buf;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment