James Hawkins : advpack: Implement LaunchINFSectionW.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Apr 20 13:19:49 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 924d91ca057b25dd7d136b0109efad2ece3b321a
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=924d91ca057b25dd7d136b0109efad2ece3b321a

Author: James Hawkins <truiken at gmail.com>
Date:   Thu Apr 20 10:09:44 2006 -0500

advpack: Implement LaunchINFSectionW.

---

 dlls/advpack/install.c |   45 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/dlls/advpack/install.c b/dlls/advpack/install.c
index af8213e..6432406 100644
--- a/dlls/advpack/install.c
+++ b/dlls/advpack/install.c
@@ -516,14 +516,49 @@ INT WINAPI LaunchINFSectionA(HWND hWnd, 
  *    'A' Always reboot.
  *    'I' Reboot if needed (default).
  *    'N' No reboot.
- * 
- * BUGS
- *  Unimplemented.
  */
 INT WINAPI LaunchINFSectionW(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
 {
-    FIXME("(%p, %p, %s, %i): stub\n", hWnd, hInst, debugstr_w(cmdline), show);
-    return 0;
+    ADVInfo info;
+    LPWSTR cmdline_copy, cmdline_ptr;
+    LPWSTR inf_filename, install_sec;
+    LPWSTR str_flags;
+    DWORD flags = 0;
+    HRESULT hr = S_OK;
+
+    TRACE("(%p, %p, %s, %d)\n", hWnd, hInst, debugstr_w(cmdline), show);
+
+    if (!cmdline)
+        return E_INVALIDARG;
+
+    cmdline_copy = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(cmdline) + 1) * sizeof(WCHAR));
+    cmdline_ptr = cmdline_copy;
+    lstrcpyW(cmdline_copy, cmdline);
+
+    inf_filename = get_parameter(&cmdline_ptr, ',');
+    install_sec = get_parameter(&cmdline_ptr, ',');
+
+    str_flags = get_parameter(&cmdline_ptr, ',');
+    if (str_flags)
+        flags = atolW(str_flags);
+
+    ZeroMemory(&info, sizeof(ADVInfo));
+
+    hr = install_init(inf_filename, install_sec, NULL, flags, &info);
+    if (hr != S_OK)
+        goto done;
+
+    hr = spapi_install(&info);
+    if (hr != S_OK)
+        goto done;
+
+    hr = adv_install(&info);
+
+done:
+    install_release(&info);
+    HeapFree(GetProcessHeap(), 0, cmdline_copy);
+
+    return hr;
 }
 
 /***********************************************************************




More information about the wine-cvs mailing list