mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-21 18:36:32 +00:00
Don't print NULL strings (crashes on Solaris).
Small code maintainability tweak in ShellExecuteExA. Two typo fixes in winmm.
This commit is contained in:
parent
bc7d0272b3
commit
b60c4ce0f0
|
@ -1503,7 +1503,7 @@ DWORD _ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
|
||||||
ERR("-- no text\n");
|
ERR("-- no text\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("-- (%p=%s 0x%08lx)\n",szOut,(char*)szOut,dwReturn);
|
TRACE("-- (%p=%s 0x%08lx)\n",szOut,debugstr_a(szOut),dwReturn);
|
||||||
return dwReturn;
|
return dwReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ DWORD WINAPI ParseFieldA(
|
||||||
LPSTR dst,
|
LPSTR dst,
|
||||||
DWORD len)
|
DWORD len)
|
||||||
{
|
{
|
||||||
WARN("('%s',0x%08lx,%p,%ld) semi-stub.\n",src,nField,dst,len);
|
WARN("(%s,0x%08lx,%p,%ld) semi-stub.\n",debugstr_a(src),nField,dst,len);
|
||||||
|
|
||||||
if (!src || !src[0] || !dst || !len)
|
if (!src || !src[0] || !dst || !len)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -973,9 +973,10 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
|
||||||
PROCESS_INFORMATION info;
|
PROCESS_INFORMATION info;
|
||||||
|
|
||||||
WARN("mask=0x%08lx hwnd=0x%04x verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s incomplete\n",
|
WARN("mask=0x%08lx hwnd=0x%04x verb=%s file=%s parm=%s dir=%s show=0x%08x class=%s incomplete\n",
|
||||||
sei->fMask, sei->hwnd, sei->lpVerb, sei->lpFile,
|
sei->fMask, sei->hwnd, debugstr_a(sei->lpVerb),
|
||||||
sei->lpParameters, sei->lpDirectory, sei->nShow,
|
debugstr_a(sei->lpFile), debugstr_a(sei->lpParameters),
|
||||||
(sei->fMask & SEE_MASK_CLASSNAME) ? sei->lpClass : "not used");
|
debugstr_a(sei->lpDirectory), sei->nShow,
|
||||||
|
(sei->fMask & SEE_MASK_CLASSNAME) ? debugstr_a(sei->lpClass) : "not used");
|
||||||
|
|
||||||
ZeroMemory(szApplicationName,MAX_PATH);
|
ZeroMemory(szApplicationName,MAX_PATH);
|
||||||
if (sei->lpFile)
|
if (sei->lpFile)
|
||||||
|
@ -996,8 +997,9 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
|
||||||
/* launch a document by fileclass like 'Wordpad.Document.1' */
|
/* launch a document by fileclass like 'Wordpad.Document.1' */
|
||||||
if (sei->fMask & SEE_MASK_CLASSNAME)
|
if (sei->fMask & SEE_MASK_CLASSNAME)
|
||||||
{
|
{
|
||||||
|
/* FIXME: szCommandline should not be of a fixed size. Plus MAX_PATH is way too short! */
|
||||||
/* the commandline contains 'c:\Path\wordpad.exe "%1"' */
|
/* the commandline contains 'c:\Path\wordpad.exe "%1"' */
|
||||||
HCR_GetExecuteCommand(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, 256);
|
HCR_GetExecuteCommand(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, sizeof(szCommandline));
|
||||||
/* fixme: get the extension of lpFile, check if it fits to the lpClass */
|
/* fixme: get the extension of lpFile, check if it fits to the lpClass */
|
||||||
TRACE("SEE_MASK_CLASSNAME->'%s'\n", szCommandline);
|
TRACE("SEE_MASK_CLASSNAME->'%s'\n", szCommandline);
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,8 +149,8 @@ void COMM_Init(void)
|
||||||
else {
|
else {
|
||||||
COM[x].handle = 0;
|
COM[x].handle = 0;
|
||||||
strcpy(COM[x].devicename, temp);
|
strcpy(COM[x].devicename, temp);
|
||||||
|
TRACE("%s = %s\n", option, COM[x].devicename);
|
||||||
}
|
}
|
||||||
TRACE("%s = %s\n", option, COM[x].devicename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(option, "LPTx");
|
strcpy(option, "LPTx");
|
||||||
|
@ -176,8 +176,8 @@ void COMM_Init(void)
|
||||||
else {
|
else {
|
||||||
LPT[x].handle = 0;
|
LPT[x].handle = 0;
|
||||||
strcpy(LPT[x].devicename, temp);
|
strcpy(LPT[x].devicename, temp);
|
||||||
|
TRACE("%s = %s\n", option, LPT[x].devicename);
|
||||||
}
|
}
|
||||||
TRACE("%s = %s\n", option, LPT[x].devicename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,7 +329,7 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2)
|
||||||
LPSTR ptr;
|
LPSTR ptr;
|
||||||
LPCSTR cause = 0;
|
LPCSTR cause = 0;
|
||||||
|
|
||||||
TRACE("('%s', %08lX);\n", fn, lParam2);
|
TRACE("(%s, %08lX);\n", debugstr_a(fn), lParam2);
|
||||||
|
|
||||||
if ((ptr = strchr(fn, ' ')) != NULL) {
|
if ((ptr = strchr(fn, ' ')) != NULL) {
|
||||||
*ptr++ = '\0';
|
*ptr++ = '\0';
|
||||||
|
@ -349,14 +349,14 @@ LPWINE_DRIVER DRIVER_TryOpenDriver32(LPCSTR fn, LPARAM lParam2)
|
||||||
lpDrv->d.d32.hModule = hModule;
|
lpDrv->d.d32.hModule = hModule;
|
||||||
lpDrv->d.d32.dwDriverID = 0;
|
lpDrv->d.d32.dwDriverID = 0;
|
||||||
|
|
||||||
if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, lParam2)) {cause = "load faile"; goto exit;}
|
if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, lParam2)) {cause = "load failed"; goto exit;}
|
||||||
|
|
||||||
TRACE("=> %p\n", lpDrv);
|
TRACE("=> %p\n", lpDrv);
|
||||||
return lpDrv;
|
return lpDrv;
|
||||||
exit:
|
exit:
|
||||||
FreeLibrary(hModule);
|
FreeLibrary(hModule);
|
||||||
HeapFree(GetProcessHeap(), 0, lpDrv);
|
HeapFree(GetProcessHeap(), 0, lpDrv);
|
||||||
TRACE("Unable to load 32 bit module \"%s\": %s\n", fn, cause);
|
TRACE("Unable to load 32 bit module %s: %s\n", debugstr_a(fn), cause);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR fn, LPCSTR sn, LPARAM lParam2
|
||||||
LPWINE_DRIVER lpDrv = NULL;
|
LPWINE_DRIVER lpDrv = NULL;
|
||||||
LPCSTR cause = 0;
|
LPCSTR cause = 0;
|
||||||
|
|
||||||
TRACE("('%s', %08lX);\n", sn, lParam2);
|
TRACE("(%s, %08lX);\n", debugstr_a(sn), lParam2);
|
||||||
|
|
||||||
lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER));
|
lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER));
|
||||||
if (lpDrv == NULL) {cause = "OOM"; goto exit;}
|
if (lpDrv == NULL) {cause = "OOM"; goto exit;}
|
||||||
|
@ -384,13 +384,13 @@ static LPWINE_DRIVER DRIVER_TryOpenDriver16(LPCSTR fn, LPCSTR sn, LPARAM lParam2
|
||||||
if (lpDrv->d.d16.hDriver16 == 0) {cause = "Not a 16 bit driver"; goto exit;}
|
if (lpDrv->d.d16.hDriver16 == 0) {cause = "Not a 16 bit driver"; goto exit;}
|
||||||
lpDrv->dwFlags = WINE_GDF_16BIT;
|
lpDrv->dwFlags = WINE_GDF_16BIT;
|
||||||
|
|
||||||
if (!DRIVER_AddToList(lpDrv, 0, lParam2)) {cause = "load faile"; goto exit;}
|
if (!DRIVER_AddToList(lpDrv, 0, lParam2)) {cause = "load failed"; goto exit;}
|
||||||
|
|
||||||
TRACE("=> %p\n", lpDrv);
|
TRACE("=> %p\n", lpDrv);
|
||||||
return lpDrv;
|
return lpDrv;
|
||||||
exit:
|
exit:
|
||||||
HeapFree(GetProcessHeap(), 0, lpDrv);
|
HeapFree(GetProcessHeap(), 0, lpDrv);
|
||||||
TRACE("Unable to load 32 bit module \"%s\": %s\n", fn, cause);
|
TRACE("Unable to load 32 bit module %s: %s\n", debugstr_a(fn), cause);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lPara
|
||||||
goto the_end;
|
goto the_end;
|
||||||
|
|
||||||
if (!(lpDrv = DRIVER_TryOpenDriver16(lpDriverName, lpSectionName, lParam2)))
|
if (!(lpDrv = DRIVER_TryOpenDriver16(lpDriverName, lpSectionName, lParam2)))
|
||||||
TRACE("Failed to open driver %s from system.ini file, section %s\n", lpDriverName, lpSectionName);
|
TRACE("Failed to open driver %s from system.ini file, section %s\n", debugstr_a(lpDriverName), debugstr_a(lpSectionName));
|
||||||
the_end:
|
the_end:
|
||||||
if (lpDrv) TRACE("=> %08lx\n", (DWORD)lpDrv);
|
if (lpDrv) TRACE("=> %08lx\n", (DWORD)lpDrv);
|
||||||
return (DWORD)lpDrv;
|
return (DWORD)lpDrv;
|
||||||
|
|
|
@ -2395,14 +2395,14 @@ BOOL WINAPI AddPrinterDriverA(LPSTR pName, DWORD level, LPBYTE pDriverInfo)
|
||||||
DRIVER_INFO_3A di3;
|
DRIVER_INFO_3A di3;
|
||||||
HKEY hkeyDrivers, hkeyName;
|
HKEY hkeyDrivers, hkeyName;
|
||||||
|
|
||||||
TRACE("(%s,%ld,%p)\n",pName,level,pDriverInfo);
|
TRACE("(%s,%ld,%p)\n",debugstr_a(pName),level,pDriverInfo);
|
||||||
|
|
||||||
if(level != 2 && level != 3) {
|
if(level != 2 && level != 3) {
|
||||||
SetLastError(ERROR_INVALID_LEVEL);
|
SetLastError(ERROR_INVALID_LEVEL);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if(pName != NULL) {
|
if(pName != NULL) {
|
||||||
FIXME("pName= `%s' - unsupported\n", pName);
|
FIXME("pName= %s - unsupported\n", debugstr_a(pName));
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -2440,7 +2440,7 @@ BOOL WINAPI AddPrinterDriverA(LPSTR pName, DWORD level, LPBYTE pDriverInfo)
|
||||||
if(RegOpenKeyA(hkeyDrivers, di3.pName, &hkeyName) == ERROR_SUCCESS) {
|
if(RegOpenKeyA(hkeyDrivers, di3.pName, &hkeyName) == ERROR_SUCCESS) {
|
||||||
RegCloseKey(hkeyName);
|
RegCloseKey(hkeyName);
|
||||||
RegCloseKey(hkeyDrivers);
|
RegCloseKey(hkeyDrivers);
|
||||||
WARN("Trying to create existing printer driver `%s'\n", di3.pName);
|
WARN("Trying to create existing printer driver %s\n", debugstr_a(di3.pName));
|
||||||
SetLastError(ERROR_PRINTER_DRIVER_ALREADY_INSTALLED);
|
SetLastError(ERROR_PRINTER_DRIVER_ALREADY_INSTALLED);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1045,7 +1045,7 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine,
|
||||||
|
|
||||||
/* Process the AppName and/or CmdLine to get module name and path */
|
/* Process the AppName and/or CmdLine to get module name and path */
|
||||||
|
|
||||||
TRACE("app '%s' cmdline '%s'\n", lpApplicationName, lpCommandLine );
|
TRACE("app %s cmdline %s\n", debugstr_a(lpApplicationName), debugstr_a(lpCommandLine) );
|
||||||
|
|
||||||
if (!(tidy_cmdline = get_file_name( lpApplicationName, lpCommandLine, name, sizeof(name) )))
|
if (!(tidy_cmdline = get_file_name( lpApplicationName, lpCommandLine, name, sizeof(name) )))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -1737,7 +1737,8 @@ BOOL WINAPI CreateScalableFontResourceA( DWORD fHidden,
|
||||||
* lpszCurrentPath can be NULL
|
* lpszCurrentPath can be NULL
|
||||||
*/
|
*/
|
||||||
FIXME("(%ld,%s,%s,%s): stub\n",
|
FIXME("(%ld,%s,%s,%s): stub\n",
|
||||||
fHidden, lpszResourceFile, lpszFontFile, lpszCurrentPath );
|
fHidden, debugstr_a(lpszResourceFile), debugstr_a(lpszFontFile),
|
||||||
|
debugstr_a(lpszCurrentPath) );
|
||||||
return FALSE; /* create failed */
|
return FALSE; /* create failed */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,7 +260,7 @@ HDRVR16 WINAPI OpenDriver16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lP
|
||||||
LPWINE_DRIVER lpDrv = NULL;
|
LPWINE_DRIVER lpDrv = NULL;
|
||||||
char drvName[128];
|
char drvName[128];
|
||||||
|
|
||||||
TRACE("('%s', '%s', %08lX);\n", lpDriverName, lpSectionName, lParam2);
|
TRACE("(%s, %s, %08lX);\n", debugstr_a(lpDriverName), debugstr_a(lpSectionName), lParam2);
|
||||||
|
|
||||||
if (!lpDriverName || !*lpDriverName) return 0;
|
if (!lpDriverName || !*lpDriverName) return 0;
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ HDRVR16 WINAPI OpenDriver16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lP
|
||||||
lpDrv = DRIVER_TryOpenDriver16(drvName, lParam2);
|
lpDrv = DRIVER_TryOpenDriver16(drvName, lParam2);
|
||||||
}
|
}
|
||||||
if (!lpDrv) {
|
if (!lpDrv) {
|
||||||
TRACE("Failed to open driver %s from system.ini file, section %s\n", lpDriverName, lpSectionName);
|
TRACE("Failed to open driver %s from system.ini file, section %s\n", debugstr_a(lpDriverName), debugstr_a(lpSectionName));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
the_end:
|
the_end:
|
||||||
|
|
Loading…
Reference in a new issue