Sync with trunk r62754.
[reactos.git] / dll / win32 / wuapi / downloader.c
index 7292966..5749ed8 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#define COBJMACROS
-
-#include "config.h"
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winuser.h"
-#include "ole2.h"
-#include "initguid.h"
-#include "wuapi.h"
-
-#include "wine/debug.h"
-
-WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
+#include "wuapi_private.h"
 
 typedef struct _update_downloader
 {
-    const struct IUpdateDownloaderVtbl *vtbl;
+    IUpdateDownloader IUpdateDownloader_iface;
     LONG refs;
 } update_downloader;
 
 static inline update_downloader *impl_from_IUpdateDownloader( IUpdateDownloader *iface )
 {
-    return (update_downloader *)((char *)iface - FIELD_OFFSET( update_downloader, vtbl ));
+    return CONTAINING_RECORD(iface, update_downloader, IUpdateDownloader_iface);
 }
 
 static ULONG WINAPI update_downloader_AddRef(
@@ -257,10 +243,10 @@ HRESULT UpdateDownloader_create( IUnknown *pUnkOuter, LPVOID *ppObj )
     downloader = HeapAlloc( GetProcessHeap(), 0, sizeof(*downloader) );
     if (!downloader) return E_OUTOFMEMORY;
 
-    downloader->vtbl = &update_downloader_vtbl;
+    downloader->IUpdateDownloader_iface.lpVtbl = &update_downloader_vtbl;
     downloader->refs = 1;
 
-    *ppObj = &downloader->vtbl;
+    *ppObj = &downloader->IUpdateDownloader_iface;
 
     TRACE("returning iface %p\n", *ppObj);
     return S_OK;