25.02.2003, Geprüft: 27.02.2003
PDF |  E-Book |  Ranking
1 Stern2 Sterne3 Sterne4 Sterne5 Sterne
 | 

Inside Windows-Update

von Mike Hartmann

Automatic Update for Update

The component DLL also contains a type library that describes the IUpdate interface that we can now work with. Two functions of this interface are important for us:
Code
1
long Initialize(long flag, IUnknown *unk)
spacer_1px
2
BSTR GetSystemSpec(BSTR classes)
Initialize() must be the first function that we call when using the COM component. The semantics of the flag parameter are not known to us and we set this parameter to zero to imitate the behavior of the Windows Update Java Script code. Initialize() contacts the Microsoft server, checks for a newer version of the component, and automatically updates the component if necessary. The interface parameter must point to the IUnknown interface of an UpdateCompleteListener object, which is also described in the type library. This object seems to implement a callback function that is called when the component has been successfully updated.
If updating iuctl.dll is necessary but fails, Initialize() returns 1. If updating iuengine.dll is necessary but fails, Initialize() returns 2. If both DLLs require an update but updating fails, 3 is returned.
For the sake of simplicity we set the interface parameter to NULL. This seems to have the effect that updating either DLL always fails.
Auf der nächsten Seite: GetSystemSpec
Seite 12 von 16
Inhalt dieses Artikels
Mehr zum Thema
Links zum Thema
Ihre Meinung zum Artikel
Benutzername:
Passwort: