Alexandre Julliard : wineboot: Don't print errors for non-fatal problems.
Alexandre Julliard
julliard at winehq.org
Mon Jan 7 08:39:22 CST 2008
Module: wine
Branch: master
Commit: ebac63e17c4768f4f284752ac3fecf2b9030cbcf
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ebac63e17c4768f4f284752ac3fecf2b9030cbcf
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Jan 7 12:25:56 2008 +0100
wineboot: Don't print errors for non-fatal problems.
---
programs/wineboot/wineboot.c | 59 ++++++++++--------------------------------
1 files changed, 14 insertions(+), 45 deletions(-)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 1552330..da0eb79 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -160,18 +160,8 @@ static BOOL pendingRename(void)
if( (res=RegOpenKeyExW( HKEY_LOCAL_MACHINE, SessionW, 0, KEY_ALL_ACCESS, &hSession ))
!=ERROR_SUCCESS )
{
- if( res==ERROR_FILE_NOT_FOUND )
- {
- WINE_TRACE("The key was not found - skipping\n");
- res=TRUE;
- }
- else
- {
- WINE_ERR("Couldn't open key, error %d\n", res );
- res=FALSE;
- }
-
- goto end;
+ WINE_TRACE("The key was not found - skipping\n");
+ return TRUE;
}
res=RegQueryValueExW( hSession, ValueName, NULL, NULL /* The value type does not really interest us, as it is not
@@ -326,9 +316,7 @@ static DWORD runCmd(LPWSTR cmdline, LPCWSTR dir, BOOL wait, BOOL minimized)
if( !CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, dir, &si, &info) )
{
- WINE_ERR("Failed to run command %s (%d)\n", wine_dbgstr_w(cmdline),
- GetLastError() );
-
+ WINE_WARN("Failed to run command %s (%d)\n", wine_dbgstr_w(cmdline), GetLastError() );
return INVALID_RUNCMD_RETURN;
}
@@ -361,8 +349,8 @@ static BOOL ProcessRunKeys( HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete,
static const WCHAR WINKEY_NAME[]={'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n',0};
- HKEY hkWin=NULL, hkRun=NULL;
- DWORD res=ERROR_SUCCESS;
+ HKEY hkWin, hkRun;
+ DWORD res;
DWORD i, nMaxCmdLine=0, nMaxValue=0;
WCHAR *szCmdLine=NULL;
WCHAR *szValue=NULL;
@@ -372,36 +360,19 @@ static BOOL ProcessRunKeys( HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete,
else
WINE_TRACE("processing %s entries under HKCU\n",wine_dbgstr_w(szKeyName) );
- if( (res=RegOpenKeyExW( hkRoot, WINKEY_NAME, 0, KEY_READ, &hkWin ))!=ERROR_SUCCESS )
- {
- WINE_ERR("RegOpenKey failed on Software\\Microsoft\\Windows\\CurrentVersion (%d)\n",
- res);
-
- goto end;
- }
+ if (RegOpenKeyExW( hkRoot, WINKEY_NAME, 0, KEY_READ, &hkWin ) != ERROR_SUCCESS)
+ return TRUE;
- if( (res=RegOpenKeyExW( hkWin, szKeyName, 0, bDelete?KEY_ALL_ACCESS:KEY_READ, &hkRun ))!=
- ERROR_SUCCESS)
+ if (RegOpenKeyExW( hkWin, szKeyName, 0, bDelete?KEY_ALL_ACCESS:KEY_READ, &hkRun ) != ERROR_SUCCESS)
{
- if( res==ERROR_FILE_NOT_FOUND )
- {
- WINE_TRACE("Key doesn't exist - nothing to be done\n");
-
- res=ERROR_SUCCESS;
- }
- else
- WINE_ERR("RegOpenKey failed on run key (%d)\n", res);
-
- goto end;
+ RegCloseKey( hkWin );
+ return TRUE;
}
-
+ RegCloseKey( hkWin );
+
if( (res=RegQueryInfoKeyW( hkRun, NULL, NULL, NULL, NULL, NULL, NULL, &i, &nMaxValue,
&nMaxCmdLine, NULL, NULL ))!=ERROR_SUCCESS )
- {
- WINE_ERR("Couldn't query key info (%d)\n", res );
-
goto end;
- }
if( i==0 )
{
@@ -470,12 +441,10 @@ end:
if( hkRun!=NULL )
RegCloseKey( hkRun );
- if( hkWin!=NULL )
- RegCloseKey( hkWin );
WINE_TRACE("done\n");
- return res==ERROR_SUCCESS?TRUE:FALSE;
+ return res==ERROR_SUCCESS;
}
/*
@@ -672,7 +641,7 @@ static BOOL ProcessStartupItems(void)
WINE_TRACE("Unable to parse display name.\n");
else
if ((iRet = (int)ShellExecuteW(NULL, NULL, wszCommand, NULL, NULL, SW_SHOWNORMAL)) <= 32)
- WINE_ERR("Error %d executing command %s.\n", iRet, wine_dbgstr_w(wszCommand));
+ WINE_WARN("Error %d executing command %s.\n", iRet, wine_dbgstr_w(wszCommand));
}
IMalloc_Free(ppM, pidlItem);
More information about the wine-cvs
mailing list