msi: Update the UI in the DeleteServices action.
This commit is contained in:
parent
a70d86d3c9
commit
3c36d9d1f9
|
@ -5383,9 +5383,10 @@ static UINT ITERATE_DeleteService( MSIRECORD *rec, LPVOID param )
|
||||||
{
|
{
|
||||||
MSIPACKAGE *package = param;
|
MSIPACKAGE *package = param;
|
||||||
MSICOMPONENT *comp;
|
MSICOMPONENT *comp;
|
||||||
|
MSIRECORD *uirow;
|
||||||
LPCWSTR component;
|
LPCWSTR component;
|
||||||
LPWSTR name = NULL;
|
LPWSTR name = NULL, display_name = NULL;
|
||||||
DWORD event;
|
DWORD event, len;
|
||||||
SC_HANDLE scm = NULL, service = NULL;
|
SC_HANDLE scm = NULL, service = NULL;
|
||||||
|
|
||||||
event = MSI_RecordGetInteger( rec, 3 );
|
event = MSI_RecordGetInteger( rec, 3 );
|
||||||
|
@ -5415,6 +5416,14 @@ static UINT ITERATE_DeleteService( MSIRECORD *rec, LPVOID param )
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
len = 0;
|
||||||
|
if (!GetServiceDisplayNameW( scm, name, NULL, &len ) &&
|
||||||
|
GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
||||||
|
{
|
||||||
|
if ((display_name = msi_alloc( ++len * sizeof(WCHAR ))))
|
||||||
|
GetServiceDisplayNameW( scm, name, display_name, &len );
|
||||||
|
}
|
||||||
|
|
||||||
service = OpenServiceW( scm, name, DELETE );
|
service = OpenServiceW( scm, name, DELETE );
|
||||||
if (!service)
|
if (!service)
|
||||||
{
|
{
|
||||||
|
@ -5426,9 +5435,16 @@ static UINT ITERATE_DeleteService( MSIRECORD *rec, LPVOID param )
|
||||||
WARN("Failed to delete service (%s): %u\n", debugstr_w(name), GetLastError());
|
WARN("Failed to delete service (%s): %u\n", debugstr_w(name), GetLastError());
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
uirow = MSI_CreateRecord( 2 );
|
||||||
|
MSI_RecordSetStringW( uirow, 1, display_name );
|
||||||
|
MSI_RecordSetStringW( uirow, 2, name );
|
||||||
|
ui_actiondata( package, szDeleteServices, uirow );
|
||||||
|
msiobj_release( &uirow->hdr );
|
||||||
|
|
||||||
CloseServiceHandle( service );
|
CloseServiceHandle( service );
|
||||||
CloseServiceHandle( scm );
|
CloseServiceHandle( scm );
|
||||||
msi_free( name );
|
msi_free( name );
|
||||||
|
msi_free( display_name );
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue