Alexandre Julliard : wineboot: Always create the various RunOnce keys.
Alexandre Julliard
julliard at winehq.org
Fri Oct 1 11:38:46 CDT 2010
Module: wine
Branch: master
Commit: 0647a85dda8048f7de7a9219e7f7a3c62c38c552
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0647a85dda8048f7de7a9219e7f7a3c62c38c552
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Oct 1 14:22:40 2010 +0200
wineboot: Always create the various RunOnce keys.
---
programs/wineboot/wineboot.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 90dd779..92331ee 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -643,7 +643,7 @@ static BOOL ProcessRunKeys( HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete,
'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, hkRun;
- DWORD res;
+ DWORD res, dispos;
DWORD i, nMaxCmdLine=0, nMaxValue=0;
WCHAR *szCmdLine=NULL;
WCHAR *szValue=NULL;
@@ -653,15 +653,17 @@ static BOOL ProcessRunKeys( HKEY hkRoot, LPCWSTR szKeyName, BOOL bDelete,
else
WINE_TRACE("processing %s entries under HKCU\n",wine_dbgstr_w(szKeyName) );
- if (RegOpenKeyExW( hkRoot, WINKEY_NAME, 0, KEY_READ, &hkWin ) != ERROR_SUCCESS)
+ if (RegCreateKeyExW( hkRoot, WINKEY_NAME, 0, NULL, 0, KEY_READ, NULL, &hkWin, NULL ) != ERROR_SUCCESS)
return TRUE;
- if (RegOpenKeyExW( hkWin, szKeyName, 0, bDelete?KEY_ALL_ACCESS:KEY_READ, &hkRun ) != ERROR_SUCCESS)
+ if ((res = RegCreateKeyExW( hkWin, szKeyName, 0, NULL, 0, bDelete ? KEY_ALL_ACCESS : KEY_READ,
+ NULL, &hkRun, &dispos ) != ERROR_SUCCESS))
{
RegCloseKey( hkWin );
return TRUE;
}
RegCloseKey( hkWin );
+ if (dispos == REG_CREATED_NEW_KEY) goto end;
if( (res=RegQueryInfoKeyW( hkRun, NULL, NULL, NULL, NULL, NULL, NULL, &i, &nMaxValue,
&nMaxCmdLine, NULL, NULL ))!=ERROR_SUCCESS )
More information about the wine-cvs
mailing list