ReactOS  0.4.14-dev-583-g2a1ba2c
addons.c File Reference
#include "appwiz.h"
#include <stdio.h>
#include <msi.h>
Include dependency graph for addons.c:

Go to the source code of this file.

Classes

struct  addon_info_t
 
struct  SHA_CTX
 

Macros

#define GECKO_VERSION   "2.40"
 
#define ARCH_STRING   ""
 
#define GECKO_SHA   "???"
 

Typedefs

typedef struct SHA_CTXPSHA_CTX
 

Enumerations

enum  install_res { INSTALL_OK = 0, INSTALL_FAILED, INSTALL_NEXT }
 

Functions

void WINAPI A_SHAInit (PSHA_CTX)
 
void WINAPI A_SHAUpdate (PSHA_CTX, const unsigned char *, UINT)
 
void WINAPI A_SHAFinal (PSHA_CTX, PULONG)
 
static BOOL sha_check (const WCHAR *file_name)
 
static void set_status (DWORD id)
 
static enum install_res install_file (const WCHAR *file_name)
 
static enum install_res install_from_unix_file (const char *dir, const char *subdir, const char *file_name)
 
static enum install_res install_from_registered_dir (void)
 
static HRESULT WINAPI InstallCallback_QueryInterface (IBindStatusCallback *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InstallCallback_AddRef (IBindStatusCallback *iface)
 
static ULONG WINAPI InstallCallback_Release (IBindStatusCallback *iface)
 
static HRESULT WINAPI InstallCallback_OnStartBinding (IBindStatusCallback *iface, DWORD dwReserved, IBinding *pib)
 
static HRESULT WINAPI InstallCallback_GetPriority (IBindStatusCallback *iface, LONG *pnPriority)
 
static HRESULT WINAPI InstallCallback_OnLowResource (IBindStatusCallback *iface, DWORD dwReserved)
 
static HRESULT WINAPI InstallCallback_OnProgress (IBindStatusCallback *iface, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
 
static HRESULT WINAPI InstallCallback_OnStopBinding (IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError)
 
static HRESULT WINAPI InstallCallback_GetBindInfo (IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
 
static HRESULT WINAPI InstallCallback_OnDataAvailable (IBindStatusCallback *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
 
static HRESULT WINAPI InstallCallback_OnObjectAvailable (IBindStatusCallback *iface, REFIID riid, IUnknown *punk)
 
static DWORD WINAPI download_proc (PVOID arg)
 
static INT_PTR CALLBACK installer_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
BOOL install_addon (addon_t addon_type, HWND hwnd_parent)
 

Variables

static const addon_info_t addons_info []
 
static const addon_info_taddon
 
static HWND install_dialog = NULL
 
static IBindingdownload_binding
 
static WCHAR GeckoUrl [] = L"https://svn.reactos.org/amine/wine_gecko-2.40-x86.msi"
 
static const CHAR mshtml_keyA []
 
static const IBindStatusCallbackVtbl InstallCallbackVtbl
 
static IBindStatusCallback InstallCallback = { &InstallCallbackVtbl }
 

Macro Definition Documentation

◆ ARCH_STRING

#define ARCH_STRING   ""

Definition at line 35 of file addons.c.

◆ GECKO_SHA

#define GECKO_SHA   "???"

Definition at line 36 of file addons.c.

◆ GECKO_VERSION

#define GECKO_VERSION   "2.40"

Definition at line 29 of file addons.c.

Typedef Documentation

◆ PSHA_CTX

typedef struct SHA_CTX * PSHA_CTX

Enumeration Type Documentation

◆ install_res

Enumerator
INSTALL_OK 
INSTALL_FAILED 
INSTALL_NEXT 

Definition at line 130 of file addons.c.

130  {
131  INSTALL_OK = 0,
133  INSTALL_NEXT,
134 };

Function Documentation

◆ A_SHAFinal()

void WINAPI A_SHAFinal ( PSHA_CTX  ,
PULONG   
)

Definition at line 171 of file sha1.c.

172 {
173  INT Pad, Index;
174  UCHAR Buffer[72];
175  ULONG *Count;
176  ULONG BufferContentSize, LengthHi, LengthLo;
177 
178  BufferContentSize = Context->Count[1] & 63;
179  if (BufferContentSize >= 56)
180  Pad = 56 + 64 - BufferContentSize;
181  else
182  Pad = 56 - BufferContentSize;
183 
184  LengthHi = (Context->Count[0] << 3) | (Context->Count[1] >> (32 - 3));
185  LengthLo = (Context->Count[1] << 3);
186 
187  memset(Buffer + 1, 0, Pad - 1);
188  Buffer[0] = 0x80;
189  Count = (ULONG*)(Buffer + Pad);
190  Count[0] = DWORD2BE(LengthHi);
191  Count[1] = DWORD2BE(LengthLo);
192  A_SHAUpdate(Context, Buffer, Pad + 8);
193 
194  for (Index = 0; Index < 5; Index++)
195  Result[Index] = DWORD2BE(Context->State[Index]);
196 
198 }
char * Pad(char *Str, char PadChar, ULONG Length)
Definition: main.cxx:29
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
int32_t INT
Definition: typedefs.h:56
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
Definition: bufpool.h:45
VOID NTAPI A_SHAUpdate(PSHA_CTX Context, const unsigned char *Buffer, ULONG BufferSize)
Definition: sha1.c:128
static const UCHAR Index[8]
Definition: usbohci.c:18
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID NTAPI A_SHAInit(PSHA_CTX Context)
Definition: sha1.c:102
#define DWORD2BE(x)
Definition: sha1.c:26
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39

Referenced by sha_check(), and VerifyInteg().

◆ A_SHAInit()

void WINAPI A_SHAInit ( PSHA_CTX  )

Definition at line 102 of file sha1.c.

103 {
104  /* SHA1 initialization constants */
105  Context->State[0] = 0x67452301;
106  Context->State[1] = 0xEFCDAB89;
107  Context->State[2] = 0x98BADCFE;
108  Context->State[3] = 0x10325476;
109  Context->State[4] = 0xC3D2E1F0;
110  Context->Count[0] =
111  Context->Count[1] = 0;
112 }

Referenced by sha_check(), and VerifyInteg().

◆ A_SHAUpdate()

void WINAPI A_SHAUpdate ( PSHA_CTX  ,
const unsigned char ,
UINT   
)

Definition at line 128 of file sha1.c.

129 {
130  ULONG BufferContentSize;
131 
132  BufferContentSize = Context->Count[1] & 63;
133  Context->Count[1] += BufferSize;
134  if (Context->Count[1] < BufferSize)
135  Context->Count[0]++;
136  Context->Count[0] += (BufferSize >> 29);
137 
138  if (BufferContentSize + BufferSize < 64)
139  {
140  memcpy(&Context->Buffer[BufferContentSize], Buffer,
141  BufferSize);
142  }
143  else
144  {
145  while (BufferContentSize + BufferSize >= 64)
146  {
147  memcpy(Context->Buffer + BufferContentSize, Buffer,
148  64 - BufferContentSize);
149  Buffer += 64 - BufferContentSize;
150  BufferSize -= 64 - BufferContentSize;
151  SHA1Transform(Context->State, Context->Buffer);
152  BufferContentSize = 0;
153  }
154  memcpy(Context->Buffer + BufferContentSize, Buffer, BufferSize);
155  }
156 }
static void SHA1Transform(ULONG State[5], UCHAR Buffer[64])
Definition: sha1.c:42
Definition: bufpool.h:45
#define BufferSize
Definition: classpnp.h:419
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int ULONG
Definition: retypes.h:1

Referenced by sha_check(), and VerifyInteg().

◆ download_proc()

static DWORD WINAPI download_proc ( PVOID  arg)
static

Definition at line 352 of file addons.c.

353 {
354  WCHAR message[256];
355  WCHAR tmp_dir[MAX_PATH], tmp_file[MAX_PATH];
356  HRESULT hres;
357 
358  GetTempPathW(sizeof(tmp_dir)/sizeof(WCHAR), tmp_dir);
359  GetTempFileNameW(tmp_dir, NULL, 0, tmp_file);
360 
361  TRACE("using temp file %s\n", debugstr_w(tmp_file));
362 
364  if(FAILED(hres)) {
365  if (LoadStringW(hApplet, IDS_DWL_FAILED, message, sizeof(message) / sizeof(WCHAR))) {
366  /* If the user aborted the download, DO NOT display the message box */
367  if (hres == E_ABORT) {
368  TRACE("Downloading of Gecko package aborted!\n");
369  } else {
371  }
372  }
373  ERR("URLDownloadToFile failed: %08x\n", hres);
374  } else {
375  if(sha_check(tmp_file)) {
376  install_file(tmp_file);
377  }else {
378  if(LoadStringW(hApplet, IDS_INVALID_SHA, message, sizeof(message)/sizeof(WCHAR))) {
380  }
381  }
382  }
383 
384  DeleteFileW(tmp_file);
386  return 0;
387 }
Definition: tftpd.h:59
HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB)
Definition: download.c:427
static enum install_res install_file(const WCHAR *file_name)
Definition: addons.c:136
static HWND install_dialog
Definition: addons.c:61
static WCHAR GeckoUrl[]
Definition: addons.c:64
HINSTANCE hApplet
Definition: access.c:17
#define IDS_INVALID_SHA
Definition: resource.h:34
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2079
#define debugstr_w
Definition: kernel32.h:32
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
static BOOL sha_check(const WCHAR *file_name)
Definition: addons.c:79
#define MB_ICONERROR
Definition: winuser.h:781
#define E_ABORT
Definition: winerror.h:2366
#define ERR(fmt,...)
Definition: debug.h:109
#define IDS_DWL_FAILED
Definition: resource.h:35

Referenced by installer_proc().

◆ install_addon()

BOOL install_addon ( addon_t  addon_type,
HWND  hwnd_parent 
)

Definition at line 422 of file addons.c.

423 {
424 
425  if(!*ARCH_STRING)
426  return FALSE;
427 
428  addon = addons_info + addon_type;
429 
430  /*
431  * Try to find addon .msi file in following order:
432  * - directory stored in $dir_config_key value of HKCU/Wine/Software/$config_key key
433  * - download the package
434  */
437 
438  return TRUE;
439 }
#define TRUE
Definition: types.h:120
HINSTANCE hApplet
Definition: access.c:17
LPCWSTR dialog_template
Definition: addons.c:45
static INT_PTR CALLBACK installer_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: addons.c:389
static HWND hwnd_parent
Definition: dce.c:36
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4374
static const addon_info_t * addon
Definition: addons.c:59
static const addon_info_t addons_info[]
Definition: addons.c:48
#define ARCH_STRING
Definition: addons.c:35
static enum install_res install_from_registered_dir(void)
Definition: addons.c:199

Referenced by start_params().

◆ install_file()

static enum install_res install_file ( const WCHAR file_name)
static

Definition at line 136 of file addons.c.

137 {
138  ULONG res;
139 
141  if(res != ERROR_SUCCESS) {
142  ERR("MsiInstallProduct failed: %u\n", res);
143  return INSTALL_FAILED;
144  }
145 
146  return INSTALL_OK;
147 }
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
Definition: msi.c:235
smooth NULL
Definition: ftsmooth.c:416
#define ERR(fmt,...)
Definition: debug.h:109
static LPCWSTR file_name
Definition: protocol.c:147
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1

Referenced by download_proc(), and install_from_unix_file().

◆ install_from_registered_dir()

static enum install_res install_from_registered_dir ( void  )
static

Definition at line 199 of file addons.c.

200 {
201  char *package_dir;
202  DWORD res, type, size = MAX_PATH;
203  enum install_res ret;
204 
205  package_dir = heap_alloc(size + sizeof(addon->file_name));
206 
207  res = RegGetValueA(HKEY_CURRENT_USER, mshtml_keyA, "GeckoCabDir", RRF_RT_ANY, &type, (PBYTE)package_dir, &size);
208  if(res == ERROR_MORE_DATA) {
209  package_dir = heap_realloc(package_dir, size + sizeof(addon->file_name));
210  res = RegGetValueA(HKEY_CURRENT_USER, mshtml_keyA, "GeckoCabDir", RRF_RT_ANY, &type, (PBYTE)package_dir, &size);
211  }
212 
213  if(res != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ)) {
214  heap_free(package_dir);
215  return INSTALL_FAILED;
216  }
217 
218  if (type == REG_EXPAND_SZ)
219  {
220  size = ExpandEnvironmentStringsA(package_dir, NULL, 0);
221  if (size)
222  {
223  char* buf = heap_alloc(size + sizeof(addon->file_name));
224  ExpandEnvironmentStringsA(package_dir, buf, size);
225  heap_free(package_dir);
226  package_dir = buf;
227  }
228  }
229 
230  TRACE("Trying %s/%s\n", debugstr_a(package_dir), debugstr_a(addon->file_name));
231 
232  ret = install_from_unix_file(package_dir, "", addon->file_name);
233 
234  heap_free(package_dir);
235  return ret;
236 }
static enum install_res install_from_unix_file(const char *dir, const char *subdir, const char *file_name)
Definition: addons.c:149
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define HKEY_CURRENT_USER
Definition: winreg.h:11
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const char * file_name
Definition: addons.c:41
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI ExpandEnvironmentStringsA(IN LPCSTR lpSrc, IN LPSTR lpDst, IN DWORD nSize)
Definition: environ.c:399
LSTATUS WINAPI RegGetValueA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:2071
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define debugstr_a
Definition: kernel32.h:31
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
static const addon_info_t * addon
Definition: addons.c:59
static const CHAR mshtml_keyA[]
Definition: addons.c:194
GLuint res
Definition: glext.h:9613
#define RRF_RT_ANY
Definition: winreg.h:64
install_res
Definition: addons.c:130
BYTE * PBYTE
Definition: pedump.c:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define REG_SZ
Definition: layer.c:22

Referenced by install_addon().

◆ install_from_unix_file()

static enum install_res install_from_unix_file ( const char dir,
const char subdir,
const char file_name 
)
static

Definition at line 149 of file addons.c.

150 {
151  LPWSTR dos_file_name;
152  char *file_path;
153  int fd, len;
154  enum install_res ret;
155  UINT res;
156 
157  len = strlen(dir);
159  if(!file_path)
160  return INSTALL_FAILED;
161 
162  memcpy(file_path, dir, len);
163  if(len && file_path[len-1] != '/' && file_path[len-1] != '\\')
164  file_path[len++] = '/';
165  if(*subdir) {
166  strcpy(file_path+len, subdir);
167  len += strlen(subdir);
168  file_path[len++] = '/';
169  }
171 
173  if(fd == -1) {
174  TRACE("%s not found\n", debugstr_a(file_path));
176  return INSTALL_NEXT;
177  }
178 
179  _close(fd);
180 
181  WARN("Could not get wine_get_dos_file_name function, calling install_cab directly.\n");
182  res = MultiByteToWideChar( CP_ACP, 0, file_path, -1, 0, 0);
183  dos_file_name = heap_alloc (res*sizeof(WCHAR));
184  MultiByteToWideChar( CP_ACP, 0, file_path, -1, dos_file_name, res);
185 
187 
188  ret = install_file(dos_file_name);
189 
190  heap_free(dos_file_name);
191  return ret;
192 }
static enum install_res install_file(const WCHAR *file_name)
Definition: addons.c:136
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:99
#define WARN(fmt,...)
Definition: debug.h:111
static int fd
Definition: io.c:51
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
unsigned int dir
Definition: maze.c:112
_Check_return_opt_ _CRTIMP int __cdecl _close(_In_ int _FileHandle)
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
_CRTIMP int __cdecl _open(const char *_Filename, int _OpenFlag,...)
Definition: file.c:2001
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
static LPCWSTR file_name
Definition: protocol.c:147
GLuint res
Definition: glext.h:9613
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
WCHAR * LPWSTR
Definition: xmlstorage.h:184
install_res
Definition: addons.c:130
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
TCHAR file_path[MAX_PATH]
Definition: sndrec32.cpp:57
#define O_RDONLY
Definition: acwin.h:108

Referenced by install_from_registered_dir().

◆ InstallCallback_AddRef()

static ULONG WINAPI InstallCallback_AddRef ( IBindStatusCallback iface)
static

Definition at line 249 of file addons.c.

250 {
251  return 2;
252 }

◆ InstallCallback_GetBindInfo()

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

Definition at line 314 of file addons.c.

316 {
317  /* FIXME */
318  *grfBINDF = 0;
319  return S_OK;
320 }
#define S_OK
Definition: intsafe.h:59

◆ InstallCallback_GetPriority()

static HRESULT WINAPI InstallCallback_GetPriority ( IBindStatusCallback iface,
LONG pnPriority 
)
static

Definition at line 269 of file addons.c.

271 {
272  return E_NOTIMPL;
273 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallCallback_OnDataAvailable()

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

Definition at line 322 of file addons.c.

324 {
325  ERR("\n");
326  return E_NOTIMPL;
327 }
#define ERR(fmt,...)
Definition: debug.h:109
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallCallback_OnLowResource()

static HRESULT WINAPI InstallCallback_OnLowResource ( IBindStatusCallback iface,
DWORD  dwReserved 
)
static

Definition at line 275 of file addons.c.

277 {
278  return E_NOTIMPL;
279 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallCallback_OnObjectAvailable()

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

Definition at line 329 of file addons.c.

331 {
332  ERR("\n");
333  return E_NOTIMPL;
334 }
#define ERR(fmt,...)
Definition: debug.h:109
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InstallCallback_OnProgress()

static HRESULT WINAPI InstallCallback_OnProgress ( IBindStatusCallback iface,
ULONG  ulProgress,
ULONG  ulProgressMax,
ULONG  ulStatusCode,
LPCWSTR  szStatusText 
)
static

Definition at line 281 of file addons.c.

283 {
285 
286  if(ulProgressMax)
287  SendMessageW(progress, PBM_SETRANGE32, 0, ulProgressMax);
288  if(ulProgress)
289  SendMessageW(progress, PBM_SETPOS, ulProgress, 0);
290 
291  return S_OK;
292 }
#define PBM_SETRANGE32
Definition: commctrl.h:2184
static HWND install_dialog
Definition: addons.c:61
#define PBM_SETPOS
Definition: commctrl.h:2180
#define ID_DWL_PROGRESS
Definition: resource.h:45
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define S_OK
Definition: intsafe.h:59
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
cd_progress_ptr progress
Definition: cdjpeg.h:150

◆ InstallCallback_OnStartBinding()

static HRESULT WINAPI InstallCallback_OnStartBinding ( IBindStatusCallback iface,
DWORD  dwReserved,
IBinding pib 
)
static

Definition at line 259 of file addons.c.

261 {
263  IBinding_AddRef(pib);
264  download_binding = pib;
265 
266  return S_OK;
267 }
static IBinding * download_binding
Definition: addons.c:62
static void set_status(DWORD id)
Definition: addons.c:121
#define S_OK
Definition: intsafe.h:59
#define IDS_DOWNLOADING
Definition: resource.h:32

◆ InstallCallback_OnStopBinding()

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

Definition at line 294 of file addons.c.

296 {
297  if(download_binding) {
298  IBinding_Release(download_binding);
300  }
301 
302  if(FAILED(hresult)) {
303  if(hresult == E_ABORT)
304  TRACE("Binding aborted\n");
305  else
306  ERR("Binding failed %08x\n", hresult);
307  return S_OK;
308  }
309 
311  return S_OK;
312 }
static IBinding * download_binding
Definition: addons.c:62
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static void set_status(DWORD id)
Definition: addons.c:121
#define E_ABORT
Definition: winerror.h:2366
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
#define IDS_INSTALLING
Definition: resource.h:33

◆ InstallCallback_QueryInterface()

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

Definition at line 238 of file addons.c.

240 {
241  if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IBindStatusCallback, riid)) {
242  *ppv = iface;
243  return S_OK;
244  }
245 
246  return E_INVALIDARG;
247 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_INVALIDARG
Definition: ddrawi.h:101
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ InstallCallback_Release()

static ULONG WINAPI InstallCallback_Release ( IBindStatusCallback iface)
static

Definition at line 254 of file addons.c.

255 {
256  return 1;
257 }

◆ installer_proc()

static INT_PTR CALLBACK installer_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 389 of file addons.c.

390 {
391  switch(msg) {
392  case WM_INITDIALOG:
395  return TRUE;
396 
397  case WM_NOTIFY:
398  break;
399 
400  case WM_COMMAND:
401  switch(wParam) {
402  case IDCANCEL:
403  if(download_binding) {
404  IBinding_Abort(download_binding);
405  }
406  else {
407  EndDialog(hwnd, 0);
408  }
409  return FALSE;
410 
411  case ID_DWL_INSTALL:
415  return FALSE;
416  }
417  }
418 
419  return FALSE;
420 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
static HWND install_dialog
Definition: addons.c:61
#define SW_HIDE
Definition: winuser.h:762
#define ID_DWL_INSTALL
Definition: resource.h:46
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static IBinding * download_binding
Definition: addons.c:62
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
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:136
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOW
Definition: winuser.h:769
#define ID_DWL_PROGRESS
Definition: resource.h:45
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define msg(x)
Definition: auth_time.c:54
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
#define WM_NOTIFY
Definition: richedit.h:61
static DWORD WINAPI download_proc(PVOID arg)
Definition: addons.c:352

Referenced by install_addon().

◆ set_status()

static void set_status ( DWORD  id)
static

Definition at line 121 of file addons.c.

122 {
124  WCHAR buf[64];
125 
126  LoadStringW(hApplet, id, buf, sizeof(buf)/sizeof(WCHAR));
128 }
static HWND install_dialog
Definition: addons.c:61
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
HINSTANCE hApplet
Definition: access.c:17
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define ID_DWL_STATUS
Definition: resource.h:47
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1599
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: ps.c:97

Referenced by InstallCallback_OnStartBinding(), and InstallCallback_OnStopBinding().

◆ sha_check()

static BOOL sha_check ( const WCHAR file_name)
static

Definition at line 79 of file addons.c.

80 {
81  const unsigned char *file_map;
82  HANDLE file, map;
83  ULONG sha[5];
84  char buf[2*sizeof(sha)+1];
85  SHA_CTX ctx;
86  DWORD size, i;
87 
90  return FALSE;
91 
93 
96  if(!map)
97  return FALSE;
98 
99  file_map = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
100  CloseHandle(map);
101  if(!file_map)
102  return FALSE;
103 
104  A_SHAInit(&ctx);
105  A_SHAUpdate(&ctx, file_map, size);
106  A_SHAFinal(&ctx, sha);
107 
108  UnmapViewOfFile(file_map);
109 
110  for(i=0; i < sizeof(sha); i++)
111  sprintf(buf + i*2, "%02x", *((unsigned char*)sha+i));
112 
113  if(strcmp(buf, addon->sha)) {
114  WARN("Got %s, expected %s\n", buf, addon->sha);
115  return FALSE;
116  }
117 
118  return TRUE;
119 }
static const WCHAR sha[]
Definition: oid.c:1218
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
void WINAPI A_SHAUpdate(PSHA_CTX, const unsigned char *, UINT)
Definition: sha1.c:128
#define MapViewOfFile
Definition: compat.h:410
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define WARN(fmt,...)
Definition: debug.h:111
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
#define sprintf(buf, format,...)
Definition: sprintf.c:55
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
Definition: addons.c:68
smooth NULL
Definition: ftsmooth.c:416
#define FILE_MAP_READ
Definition: compat.h:435
#define OPEN_EXISTING
Definition: compat.h:434
void WINAPI A_SHAInit(PSHA_CTX)
Definition: sha1.c:102
GLsizeiptr size
Definition: glext.h:5919
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:409
const char file[]
Definition: icontest.c:11
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
Definition: _map.h:44
#define GENERIC_READ
Definition: compat.h:124
void WINAPI A_SHAFinal(PSHA_CTX, PULONG)
Definition: sha1.c:171
static const addon_info_t * addon
Definition: addons.c:59
#define PAGE_READONLY
Definition: compat.h:127
static LPCWSTR file_name
Definition: protocol.c:147
#define CreateFileW
Definition: compat.h:408
unsigned int ULONG
Definition: retypes.h:1
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
const char * sha
Definition: addons.c:42
#define UnmapViewOfFile
Definition: compat.h:411
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 GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum map
Definition: glfuncs.h:262
Definition: fci.c:126

Referenced by download_proc().

Variable Documentation

◆ addon

const addon_info_t* addon
static

Definition at line 59 of file addons.c.

Referenced by do_read(), install_addon(), install_from_registered_dir(), and sha_check().

◆ addons_info

const addon_info_t addons_info[]
static
Initial value:
= {
{
"wine_gecko-" GECKO_VERSION "-" ARCH_STRING ".msi",
"MSHTML",
"GeckoCabDir",
}
}
#define GECKO_SHA
Definition: addons.c:36
#define GECKO_VERSION
Definition: addons.c:29
#define ARCH_STRING
Definition: addons.c:35

Definition at line 48 of file addons.c.

Referenced by install_addon().

◆ download_binding

IBinding* download_binding
static

◆ GeckoUrl

WCHAR GeckoUrl[] = L"https://svn.reactos.org/amine/wine_gecko-2.40-x86.msi"
static

Definition at line 64 of file addons.c.

Referenced by download_proc().

◆ install_dialog

HWND install_dialog = NULL
static

Definition at line 61 of file addons.c.

Referenced by download_proc(), InstallCallback_OnProgress(), installer_proc(), and set_status().

◆ InstallCallback

Definition at line 350 of file addons.c.

◆ InstallCallbackVtbl

const IBindStatusCallbackVtbl InstallCallbackVtbl
static
Initial value:
= {
}
static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError)
Definition: addons.c:294
static HRESULT WINAPI InstallCallback_OnProgress(IBindStatusCallback *iface, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
Definition: addons.c:281
static HRESULT WINAPI InstallCallback_OnLowResource(IBindStatusCallback *iface, DWORD dwReserved)
Definition: addons.c:275
static HRESULT WINAPI InstallCallback_OnObjectAvailable(IBindStatusCallback *iface, REFIID riid, IUnknown *punk)
Definition: addons.c:329
static ULONG WINAPI InstallCallback_Release(IBindStatusCallback *iface)
Definition: addons.c:254
static HRESULT WINAPI InstallCallback_GetPriority(IBindStatusCallback *iface, LONG *pnPriority)
Definition: addons.c:269
static HRESULT WINAPI InstallCallback_OnDataAvailable(IBindStatusCallback *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
Definition: addons.c:322
static HRESULT WINAPI InstallCallback_OnStartBinding(IBindStatusCallback *iface, DWORD dwReserved, IBinding *pib)
Definition: addons.c:259
static HRESULT WINAPI InstallCallback_QueryInterface(IBindStatusCallback *iface, REFIID riid, void **ppv)
Definition: addons.c:238
static ULONG WINAPI InstallCallback_AddRef(IBindStatusCallback *iface)
Definition: addons.c:249
static HRESULT WINAPI InstallCallback_GetBindInfo(IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
Definition: addons.c:314

Definition at line 336 of file addons.c.

◆ mshtml_keyA

const CHAR mshtml_keyA[]
static
Initial value:
=
{'S','o','f','t','w','a','r','e',
'\\','W','i','n','e',
'\\','M','S','H','T','M','L',0}

Definition at line 194 of file addons.c.

Referenced by install_from_registered_dir().