123 *
ppv = &
This->IBindStatusCallback_iface;
127 TRACE(
"(%p)->(IID_IBindStatusCallback %p)\n",
This,
ppv);
128 *
ppv = &
This->IBindStatusCallback_iface;
163 IInstallEngine2_Release(&
This->engine->IInstallEngine2_iface);
207 case BINDSTATUS_BEGINDOWNLOADDATA:
208 if (!
This->engine->thread.download_start)
211 case BINDSTATUS_DOWNLOADINGDATA:
212 case BINDSTATUS_ENDDOWNLOADDATA:
213 This->engine->thread.downloaded_kb =
This->dl_previous_kb +
progress / 1024;
214 if (
This->engine->callback)
216 hr = IInstallEngineCallback_OnComponentProgress(
This->engine->callback,
221 case BINDSTATUS_CACHEFILENAMEAVAILABLE:
223 if (!
This->cache_file)
225 ERR(
"Failed to allocate memory for cache file\n");
230 case BINDSTATUS_CONNECTING:
231 case BINDSTATUS_SENDINGREQUEST:
232 case BINDSTATUS_MIMETYPEAVAILABLE:
233 case BINDSTATUS_FINDINGRESOURCE:
255 if (!
This->cache_file)
275 DWORD *grfBINDF, BINDINFO *pbindinfo)
279 TRACE(
"(%p)->(%p %p)\n",
This, grfBINDF, pbindinfo);
281 *grfBINDF = BINDF_PULLDATA | BINDF_NEEDFILE;
290 TRACE(
"(%p)->(%08x %u %p %p)\n",
This, grfBSCF,
dwSize, pformatetc, pstgmed);
325 cb = heap_alloc_zero(
sizeof(*
cb));
356 *
ppv = &
This->IInstallEngine2_iface;
359 *
ppv = &
This->IInstallEngine2_iface;
362 *
ppv = &
This->IInstallEngine2_iface;
364 TRACE(
"(%p)->(IID_IInstallEngineTiming %p)\n",
This,
ppv);
365 *
ppv = &
This->IInstallEngineTiming_iface;
396 ICifFile_Release(
This->icif);
411 IInstallEngineCallback_OnEngineStatusChange(
This->callback,
status, 0);
424 hr = IEnumCifComponents_Reset(enum_comp);
427 while (
SUCCEEDED(IEnumCifComponents_Next(enum_comp, &comp)))
429 if (ICifComponent_GetInstallQueueState(comp) !=
ActionInstall)
434 download = ICifComponent_GetDownloadSize(comp);
441 *size_download = download;
452 hr = IEnumCifComponents_Reset(enum_comp);
455 while (
SUCCEEDED(IEnumCifComponents_Next(enum_comp, &comp)))
457 if (ICifComponent_GetInstallQueueState(comp) !=
ActionInstall)
475 char *url_temp =
NULL;
512 int len_base =
strlen(baseurl);
516 combined =
heap_alloc(len_base + len_url + 2);
517 if (!combined)
return NULL;
519 strcpy(combined, baseurl);
520 if (len_base && combined[len_base-1] !=
'/')
532 if (
flags & URLF_RELATIVEURL)
561 if (!combined)
return NULL;
579 if (!
This->downloaddir)
581 WARN(
"No download directory set\n");
588 FIXME(
"Failed to create moniker\n");
595 IMoniker_Release(mon);
617 if (unk) IUnknown_Release(unk);
620 IMoniker_Release(mon);
621 IBindCtx_Release(bindctx);
627 IBindStatusCallback_Release(&
callback->IBindStatusCallback_iface);
631 if (mon) IMoniker_Release(mon);
633 if (
callback) IBindStatusCallback_Release(&
callback->IBindStatusCallback_iface);
634 if (bindctx) IBindCtx_Release(bindctx);
641 char id[MAX_ID_LENGTH+1],
type;
648 hr = ICifComponent_GetDependency(comp,
i,
id,
sizeof(
id), &
type, &ver, &build);
660 DWORD size_dl, size_install, phase;
661 char display[MAX_DISPLAYNAME_LENGTH+1];
662 char id[MAX_ID_LENGTH+1];
666 hr = ICifComponent_GetID(comp,
id,
sizeof(
id));
674 size_dl = (
This->thread.operation ==
OP_DOWNLOAD) ? ICifComponent_GetDownloadSize(comp) : 0;
679 IInstallEngineCallback_OnStartComponent(
This->callback,
id, size_dl, size_install,
display);
709 IInstallEngineCallback_OnEngineProblem(
This->callback, ENGINEPROBLEM_DOWNLOADFAIL, &retry);
710 if (!retry)
goto done;
725 FIXME(
"Installation not yet implemented\n");
728 IInstallEngineCallback_OnStopComponent(
This->callback,
id,
hr, phase,
display, 0);
739 IInstallEngineCallback_OnStartInstall(
This->callback,
This->thread.download_size,
This->thread.install_size);
756 IInstallEngineCallback_OnStopInstall(
This->callback,
hr,
NULL, 0);
758 IEnumCifComponents_Release(
This->thread.enum_comp);
759 IInstallEngine2_Release(&
This->IInstallEngine2_iface);
771 This->thread.jobflags = jobflags;
772 This->thread.downloaded_kb = 0;
773 This->thread.download_start = 0;
782 hr = ICifFile_EnumComponents(
This->icif, &
This->thread.enum_comp, 0,
NULL);
788 IInstallEngine2_AddRef(&
This->IInstallEngine2_iface);
793 IInstallEngine2_Release(&
This->IInstallEngine2_iface);
802 IEnumCifComponents_Release(
This->thread.enum_comp);
839 IInstallEngineCallback_OnEngineStatusChange(
This->callback, ENGINESTATUS_INSTALLING, 0);
871 if (!
This->icif || !
id)
882 if (ICifComponent_GetInstallQueueState(comp) !=
ActionInstall)
885 if (ICifComponent_IsComponentDownloaded(comp) !=
S_FALSE)
948 hr = ICifFile_FindComponent(
This->icif,
id, &comp);
951 hr = ICifComponent_SetInstallQueueState(comp,
action);
954 hr = ICifComponent_SetCurrentPriority(comp,
priority);
1004 if (
This->downloaddir)
1082 ICifFile_Release(
This->icif);
1103 if (!
This->icif || !cif_file)
1106 ICifFile_AddRef(
This->icif);
1107 *cif_file =
This->icif;
1145 return IInstallEngine2_QueryInterface(&
This->IInstallEngine2_iface,
riid,
ppv);
1151 return IInstallEngine2_AddRef(&
This->IInstallEngine2_iface);
1157 return IInstallEngine2_Release(&
This->IInstallEngine2_iface);
1183 progress->dwDownloadKBRemaining =
max(
This->thread.download_size,
This->thread.downloaded_kb) -
This->thread.downloaded_kb;
1186 if (
This->thread.download_start &&
This->thread.downloaded_kb && elapsed > 100)
1187 progress->dwDownloadSecsRemaining = (
progress->dwDownloadKBRemaining * elapsed) / (
This->thread.downloaded_kb * 1000);
1189 progress->dwDownloadSecsRemaining = -1;
1191 progress->dwInstallKBRemaining = 0;
1192 progress->dwInstallSecsRemaining = -1;
1211 TRACE(
"(%p)->(IID_IUnknown %p)\n", iface,
ppv);
1214 TRACE(
"(%p)->(IID_IClassFactory %p)\n", iface,
ppv);
1278 case DLL_WINE_PREATTACH:
static const IInstallEngineTimingVtbl InstallEngineTimingVtbl
static const WCHAR path2[]
static const IBindStatusCallbackVtbl BindStatusCallbackVtbl
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
static HRESULT process_component(InstallEngine *This, ICifComponent *comp)
static void set_status(InstallEngine *This, DWORD status)
char * strcat(char *DstString, const char *SrcString)
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
static ULONG WINAPI InstallEngineTiming_Release(IInstallEngineTiming *iface)
static HRESULT WINAPI InstallEngineTiming_QueryInterface(IInstallEngineTiming *iface, REFIID riid, void **ppv)
ACPI_SIZE strlen(const char *String)
static HRESULT WINAPI downloadcb_OnObjectAvailable(IBindStatusCallback *iface, REFIID riid, IUnknown *punk)
static WCHAR * strdupW(const WCHAR *src)
static ULONG WINAPI downloadcb_Release(IBindStatusCallback *iface)
static HRESULT WINAPI InstallEngine_GetSizes(IInstallEngine2 *iface, const char *id, COMPONENT_SIZES *sizes)
static HRESULT WINAPI InstallEngine_UnregisterInstallEngineCallback(IInstallEngine2 *iface)
static HRESULT WINAPI InstallEngine_RegisterInstallEngineCallback(IInstallEngine2 *iface, IInstallEngineCallback *callback)
static HRESULT WINAPI InstallEngine_SetHWND(IInstallEngine2 *iface, HWND hwnd)
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
WINE_DEFAULT_DEBUG_CHANNEL(inseng)
#define InterlockedCompareExchange
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
DWORD WINAPI GetLastError(VOID)
#define DLL_PROCESS_ATTACH
static HRESULT WINAPI downloadcb_OnStartBinding(IBindStatusCallback *iface, DWORD reserved, IBinding *pbind)
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
static HRESULT get_url(ICifComponent *comp, int index, char **url, DWORD *flags)
#define CLASS_E_CLASSNOTAVAILABLE
ULONGLONG WINAPI GetTickCount64(VOID)
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
static HRESULT WINAPI InstallEngineTiming_GetRates(IInstallEngineTiming *iface, DWORD *download, DWORD *install)
static void * heap_alloc(size_t len)
static HRESULT WINAPI InstallEngine_SetCifFile(IInstallEngine2 *iface, const char *cab_name, const char *cif_name)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
HRESULT WINAPI DllUnregisterServer(void)
void component_set_downloaded(ICifComponent *iface, BOOL value)
static HRESULT WINAPI InstallEngine_Resume(IInstallEngine2 *iface)
static HRESULT calc_sizes(IEnumCifComponents *enum_comp, DWORD operation, DWORD *size_download, DWORD *size_install)
static HRESULT WINAPI downloadcb_OnStopBinding(IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
static HRESULT downloadcb_create(InstallEngine *engine, HANDLE event, char *file_name, char *id, char *display, DWORD dl_size, struct downloadcb **callback)
static HINSTANCE instance
static ULONG WINAPI InstallEngine_AddRef(IInstallEngine2 *iface)
static HRESULT WINAPI InstallEngine_SetAction(IInstallEngine2 *iface, const char *id, DWORD action, DWORD priority)
IInstallEngine2 IInstallEngine2_iface
static HRESULT WINAPI InstallEngine_SetInstallDrive(IInstallEngine2 *iface, char drive)
static UINT enum_components(const WCHAR *usersid, DWORD ctx, DWORD index, DWORD *idx, WCHAR guid[39], MSIINSTALLCONTEXT *installed_ctx, LPWSTR sid, LPDWORD sid_len)
static HRESULT WINAPI InstallEngine_SetIStream(IInstallEngine2 *iface, IStream *stream)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
static HRESULT WINAPI downloadcb_OnDataAvailable(IBindStatusCallback *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
static HRESULT WINAPI InstallEngineCF_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
WDF_INTERRUPT_PRIORITY priority
static HRESULT WINAPI downloadcb_OnLowResource(IBindStatusCallback *iface, DWORD reserved)
IBindStatusCallback IBindStatusCallback_iface
static HRESULT download_url(InstallEngine *This, char *id, char *display, char *url, DWORD flags, DWORD dl_size)
HRESULT WINAPI DllCanUnloadNow(void)
static char * combine_url(char *baseurl, char *url)
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
char * component_get_id(ICifComponent *iface)
static char * merge_path(char *path1, char *path2)
static const WCHAR path1[]
static HRESULT WINAPI InstallEngine_SetDownloadDir(IInstallEngine2 *iface, const char *download_dir)
static HRESULT WINAPI downloadcb_OnProgress(IBindStatusCallback *iface, ULONG progress, ULONG progress_max, ULONG status, const WCHAR *status_text)
GLboolean GLboolean GLboolean b
IEnumCifComponents * enum_comp
static HRESULT WINAPI InstallEngine_QueryInterface(IInstallEngine2 *iface, REFIID riid, void **ppv)
static InstallEngine * impl_from_IInstallEngineTiming(IInstallEngineTiming *iface)
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
static HRESULT WINAPI InstallEngine_SetBaseUrl(IInstallEngine2 *iface, const char *base_name)
static HRESULT WINAPI InstallEngine_EnumDownloadIDs(IInstallEngine2 *iface, UINT index, char **id)
static HRESULT WINAPI InstallEngine_IsComponentInstalled(IInstallEngine2 *iface, const char *id, DWORD *status)
static HRESULT WINAPI downloadcb_GetPriority(IBindStatusCallback *iface, LONG *priority)
static HRESULT WINAPI InstallEngine_InstallComponents(IInstallEngine2 *iface, DWORD flags)
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
static HRESULT WINAPI InstallEngineTiming_GetInstallProgress(IInstallEngineTiming *iface, INSTALLPROGRESS *progress)
static HRESULT WINAPI InstallEngine_GetEngineStatus(IInstallEngine2 *iface, DWORD *status)
static ULONG WINAPI InstallEngineTiming_AddRef(IInstallEngineTiming *iface)
#define InterlockedDecrement
HRESULT WINAPI DllRegisterServer(void)
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
static ULONG WINAPI downloadcb_AddRef(IBindStatusCallback *iface)
BOOL WINAPI CheckTrustEx(LPVOID a, LPVOID b, LPVOID c, LPVOID d, LPVOID e)
static LPWSTR strAtoW(const char *str)
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
static const IClassFactoryVtbl InstallEngineCFVtbl
static HRESULT start_installation(InstallEngine *This, DWORD operation, DWORD jobflags)
HRESULT WINAPI GetICifFileFromFile(ICifFile **icif, const char *path)
static HRESULT WINAPI InstallEngine_DownloadComponents(IInstallEngine2 *iface, DWORD flags)
static HRESULT process_component_dependencies(InstallEngine *This, ICifComponent *comp)
DWORD WINAPI thread_installation(LPVOID param)
static IClassFactory InstallEngineCF
HRESULT WINAPI CreateAsyncBindCtx(DWORD reserved, IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx **pbind)
static HRESULT generate_moniker(char *baseurl, char *url, DWORD flags, IMoniker **moniker)
#define InterlockedIncrement
static HRESULT get_next_component(IEnumCifComponents *enum_comp, DWORD operation, ICifComponent **ret_comp)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static HRESULT WINAPI downloadcb_QueryInterface(IBindStatusCallback *iface, REFIID riid, void **ppv)
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
IInstallEngineCallback * callback
static HRESULT WINAPI InstallEngine_Abort(IInstallEngine2 *iface, DWORD flags)
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
static HRESULT WINAPI InstallEngine2_GetICifFile(IInstallEngine2 *iface, ICifFile **cif_file)
struct thread_info thread
IInstallEngineTiming IInstallEngineTiming_iface
static HMODULE MODULEINFO DWORD cb
static HRESULT WINAPI downloadcb_GetBindInfo(IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
static HRESULT WINAPI InstallEngine_SetInstallOptions(IInstallEngine2 *iface, DWORD flags)
char * strcpy(char *DstString, const char *SrcString)
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
static ULONG WINAPI InstallEngine_Release(IInstallEngine2 *iface)
static HRESULT WINAPI InstallEngine2_SetLocalCif(IInstallEngine2 *iface, const char *cif)
static HRESULT WINAPI InstallEngine_EnumInstallIDs(IInstallEngine2 *iface, UINT index, char **id)
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
GLuint GLuint GLsizei GLenum type
static HRESULT WINAPI InstallEngine_Suspend(IInstallEngine2 *iface)
static IPrintDialogCallback callback
GLboolean GLboolean GLboolean GLboolean a
static HRESULT WINAPI InstallEngine_GetDisplayName(IInstallEngine2 *iface, const char *id, const char *name)
static const IInstallEngine2Vtbl InstallEngine2Vtbl
const GUID IID_IClassFactory
static const struct @526 sizes[]
static LPSTR strdupA(LPCSTR str)
static SERVICE_STATUS status
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
static HRESULT WINAPI InstallEngine_LaunchExtraCommand(IInstallEngine2 *iface, const char *inf_name, const char *section)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static BOOL heap_free(void *mem)