WUW4.dll - The Software Update Wizard Dynamic Link Library

The wuw4.dll file is a Windows dynamic link library, which your application uses to communicate with the Software Update Wizard Service application.  If you are instead calling wuwstub.exe from your application then wuwstub.exe uses wuw4.dll to communicate with the Software Update Wizard service (WebUpdateSvc.exe) and launches the Software Update Wizard User Interface component (WuWUI.exe).

Wuw4.dll is normally installed into the Windows folder.  If you use wuwinstaller.exe to install the Software Update Wizard it will locate wuw4.dll there.

Wuw4.dll contains 2 exported functions:

WebUpdate(URL)

and

WebUpdateWait(URL, TimeOut)

 

The first function, WebUpdate(), passes the URL of the update script to the Software Update Wizard and returns immediately.  It therefore causes the Software Update Wizard to work asynchronously (i.e. in parallel) with your application.

The WebUpdateWait() function passes the URL and a timeout in milliseconds ('000ths of a second) to wuw4.dll.  However, the WebUpdateWait() function in wuw4.dll does not return until the Software Update Wizard has completely finished processing the call.  It therefore causes the Software Update Wizard to work synchronously (i.e. sequentially) with your application.  Note that the milliseconds argument causes control to return to your program either when the specified time is up or when the Software Update Wizard has finished, whichever occurs earlier.

When the DLL receives the URL of the update script it then either sends the URL through a named pipe to the Software Update Wizard Service.

The declaration of the WebUpdate() function from the (supplied) WebUpdate.h file is shown here:

//////////////////////////////////////////////////////////////////
// Software Update Wizard DLL Header File
// © Peter Boulton, Data Perceptions / PowerProgrammer - 2002-2005
//////////////////////////////////////////////////////////////////
// The one and only function - WebUpdate(LPCTSTR szURL) where
// szURL is the URL of the server update script file.
// Function returns 1 if successful, else 0.
// Note __stdcall calling convention for use in VB
// Example call:
//
//        WebUpdate("http://www.myserver.com/update.txt");
//
// Here is an example VBA call:
//  --------------------------------------------------------------------------------------------------------------
//    Private Declare Function WebUpdate Lib "D:\MSDEV\Projects\wuw\Release\wuw4.dll" (ByVal URL As String) As Long
//  --------------------------------------------------------------------------------------------------------------
//    Private Sub CommandButton1_Click()
//
//    Dim myURL As String
//    myURL = "http://localhost/prophecy/prophecyupdate.txt"
//    Call WebUpdate(myURL)
//
//    End Sub

/////////////////////////////////////////////////////////////////////////////////////////
// Implementation 1: Returns immediately on launching Software Update Wizard
int __stdcall WebUpdate(LPCTSTR URL);
/////////////////////////////////////////////////////////////////////////////////////////
// Implementation 2: Returns after Software Update Wizard has finished parsing script file and,
//                   if necessary, downloading the updates, or after nTimeOut milliseconds,
//                   whichever occurs earlier.
int __stdcall WebUpdateWait(LPCTSTR szURL, UINT nTimeOut);
/////////////////////////////////////////////////////////////////////////////////////////

Notes