ReactOS  0.4.13-dev-242-g611e6d7
inseng_main.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "rpcproxy.h"
#include "urlmon.h"
#include "shlwapi.h"
#include "initguid.h"
#include "inseng.h"
#include "inseng_private.h"
#include "wine/debug.h"
Include dependency graph for inseng_main.c:

Go to the source code of this file.

Classes

struct  thread_info
 
class  InstallEngine
 
struct  downloadcb
 

Macros

#define COBJMACROS
 

Enumerations

enum  thread_operation { OP_DOWNLOAD, OP_INSTALL }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (inseng)
 
static InstallEngineimpl_from_IInstallEngine2 (IInstallEngine2 *iface)
 
static struct downloadcbimpl_from_IBindStatusCallback (IBindStatusCallback *iface)
 
static InstallEngineimpl_from_IInstallEngineTiming (IInstallEngineTiming *iface)
 
static HRESULT WINAPI downloadcb_QueryInterface (IBindStatusCallback *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI downloadcb_AddRef (IBindStatusCallback *iface)
 
static ULONG WINAPI downloadcb_Release (IBindStatusCallback *iface)
 
static HRESULT WINAPI downloadcb_OnStartBinding (IBindStatusCallback *iface, DWORD reserved, IBinding *pbind)
 
static HRESULT WINAPI downloadcb_GetPriority (IBindStatusCallback *iface, LONG *priority)
 
static HRESULT WINAPI downloadcb_OnLowResource (IBindStatusCallback *iface, DWORD reserved)
 
static HRESULT WINAPI downloadcb_OnProgress (IBindStatusCallback *iface, ULONG progress, ULONG progress_max, ULONG status, const WCHAR *status_text)
 
static HRESULT WINAPI downloadcb_OnStopBinding (IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError)
 
static HRESULT WINAPI downloadcb_GetBindInfo (IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
 
static HRESULT WINAPI downloadcb_OnDataAvailable (IBindStatusCallback *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
 
static HRESULT WINAPI downloadcb_OnObjectAvailable (IBindStatusCallback *iface, REFIID riid, IUnknown *punk)
 
static HRESULT downloadcb_create (InstallEngine *engine, HANDLE event, char *file_name, char *id, char *display, DWORD dl_size, struct downloadcb **callback)
 
static HRESULT WINAPI InstallEngine_QueryInterface (IInstallEngine2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InstallEngine_AddRef (IInstallEngine2 *iface)
 
static ULONG WINAPI InstallEngine_Release (IInstallEngine2 *iface)
 
static void set_status (InstallEngine *This, DWORD status)
 
static HRESULT calc_sizes (IEnumCifComponents *enum_comp, DWORD operation, DWORD *size_download, DWORD *size_install)
 
static HRESULT get_next_component (IEnumCifComponents *enum_comp, DWORD operation, ICifComponent **ret_comp)
 
static HRESULT get_url (ICifComponent *comp, int index, char **url, DWORD *flags)
 
static charcombine_url (char *baseurl, char *url)
 
static HRESULT generate_moniker (char *baseurl, char *url, DWORD flags, IMoniker **moniker)
 
static charmerge_path (char *path1, char *path2)
 
static HRESULT download_url (InstallEngine *This, char *id, char *display, char *url, DWORD flags, DWORD dl_size)
 
static HRESULT process_component_dependencies (InstallEngine *This, ICifComponent *comp)
 
static HRESULT process_component (InstallEngine *This, ICifComponent *comp)
 
DWORD WINAPI thread_installation (LPVOID param)
 
static HRESULT start_installation (InstallEngine *This, DWORD operation, DWORD jobflags)
 
static HRESULT WINAPI InstallEngine_GetEngineStatus (IInstallEngine2 *iface, DWORD *status)
 
static HRESULT WINAPI InstallEngine_SetCifFile (IInstallEngine2 *iface, const char *cab_name, const char *cif_name)
 
static HRESULT WINAPI InstallEngine_DownloadComponents (IInstallEngine2 *iface, DWORD flags)
 
static HRESULT WINAPI InstallEngine_InstallComponents (IInstallEngine2 *iface, DWORD flags)
 
static HRESULT WINAPI InstallEngine_EnumInstallIDs (IInstallEngine2 *iface, UINT index, char **id)
 
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 InstallEngine_RegisterInstallEngineCallback (IInstallEngine2 *iface, IInstallEngineCallback *callback)
 
static HRESULT WINAPI InstallEngine_UnregisterInstallEngineCallback (IInstallEngine2 *iface)
 
static HRESULT WINAPI InstallEngine_SetAction (IInstallEngine2 *iface, const char *id, DWORD action, DWORD priority)
 
static HRESULT WINAPI InstallEngine_GetSizes (IInstallEngine2 *iface, const char *id, COMPONENT_SIZES *sizes)
 
static HRESULT WINAPI InstallEngine_LaunchExtraCommand (IInstallEngine2 *iface, const char *inf_name, const char *section)
 
static HRESULT WINAPI InstallEngine_GetDisplayName (IInstallEngine2 *iface, const char *id, const char *name)
 
static HRESULT WINAPI InstallEngine_SetBaseUrl (IInstallEngine2 *iface, const char *base_name)
 
static HRESULT WINAPI InstallEngine_SetDownloadDir (IInstallEngine2 *iface, const char *download_dir)
 
static HRESULT WINAPI InstallEngine_SetInstallDrive (IInstallEngine2 *iface, char drive)
 
static HRESULT WINAPI InstallEngine_SetInstallOptions (IInstallEngine2 *iface, DWORD flags)
 
static HRESULT WINAPI InstallEngine_SetHWND (IInstallEngine2 *iface, HWND hwnd)
 
static HRESULT WINAPI InstallEngine_SetIStream (IInstallEngine2 *iface, IStream *stream)
 
static HRESULT WINAPI InstallEngine_Abort (IInstallEngine2 *iface, DWORD flags)
 
static HRESULT WINAPI InstallEngine_Suspend (IInstallEngine2 *iface)
 
static HRESULT WINAPI InstallEngine_Resume (IInstallEngine2 *iface)
 
static HRESULT WINAPI InstallEngine2_SetLocalCif (IInstallEngine2 *iface, const char *cif)
 
static HRESULT WINAPI InstallEngine2_GetICifFile (IInstallEngine2 *iface, ICifFile **cif_file)
 
static HRESULT WINAPI InstallEngineTiming_QueryInterface (IInstallEngineTiming *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InstallEngineTiming_AddRef (IInstallEngineTiming *iface)
 
static ULONG WINAPI InstallEngineTiming_Release (IInstallEngineTiming *iface)
 
static HRESULT WINAPI InstallEngineTiming_GetRates (IInstallEngineTiming *iface, DWORD *download, DWORD *install)
 
static HRESULT WINAPI InstallEngineTiming_GetInstallProgress (IInstallEngineTiming *iface, INSTALLPROGRESS *progress)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL fLock)
 
static HRESULT WINAPI InstallEngineCF_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 
BOOL WINAPI CheckTrustEx (LPVOID a, LPVOID b, LPVOID c, LPVOID d, LPVOID e)
 
HRESULT WINAPI DllInstall (BOOL bInstall, LPCWSTR cmdline)
 

Variables

static HINSTANCE instance
 
static const IBindStatusCallbackVtbl BindStatusCallbackVtbl
 
static const IInstallEngine2Vtbl InstallEngine2Vtbl
 
static const IInstallEngineTimingVtbl InstallEngineTimingVtbl
 
static const IClassFactoryVtbl InstallEngineCFVtbl
 
static IClassFactory InstallEngineCF = { &InstallEngineCFVtbl }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file inseng_main.c.

Enumeration Type Documentation

◆ thread_operation

Enumerator
OP_DOWNLOAD 
OP_INSTALL 

Definition at line 49 of file inseng_main.c.

50 {
53 };

Function Documentation

◆ calc_sizes()

static HRESULT calc_sizes ( IEnumCifComponents enum_comp,
DWORD  operation,
DWORD size_download,
DWORD size_install 
)
static

Definition at line 415 of file inseng_main.c.

416 {
417  ICifComponent *comp;
418  DWORD download = 0;
419  DWORD install = 0;
420  HRESULT hr;
421 
422  /* FIXME: what about inactive dependencies and how does
423  * INSTALLOPTIONS_FORCEDEPENDENCIES play into this ?*/
424 
425  hr = IEnumCifComponents_Reset(enum_comp);
426  if (FAILED(hr)) return hr;
427 
428  while (SUCCEEDED(IEnumCifComponents_Next(enum_comp, &comp)))
429  {
430  if (ICifComponent_GetInstallQueueState(comp) != ActionInstall)
431  continue;
432 
433  /* FIXME: handle install options and find out the default options*/
434  if (operation == OP_DOWNLOAD && ICifComponent_IsComponentDownloaded(comp) == S_FALSE)
435  download = ICifComponent_GetDownloadSize(comp);
436  /*
437  if (operation == OP_INSTALL && ICifComponent_IsComponentInstalled(comp) == S_FALSE)
438  install = ICifComponent_GetInstalledSize(comp);
439  */
440  }
441 
442  *size_download = download;
443  *size_install = install;
444 
445  return S_OK;
446 }
HRESULT hr
Definition: shlfolder.c:183
int install
Definition: msacm.c:1353
#define S_FALSE
Definition: winerror.h:2357
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by start_installation().

◆ CheckTrustEx()

BOOL WINAPI CheckTrustEx ( LPVOID  a,
LPVOID  b,
LPVOID  c,
LPVOID  d,
LPVOID  e 
)

Definition at line 1327 of file inseng_main.c.

1328 {
1329  FIXME("%p %p %p %p %p\n", a, b, c, d, e );
1330  return TRUE;
1331 }
#define TRUE
Definition: types.h:120
#define e
Definition: ke_i.h:82
#define FIXME(fmt,...)
Definition: debug.h:110
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define d
Definition: ke_i.h:81
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 1228 of file inseng_main.c.

1229 {
1230  return 2;
1231 }

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory iface,
BOOL  fLock 
)
static

Definition at line 1238 of file inseng_main.c.

1239 {
1240  return S_OK;
1241 }
#define S_OK
Definition: intsafe.h:59

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1207 of file inseng_main.c.

1208 {
1209  *ppv = NULL;
1210 
1211  if(IsEqualGUID(&IID_IUnknown, riid)) {
1212  TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
1213  *ppv = iface;
1214  }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
1215  TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
1216  *ppv = iface;
1217  }
1218 
1219  if(*ppv) {
1220  IUnknown_AddRef((IUnknown*)*ppv);
1221  return S_OK;
1222  }
1223 
1224  FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
1225  return E_NOINTERFACE;
1226 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IClassFactory

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 1233 of file inseng_main.c.

1234 {
1235  return 1;
1236 }

◆ combine_url()

static char* combine_url ( char baseurl,
char url 
)
static

Definition at line 511 of file inseng_main.c.

512 {
513  int len_base = strlen(baseurl);
514  int len_url = strlen(url);
515  char *combined;
516 
517  combined = heap_alloc(len_base + len_url + 2);
518  if (!combined) return NULL;
519 
520  strcpy(combined, baseurl);
521  if (len_base && combined[len_base-1] != '/')
522  strcat(combined, "/");
523  strcat(combined, url);
524 
525  return combined;
526 }
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR url[]
Definition: encode.c:1432
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by generate_moniker().

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 1306 of file inseng_main.c.

1307 {
1308  return S_FALSE;
1309 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  iid,
LPVOID ppv 
)

Definition at line 1292 of file inseng_main.c.

1293 {
1294  if(IsEqualGUID(rclsid, &CLSID_InstallEngine)) {
1295  TRACE("(CLSID_InstallEngine %s %p)\n", debugstr_guid(iid), ppv);
1296  return IClassFactory_QueryInterface(&InstallEngineCF, iid, ppv);
1297  }
1298 
1299  FIXME("(%s %s %p)\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
1301 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static IClassFactory InstallEngineCF
Definition: inseng_main.c:1273
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ DllInstall()

HRESULT WINAPI DllInstall ( BOOL  bInstall,
LPCWSTR  cmdline 
)

Definition at line 1336 of file inseng_main.c.

1337 {
1338  FIXME("(%s, %s): stub\n", bInstall ? "TRUE" : "FALSE", debugstr_w(cmdline));
1339  return S_OK;
1340 }
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  lpv 
)

Definition at line 1275 of file inseng_main.c.

1276 {
1277  switch(fdwReason)
1278  {
1279  case DLL_WINE_PREATTACH:
1280  return FALSE; /* prefer native version */
1281  case DLL_PROCESS_ATTACH:
1282  instance = hInstDLL;
1283  DisableThreadLibraryCalls(hInstDLL);
1284  break;
1285  }
1286  return TRUE;
1287 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static HINSTANCE instance
Definition: inseng_main.c:47

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 1314 of file inseng_main.c.

1315 {
1317 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE instance
Definition: inseng_main.c:47

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 1322 of file inseng_main.c.

1323 {
1325 }
static HINSTANCE instance
Definition: inseng_main.c:47
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ download_url()

static HRESULT download_url ( InstallEngine This,
char id,
char display,
char url,
DWORD  flags,
DWORD  dl_size 
)
static

Definition at line 570 of file inseng_main.c.

571 {
572  struct downloadcb *callback = NULL;
573  char *filename = NULL;
574  IUnknown *unk = NULL;
575  IMoniker *mon = NULL;
576  IBindCtx *bindctx = NULL;
577  HANDLE event = NULL;
578  HRESULT hr;
579 
580  if (!This->downloaddir)
581  {
582  WARN("No download directory set\n");
583  return E_FAIL;
584  }
585 
586  hr = generate_moniker(This->baseurl, url, flags, &mon);
587  if (FAILED(hr))
588  {
589  FIXME("Failed to create moniker\n");
590  return hr;
591  }
592 
593  event = CreateEventW(NULL, TRUE, FALSE, NULL);
594  if (!event)
595  {
596  IMoniker_Release(mon);
597  return E_FAIL;
598  }
599 
600  filename = strrchr(url, '/');
601  if (!filename) filename = url;
602 
603  filename = merge_path(This->downloaddir, filename);
604  if (!filename)
605  {
606  hr = E_OUTOFMEMORY;
607  goto error;
608  }
609 
611  if (FAILED(hr)) goto error;
612 
613  hr = CreateAsyncBindCtx(0, &callback->IBindStatusCallback_iface, NULL, &bindctx);
614  if(FAILED(hr)) goto error;
615 
616  hr = IMoniker_BindToStorage(mon, bindctx, NULL, &IID_IUnknown, (void**)&unk);
617  if (FAILED(hr)) goto error;
618  if (unk) IUnknown_Release(unk);
619 
621  IMoniker_Release(mon);
622  IBindCtx_Release(bindctx);
623 
625  hr = callback->hr;
626 
628  IBindStatusCallback_Release(&callback->IBindStatusCallback_iface);
629  return hr;
630 
631 error:
632  if (mon) IMoniker_Release(mon);
633  if (event) CloseHandle(event);
634  if (callback) IBindStatusCallback_Release(&callback->IBindStatusCallback_iface);
635  if (bindctx) IBindCtx_Release(bindctx);
637  return hr;
638 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
#define WARN(fmt,...)
Definition: debug.h:111
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
const char * filename
Definition: ioapi.h:135
#define E_FAIL
Definition: ddrawi.h:102
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
int * display
Definition: x11stubs.c:12
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
static HRESULT downloadcb_create(InstallEngine *engine, HANDLE event, char *file_name, char *id, char *display, DWORD dl_size, struct downloadcb **callback)
Definition: inseng_main.c:321
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static char * merge_path(char *path1, char *path2)
Definition: inseng_main.c:557
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
const GUID IID_IUnknown
GLbitfield flags
Definition: glext.h:7161
struct _cl_event * event
Definition: glext.h:7739
HRESULT WINAPI CreateAsyncBindCtx(DWORD reserved, IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx **pbind)
Definition: bindctx.c:899
static HRESULT generate_moniker(char *baseurl, char *url, DWORD flags, IMoniker **moniker)
Definition: inseng_main.c:528
#define INFINITE
Definition: serial.h:102
DWORD dl_size
Definition: inseng_main.c:94
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by process_component().

◆ downloadcb_AddRef()

static ULONG WINAPI downloadcb_AddRef ( IBindStatusCallback iface)
static

Definition at line 142 of file inseng_main.c.

143 {
146 
147  TRACE("(%p) ref = %d\n", This, ref);
148 
149  return ref;
150 }
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107

◆ downloadcb_create()

static HRESULT downloadcb_create ( InstallEngine engine,
HANDLE  event,
char file_name,
char id,
char display,
DWORD  dl_size,
struct downloadcb **  callback 
)
static

Definition at line 321 of file inseng_main.c.

323 {
324  struct downloadcb *cb;
325 
326  cb = heap_alloc_zero(sizeof(*cb));
327  if (!cb) return E_OUTOFMEMORY;
328 
329  cb->IBindStatusCallback_iface.lpVtbl = &BindStatusCallbackVtbl;
330  cb->ref = 1;
331  cb->hr = E_FAIL;
332  cb->id = id;
333  cb->display = display;
334  cb->engine = engine;
335  cb->dl_size = dl_size;
336  cb->dl_previous_kb = engine->thread.downloaded_kb;
337  cb->event_done = event;
338  cb->file_name = strAtoW(file_name);
339  if (!cb->file_name)
340  {
341  heap_free(cb);
342  return E_OUTOFMEMORY;
343  }
344 
345  IInstallEngine2_AddRef(&engine->IInstallEngine2_iface);
346 
347  *callback = cb;
348  return S_OK;
349 }
static const IBindStatusCallbackVtbl BindStatusCallbackVtbl
Definition: inseng_main.c:306
#define E_FAIL
Definition: ddrawi.h:102
int * display
Definition: x11stubs.c:12
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
IInstallEngine2 IInstallEngine2_iface
Definition: inseng_main.c:69
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
static DWORD cb
Definition: integrity.c:41
static LPWSTR strAtoW(const char *str)
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59
static LPCWSTR file_name
Definition: protocol.c:146
struct thread_info thread
Definition: inseng_main.c:80
GLenum GLuint id
Definition: glext.h:5579
DWORD dl_size
Definition: inseng_main.c:94
InstallEngine * engine
Definition: inseng_main.c:97
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by download_url().

◆ downloadcb_GetBindInfo()

static HRESULT WINAPI downloadcb_GetBindInfo ( IBindStatusCallback iface,
DWORD grfBINDF,
BINDINFO *  pbindinfo 
)
static

Definition at line 275 of file inseng_main.c.

277 {
279 
280  TRACE("(%p)->(%p %p)\n", This, grfBINDF, pbindinfo);
281 
282  *grfBINDF = BINDF_PULLDATA | BINDF_NEEDFILE;
283  return S_OK;
284 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107

◆ downloadcb_GetPriority()

static HRESULT WINAPI downloadcb_GetPriority ( IBindStatusCallback iface,
LONG priority 
)
static

Definition at line 180 of file inseng_main.c.

181 {
183 
184  FIXME("(%p)->(%p): stub\n", This, priority);
185 
186  return E_NOTIMPL;
187 }
#define FIXME(fmt,...)
Definition: debug.h:110
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107
#define E_NOTIMPL
Definition: ddrawi.h:99
static int priority
Definition: timer.c:163

◆ downloadcb_OnDataAvailable()

static HRESULT WINAPI downloadcb_OnDataAvailable ( IBindStatusCallback iface,
DWORD  grfBSCF,
DWORD  dwSize,
FORMATETC *  pformatetc,
STGMEDIUM *  pstgmed 
)
static

Definition at line 286 of file inseng_main.c.

288 {
290 
291  TRACE("(%p)->(%08x %u %p %p)\n", This, grfBSCF, dwSize, pformatetc, pstgmed);
292 
293  return S_OK;
294 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

◆ downloadcb_OnLowResource()

static HRESULT WINAPI downloadcb_OnLowResource ( IBindStatusCallback iface,
DWORD  reserved 
)
static

Definition at line 189 of file inseng_main.c.

190 {
192 
193  FIXME("(%p)->(%u): stub\n", This, reserved);
194 
195  return E_NOTIMPL;
196 }
#define FIXME(fmt,...)
Definition: debug.h:110
r reserved
Definition: btrfs.c:2673
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ downloadcb_OnObjectAvailable()

static HRESULT WINAPI downloadcb_OnObjectAvailable ( IBindStatusCallback iface,
REFIID  riid,
IUnknown punk 
)
static

Definition at line 296 of file inseng_main.c.

298 {
300 
301  FIXME("(%p)->(%s %p): stub\n", This, debugstr_guid(riid), punk);
302 
303  return E_NOTIMPL;
304 }
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ downloadcb_OnProgress()

static HRESULT WINAPI downloadcb_OnProgress ( IBindStatusCallback iface,
ULONG  progress,
ULONG  progress_max,
ULONG  status,
const WCHAR status_text 
)
static

Definition at line 198 of file inseng_main.c.

200 {
202  HRESULT hr = S_OK;
203 
204  TRACE("%p)->(%u %u %u %s)\n", This, progress, progress_max, status, debugstr_w(status_text));
205 
206  switch(status)
207  {
208  case BINDSTATUS_BEGINDOWNLOADDATA:
209  if (!This->engine->thread.download_start)
210  This->engine->thread.download_start = GetTickCount64();
211  /* fall-through */
212  case BINDSTATUS_DOWNLOADINGDATA:
213  case BINDSTATUS_ENDDOWNLOADDATA:
214  This->engine->thread.downloaded_kb = This->dl_previous_kb + progress / 1024;
215  if (This->engine->callback)
216  {
217  hr = IInstallEngineCallback_OnComponentProgress(This->engine->callback,
218  This->id, INSTALLSTATUS_DOWNLOADING, This->display, NULL, progress / 1024, This->dl_size);
219  }
220  break;
221 
222  case BINDSTATUS_CACHEFILENAMEAVAILABLE:
223  This->cache_file = strdupW(status_text);
224  if (!This->cache_file)
225  {
226  ERR("Failed to allocate memory for cache file\n");
227  hr = E_OUTOFMEMORY;
228  }
229  break;
230 
231  case BINDSTATUS_CONNECTING:
232  case BINDSTATUS_SENDINGREQUEST:
233  case BINDSTATUS_MIMETYPEAVAILABLE:
234  case BINDSTATUS_FINDINGRESOURCE:
235  break;
236 
237  default:
238  FIXME("Unsupported status %u\n", status);
239  }
240 
241  return hr;
242 }
HRESULT hr
Definition: shlfolder.c:183
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
ULONGLONG WINAPI GetTickCount64(VOID)
Definition: GetTickCount64.c:9
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107
cd_progress_ptr progress
Definition: cdjpeg.h:150
Definition: ps.c:97

◆ downloadcb_OnStartBinding()

static HRESULT WINAPI downloadcb_OnStartBinding ( IBindStatusCallback iface,
DWORD  reserved,
IBinding pbind 
)
static

Definition at line 171 of file inseng_main.c.

172 {
174 
175  TRACE("(%p)->(%u %p)\n", This, reserved, pbind);
176 
177  return S_OK;
178 }
r reserved
Definition: btrfs.c:2673
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107

◆ downloadcb_OnStopBinding()

static HRESULT WINAPI downloadcb_OnStopBinding ( IBindStatusCallback iface,
HRESULT  hresult,
LPCWSTR  szError 
)
static

Definition at line 244 of file inseng_main.c.

245 {
247 
248  TRACE("(%p)->(%08x %s)\n", This, hresult, debugstr_w(szError));
249 
250  if (FAILED(hresult))
251  {
252  This->hr = hresult;
253  goto done;
254  }
255 
256  if (!This->cache_file)
257  {
258  This->hr = E_FAIL;
259  goto done;
260  }
261 
262  if (CopyFileW(This->cache_file, This->file_name, FALSE))
263  This->hr = S_OK;
264  else
265  {
266  ERR("CopyFile failed: %u\n", GetLastError());
267  This->hr = E_FAIL;
268  }
269 
270 done:
271  SetEvent(This->event_done);
272  return S_OK;
273 }
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define E_FAIL
Definition: ddrawi.h:102
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107

◆ downloadcb_QueryInterface()

static HRESULT WINAPI downloadcb_QueryInterface ( IBindStatusCallback iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 117 of file inseng_main.c.

118 {
120 
122  {
123  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
124  *ppv = &This->IBindStatusCallback_iface;
125  }
126  else if (IsEqualGUID(&IID_IBindStatusCallback, riid))
127  {
128  TRACE("(%p)->(IID_IBindStatusCallback %p)\n", This, ppv);
129  *ppv = &This->IBindStatusCallback_iface;
130  }
131  else
132  {
133  FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv);
134  *ppv = NULL;
135  return E_NOINTERFACE;
136  }
137 
138  IUnknown_AddRef((IUnknown *)*ppv);
139  return S_OK;
140 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ downloadcb_Release()

static ULONG WINAPI downloadcb_Release ( IBindStatusCallback iface)
static

Definition at line 152 of file inseng_main.c.

153 {
156 
157  TRACE("(%p) ref = %d\n", This, ref);
158 
159  if (!ref)
160  {
161  heap_free(This->file_name);
162  heap_free(This->cache_file);
163 
164  IInstallEngine2_Release(&This->engine->IInstallEngine2_iface);
165  heap_free(This);
166  }
167 
168  return ref;
169 }
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static struct downloadcb * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
Definition: inseng_main.c:107
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ generate_moniker()

static HRESULT generate_moniker ( char baseurl,
char url,
DWORD  flags,
IMoniker **  moniker 
)
static

Definition at line 528 of file inseng_main.c.

529 {
530  WCHAR *urlW;
531  HRESULT hr;
532 
533  if (flags & URLF_RELATIVEURL)
534  {
535  char *combined;
536  if (!baseurl)
537  return E_FAIL;
538 
539  combined = combine_url(baseurl, url);
540  if (!combined) return E_OUTOFMEMORY;
541 
542  urlW = strAtoW(combined);
543  heap_free(combined);
544  if (!urlW) return E_OUTOFMEMORY;
545  }
546  else
547  {
548  urlW = strAtoW(url);
549  if (!urlW) return E_OUTOFMEMORY;
550  }
551 
552  hr = CreateURLMoniker(NULL, urlW, moniker);
553  heap_free(urlW);
554  return hr;
555 }
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
static char * combine_url(char *baseurl, char *url)
Definition: inseng_main.c:511
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
GLbitfield flags
Definition: glext.h:7161
static LPWSTR strAtoW(const char *str)
Definition: main.c:41
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
Definition: umon.c:732
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by download_url().

◆ get_next_component()

static HRESULT get_next_component ( IEnumCifComponents enum_comp,
DWORD  operation,
ICifComponent **  ret_comp 
)
static

Definition at line 448 of file inseng_main.c.

449 {
450  ICifComponent *comp;
451  HRESULT hr;
452 
453  hr = IEnumCifComponents_Reset(enum_comp);
454  if (FAILED(hr)) return hr;
455 
456  while (SUCCEEDED(IEnumCifComponents_Next(enum_comp, &comp)))
457  {
458  if (ICifComponent_GetInstallQueueState(comp) != ActionInstall)
459  continue;
460 
461  /* FIXME: handle install options and find out the default options*/
462  if (operation == OP_DOWNLOAD && ICifComponent_IsComponentDownloaded(comp) != S_FALSE)
463  continue;
464  if (operation == OP_INSTALL && ICifComponent_IsComponentInstalled(comp) != S_FALSE)
465  continue;
466 
467  *ret_comp = comp;
468  return S_OK;
469  }
470 
471  return S_FALSE;
472 }
HRESULT hr
Definition: shlfolder.c:183
#define S_FALSE
Definition: winerror.h:2357
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by thread_installation().

◆ get_url()

static HRESULT get_url ( ICifComponent comp,
int  index,
char **  url,
DWORD flags 
)
static

Definition at line 474 of file inseng_main.c.

475 {
476  char *url_temp = NULL;
477  int size = MAX_PATH / 2;
478  HRESULT hr;
479 
480  /* FIXME: should we add an internal get function to prevent this ugly code ? */
481 
482  /* check if there is an url with such an index */
483  hr = ICifComponent_GetUrl(comp, index, NULL, 0, flags);
484  if (FAILED(hr))
485  {
486  *url = NULL;
487  *flags = 0;
488  return S_OK;
489  }
490 
491  do
492  {
493  size *= 2;
494  heap_free(url_temp);
495  url_temp = heap_alloc(size);
496  if (!url_temp) return E_OUTOFMEMORY;
497 
498  hr = ICifComponent_GetUrl(comp, index, url_temp, size, flags);
499  if (FAILED(hr))
500  {
501  heap_free(url_temp);
502  return hr;
503  }
504  }
505  while (strlen(url_temp) == size-1);
506 
507  *url = url_temp;
508  return S_OK;
509 }
HRESULT hr
Definition: shlfolder.c:183
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
#define MAX_PATH
Definition: compat.h:26
GLbitfield flags
Definition: glext.h:7161
#define S_OK
Definition: intsafe.h:59
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by process_component().

◆ impl_from_IBindStatusCallback()

static struct downloadcb* impl_from_IBindStatusCallback ( IBindStatusCallback iface)
inlinestatic

Definition at line 107 of file inseng_main.c.

108 {
110 }
IBindStatusCallback IBindStatusCallback_iface
Definition: inseng_main.c:85
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)
Definition: Messaging.c:560

Referenced by downloadcb_AddRef(), downloadcb_GetBindInfo(), downloadcb_GetPriority(), downloadcb_OnDataAvailable(), downloadcb_OnLowResource(), downloadcb_OnObjectAvailable(), downloadcb_OnProgress(), downloadcb_OnStartBinding(), downloadcb_OnStopBinding(), downloadcb_QueryInterface(), and downloadcb_Release().

◆ impl_from_IInstallEngine2()

◆ impl_from_IInstallEngineTiming()

static InstallEngine* impl_from_IInstallEngineTiming ( IInstallEngineTiming iface)
inlinestatic

Definition at line 112 of file inseng_main.c.

113 {
114  return CONTAINING_RECORD(iface, InstallEngine, IInstallEngineTiming_iface);
115 }
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)
Definition: Messaging.c:560

Referenced by InstallEngineTiming_AddRef(), InstallEngineTiming_GetInstallProgress(), InstallEngineTiming_GetRates(), InstallEngineTiming_QueryInterface(), and InstallEngineTiming_Release().

◆ InstallEngine2_GetICifFile()

static HRESULT WINAPI InstallEngine2_GetICifFile ( IInstallEngine2 iface,
ICifFile **  cif_file 
)
static

Definition at line 1098 of file inseng_main.c.

1099 {
1101 
1102  TRACE("(%p)->(%p)\n", This, cif_file);
1103 
1104  if (!This->icif || !cif_file)
1105  return E_FAIL;
1106 
1107  ICifFile_AddRef(This->icif);
1108  *cif_file = This->icif;
1109  return S_OK;
1110 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define E_FAIL
Definition: ddrawi.h:102
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ InstallEngine2_SetLocalCif()

static HRESULT WINAPI InstallEngine2_SetLocalCif ( IInstallEngine2 iface,
const char cif 
)
static

Definition at line 1075 of file inseng_main.c.

1076 {
1078  HRESULT hr;
1079 
1080  TRACE("(%p)->(%s)\n", This, debugstr_a(cif));
1081 
1082  if (This->icif)
1083  ICifFile_Release(This->icif);
1084 
1085  set_status(This, ENGINESTATUS_LOADING);
1086 
1087  hr = GetICifFileFromFile(&This->icif, cif);
1088  if (SUCCEEDED(hr))
1089  set_status(This, ENGINESTATUS_READY);
1090  else
1091  {
1092  This->icif = NULL;
1093  set_status(This, ENGINESTATUS_NOTREADY);
1094  }
1095  return hr;
1096 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
static void set_status(InstallEngine *This, DWORD status)
Definition: inseng_main.c:407
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI GetICifFileFromFile(ICifFile **icif, const char *path)
Definition: icif.c:1732
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ InstallEngine_Abort()

static HRESULT WINAPI InstallEngine_Abort ( IInstallEngine2 iface,
DWORD  flags 
)
static

Definition at line 1048 of file inseng_main.c.

1049 {
1051 
1052  FIXME("(%p)->(%x): stub\n", This, flags);
1053 
1054  return E_NOTIMPL;
1055 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_AddRef()

static ULONG WINAPI InstallEngine_AddRef ( IInstallEngine2 iface)
static

Definition at line 377 of file inseng_main.c.

378 {
381 
382  TRACE("(%p) ref=%d\n", This, ref);
383 
384  return ref;
385 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ InstallEngine_DownloadComponents()

static HRESULT WINAPI InstallEngine_DownloadComponents ( IInstallEngine2 iface,
DWORD  flags 
)
static

Definition at line 829 of file inseng_main.c.

830 {
832 
833  TRACE("(%p)->(%x)\n", This, flags);
834 
835  /* The interface is not really threadsafe on windows, but we can at least prevent multiple installations */
836  if (InterlockedCompareExchange((LONG *)&This->status, ENGINESTATUS_INSTALLING, ENGINESTATUS_READY) != ENGINESTATUS_READY)
837  return E_FAIL;
838 
839  if (This->callback)
840  IInstallEngineCallback_OnEngineStatusChange(This->callback, ENGINESTATUS_INSTALLING, 0);
841 
843 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define InterlockedCompareExchange
Definition: interlocked.h:104
#define E_FAIL
Definition: ddrawi.h:102
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
static HRESULT start_installation(InstallEngine *This, DWORD operation, DWORD jobflags)
Definition: inseng_main.c:766

◆ InstallEngine_EnumDownloadIDs()

static HRESULT WINAPI InstallEngine_EnumDownloadIDs ( IInstallEngine2 iface,
UINT  index,
char **  id 
)
static

Definition at line 863 of file inseng_main.c.

864 {
867  ICifComponent *comp;
868  HRESULT hr;
869 
870  TRACE("(%p)->(%u %p)\n", This, index, id);
871 
872  if (!This->icif || !id)
873  return E_FAIL;
874 
875  hr = ICifFile_EnumComponents(This->icif, &enum_components, 0, NULL);
876  if (FAILED(hr)) return hr;
877 
878  for (;;)
879  {
880  hr = IEnumCifComponents_Next(enum_components, &comp);
881  if (FAILED(hr)) goto done;
882 
883  if (ICifComponent_GetInstallQueueState(comp) != ActionInstall)
884  continue;
885 
886  if (ICifComponent_IsComponentDownloaded(comp) != S_FALSE)
887  continue;
888 
889  if (index == 0)
890  {
891  char *id_src = component_get_id(comp);
892  *id = CoTaskMemAlloc(strlen(id_src) + 1);
893 
894  if (*id)
895  strcpy(*id, id_src);
896  else
897  hr = E_OUTOFMEMORY;
898  goto done;
899  }
900 
901  index--;
902  }
903 
904 done:
905  IEnumCifComponents_Release(enum_components);
906  return hr;
907 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
HRESULT hr
Definition: shlfolder.c:183
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static UINT enum_components(const WCHAR *usersid, DWORD ctx, DWORD index, DWORD *idx, WCHAR guid[39], MSIINSTALLCONTEXT *installed_ctx, LPWSTR sid, LPDWORD sid_len)
Definition: registry.c:1406
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
char * component_get_id(ICifComponent *iface)
Definition: icif.c:339
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

◆ InstallEngine_EnumInstallIDs()

static HRESULT WINAPI InstallEngine_EnumInstallIDs ( IInstallEngine2 iface,
UINT  index,
char **  id 
)
static

Definition at line 854 of file inseng_main.c.

855 {
857 
858  FIXME("(%p)->(%u %p): stub\n", This, index, id);
859 
860  return E_NOTIMPL;
861 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_GetDisplayName()

static HRESULT WINAPI InstallEngine_GetDisplayName ( IInstallEngine2 iface,
const char id,
const char name 
)
static

Definition at line 977 of file inseng_main.c.

978 {
980 
981  FIXME("(%p)->(%s %s): stub\n", This, debugstr_a(id), debugstr_a(name));
982 
983  return E_NOTIMPL;
984 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:36

◆ InstallEngine_GetEngineStatus()

static HRESULT WINAPI InstallEngine_GetEngineStatus ( IInstallEngine2 iface,
DWORD status 
)
static

Definition at line 807 of file inseng_main.c.

808 {
810 
811  TRACE("(%p)->(%p)\n", This, status);
812 
813  if (!status)
814  return E_FAIL;
815 
816  *status = This->status;
817  return S_OK;
818 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define E_FAIL
Definition: ddrawi.h:102
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
Definition: ps.c:97

◆ InstallEngine_GetSizes()

static HRESULT WINAPI InstallEngine_GetSizes ( IInstallEngine2 iface,
const char id,
COMPONENT_SIZES sizes 
)
static

Definition at line 959 of file inseng_main.c.

960 {
962 
963  FIXME("(%p)->(%s %p): stub\n", This, debugstr_a(id), sizes);
964 
965  return E_NOTIMPL;
966 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
static const struct @509 sizes[]
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_InstallComponents()

static HRESULT WINAPI InstallEngine_InstallComponents ( IInstallEngine2 iface,
DWORD  flags 
)
static

Definition at line 845 of file inseng_main.c.

846 {
848 
849  FIXME("(%p)->(%x): stub\n", This, flags);
850 
851  return E_NOTIMPL;
852 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_IsComponentInstalled()

static HRESULT WINAPI InstallEngine_IsComponentInstalled ( IInstallEngine2 iface,
const char id,
DWORD status 
)
static

Definition at line 909 of file inseng_main.c.

910 {
912 
913  FIXME("(%p)->(%s %p): stub\n", This, debugstr_a(id), status);
914 
915  return E_NOTIMPL;
916 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: ps.c:97

◆ InstallEngine_LaunchExtraCommand()

static HRESULT WINAPI InstallEngine_LaunchExtraCommand ( IInstallEngine2 iface,
const char inf_name,
const char section 
)
static

Definition at line 968 of file inseng_main.c.

969 {
971 
972  FIXME("(%p)->(%s %s): stub\n", This, debugstr_a(inf_name), debugstr_a(section));
973 
974  return E_NOTIMPL;
975 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
Definition: parser.c:55
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_QueryInterface()

static HRESULT WINAPI InstallEngine_QueryInterface ( IInstallEngine2 iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 351 of file inseng_main.c.

352 {
354 
355  if(IsEqualGUID(&IID_IUnknown, riid)) {
356  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
357  *ppv = &This->IInstallEngine2_iface;
358  }else if(IsEqualGUID(&IID_IInstallEngine, riid)) {
359  TRACE("(%p)->(IID_IInstallEngine %p)\n", This, ppv);
360  *ppv = &This->IInstallEngine2_iface;
361  }else if(IsEqualGUID(&IID_IInstallEngine2, riid)) {
362  TRACE("(%p)->(IID_IInstallEngine2 %p)\n", This, ppv);
363  *ppv = &This->IInstallEngine2_iface;
364  }else if(IsEqualGUID(&IID_IInstallEngineTiming, riid)) {
365  TRACE("(%p)->(IID_IInstallEngineTiming %p)\n", This, ppv);
366  *ppv = &This->IInstallEngineTiming_iface;
367  }else {
368  FIXME("(%p)->(%s %p) not found\n", This, debugstr_guid(riid), ppv);
369  *ppv = NULL;
370  return E_NOINTERFACE;
371  }
372 
373  IUnknown_AddRef((IUnknown *)*ppv);
374  return S_OK;
375 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ InstallEngine_RegisterInstallEngineCallback()

static HRESULT WINAPI InstallEngine_RegisterInstallEngineCallback ( IInstallEngine2 iface,
IInstallEngineCallback callback 
)
static

Definition at line 918 of file inseng_main.c.

919 {
921 
922  TRACE("(%p)->(%p)\n", This, callback);
923 
924  This->callback = callback;
925  return S_OK;
926 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ InstallEngine_Release()

static ULONG WINAPI InstallEngine_Release ( IInstallEngine2 iface)
static

Definition at line 387 of file inseng_main.c.

388 {
391 
392  TRACE("(%p) ref=%d\n", This, ref);
393 
394  if (!ref)
395  {
396  if (This->icif)
397  ICifFile_Release(This->icif);
398 
399  heap_free(This->baseurl);
400  heap_free(This->downloaddir);
401  heap_free(This);
402  }
403 
404  return ref;
405 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ InstallEngine_Resume()

static HRESULT WINAPI InstallEngine_Resume ( IInstallEngine2 iface)
static

Definition at line 1066 of file inseng_main.c.

1067 {
1069 
1070  FIXME("(%p): stub\n", This);
1071 
1072  return E_NOTIMPL;
1073 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_SetAction()

static HRESULT WINAPI InstallEngine_SetAction ( IInstallEngine2 iface,
const char id,
DWORD  action,
DWORD  priority 
)
static

Definition at line 938 of file inseng_main.c.

939 {
941  ICifComponent *comp;
942  HRESULT hr;
943 
944  TRACE("(%p)->(%s %u %u)\n", This, debugstr_a(id), action, priority);
945 
946  if (!This->icif)
947  return E_FAIL; /* FIXME: check error code */
948 
949  hr = ICifFile_FindComponent(This->icif, id, &comp);
950  if (FAILED(hr)) return hr;
951 
952  hr = ICifComponent_SetInstallQueueState(comp, action);
953  if (FAILED(hr)) return hr;
954 
955  hr = ICifComponent_SetCurrentPriority(comp, priority);
956  return hr;
957 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
const WCHAR * action
Definition: action.c:7783
static int priority
Definition: timer.c:163

◆ InstallEngine_SetBaseUrl()

static HRESULT WINAPI InstallEngine_SetBaseUrl ( IInstallEngine2 iface,
const char base_name 
)
static

Definition at line 986 of file inseng_main.c.

987 {
989 
990  TRACE("(%p)->(%s)\n", This, debugstr_a(base_name));
991 
992  if (This->baseurl)
993  heap_free(This->baseurl);
994 
995  This->baseurl = strdupA(base_name);
996  return This->baseurl ? S_OK : E_OUTOFMEMORY;
997 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define S_OK
Definition: intsafe.h:59
static LPSTR strdupA(LPCSTR str)
Definition: mimeole.c:482
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ InstallEngine_SetCifFile()

static HRESULT WINAPI InstallEngine_SetCifFile ( IInstallEngine2 iface,
const char cab_name,
const char cif_name 
)
static

Definition at line 820 of file inseng_main.c.

821 {
823 
824  FIXME("(%p)->(%s %s): stub\n", This, debugstr_a(cab_name), debugstr_a(cif_name));
825 
826  return E_NOTIMPL;
827 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_SetDownloadDir()

static HRESULT WINAPI InstallEngine_SetDownloadDir ( IInstallEngine2 iface,
const char download_dir 
)
static

Definition at line 999 of file inseng_main.c.

1000 {
1002 
1003  TRACE("(%p)->(%s)\n", This, debugstr_a(download_dir));
1004 
1005  if (This->downloaddir)
1006  heap_free(This->downloaddir);
1007 
1008  This->downloaddir = strdupA(download_dir);
1009  return This->downloaddir ? S_OK : E_OUTOFMEMORY;
1010 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define S_OK
Definition: intsafe.h:59
static LPSTR strdupA(LPCSTR str)
Definition: mimeole.c:482
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ InstallEngine_SetHWND()

static HRESULT WINAPI InstallEngine_SetHWND ( IInstallEngine2 iface,
HWND  hwnd 
)
static

Definition at line 1030 of file inseng_main.c.

1031 {
1033 
1034  FIXME("(%p)->(%p): stub\n", This, hwnd);
1035 
1036  return E_NOTIMPL;
1037 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_SetInstallDrive()

static HRESULT WINAPI InstallEngine_SetInstallDrive ( IInstallEngine2 iface,
char  drive 
)
static

Definition at line 1012 of file inseng_main.c.

1013 {
1015 
1016  FIXME("(%p)->(%c): stub\n", This, drive);
1017 
1018  return E_NOTIMPL;
1019 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_SetInstallOptions()

static HRESULT WINAPI InstallEngine_SetInstallOptions ( IInstallEngine2 iface,
DWORD  flags 
)
static

Definition at line 1021 of file inseng_main.c.

1022 {
1024 
1025  FIXME("(%p)->(%x): stub\n", This, flags);
1026 
1027  return E_NOTIMPL;
1028 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_SetIStream()

static HRESULT WINAPI InstallEngine_SetIStream ( IInstallEngine2 iface,
IStream stream 
)
static

Definition at line 1039 of file inseng_main.c.

1040 {
1042 
1043  FIXME("(%p)->(%p): stub\n", This, stream);
1044 
1045  return E_NOTIMPL;
1046 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
Definition: parse.h:22
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_Suspend()

static HRESULT WINAPI InstallEngine_Suspend ( IInstallEngine2 iface)
static

Definition at line 1057 of file inseng_main.c.

1058 {
1060 
1061  FIXME("(%p): stub\n", This);
1062 
1063  return E_NOTIMPL;
1064 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallEngine_UnregisterInstallEngineCallback()

static HRESULT WINAPI InstallEngine_UnregisterInstallEngineCallback ( IInstallEngine2 iface)
static

Definition at line 928 of file inseng_main.c.

929 {
931 
932  TRACE("(%p)\n", This);
933 
934  This->callback = NULL;
935  return S_OK;
936 }
static InstallEngine * impl_from_IInstallEngine2(IInstallEngine2 *iface)
Definition: inseng_main.c:102
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ InstallEngineCF_CreateInstance()

static HRESULT WINAPI InstallEngineCF_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1243 of file inseng_main.c.

1245 {
1247  HRESULT hres;
1248 
1249  TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
1250 
1251  engine = heap_alloc_zero(sizeof(*engine));
1252  if(!engine)
1253  return E_OUTOFMEMORY;
1254 
1257  engine->ref = 1;
1258  engine->status = ENGINESTATUS_NOTREADY;
1259 
1260  hres = IInstallEngine2_QueryInterface(&engine->IInstallEngine2_iface, riid, ppv);
1261  IInstallEngine2_Release(&engine->IInstallEngine2_iface);
1262  return hres;
1263 }
static const IInstallEngineTimingVtbl InstallEngineTimingVtbl
Definition: inseng_main.c:1198
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
IInstallEngine2 IInstallEngine2_iface
Definition: inseng_main.c:69
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
IInstallEngineTiming IInstallEngineTiming_iface
Definition: inseng_main.c:70
static const IInstallEngine2Vtbl InstallEngine2Vtbl
Definition: inseng_main.c:1112
InstallEngine * engine
Definition: inseng_main.c:97

◆ InstallEngineTiming_AddRef()

static ULONG WINAPI InstallEngineTiming_AddRef ( IInstallEngineTiming iface)
static

Definition at line 1149 of file inseng_main.c.

1150 {
1152  return IInstallEngine2_AddRef(&This->IInstallEngine2_iface);
1153 }
static InstallEngine * impl_from_IInstallEngineTiming(IInstallEngineTiming *iface)
Definition: inseng_main.c:112

◆ InstallEngineTiming_GetInstallProgress()

static HRESULT WINAPI InstallEngineTiming_GetInstallProgress ( IInstallEngineTiming iface,
INSTALLPROGRESS progress 
)
static

Definition at line 1173 of file inseng_main.c.

1174 {
1176  ULONGLONG elapsed;
1177  static int once;
1178 
1179  if (!once)
1180  FIXME("(%p)->(%p): semi-stub\n", This, progress);
1181  else
1182  TRACE("(%p)->(%p): semi-stub\n", This, progress);
1183 
1184  progress->dwDownloadKBRemaining = max(This->thread.download_size, This->thread.downloaded_kb) - This->thread.downloaded_kb;
1185 
1186  elapsed = GetTickCount64() - This->thread.download_start;
1187  if (This->thread.download_start && This->thread.downloaded_kb && elapsed > 100)
1188  progress->dwDownloadSecsRemaining = (progress->dwDownloadKBRemaining * elapsed) / (This->thread.downloaded_kb * 1000);
1189  else
1190  progress->dwDownloadSecsRemaining = -1;
1191 
1192  progress->dwInstallKBRemaining = 0;
1193  progress->dwInstallSecsRemaining = -1;
1194 
1195  return S_OK;
1196 }
#define max(a, b)
Definition: svc.c:63
ULONGLONG WINAPI GetTickCount64(VOID)
Definition: GetTickCount64.c:9
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
static InstallEngine * impl_from_IInstallEngineTiming(IInstallEngineTiming *iface)
Definition: inseng_main.c:112
uint64_t ULONGLONG
Definition: typedefs.h:65
#define S_OK
Definition: intsafe.h:59
cd_progress_ptr progress
Definition: cdjpeg.h:150

◆ InstallEngineTiming_GetRates()

static HRESULT WINAPI InstallEngineTiming_GetRates ( IInstallEngineTiming iface,
DWORD download,
DWORD install 
)
static

Definition at line 1161 of file inseng_main.c.

1162 {
1164 
1165  FIXME("(%p)->(%p, %p): stub\n", This, download, install);
1166 
1167  *download = 0;
1168  *install = 0;
1169 
1170  return S_OK;
1171 }
int install
Definition: msacm.c:1353
#define FIXME(fmt,...)
Definition: debug.h:110
static InstallEngine * impl_from_IInstallEngineTiming(IInstallEngineTiming *iface)
Definition: inseng_main.c:112
#define S_OK
Definition: intsafe.h:59

◆ InstallEngineTiming_QueryInterface()

static HRESULT WINAPI InstallEngineTiming_QueryInterface ( IInstallEngineTiming iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1143 of file inseng_main.c.

1144 {
1146  return IInstallEngine2_QueryInterface(&This->IInstallEngine2_iface, riid, ppv);
1147 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static InstallEngine * impl_from_IInstallEngineTiming(IInstallEngineTiming *iface)
Definition: inseng_main.c:112

◆ InstallEngineTiming_Release()

static ULONG WINAPI InstallEngineTiming_Release ( IInstallEngineTiming iface)
static

Definition at line 1155 of file inseng_main.c.

1156 {
1158  return IInstallEngine2_Release(&This->IInstallEngine2_iface);
1159 }
static InstallEngine * impl_from_IInstallEngineTiming(IInstallEngineTiming *iface)
Definition: inseng_main.c:112

◆ merge_path()

static char* merge_path ( char path1,
char path2 
)
static

Definition at line 557 of file inseng_main.c.

558 {
559  int len = strlen(path1) + strlen(path2) + 2;
560  char *combined = heap_alloc(len);
561 
562  if (!combined) return NULL;
563  strcpy(combined, path1);
564  strcat(combined, "\\");
565  strcat(combined, path2);
566 
567  return combined;
568 }
static const WCHAR path2[]
Definition: path.c:29
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR path1[]
Definition: path.c:28
GLenum GLsizei len
Definition: glext.h:6722
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by download_url().

◆ process_component()

static HRESULT process_component ( InstallEngine This,
ICifComponent comp 
)
static

Definition at line 659 of file inseng_main.c.

660 {
661  DWORD size_dl, size_install, phase;
662  char display[MAX_DISPLAYNAME_LENGTH+1];
663  char id[MAX_ID_LENGTH+1];
664  HRESULT hr;
665  int i;
666 
667  hr = ICifComponent_GetID(comp, id, sizeof(id));
668  if (FAILED(hr)) return hr;
669 
670  TRACE("processing component %s\n", debugstr_a(id));
671 
672  hr = ICifComponent_GetDescription(comp, display, sizeof(display));
673  if (FAILED(hr)) return hr;
674 
675  size_dl = (This->thread.operation == OP_DOWNLOAD) ? ICifComponent_GetDownloadSize(comp) : 0;
676  size_install = 0; /* (This->thread.operation == OP_INSTALL) ? ICifComponent_GetInstalledSize(comp) : 0; */
677 
678  if (This->callback)
679  {
680  IInstallEngineCallback_OnStartComponent(This->callback, id, size_dl, size_install, display);
681  IInstallEngineCallback_OnComponentProgress(This->callback, id, INSTALLSTATUS_INITIALIZING, display, NULL, 0, 0);
683  }
684 
686  if (FAILED(hr)) return hr;
687 
688  if (This->thread.operation == OP_DOWNLOAD)
689  {
690  for (i = 0;; i++)
691  {
692  DWORD flags;
693  char *url;
694 
696 
697  hr = get_url(comp, i, &url, &flags);
698  if (FAILED(hr)) goto done;
699  if (!url) break;
700 
701  TRACE("processing url %s\n", debugstr_a(url));
702 
703  hr = download_url(This, id, display, url, flags, size_dl);
704  heap_free(url);
705  if (FAILED(hr))
706  {
707  DWORD retry = 0;
708 
709  if (This->callback)
710  IInstallEngineCallback_OnEngineProblem(This->callback, ENGINEPROBLEM_DOWNLOADFAIL, &retry);
711  if (!retry) goto done;
712 
713  i--;
714  continue;
715  }
716 
718  /* FIXME: check trust */
719  IInstallEngineCallback_OnComponentProgress(This->callback, id, INSTALLSTATUS_CHECKINGTRUST, display, NULL, 0, 0);
720  }
721 
724  }
725  else
726  FIXME("Installation not yet implemented\n");
727 
728 done:
729  IInstallEngineCallback_OnStopComponent(This->callback, id, hr, phase, display, 0);
730  return hr;
731 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
static HRESULT get_url(ICifComponent *comp, int index, char **url, DWORD *flags)
Definition: inseng_main.c:474
void component_set_downloaded(ICifComponent *iface, BOOL value)
Definition: icif.c:325
int * display
Definition: x11stubs.c:12
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
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static HRESULT download_url(InstallEngine *This, char *id, char *display, char *url, DWORD flags, DWORD dl_size)
Definition: inseng_main.c:570
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
static HRESULT process_component_dependencies(InstallEngine *This, ICifComponent *comp)
Definition: inseng_main.c:640
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by thread_installation().

◆ process_component_dependencies()

static HRESULT process_component_dependencies ( InstallEngine This,
ICifComponent comp 
)
static

Definition at line 640 of file inseng_main.c.

641 {
642  char id[MAX_ID_LENGTH+1], type;
643  DWORD ver, build;
644  HRESULT hr;
645  int i;
646 
647  for (i = 0;; i++)
648  {
649  hr = ICifComponent_GetDependency(comp, i, id, sizeof(id), &type, &ver, &build);
650  if (SUCCEEDED(hr))
651  FIXME("Can't handle dependencies yet: %s\n", debugstr_a(id));
652  else
653  break;
654  }
655 
656  return S_OK;
657 }
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
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
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by process_component().

◆ set_status()

static void set_status ( InstallEngine This,
DWORD  status 
)
static

Definition at line 407 of file inseng_main.c.

408 {
409  This->status = status;
410 
411  if (This->callback)
412  IInstallEngineCallback_OnEngineStatusChange(This->callback, status, 0);
413 }
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by InstallEngine2_SetLocalCif(), and thread_installation().

◆ start_installation()

static HRESULT start_installation ( InstallEngine This,
DWORD  operation,
DWORD  jobflags 
)
static

Definition at line 766 of file inseng_main.c.

767 {
768  HANDLE thread;
769  HRESULT hr;
770 
771  This->thread.operation = operation;
772  This->thread.jobflags = jobflags;
773  This->thread.downloaded_kb = 0;
774  This->thread.download_start = 0;
775 
776  /* Windows sends the OnStartInstall event from a different thread,
777  * but OnStartInstall already contains the required download and install size.
778  * The only way to signal an error from the thread is to send an OnStopComponent /
779  * OnStopInstall signal which can only occur after OnStartInstall. We need to
780  * precompute the sizes here to be able inform the application about errors while
781  * calculating the required sizes. */
782 
783  hr = ICifFile_EnumComponents(This->icif, &This->thread.enum_comp, 0, NULL);
784  if (FAILED(hr)) return hr;
785 
786  hr = calc_sizes(This->thread.enum_comp, operation, &This->thread.download_size, &This->thread.install_size);
787  if (FAILED(hr)) goto error;
788 
789  IInstallEngine2_AddRef(&This->IInstallEngine2_iface);
790 
792  if (!thread)
793  {
794  IInstallEngine2_Release(&This->IInstallEngine2_iface);
795  hr = E_FAIL;
796  goto error;
797  }
798 
800  return S_OK;
801 
802 error:
803  IEnumCifComponents_Release(This->thread.enum_comp);
804  return hr;
805 }
#define CloseHandle
Definition: compat.h:398
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
#define E_FAIL
Definition: ddrawi.h:102
static HRESULT calc_sizes(IEnumCifComponents *enum_comp, DWORD operation, DWORD *size_download, DWORD *size_install)
Definition: inseng_main.c:415
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)
Definition: thread.c:111
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
static HANDLE thread
Definition: service.c:33
DWORD WINAPI thread_installation(LPVOID param)
Definition: inseng_main.c:733
#define S_OK
Definition: intsafe.h:59

Referenced by InstallEngine_DownloadComponents().

◆ thread_installation()

DWORD WINAPI thread_installation ( LPVOID  param)

Definition at line 733 of file inseng_main.c.

734 {
736  ICifComponent *comp;
737  HRESULT hr;
738 
739  if (This->callback)
740  IInstallEngineCallback_OnStartInstall(This->callback, This->thread.download_size, This->thread.install_size);
741 
742  for (;;)
743  {
744  hr = get_next_component(This->thread.enum_comp, This->thread.operation, &comp);
745  if (FAILED(hr)) break;
746  if (hr == S_FALSE)
747  {
748  hr = S_OK;
749  break;
750  }
751 
752  hr = process_component(This, comp);
753  if (FAILED(hr)) break;
754  }
755 
756  if (This->callback)
757  IInstallEngineCallback_OnStopInstall(This->callback, hr, NULL, 0);
758 
759  IEnumCifComponents_Release(This->thread.enum_comp);
760  IInstallEngine2_Release(&This->IInstallEngine2_iface);
761 
762  set_status(This, ENGINESTATUS_READY);
763  return 0;
764 }
static HRESULT process_component(InstallEngine *This, ICifComponent *comp)
Definition: inseng_main.c:659
static void set_status(InstallEngine *This, DWORD status)
Definition: inseng_main.c:407
HRESULT hr
Definition: shlfolder.c:183
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
GLfloat param
Definition: glext.h:5796
#define S_OK
Definition: intsafe.h:59
static HRESULT get_next_component(IEnumCifComponents *enum_comp, DWORD operation, ICifComponent **ret_comp)
Definition: inseng_main.c:448

Referenced by start_installation().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( inseng  )

Variable Documentation

◆ BindStatusCallbackVtbl

const IBindStatusCallbackVtbl BindStatusCallbackVtbl
static
Initial value:
=
{
}
static HRESULT WINAPI downloadcb_OnObjectAvailable(IBindStatusCallback *iface, REFIID riid, IUnknown *punk)
Definition: inseng_main.c:296
static ULONG WINAPI downloadcb_Release(IBindStatusCallback *iface)
Definition: inseng_main.c:152
static HRESULT WINAPI downloadcb_OnStartBinding(IBindStatusCallback *iface, DWORD reserved, IBinding *pbind)
Definition: inseng_main.c:171
static HRESULT WINAPI downloadcb_OnStopBinding(IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError)
Definition: inseng_main.c:244
static HRESULT WINAPI downloadcb_OnDataAvailable(IBindStatusCallback *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
Definition: inseng_main.c:286
static HRESULT WINAPI downloadcb_OnLowResource(IBindStatusCallback *iface, DWORD reserved)
Definition: inseng_main.c:189
static HRESULT WINAPI downloadcb_OnProgress(IBindStatusCallback *iface, ULONG progress, ULONG progress_max, ULONG status, const WCHAR *status_text)
Definition: inseng_main.c:198
static HRESULT WINAPI downloadcb_GetPriority(IBindStatusCallback *iface, LONG *priority)
Definition: inseng_main.c:180
static ULONG WINAPI downloadcb_AddRef(IBindStatusCallback *iface)
Definition: inseng_main.c:142
static HRESULT WINAPI downloadcb_QueryInterface(IBindStatusCallback *iface, REFIID riid, void **ppv)
Definition: inseng_main.c:117
static HRESULT WINAPI downloadcb_GetBindInfo(IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
Definition: inseng_main.c:275

Definition at line 306 of file inseng_main.c.

Referenced by downloadcb_create().

◆ InstallEngine2Vtbl

const IInstallEngine2Vtbl InstallEngine2Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI InstallEngine_GetSizes(IInstallEngine2 *iface, const char *id, COMPONENT_SIZES *sizes)
Definition: inseng_main.c:959
static HRESULT WINAPI InstallEngine_UnregisterInstallEngineCallback(IInstallEngine2 *iface)
Definition: inseng_main.c:928
static HRESULT WINAPI InstallEngine_RegisterInstallEngineCallback(IInstallEngine2 *iface, IInstallEngineCallback *callback)
Definition: inseng_main.c:918
static HRESULT WINAPI InstallEngine_SetHWND(IInstallEngine2 *iface, HWND hwnd)
Definition: inseng_main.c:1030
static HRESULT WINAPI InstallEngine_SetCifFile(IInstallEngine2 *iface, const char *cab_name, const char *cif_name)
Definition: inseng_main.c:820
static HRESULT WINAPI InstallEngine_Resume(IInstallEngine2 *iface)
Definition: inseng_main.c:1066
static ULONG WINAPI InstallEngine_AddRef(IInstallEngine2 *iface)
Definition: inseng_main.c:377
static HRESULT WINAPI InstallEngine_SetAction(IInstallEngine2 *iface, const char *id, DWORD action, DWORD priority)
Definition: inseng_main.c:938
static HRESULT WINAPI InstallEngine_SetInstallDrive(IInstallEngine2 *iface, char drive)
Definition: inseng_main.c:1012
static HRESULT WINAPI InstallEngine_SetIStream(IInstallEngine2 *iface, IStream *stream)
Definition: inseng_main.c:1039
static HRESULT WINAPI InstallEngine_SetDownloadDir(IInstallEngine2 *iface, const char *download_dir)
Definition: inseng_main.c:999
static HRESULT WINAPI InstallEngine_QueryInterface(IInstallEngine2 *iface, REFIID riid, void **ppv)
Definition: inseng_main.c:351
static HRESULT WINAPI InstallEngine_SetBaseUrl(IInstallEngine2 *iface, const char *base_name)
Definition: inseng_main.c:986
static HRESULT WINAPI InstallEngine_EnumDownloadIDs(IInstallEngine2 *iface, UINT index, char **id)
Definition: inseng_main.c:863
static HRESULT WINAPI InstallEngine_IsComponentInstalled(IInstallEngine2 *iface, const char *id, DWORD *status)
Definition: inseng_main.c:909
static HRESULT WINAPI InstallEngine_InstallComponents(IInstallEngine2 *iface, DWORD flags)
Definition: inseng_main.c:845
static HRESULT WINAPI InstallEngine_GetEngineStatus(IInstallEngine2 *iface, DWORD *status)
Definition: inseng_main.c:807
static HRESULT WINAPI InstallEngine_DownloadComponents(IInstallEngine2 *iface, DWORD flags)
Definition: inseng_main.c:829
static HRESULT WINAPI InstallEngine_Abort(IInstallEngine2 *iface, DWORD flags)
Definition: inseng_main.c:1048
static HRESULT WINAPI InstallEngine2_GetICifFile(IInstallEngine2 *iface, ICifFile **cif_file)
Definition: inseng_main.c:1098
static HRESULT WINAPI InstallEngine_SetInstallOptions(IInstallEngine2 *iface, DWORD flags)
Definition: inseng_main.c:1021
static ULONG WINAPI InstallEngine_Release(IInstallEngine2 *iface)
Definition: inseng_main.c:387
static HRESULT WINAPI InstallEngine2_SetLocalCif(IInstallEngine2 *iface, const char *cif)
Definition: inseng_main.c:1075
static HRESULT WINAPI InstallEngine_EnumInstallIDs(IInstallEngine2 *iface, UINT index, char **id)
Definition: inseng_main.c:854
static HRESULT WINAPI InstallEngine_Suspend(IInstallEngine2 *iface)
Definition: inseng_main.c:1057
static HRESULT WINAPI InstallEngine_GetDisplayName(IInstallEngine2 *iface, const char *id, const char *name)
Definition: inseng_main.c:977
static HRESULT WINAPI InstallEngine_LaunchExtraCommand(IInstallEngine2 *iface, const char *inf_name, const char *section)
Definition: inseng_main.c:968

Definition at line 1112 of file inseng_main.c.

Referenced by InstallEngineCF_CreateInstance().

◆ InstallEngineCF

IClassFactory InstallEngineCF = { &InstallEngineCFVtbl }
static

Definition at line 1273 of file inseng_main.c.

Referenced by DllGetClassObject().

◆ InstallEngineCFVtbl

const IClassFactoryVtbl InstallEngineCFVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
Definition: inseng_main.c:1238
static HRESULT WINAPI InstallEngineCF_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: inseng_main.c:1243
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: inseng_main.c:1228
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: inseng_main.c:1233
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: inseng_main.c:1207

Definition at line 1265 of file inseng_main.c.

◆ InstallEngineTimingVtbl

const IInstallEngineTimingVtbl InstallEngineTimingVtbl
static
Initial value:
=
{
}
static ULONG WINAPI InstallEngineTiming_Release(IInstallEngineTiming *iface)
Definition: inseng_main.c:1155
static HRESULT WINAPI InstallEngineTiming_QueryInterface(IInstallEngineTiming *iface, REFIID riid, void **ppv)
Definition: inseng_main.c:1143
static HRESULT WINAPI InstallEngineTiming_GetRates(IInstallEngineTiming *iface, DWORD *download, DWORD *install)
Definition: inseng_main.c:1161
static HRESULT WINAPI InstallEngineTiming_GetInstallProgress(IInstallEngineTiming *iface, INSTALLPROGRESS *progress)
Definition: inseng_main.c:1173
static ULONG WINAPI InstallEngineTiming_AddRef(IInstallEngineTiming *iface)
Definition: inseng_main.c:1149

Definition at line 1198 of file inseng_main.c.

Referenced by InstallEngineCF_CreateInstance().

◆ instance

HINSTANCE instance
static

Definition at line 47 of file inseng_main.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().