Synchronize with trunk r58606.
[reactos.git] / dll / win32 / wuapi / downloader.c
index 7292966..3bd6cc2 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+
 #define COBJMACROS
 
-#include "config.h"
+#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 <windef.h>
+#include <winbase.h>
+//#include "winuser.h"
+#include <ole2.h>
+//#include "initguid.h"
+#include <wuapi.h>
 
-#include "wine/debug.h"
+#include <wine/debug.h>
 
 WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
 
 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 +260,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;