ReactOS  0.4.15-dev-994-ga9f6032
media.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winerror.h"
#include "wine/debug.h"
#include "fdi.h"
#include "msipriv.h"
#include "winuser.h"
#include "winreg.h"
#include "shlwapi.h"
#include "objidl.h"
#include "wine/unicode.h"
#include "resource.h"
Include dependency graph for media.c:

Go to the source code of this file.

Classes

struct  package_disk
 

Macros

#define COBJMACROS
 
#define _O_RDONLY   0
 
#define _O_WRONLY   1
 
#define _O_RDWR   2
 
#define _O_ACCMODE   (_O_RDONLY|_O_WRONLY|_O_RDWR)
 
#define _O_APPEND   0x0008
 
#define _O_RANDOM   0x0010
 
#define _O_SEQUENTIAL   0x0020
 
#define _O_TEMPORARY   0x0040
 
#define _O_NOINHERIT   0x0080
 
#define _O_CREAT   0x0100
 
#define _O_TRUNC   0x0200
 
#define _O_EXCL   0x0400
 
#define _O_SHORT_LIVED   0x1000
 
#define _O_TEXT   0x4000
 
#define _O_BINARY   0x8000
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static BOOL source_matches_volume (MSIMEDIAINFO *mi, LPCWSTR source_root)
 
static UINT msi_change_media (MSIPACKAGE *package, MSIMEDIAINFO *mi)
 
static MSICABINETSTREAMmsi_get_cabinet_stream (MSIPACKAGE *package, UINT disk_id)
 
static void *CDECL cabinet_alloc (ULONG cb)
 
static void CDECL cabinet_free (void *pv)
 
static INT_PTR CDECL cabinet_open (char *pszFile, int oflag, int pmode)
 
static UINT CDECL cabinet_read (INT_PTR hf, void *pv, UINT cb)
 
static UINT CDECL cabinet_write (INT_PTR hf, void *pv, UINT cb)
 
static int CDECL cabinet_close (INT_PTR hf)
 
static LONG CDECL cabinet_seek (INT_PTR hf, LONG dist, int seektype)
 
static INT_PTR CDECL cabinet_open_stream (char *pszFile, int oflag, int pmode)
 
static UINT CDECL cabinet_read_stream (INT_PTR hf, void *pv, UINT cb)
 
static int CDECL cabinet_close_stream (INT_PTR hf)
 
static LONG CDECL cabinet_seek_stream (INT_PTR hf, LONG dist, int seektype)
 
static UINT CDECL msi_media_get_disk_info (MSIPACKAGE *package, MSIMEDIAINFO *mi)
 
static INT_PTR cabinet_partial_file (FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
 
static WCHARget_cabinet_filename (MSIMEDIAINFO *mi)
 
static INT_PTR cabinet_next_cabinet (FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
 
static INT_PTR cabinet_next_cabinet_stream (FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
 
static INT_PTR cabinet_copy_file (FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
 
static INT_PTR cabinet_close_file_info (FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
 
static INT_PTR CDECL cabinet_notify (FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
 
static INT_PTR CDECL cabinet_notify_stream (FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
 
static BOOL extract_cabinet (MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
 
static BOOL extract_cabinet_stream (MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
 
BOOL msi_cabextract (MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
 
void msi_free_media_info (MSIMEDIAINFO *mi)
 
static UINT get_drive_type (const WCHAR *path)
 
UINT msi_load_media_info (MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
 
static UINT find_published_source (MSIPACKAGE *package, MSIMEDIAINFO *mi)
 
UINT ready_media (MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi)
 
UINT msi_add_cabinet_stream (MSIPACKAGE *package, UINT disk_id, IStorage *storage, const WCHAR *name)
 

Variables

static struct package_disk package_disk
 

Macro Definition Documentation

◆ _O_ACCMODE

#define _O_ACCMODE   (_O_RDONLY|_O_WRONLY|_O_RDWR)

Definition at line 43 of file media.c.

◆ _O_APPEND

#define _O_APPEND   0x0008

Definition at line 44 of file media.c.

◆ _O_BINARY

#define _O_BINARY   0x8000

Definition at line 54 of file media.c.

◆ _O_CREAT

#define _O_CREAT   0x0100

Definition at line 49 of file media.c.

◆ _O_EXCL

#define _O_EXCL   0x0400

Definition at line 51 of file media.c.

◆ _O_NOINHERIT

#define _O_NOINHERIT   0x0080

Definition at line 48 of file media.c.

◆ _O_RANDOM

#define _O_RANDOM   0x0010

Definition at line 45 of file media.c.

◆ _O_RDONLY

#define _O_RDONLY   0

Definition at line 40 of file media.c.

◆ _O_RDWR

#define _O_RDWR   2

Definition at line 42 of file media.c.

◆ _O_SEQUENTIAL

#define _O_SEQUENTIAL   0x0020

Definition at line 46 of file media.c.

◆ _O_SHORT_LIVED

#define _O_SHORT_LIVED   0x1000

Definition at line 52 of file media.c.

◆ _O_TEMPORARY

#define _O_TEMPORARY   0x0040

Definition at line 47 of file media.c.

◆ _O_TEXT

#define _O_TEXT   0x4000

Definition at line 53 of file media.c.

◆ _O_TRUNC

#define _O_TRUNC   0x0200

Definition at line 50 of file media.c.

◆ _O_WRONLY

#define _O_WRONLY   1

Definition at line 41 of file media.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file media.c.

Function Documentation

◆ cabinet_alloc()

static void* CDECL cabinet_alloc ( ULONG  cb)
static

Definition at line 114 of file media.c.

115 {
116  return msi_alloc(cb);
117 }
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204

Referenced by extract_cabinet(), and extract_cabinet_stream().

◆ cabinet_close()

static int CDECL cabinet_close ( INT_PTR  hf)
static

Definition at line 177 of file media.c.

178 {
179  HANDLE handle = (HANDLE)hf;
180  return CloseHandle(handle) ? 0 : -1;
181 }
#define CloseHandle
Definition: compat.h:487
PVOID HANDLE
Definition: typedefs.h:73

Referenced by extract_cabinet().

◆ cabinet_close_file_info()

static INT_PTR cabinet_close_file_info ( FDINOTIFICATIONTYPE  fdint,
PFDINOTIFICATION  pfdin 
)
static

Definition at line 506 of file media.c.

508 {
509  MSICABDATA *data = pfdin->pv;
510  FILETIME ft;
511  FILETIME ftLocal;
512  HANDLE handle = (HANDLE)pfdin->hf;
513 
514  data->mi->is_continuous = FALSE;
515 
516  if (!DosDateTimeToFileTime(pfdin->date, pfdin->time, &ft))
517  return -1;
518  if (!LocalFileTimeToFileTime(&ft, &ftLocal))
519  return -1;
520  if (!SetFileTime(handle, &ftLocal, 0, &ftLocal))
521  return -1;
522 
524 
525  data->cb(data->package, data->curfile, MSICABEXTRACT_FILEEXTRACTED, NULL, NULL,
526  data->user);
527 
528  msi_free(data->curfile);
529  data->curfile = NULL;
530 
531  return 1;
532 }
#define CloseHandle
Definition: compat.h:487
USHORT time
Definition: fdi.h:236
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:1098
BOOL WINAPI LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, OUT LPFILETIME lpFileTime)
Definition: time.c:253
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
#define MSICABEXTRACT_FILEEXTRACTED
Definition: msipriv.h:1055
if(!(yy_init))
Definition: macro.lex.yy.c:714
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
PVOID HANDLE
Definition: typedefs.h:73
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
USHORT date
Definition: fdi.h:235
INT_PTR hf
Definition: fdi.h:233
void * pv
Definition: fdi.h:231
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

Referenced by cabinet_notify(), and cabinet_notify_stream().

◆ cabinet_close_stream()

static int CDECL cabinet_close_stream ( INT_PTR  hf)
static

Definition at line 251 of file media.c.

252 {
253  IStream *stm = (IStream *)hf;
254  IStream_Release( stm );
255  return 0;
256 }

Referenced by extract_cabinet_stream().

◆ cabinet_copy_file()

static INT_PTR cabinet_copy_file ( FDINOTIFICATIONTYPE  fdint,
PFDINOTIFICATION  pfdin 
)
static

Definition at line 419 of file media.c.

421 {
422  MSICABDATA *data = pfdin->pv;
423  HANDLE handle = 0;
424  LPWSTR path = NULL;
425  DWORD attrs;
426 
427  data->curfile = strdupAtoW(pfdin->psz1);
428  if (!data->cb(data->package, data->curfile, MSICABEXTRACT_BEGINEXTRACT, &path,
429  &attrs, data->user))
430  {
431  /* We're not extracting this file, so free the filename. */
432  msi_free(data->curfile);
433  data->curfile = NULL;
434  goto done;
435  }
436 
437  TRACE("extracting %s -> %s\n", debugstr_w(data->curfile), debugstr_w(path));
438 
440  if (!attrs) attrs = FILE_ATTRIBUTE_NORMAL;
441 
443  NULL, CREATE_ALWAYS, attrs, NULL);
445  {
446  DWORD err = GetLastError();
447  DWORD attrs2 = GetFileAttributesW(path);
448 
449  if (attrs2 == INVALID_FILE_ATTRIBUTES)
450  {
451  ERR("failed to create %s (error %d)\n", debugstr_w(path), err);
452  goto done;
453  }
454  else if (err == ERROR_ACCESS_DENIED && (attrs2 & FILE_ATTRIBUTE_READONLY))
455  {
456  TRACE("removing read-only attribute on %s\n", debugstr_w(path));
459 
460  if (handle != INVALID_HANDLE_VALUE) goto done;
461  err = GetLastError();
462  }
464  {
465  WCHAR *tmpfileW, *tmppathW, *p;
466  DWORD len;
467 
468  TRACE("file in use, scheduling rename operation\n");
469 
470  if (!(tmppathW = strdupW( path ))) return ERROR_OUTOFMEMORY;
471  if ((p = strrchrW(tmppathW, '\\'))) *p = 0;
472  len = strlenW( tmppathW ) + 16;
473  if (!(tmpfileW = msi_alloc(len * sizeof(WCHAR))))
474  {
475  msi_free( tmppathW );
476  return ERROR_OUTOFMEMORY;
477  }
478  if (!GetTempFileNameW(tmppathW, szMsi, 0, tmpfileW)) tmpfileW[0] = 0;
479  msi_free( tmppathW );
480 
481  handle = CreateFileW(tmpfileW, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, attrs, NULL);
482 
483  if (handle != INVALID_HANDLE_VALUE &&
486  {
487  data->package->need_reboot_at_end = 1;
488  }
489  else
490  {
491  WARN("failed to schedule rename operation %s (error %d)\n", debugstr_w(path), GetLastError());
492  DeleteFileW( tmpfileW );
493  }
494  msi_free(tmpfileW);
495  }
496  else
497  WARN("failed to create %s (error %d)\n", debugstr_w(path), err);
498  }
499 
500 done:
501  msi_free(path);
502 
503  return (INT_PTR)handle;
504 }
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:944
#define ERROR_USER_MAPPED_FILE
Definition: winerror.h:727
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
#define WARN(fmt,...)
Definition: debug.h:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:479
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
int32_t INT_PTR
Definition: typedefs.h:64
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
#define GENERIC_WRITE
Definition: nt_native.h:90
#define debugstr_w
Definition: kernel32.h:32
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
smooth NULL
Definition: ftsmooth.c:416
char * psz1
Definition: fdi.h:228
#define MOVEFILE_DELAY_UNTIL_REBOOT
Definition: winbase.h:381
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
static const WCHAR szMsi[]
Definition: msipriv.h:1119
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
GLenum GLsizei len
Definition: glext.h:6722
#define GENERIC_READ
Definition: compat.h:135
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:135
#define err(...)
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
#define ERR(fmt,...)
Definition: debug.h:110
#define CREATE_ALWAYS
Definition: disk.h:72
#define MSICABEXTRACT_BEGINEXTRACT
Definition: msipriv.h:1054
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
void * pv
Definition: fdi.h:231
#define CreateFileW
Definition: compat.h:489
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
BOOL WINAPI MoveFileExW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
Definition: move.c:1060
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by cabinet_notify(), and cabinet_notify_stream().

◆ cabinet_free()

static void CDECL cabinet_free ( void pv)
static

Definition at line 119 of file media.c.

120 {
121  msi_free(pv);
122 }
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

Referenced by extract_cabinet(), and extract_cabinet_stream().

◆ cabinet_next_cabinet()

static INT_PTR cabinet_next_cabinet ( FDINOTIFICATIONTYPE  fdint,
PFDINOTIFICATION  pfdin 
)
static

Definition at line 319 of file media.c.

321 {
322  MSICABDATA *data = pfdin->pv;
323  MSIMEDIAINFO *mi = data->mi;
324  LPWSTR cabinet_file = NULL, cab = strdupAtoW(pfdin->psz1);
325  INT_PTR res = -1;
326  UINT rc;
327 
328  msi_free(mi->disk_prompt);
329  msi_free(mi->cabinet);
330  msi_free(mi->volume_label);
331  mi->disk_prompt = NULL;
332  mi->cabinet = NULL;
333  mi->volume_label = NULL;
334 
335  mi->disk_id++;
336  mi->is_continuous = TRUE;
337 
338  rc = msi_media_get_disk_info(data->package, mi);
339  if (rc != ERROR_SUCCESS)
340  {
341  ERR("Failed to get next cabinet information: %d\n", rc);
342  goto done;
343  }
344 
345  if (strcmpiW( mi->cabinet, cab ))
346  {
347  char *next_cab;
348  ULONG length;
349 
350  WARN("Continuous cabinet %s does not match the next cabinet %s in the media table => use latter one\n", debugstr_w(cab), debugstr_w(mi->cabinet));
351 
352  /* Use cabinet name from the media table */
353  next_cab = strdupWtoA(mi->cabinet);
354  /* Modify path to cabinet file with full filename (psz3 points to a 256 bytes buffer that can be modified contrary to psz1 and psz2) */
355  length = strlen(pfdin->psz3) + 1 + strlen(next_cab) + 1;
356  if (length > 256)
357  {
358  WARN("Cannot update next cabinet filename with a string size %u > 256\n", length);
359  msi_free(next_cab);
360  goto done;
361  }
362  else
363  {
364  strcat(pfdin->psz3, "\\");
365  strcat(pfdin->psz3, next_cab);
366  }
367  /* Path psz3 and cabinet psz1 are concatenated by FDI so just reset psz1 */
368  *pfdin->psz1 = 0;
369  msi_free(next_cab);
370  }
371 
372  if (!(cabinet_file = get_cabinet_filename(mi)))
373  goto done;
374 
375  TRACE("Searching for %s\n", debugstr_w(cabinet_file));
376 
377  res = 0;
378  if (GetFileAttributesW(cabinet_file) == INVALID_FILE_ATTRIBUTES)
379  {
380  if (msi_change_media(data->package, mi) != ERROR_SUCCESS)
381  res = -1;
382  }
383 
384 done:
385  msi_free(cab);
386  msi_free(cabinet_file);
387  return res;
388 }
static WCHAR * get_cabinet_filename(MSIMEDIAINFO *mi)
Definition: media.c:307
#define ERROR_SUCCESS
Definition: deptool.c:10
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
static LPSTR strdupWtoA(LPCWSTR str)
Definition: hhctrl.h:296
static MONITORINFO mi
Definition: win.c:7339
int32_t INT_PTR
Definition: typedefs.h:64
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
char * psz1
Definition: fdi.h:228
#define TRACE(s)
Definition: solgame.cpp:4
char * psz3
Definition: fdi.h:230
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:80
#define strcmpiW(s1, s2)
Definition: unicode.h:39
#define ERR(fmt,...)
Definition: debug.h:110
unsigned int UINT
Definition: ndis.h:50
void * pv
Definition: fdi.h:231
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1
static UINT CDECL msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:275
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65

Referenced by cabinet_notify().

◆ cabinet_next_cabinet_stream()

static INT_PTR cabinet_next_cabinet_stream ( FDINOTIFICATIONTYPE  fdint,
PFDINOTIFICATION  pfdin 
)
static

Definition at line 390 of file media.c.

392 {
393  MSICABDATA *data = pfdin->pv;
394  MSIMEDIAINFO *mi = data->mi;
395  UINT rc;
396 
397  msi_free( mi->disk_prompt );
398  msi_free( mi->cabinet );
399  msi_free( mi->volume_label );
400  mi->disk_prompt = NULL;
401  mi->cabinet = NULL;
402  mi->volume_label = NULL;
403 
404  mi->disk_id++;
405  mi->is_continuous = TRUE;
406 
407  rc = msi_media_get_disk_info( data->package, mi );
408  if (rc != ERROR_SUCCESS)
409  {
410  ERR("Failed to get next cabinet information: %u\n", rc);
411  return -1;
412  }
413  package_disk.id = mi->disk_id;
414 
415  TRACE("next cabinet is %s disk id %u\n", debugstr_w(mi->cabinet), mi->disk_id);
416  return 0;
417 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
static MONITORINFO mi
Definition: win.c:7339
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
UINT id
Definition: media.c:193
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define ERR(fmt,...)
Definition: debug.h:110
unsigned int UINT
Definition: ndis.h:50
void * pv
Definition: fdi.h:231
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static UINT CDECL msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:275

Referenced by cabinet_notify_stream().

◆ cabinet_notify()

static INT_PTR CDECL cabinet_notify ( FDINOTIFICATIONTYPE  fdint,
PFDINOTIFICATION  pfdin 
)
static

Definition at line 534 of file media.c.

535 {
536  switch (fdint)
537  {
538  case fdintPARTIAL_FILE:
539  return cabinet_partial_file(fdint, pfdin);
540 
541  case fdintNEXT_CABINET:
542  return cabinet_next_cabinet(fdint, pfdin);
543 
544  case fdintCOPY_FILE:
545  return cabinet_copy_file(fdint, pfdin);
546 
548  return cabinet_close_file_info(fdint, pfdin);
549 
550  default:
551  return 0;
552  }
553 }
static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:419
static INT_PTR cabinet_next_cabinet(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:319
static INT_PTR cabinet_close_file_info(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:506
static INT_PTR cabinet_partial_file(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:299

Referenced by extract_cabinet().

◆ cabinet_notify_stream()

static INT_PTR CDECL cabinet_notify_stream ( FDINOTIFICATIONTYPE  fdint,
PFDINOTIFICATION  pfdin 
)
static

Definition at line 555 of file media.c.

556 {
557  switch (fdint)
558  {
559  case fdintPARTIAL_FILE:
560  return cabinet_partial_file( fdint, pfdin );
561 
562  case fdintNEXT_CABINET:
563  return cabinet_next_cabinet_stream( fdint, pfdin );
564 
565  case fdintCOPY_FILE:
566  return cabinet_copy_file( fdint, pfdin );
567 
569  return cabinet_close_file_info( fdint, pfdin );
570 
571  case fdintCABINET_INFO:
572  return 0;
573 
574  default:
575  ERR("Unexpected notification %d\n", fdint);
576  return 0;
577  }
578 }
static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:419
static INT_PTR cabinet_close_file_info(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:506
static INT_PTR cabinet_partial_file(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:299
#define ERR(fmt,...)
Definition: debug.h:110
static INT_PTR cabinet_next_cabinet_stream(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:390

Referenced by extract_cabinet_stream().

◆ cabinet_open()

static INT_PTR CDECL cabinet_open ( char pszFile,
int  oflag,
int  pmode 
)
static

Definition at line 124 of file media.c.

125 {
126  DWORD dwAccess = 0;
127  DWORD dwShareMode = 0;
128  DWORD dwCreateDisposition = OPEN_EXISTING;
129 
130  switch (oflag & _O_ACCMODE)
131  {
132  case _O_RDONLY:
133  dwAccess = GENERIC_READ;
134  dwShareMode = FILE_SHARE_READ | FILE_SHARE_DELETE;
135  break;
136  case _O_WRONLY:
137  dwAccess = GENERIC_WRITE;
139  break;
140  case _O_RDWR:
141  dwAccess = GENERIC_READ | GENERIC_WRITE;
143  break;
144  }
145 
146  if ((oflag & (_O_CREAT | _O_EXCL)) == (_O_CREAT | _O_EXCL))
147  dwCreateDisposition = CREATE_NEW;
148  else if (oflag & _O_CREAT)
149  dwCreateDisposition = CREATE_ALWAYS;
150 
151  return (INT_PTR)CreateFileA(pszFile, dwAccess, dwShareMode, NULL,
152  dwCreateDisposition, 0, NULL);
153 }
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
int32_t INT_PTR
Definition: typedefs.h:64
#define FILE_SHARE_READ
Definition: compat.h:136
#define _O_WRONLY
Definition: media.c:41
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:523
#define _O_EXCL
Definition: media.c:51
#define _O_RDWR
Definition: media.c:42
unsigned long DWORD
Definition: ntddk_ex.h:95
#define _O_CREAT
Definition: media.c:49
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define GENERIC_READ
Definition: compat.h:135
#define CREATE_ALWAYS
Definition: disk.h:72
#define _O_RDONLY
Definition: media.c:40
#define CREATE_NEW
Definition: disk.h:69
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:488
#define _O_ACCMODE
Definition: media.c:43

Referenced by extract_cabinet().

◆ cabinet_open_stream()

static INT_PTR CDECL cabinet_open_stream ( char pszFile,
int  oflag,
int  pmode 
)
static

Definition at line 198 of file media.c.

199 {
200  MSICABINETSTREAM *cab;
201  IStream *stream;
202 
204  {
205  WARN("failed to get cabinet stream\n");
206  return -1;
207  }
208  if (cab->storage == package_disk.package->db->storage)
209  {
211  if (r != ERROR_SUCCESS)
212  {
213  WARN("failed to get stream %u\n", r);
214  return -1;
215  }
216  }
217  else /* patch storage */
218  {
219  HRESULT hr;
220  WCHAR *encoded;
221 
222  if (!(encoded = encode_streamname( FALSE, cab->stream + 1 )))
223  {
224  WARN("failed to encode stream name\n");
225  return -1;
226  }
227  hr = IStorage_OpenStream( cab->storage, encoded, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stream );
228  msi_free( encoded );
229  if (FAILED(hr))
230  {
231  WARN("failed to open stream 0x%08x\n", hr);
232  return -1;
233  }
234  }
235  return (INT_PTR)stream;
236 }
UINT msi_get_stream(MSIDATABASE *, const WCHAR *, IStream **) DECLSPEC_HIDDEN
Definition: streams.c:518
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define WARN(fmt,...)
Definition: debug.h:112
MSIPACKAGE * package
Definition: media.c:192
int32_t INT_PTR
Definition: typedefs.h:64
IStorage * storage
Definition: msipriv.h:182
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
static MSICABINETSTREAM * msi_get_cabinet_stream(MSIPACKAGE *package, UINT disk_id)
Definition: media.c:103
#define STGM_READ
Definition: objbase.h:916
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
LPWSTR encode_streamname(BOOL bTable, LPCWSTR in) DECLSPEC_HIDDEN
Definition: table.c:128
UINT id
Definition: media.c:193
MSIDATABASE * db
Definition: msipriv.h:386
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
IStorage * storage
Definition: msipriv.h:98

Referenced by extract_cabinet_stream().

◆ cabinet_partial_file()

static INT_PTR cabinet_partial_file ( FDINOTIFICATIONTYPE  fdint,
PFDINOTIFICATION  pfdin 
)
static

Definition at line 299 of file media.c.

301 {
302  MSICABDATA *data = pfdin->pv;
303  data->mi->is_continuous = FALSE;
304  return 0;
305 }
#define FALSE
Definition: types.h:117
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void * pv
Definition: fdi.h:231

Referenced by cabinet_notify(), and cabinet_notify_stream().

◆ cabinet_read()

static UINT CDECL cabinet_read ( INT_PTR  hf,
void pv,
UINT  cb 
)
static

Definition at line 155 of file media.c.

156 {
157  HANDLE handle = (HANDLE)hf;
158  DWORD read;
159 
160  if (ReadFile(handle, pv, cb, &read, NULL))
161  return read;
162 
163  return 0;
164 }
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
PVOID HANDLE
Definition: typedefs.h:73
#define ReadFile(a, b, c, d, e)
Definition: compat.h:490
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

Referenced by extract_cabinet().

◆ cabinet_read_stream()

static UINT CDECL cabinet_read_stream ( INT_PTR  hf,
void pv,
UINT  cb 
)
static

Definition at line 238 of file media.c.

239 {
240  IStream *stm = (IStream *)hf;
241  DWORD read;
242  HRESULT hr;
243 
244  hr = IStream_Read( stm, pv, cb, &read );
245  if (hr == S_OK || hr == S_FALSE)
246  return read;
247 
248  return 0;
249 }
HRESULT hr
Definition: shlfolder.c:183
#define S_FALSE
Definition: winerror.h:2357
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

Referenced by extract_cabinet_stream().

◆ cabinet_seek()

static LONG CDECL cabinet_seek ( INT_PTR  hf,
LONG  dist,
int  seektype 
)
static

Definition at line 183 of file media.c.

184 {
185  HANDLE handle = (HANDLE)hf;
186  /* flags are compatible and so are passed straight through */
187  return SetFilePointer(handle, dist, NULL, seektype);
188 }
smooth NULL
Definition: ftsmooth.c:416
PVOID HANDLE
Definition: typedefs.h:73
#define SetFilePointer
Definition: compat.h:491

Referenced by extract_cabinet().

◆ cabinet_seek_stream()

static LONG CDECL cabinet_seek_stream ( INT_PTR  hf,
LONG  dist,
int  seektype 
)
static

Definition at line 258 of file media.c.

259 {
260  IStream *stm = (IStream *)hf;
261  LARGE_INTEGER move;
262  ULARGE_INTEGER newpos;
263  HRESULT hr;
264 
265  move.QuadPart = dist;
266  hr = IStream_Seek( stm, move, seektype, &newpos );
267  if (SUCCEEDED(hr))
268  {
269  if (newpos.QuadPart <= MAXLONG) return newpos.QuadPart;
270  ERR("Too big!\n");
271  }
272  return -1;
273 }
HRESULT hr
Definition: shlfolder.c:183
#define MAXLONG
Definition: umtypes.h:116
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
LONG HRESULT
Definition: typedefs.h:79
#define ERR(fmt,...)
Definition: debug.h:110
#define SUCCEEDED(hr)
Definition: intsafe.h:57
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by extract_cabinet_stream().

◆ cabinet_write()

static UINT CDECL cabinet_write ( INT_PTR  hf,
void pv,
UINT  cb 
)
static

Definition at line 166 of file media.c.

167 {
168  HANDLE handle = (HANDLE)hf;
169  DWORD written;
170 
171  if (WriteFile(handle, pv, cb, &written, NULL))
172  return written;
173 
174  return 0;
175 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
PVOID HANDLE
Definition: typedefs.h:73
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32

Referenced by extract_cabinet(), and extract_cabinet_stream().

◆ extract_cabinet()

static BOOL extract_cabinet ( MSIPACKAGE package,
MSIMEDIAINFO mi,
LPVOID  data 
)
static

Definition at line 580 of file media.c.

581 {
582  LPSTR cabinet, cab_path = NULL;
583  HFDI hfdi;
584  ERF erf;
585  BOOL ret = FALSE;
586 
587  TRACE("extracting %s disk id %u\n", debugstr_w(mi->cabinet), mi->disk_id);
588 
591  if (!hfdi)
592  {
593  ERR("FDICreate failed\n");
594  return FALSE;
595  }
596 
597  cabinet = strdupWtoA( mi->cabinet );
598  if (!cabinet)
599  goto done;
600 
601  cab_path = strdupWtoA( mi->sourcedir );
602  if (!cab_path)
603  goto done;
604 
605  ret = FDICopy( hfdi, cabinet, cab_path, 0, cabinet_notify, NULL, data );
606  if (!ret)
607  ERR("FDICopy failed\n");
608 
609 done:
610  FDIDestroy( hfdi );
611  msi_free(cabinet );
612  msi_free( cab_path );
613 
614  if (ret)
615  mi->is_extracted = TRUE;
616 
617  return ret;
618 }
BOOL __cdecl FDIDestroy(HFDI hfdi)
Definition: fdi.c:2831
#define TRUE
Definition: types.h:120
static void *CDECL cabinet_alloc(ULONG cb)
Definition: media.c:114
static LPSTR strdupWtoA(LPCWSTR str)
Definition: hhctrl.h:296
static int CDECL cabinet_close(INT_PTR hf)
Definition: media.c:177
static MONITORINFO mi
Definition: win.c:7339
char * LPSTR
Definition: xmlstorage.h:182
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: fci.h:44
BOOL __cdecl FDICopy(HFDI hfdi, char *pszCabinet, char *pszCabPath, int flags, PFNFDINOTIFY pfnfdin, PFNFDIDECRYPT pfnfdid, void *pvUser)
Definition: fdi.c:2431
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
HFDI __cdecl FDICreate(PFNALLOC pfnalloc, PFNFREE pfnfree, PFNOPEN pfnopen, PFNREAD pfnread, PFNWRITE pfnwrite, PFNCLOSE pfnclose, PFNSEEK pfnseek, int cpuType, PERF perf)
Definition: fdi.c:412
#define TRACE(s)
Definition: solgame.cpp:4
static INT_PTR CDECL cabinet_open(char *pszFile, int oflag, int pmode)
Definition: media.c:124
double __cdecl erf(double)
static LONG CDECL cabinet_seek(INT_PTR hf, LONG dist, int seektype)
Definition: media.c:183
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define ERR(fmt,...)
Definition: debug.h:110
static INT_PTR CDECL cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:534
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static UINT CDECL cabinet_read(INT_PTR hf, void *pv, UINT cb)
Definition: media.c:155
static UINT CDECL cabinet_write(INT_PTR hf, void *pv, UINT cb)
Definition: media.c:166
static void CDECL cabinet_free(void *pv)
Definition: media.c:119

Referenced by msi_cabextract().

◆ extract_cabinet_stream()

static BOOL extract_cabinet_stream ( MSIPACKAGE package,
MSIMEDIAINFO mi,
LPVOID  data 
)
static

Definition at line 620 of file media.c.

621 {
622  static char filename[] = {'<','S','T','R','E','A','M','>',0};
623  HFDI hfdi;
624  ERF erf;
625  BOOL ret = FALSE;
626 
627  TRACE("extracting %s disk id %u\n", debugstr_w(mi->cabinet), mi->disk_id);
628 
631  if (!hfdi)
632  {
633  ERR("FDICreate failed\n");
634  return FALSE;
635  }
636 
637  package_disk.package = package;
638  package_disk.id = mi->disk_id;
639 
641  if (!ret) ERR("FDICopy failed\n");
642 
643  FDIDestroy( hfdi );
644  if (ret) mi->is_extracted = TRUE;
645  return ret;
646 }
static INT_PTR CDECL cabinet_open_stream(char *pszFile, int oflag, int pmode)
Definition: media.c:198
static INT_PTR CDECL cabinet_notify_stream(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
Definition: media.c:555
BOOL __cdecl FDIDestroy(HFDI hfdi)
Definition: fdi.c:2831
#define TRUE
Definition: types.h:120
static void *CDECL cabinet_alloc(ULONG cb)
Definition: media.c:114
static int CDECL cabinet_close_stream(INT_PTR hf)
Definition: media.c:251
static MONITORINFO mi
Definition: win.c:7339
MSIPACKAGE * package
Definition: media.c:192
const char * filename
Definition: ioapi.h:135
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: fci.h:44
BOOL __cdecl FDICopy(HFDI hfdi, char *pszCabinet, char *pszCabPath, int flags, PFNFDINOTIFY pfnfdin, PFNFDIDECRYPT pfnfdid, void *pvUser)
Definition: fdi.c:2431
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
HFDI __cdecl FDICreate(PFNALLOC pfnalloc, PFNFREE pfnfree, PFNOPEN pfnopen, PFNREAD pfnread, PFNWRITE pfnwrite, PFNCLOSE pfnclose, PFNSEEK pfnseek, int cpuType, PERF perf)
Definition: fdi.c:412
#define TRACE(s)
Definition: solgame.cpp:4
double __cdecl erf(double)
static UINT CDECL cabinet_read_stream(INT_PTR hf, void *pv, UINT cb)
Definition: media.c:238
UINT id
Definition: media.c:193
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define ERR(fmt,...)
Definition: debug.h:110
static LONG CDECL cabinet_seek_stream(INT_PTR hf, LONG dist, int seektype)
Definition: media.c:258
static UINT CDECL cabinet_write(INT_PTR hf, void *pv, UINT cb)
Definition: media.c:166
static void CDECL cabinet_free(void *pv)
Definition: media.c:119

Referenced by msi_cabextract().

◆ find_published_source()

static UINT find_published_source ( MSIPACKAGE package,
MSIMEDIAINFO mi 
)
static

Definition at line 748 of file media.c.

749 {
752  WCHAR prompt[MAX_PATH];
753  DWORD volumesz, promptsz;
754  DWORD index, size, id;
755  WCHAR last_type[2];
756  UINT r;
757 
758  size = 2;
760  package->Context, MSICODE_PRODUCT,
761  INSTALLPROPERTY_LASTUSEDTYPEW, last_type, &size);
762  if (r != ERROR_SUCCESS)
763  return r;
764 
765  size = MAX_PATH;
767  package->Context, MSICODE_PRODUCT,
769  if (r != ERROR_SUCCESS)
770  return r;
771 
772  if (last_type[0] == 'n')
773  {
774  WCHAR cabinet_file[MAX_PATH];
775  BOOL check_all = FALSE;
776 
777  while(TRUE)
778  {
779  index = 0;
780  volumesz = MAX_PATH;
781  while (MsiSourceListEnumSourcesW(package->ProductCode, NULL,
782  package->Context,
784  volume, &volumesz) == ERROR_SUCCESS)
785  {
786  if (check_all || !strncmpiW(source, volume, strlenW(source)))
787  {
788  lstrcpyW(cabinet_file, volume);
789  PathAddBackslashW(cabinet_file);
790  lstrcatW(cabinet_file, mi->cabinet);
791 
792  if (GetFileAttributesW(cabinet_file) == INVALID_FILE_ATTRIBUTES)
793  {
794  volumesz = MAX_PATH;
795  if(!check_all)
796  break;
797  continue;
798  }
799 
800  lstrcpyW(mi->sourcedir, volume);
801  PathAddBackslashW(mi->sourcedir);
802  TRACE("Found network source %s\n", debugstr_w(mi->sourcedir));
803  return ERROR_SUCCESS;
804  }
805  }
806 
807  if (!check_all)
808  check_all = TRUE;
809  else
810  break;
811  }
812  }
813 
814  index = 0;
815  volumesz = MAX_PATH;
816  promptsz = MAX_PATH;
818  package->Context,
819  MSICODE_PRODUCT, index++, &id,
820  volume, &volumesz, prompt, &promptsz) == ERROR_SUCCESS)
821  {
822  mi->disk_id = id;
823  msi_free( mi->volume_label );
824  if (!(mi->volume_label = msi_alloc( ++volumesz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
825  strcpyW( mi->volume_label, volume );
826 
827  msi_free( mi->disk_prompt );
828  if (!(mi->disk_prompt = msi_alloc( ++promptsz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
829  strcpyW( mi->disk_prompt, prompt );
830 
832  {
833  /* FIXME: what about SourceDir */
834  lstrcpyW(mi->sourcedir, source);
835  PathAddBackslashW(mi->sourcedir);
836  TRACE("Found disk source %s\n", debugstr_w(mi->sourcedir));
837  return ERROR_SUCCESS;
838  }
839  }
840 
841  return ERROR_FUNCTION_FAILED;
842 }
LPWSTR ProductCode
Definition: msipriv.h:426
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
UINT WINAPI MsiSourceListGetInfoW(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szProperty, LPWSTR szValue, LPDWORD pcchValue)
Definition: source.c:538
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static MONITORINFO mi
Definition: win.c:7339
#define strncmpiW(s1, s2, n)
Definition: unicode.h:40
UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwIndex, LPDWORD pdwDiskId, LPWSTR szVolumeLabel, LPDWORD pcchVolumeLabel, LPWSTR szDiskPrompt, LPDWORD pcchDiskPrompt)
Definition: source.c:206
static const WCHAR INSTALLPROPERTY_LASTUSEDSOURCEW[]
Definition: msi.h:405
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define FALSE
Definition: types.h:117
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
Definition: media.c:56
GLuint index
Definition: glext.h:6031
UINT WINAPI MsiSourceListEnumSourcesW(LPCWSTR szProductCodeOrPatch, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwIndex, LPWSTR szSource, LPDWORD pcchSource)
Definition: source.c:411
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define index(s, c)
Definition: various.h:29
static const WCHAR INSTALLPROPERTY_LASTUSEDTYPEW[]
Definition: msi.h:409
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define lstrcpyW
Definition: compat.h:497
unsigned int UINT
Definition: ndis.h:50
UINT Context
Definition: msipriv.h:437
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
GLenum GLuint id
Definition: glext.h:5579
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by ready_media().

◆ get_cabinet_filename()

static WCHAR* get_cabinet_filename ( MSIMEDIAINFO mi)
static

Definition at line 307 of file media.c.

308 {
309  int len;
310  WCHAR *ret;
311 
312  len = strlenW(mi->sourcedir) + strlenW(mi->cabinet) + 1;
313  if (!(ret = msi_alloc(len * sizeof(WCHAR)))) return NULL;
314  strcpyW(ret, mi->sourcedir);
315  strcatW(ret, mi->cabinet);
316  return ret;
317 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static MONITORINFO mi
Definition: win.c:7339
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
GLenum GLsizei len
Definition: glext.h:6722
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204

Referenced by cabinet_next_cabinet(), and ready_media().

◆ get_drive_type()

static UINT get_drive_type ( const WCHAR path)
static

Definition at line 670 of file media.c.

671 {
672  WCHAR root[MAX_PATH + 1];
673 
674  strcpyW(root, path);
677 
678  return GetDriveTypeW(root);
679 }
BOOL WINAPI PathStripToRootW(LPWSTR lpszPath)
Definition: path.c:728
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219

Referenced by msi_load_media_info().

◆ msi_add_cabinet_stream()

UINT msi_add_cabinet_stream ( MSIPACKAGE package,
UINT  disk_id,
IStorage storage,
const WCHAR name 
)

Definition at line 912 of file media.c.

913 {
914  MSICABINETSTREAM *cab, *item;
915 
916  TRACE("%p, %u, %p, %s\n", package, disk_id, storage, debugstr_w(name));
917 
919  {
920  if (item->disk_id == disk_id)
921  {
922  TRACE("duplicate disk id %u\n", disk_id);
923  return ERROR_FUNCTION_FAILED;
924  }
925  }
926  if (!(cab = msi_alloc( sizeof(*cab) ))) return ERROR_OUTOFMEMORY;
927  if (!(cab->stream = msi_alloc( (strlenW( name ) + 1) * sizeof(WCHAR ) )))
928  {
929  msi_free( cab );
930  return ERROR_OUTOFMEMORY;
931  }
932  strcpyW( cab->stream, name );
933  cab->disk_id = disk_id;
934  cab->storage = storage;
935  IStorage_AddRef( storage );
936  list_add_tail( &package->cabinet_streams, &cab->entry );
937 
938  return ERROR_SUCCESS;
939 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
IStorage * storage
Definition: msipriv.h:182
struct list entry
Definition: msipriv.h:180
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
uint32_t entry
Definition: isohybrid.c:63
struct list cabinet_streams
Definition: msipriv.h:399
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
static ATOM item
Definition: dde.c:856
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
Definition: name.c:38
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by load_media(), and patch_add_media().

◆ msi_cabextract()

BOOL msi_cabextract ( MSIPACKAGE package,
MSIMEDIAINFO mi,
LPVOID  data 
)

Definition at line 653 of file media.c.

654 {
655  if (mi->cabinet[0] == '#')
656  {
657  return extract_cabinet_stream( package, mi, data );
658  }
659  return extract_cabinet( package, mi, data );
660 }
static BOOL extract_cabinet(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:580
static MONITORINFO mi
Definition: win.c:7339
static BOOL extract_cabinet_stream(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:620
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ msi_change_media()

static UINT msi_change_media ( MSIPACKAGE package,
MSIMEDIAINFO mi 
)
static

Definition at line 80 of file media.c.

81 {
83  LPWSTR source_dir;
84  UINT r = IDRETRY;
85 
86  source_dir = msi_dup_property(package->db, szSourceDir);
88 
89  while (r == IDRETRY && !source_matches_volume(mi, source_dir))
90  {
93  MSI_RecordSetStringW(record, 2, mi->disk_prompt);
95  }
96 
97  msiobj_release(&record->hdr);
98  msi_free(source_dir);
99 
100  return r;
101 }
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static MONITORINFO mi
Definition: win.c:7339
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:328
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1946
smooth NULL
Definition: ftsmooth.c:416
static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
Definition: media.c:56
MSIDATABASE * db
Definition: msipriv.h:386
#define IDRETRY
Definition: winuser.h:827
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static const WCHAR szSourceDir[]
Definition: msipriv.h:1100
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
#define MB_RETRYCANCEL
Definition: winuser.h:799
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define MSIERR_CABNOTFOUND
Definition: resource.h:29
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370

Referenced by cabinet_next_cabinet(), and ready_media().

◆ msi_free_media_info()

void msi_free_media_info ( MSIMEDIAINFO mi)

Definition at line 662 of file media.c.

663 {
664  msi_free(mi->disk_prompt);
665  msi_free(mi->cabinet);
666  msi_free(mi->volume_label);
667  msi_free(mi);
668 }
static MONITORINFO mi
Definition: win.c:7339
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ msi_get_cabinet_stream()

static MSICABINETSTREAM* msi_get_cabinet_stream ( MSIPACKAGE package,
UINT  disk_id 
)
static

Definition at line 103 of file media.c.

104 {
105  MSICABINETSTREAM *cab;
106 
108  {
109  if (cab->disk_id == disk_id) return cab;
110  }
111  return NULL;
112 }
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
uint32_t entry
Definition: isohybrid.c:63
struct list cabinet_streams
Definition: msipriv.h:399

Referenced by cabinet_open_stream().

◆ msi_load_media_info()

UINT msi_load_media_info ( MSIPACKAGE package,
UINT  Sequence,
MSIMEDIAINFO mi 
)

Definition at line 681 of file media.c.

682 {
683  static const WCHAR query[] = {
684  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','M','e','d','i','a','`',' ',
685  'W','H','E','R','E',' ','`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ',
686  '>','=',' ','%','i',' ','O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0};
687  MSIRECORD *row;
688  LPWSTR source_dir, source;
689  DWORD options;
690 
691  if (Sequence <= mi->last_sequence) /* already loaded */
692  return ERROR_SUCCESS;
693 
694  row = MSI_QueryGetRecord(package->db, query, Sequence);
695  if (!row)
696  {
697  TRACE("Unable to query row\n");
698  return ERROR_FUNCTION_FAILED;
699  }
700 
701  mi->is_extracted = FALSE;
702  mi->disk_id = MSI_RecordGetInteger(row, 1);
703  mi->last_sequence = MSI_RecordGetInteger(row, 2);
704  msi_free(mi->disk_prompt);
705  mi->disk_prompt = strdupW(MSI_RecordGetString(row, 3));
706  msi_free(mi->cabinet);
707  mi->cabinet = strdupW(MSI_RecordGetString(row, 4));
708  msi_free(mi->volume_label);
709  mi->volume_label = strdupW(MSI_RecordGetString(row, 5));
710  msiobj_release(&row->hdr);
711 
712  msi_set_sourcedir_props(package, FALSE);
713  source_dir = msi_dup_property(package->db, szSourceDir);
714  lstrcpyW(mi->sourcedir, source_dir);
715  PathAddBackslashW(mi->sourcedir);
716  mi->type = get_drive_type(source_dir);
717 
719  if (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE)
720  {
721  source = source_dir;
723  }
724  else if (package->BaseURL && UrlIsW(package->BaseURL, URLIS_URL))
725  {
726  source = package->BaseURL;
728  }
729  else
730  {
731  source = mi->sourcedir;
733  }
734 
735  msi_package_add_media_disk(package, package->Context,
736  MSICODE_PRODUCT, mi->disk_id,
737  mi->volume_label, mi->disk_prompt);
738 
739  msi_package_add_info(package, package->Context,
741 
742  msi_free(source_dir);
743  TRACE("sequence %u -> cabinet %s disk id %u\n", Sequence, debugstr_w(mi->cabinet), mi->disk_id);
744  return ERROR_SUCCESS;
745 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
Definition: action.c:441
static MONITORINFO mi
Definition: win.c:7339
UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR) DECLSPEC_HIDDEN
Definition: package.c:2800
static const WCHAR INSTALLPROPERTY_LASTUSEDSOURCEW[]
Definition: msi.h:405
#define DRIVE_REMOVABLE
Definition: winbase.h:248
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define DRIVE_CDROM
Definition: machpc98.h:115
#define FALSE
Definition: types.h:117
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
#define debugstr_w
Definition: kernel32.h:32
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:482
int options
Definition: main.c:106
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIRECORD * MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...) DECLSPEC_HIDDEN
Definition: msiquery.c:206
unsigned long DWORD
Definition: ntddk_ex.h:95
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static const WCHAR szSourceDir[]
Definition: msipriv.h:1100
UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR) DECLSPEC_HIDDEN
Definition: package.c:2823
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
Definition: url.c:1933
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:245
#define lstrcpyW
Definition: compat.h:497
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
UINT Context
Definition: msipriv.h:437
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
LPWSTR BaseURL
Definition: msipriv.h:424
static UINT get_drive_type(const WCHAR *path)
Definition: media.c:670
WCHAR * LPWSTR
Definition: xmlstorage.h:184
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ msi_media_get_disk_info()

static UINT CDECL msi_media_get_disk_info ( MSIPACKAGE package,
MSIMEDIAINFO mi 
)
static

Definition at line 275 of file media.c.

276 {
277  MSIRECORD *row;
278 
279  static const WCHAR query[] = {
280  'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
281  '`','M','e','d','i','a','`',' ','W','H','E','R','E',' ',
282  '`','D','i','s','k','I','d','`',' ','=',' ','%','i',0};
283 
284  row = MSI_QueryGetRecord(package->db, query, mi->disk_id);
285  if (!row)
286  {
287  TRACE("Unable to query row\n");
288  return ERROR_FUNCTION_FAILED;
289  }
290 
291  mi->disk_prompt = strdupW(MSI_RecordGetString(row, 3));
292  mi->cabinet = strdupW(MSI_RecordGetString(row, 4));
293  mi->volume_label = strdupW(MSI_RecordGetString(row, 5));
294 
295  msiobj_release(&row->hdr);
296  return ERROR_SUCCESS;
297 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
static MONITORINFO mi
Definition: win.c:7339
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:482
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIRECORD * MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...) DECLSPEC_HIDDEN
Definition: msiquery.c:206
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

Referenced by cabinet_next_cabinet(), and cabinet_next_cabinet_stream().

◆ ready_media()

UINT ready_media ( MSIPACKAGE package,
BOOL  compressed,
MSIMEDIAINFO mi 
)

Definition at line 844 of file media.c.

845 {
846  UINT rc;
847  WCHAR *cabinet_file = NULL;
848 
849  /* media info for continuous cabinet is already loaded */
850  if (mi->is_continuous) return ERROR_SUCCESS;
851 
852  if (mi->cabinet)
853  {
854  /* cabinet is internal, no checks needed */
855  if (mi->cabinet[0] == '#') return ERROR_SUCCESS;
856 
857  if (!(cabinet_file = get_cabinet_filename( mi ))) return ERROR_OUTOFMEMORY;
858 
859  /* package should be downloaded */
860  if (compressed && GetFileAttributesW( cabinet_file ) == INVALID_FILE_ATTRIBUTES &&
861  package->BaseURL && UrlIsW( package->BaseURL, URLIS_URL ))
862  {
863  WCHAR temppath[MAX_PATH], *p;
864 
865  if ((rc = msi_download_file( cabinet_file, temppath )) != ERROR_SUCCESS)
866  {
867  ERR("failed to download %s (%u)\n", debugstr_w(cabinet_file), rc);
868  msi_free( cabinet_file );
869  return rc;
870  }
871  if ((p = strrchrW( temppath, '\\' ))) *p = 0;
872  strcpyW( mi->sourcedir, temppath );
873  PathAddBackslashW( mi->sourcedir );
874  msi_free( mi->cabinet );
875  mi->cabinet = strdupW( p + 1 );
876  msi_free( cabinet_file );
877  return ERROR_SUCCESS;
878  }
879  }
880  /* check volume matches, change media if not */
881  if (mi->volume_label && mi->disk_id > 1)
882  {
883  WCHAR *source = msi_dup_property( package->db, szSourceDir );
885  msi_free( source );
886 
887  if (!match && (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE))
888  {
889  if ((rc = msi_change_media( package, mi )) != ERROR_SUCCESS)
890  {
891  msi_free( cabinet_file );
892  return rc;
893  }
894  }
895  }
896  if (mi->cabinet)
897  {
898  if (compressed && GetFileAttributesW( cabinet_file ) == INVALID_FILE_ATTRIBUTES)
899  {
900  if ((rc = find_published_source( package, mi )) != ERROR_SUCCESS)
901  {
902  ERR("cabinet not found: %s\n", debugstr_w(cabinet_file));
903  msi_free( cabinet_file );
904  return ERROR_INSTALL_FAILURE;
905  }
906  }
907  }
908  msi_free( cabinet_file );
909  return ERROR_SUCCESS;
910 }
static WCHAR * get_cabinet_filename(MSIMEDIAINFO *mi)
Definition: media.c:307
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: match.c:28
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
static MONITORINFO mi
Definition: win.c:7339
#define DRIVE_REMOVABLE
Definition: winbase.h:248
#define DRIVE_CDROM
Definition: machpc98.h:115
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename) DECLSPEC_HIDDEN
Definition: package.c:1107
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
Definition: media.c:56
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ERROR_INSTALL_FAILURE
Definition: winerror.h:961
#define MAX_PATH
Definition: compat.h:34
MSIDATABASE * db
Definition: msipriv.h:386
static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:748
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
static const WCHAR szSourceDir[]
Definition: msipriv.h:1100
static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:80
BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
Definition: url.c:1933
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
#define ERR(fmt,...)
Definition: debug.h:110
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
LPWSTR BaseURL
Definition: msipriv.h:424
GLfloat GLfloat p
Definition: glext.h:8902
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ source_matches_volume()

static BOOL source_matches_volume ( MSIMEDIAINFO mi,
LPCWSTR  source_root 
)
static

Definition at line 56 of file media.c.

57 {
59  const WCHAR *p;
60  int len, len2;
61 
62  strcpyW(root, source_root);
65 
67  {
68  WARN("failed to get volume information for %s (%u)\n", debugstr_w(root), GetLastError());
69  return FALSE;
70  }
71 
72  len = strlenW( volume_name );
73  len2 = strlenW( mi->volume_label );
74  if (len2 > len) return FALSE;
75  p = volume_name + len - len2;
76 
77  return !strcmpiW( mi->volume_label, p );
78 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define WARN(fmt,...)
Definition: debug.h:112
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static MONITORINFO mi
Definition: win.c:7339
#define FALSE
Definition: types.h:117
BOOL WINAPI PathStripToRootW(LPWSTR lpszPath)
Definition: path.c:728
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
GLenum GLsizei len
Definition: glext.h:6722
#define strcmpiW(s1, s2)
Definition: unicode.h:39
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:226
static char volume_name[]
Definition: mkdosfs.c:526
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by find_published_source(), msi_change_media(), and ready_media().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )

Variable Documentation

◆ package_disk

Definition at line 196 of file media.c.