Hans Leidekker : msi: Update the UI in the DeleteServices action.

Alexandre Julliard julliard at winehq.org
Fri Mar 5 09:42:56 CST 2010


Module: wine
Branch: master
Commit: 3c36d9d1f956e51f7b8764f63232ae7c45c3f68a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3c36d9d1f956e51f7b8764f63232ae7c45c3f68a

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Fri Mar  5 12:24:41 2010 +0100

msi: Update the UI in the DeleteServices action.

---

 dlls/msi/action.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index e321099..7a666f5 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -5383,9 +5383,10 @@ static UINT ITERATE_DeleteService( MSIRECORD *rec, LPVOID param )
 {
     MSIPACKAGE *package = param;
     MSICOMPONENT *comp;
+    MSIRECORD *uirow;
     LPCWSTR component;
-    LPWSTR name = NULL;
-    DWORD event;
+    LPWSTR name = NULL, display_name = NULL;
+    DWORD event, len;
     SC_HANDLE scm = NULL, service = NULL;
 
     event = MSI_RecordGetInteger( rec, 3 );
@@ -5415,6 +5416,14 @@ static UINT ITERATE_DeleteService( MSIRECORD *rec, LPVOID param )
         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 );
     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());
 
 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( scm );
     msi_free( name );
+    msi_free( display_name );
 
     return ERROR_SUCCESS;
 }




More information about the wine-cvs mailing list