Modified: trunk/reactos/include/wine/msidefs.h
Modified: trunk/reactos/lib/msi/Makefile.in
Modified: trunk/reactos/lib/msi/action.c
Modified: trunk/reactos/lib/msi/action.h
Modified: trunk/reactos/lib/msi/appsearch.c
Modified: trunk/reactos/lib/msi/cond.tab.c
Modified: trunk/reactos/lib/msi/cond.tab.h
Modified: trunk/reactos/lib/msi/cond.y
Modified: trunk/reactos/lib/msi/custom.c
Added: trunk/reactos/lib/msi/database.c
Modified: trunk/reactos/lib/msi/dialog.c
Modified: trunk/reactos/lib/msi/format.c
Modified: trunk/reactos/lib/msi/msi.c
Modified: trunk/reactos/lib/msi/msi.rc
Modified: trunk/reactos/lib/msi/msi.spec
Modified: trunk/reactos/lib/msi/msi_Es.rc
Added: trunk/reactos/lib/msi/msi_Nl.rc
Modified: trunk/reactos/lib/msi/msipriv.h
Modified: trunk/reactos/lib/msi/msiquery.c
Modified: trunk/reactos/lib/msi/package.c
Modified: trunk/reactos/lib/msi/preview.c
Modified: trunk/reactos/lib/msi/record.c
Modified: trunk/reactos/lib/msi/registry.c
Modified: trunk/reactos/lib/msi/suminfo.c
Modified: trunk/reactos/lib/msi/table.c
--- trunk/reactos/include/wine/msidefs.h 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/include/wine/msidefs.h 2005-04-26 20:39:02 UTC (rev 14823)
@@ -103,6 +103,49 @@
msidbComponentAttributes64bit = 0x00000100
};
+/*
+ * Windows SDK braindamage alert
+ *
+ * PID_DICTIONARY and PID_CODEPAGE are defined by propidl.h too
+ * PID_SECURITY is defined in propidl.h with a different value!
+ * So these need to be undefined first.
+ */
+#ifdef PID_DICTIONARY
+#undef PID_DICTIONARY
+#endif
+
+#ifdef PID_CODEPAGE
+#undef PID_CODEPAGE
+#endif
+
+#ifdef PID_SECURITY
+#undef PID_SECURITY
+#endif
+
+#define PID_DICTIONARY 0
+#define PID_CODEPAGE 1
+#define PID_TITLE 2
+#define PID_SUBJECT 3
+#define PID_AUTHOR 4
+#define PID_KEYWORDS 5
+#define PID_COMMENTS 6
+#define PID_TEMPLATE 7
+#define PID_LASTAUTHOR 8
+#define PID_REVNUMBER 9
+#define PID_EDITTINE 10
+#define PID_LASTPRINTED 11
+#define PID_CREATE_DTM 12
+#define PID_LASTSAVE_DTM 13
+#define PID_PAGECOUNT 14
+#define PID_WORDCOUNT 15
+#define PID_CHARCOUNT 16
+#define PID_THUMBNAIL 17
+#define PID_APPNAME 18
+#define PID_SECURITY 19
+#define PID_MSIVERSION PID_PAGECOUNT
+#define PID_MSISOURCE PID_WORDCOUNT
+#define PID_MSIRESTRICT PID_CHARCOUNT
+
#ifdef __cplusplus
}
#endif
--- trunk/reactos/lib/msi/Makefile.in 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/lib/msi/Makefile.in 2005-04-26 20:39:02 UTC (rev 14823)
@@ -11,6 +11,7 @@
appsearch.c \
create.c \
custom.c \
+ database.c \
delete.c \
dialog.c \
distinct.c \
--- trunk/reactos/lib/msi/action.c 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/lib/msi/action.c 2005-04-26 20:39:02 UTC (rev 14823)
@@ -61,7 +61,7 @@
*/
static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package, BOOL UIran);
static UINT ACTION_ProcessUISequence(MSIPACKAGE *package);
-static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq);
+static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq, BOOL UI);
static UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name,
LPWSTR *FilePath);
@@ -508,8 +508,8 @@
memset(&package->files[index],0,sizeof(MSIFILE));
- package->files[index].File = dupstrW(name);
- package->files[index].TargetPath = dupstrW(path);
+ package->files[index].File = strdupW(name);
+ package->files[index].TargetPath = strdupW(path);
package->files[index].Temporary = TRUE;
TRACE("Tracking tempfile (%s)\n",debugstr_w(package->files[index].File));
@@ -677,7 +677,7 @@
package->ActionFormat = load_dynamic_stringW(row,3);
HeapFree(GetProcessHeap(),0,package->LastAction);
- package->LastAction = dupstrW(action);
+ package->LastAction = strdupW(action);
msiobj_release(&row->hdr);
MSI_ViewClose(view);
@@ -864,6 +864,7 @@
DWORD sz;
WCHAR buffer[10];
UINT rc;
+ BOOL ui = FALSE;
static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
static const WCHAR szAction[] = {'A','C','T','I','O','N',0};
static const WCHAR szInstall[] = {'I','N','S','T','A','L','L',0};
@@ -875,8 +876,8 @@
{
LPWSTR p, check, path;
- package->PackagePath = dupstrW(szPackagePath);
- path = dupstrW(szPackagePath);
+ package->PackagePath = strdupW(szPackagePath);
+ path = strdupW(szPackagePath);
p = strrchrW(path,'\\');
if (p)
{
@@ -921,7 +922,7 @@
while (*ptr == ' ') ptr++;
len = ptr2-ptr;
prop = HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR));
- strncpyW(prop,ptr,len);
+ memcpy(prop,ptr,len*sizeof(WCHAR));
prop[len]=0;
ptr2++;
@@ -941,7 +942,7 @@
len -= 2;
}
val = HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR));
- strncpyW(val,ptr2,len);
+ memcpy(val,ptr2,len*sizeof(WCHAR));
val[len] = 0;
if (strlenW(prop) > 0)
@@ -963,6 +964,7 @@
if (atoiW(buffer) >= INSTALLUILEVEL_REDUCED)
{
rc = ACTION_ProcessUISequence(package);
+ ui = TRUE;
if (rc == ERROR_SUCCESS)
rc = ACTION_ProcessExecSequence(package,TRUE);
}
@@ -980,13 +982,13 @@
/* process the ending type action */
if (rc == ERROR_SUCCESS)
- ACTION_PerformActionSequence(package,-1);
+ ACTION_PerformActionSequence(package,-1,ui);
else if (rc == ERROR_INSTALL_USEREXIT)
- ACTION_PerformActionSequence(package,-2);
+ ACTION_PerformActionSequence(package,-2,ui);
else if (rc == ERROR_FUNCTION_FAILED)
- ACTION_PerformActionSequence(package,-3);
+ ACTION_PerformActionSequence(package,-3,ui);
else if (rc == ERROR_INSTALL_SUSPEND)
- ACTION_PerformActionSequence(package,-4);
+ ACTION_PerformActionSequence(package,-4,ui);
/* finish up running custom actions */
ACTION_FinishCustomActions(package);
@@ -994,7 +996,7 @@
return rc;
}
-static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq)
+static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq, BOOL UI)
{
MSIQUERY * view;
UINT rc;
@@ -1007,8 +1009,17 @@
'S','e','q','u','e','n','c','e',' ', 'W','H','E','R','E',' ',
'S','e','q','u','e','n','c','e',' ', '=',' ','%','i',0};
- rc = MSI_OpenQuery(package->db, &view, ExecSeqQuery, seq);
+ static const WCHAR UISeqQuery[] =
+ {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
+ 'I','n','s','t','a','l','l','U','I','S','e','q','u','e','n','c','e',
+ ' ', 'W','H','E','R','E',' ', 'S','e','q','u','e','n','c','e',
+ ' ', '=',' ','%','i',0};
+ if (UI)
+ rc = MSI_OpenQuery(package->db, &view, UISeqQuery, seq);
+ else
+ rc = MSI_OpenQuery(package->db, &view, ExecSeqQuery, seq);
+
if (rc == ERROR_SUCCESS)
{
rc = MSI_ViewExecute(view, 0);
@@ -1058,7 +1069,10 @@
goto end;
}
- rc = ACTION_PerformAction(package,buffer);
+ if (UI)
+ rc = ACTION_PerformUIAction(package,buffer);
+ else
+ rc = ACTION_PerformAction(package,buffer);
msiobj_release(&row->hdr);
end:
MSI_ViewClose(view);
@@ -1921,7 +1935,7 @@
memset(&package->folders[index],0,sizeof(MSIFOLDER));
- package->folders[index].Directory = dupstrW(dir);
+ package->folders[index].Directory = strdupW(dir);
rc = MSI_OpenQuery(package->db, &view, Query, dir);
if (rc != ERROR_SUCCESS)
@@ -1980,13 +1994,13 @@
{
TRACE(" TargetDefault = %s\n",debugstr_w(targetdir));
HeapFree(GetProcessHeap(),0, package->folders[index].TargetDefault);
- package->folders[index].TargetDefault = dupstrW(targetdir);
+ package->folders[index].TargetDefault = strdupW(targetdir);
}
if (srcdir)
- package->folders[index].SourceDefault = dupstrW(srcdir);
+ package->folders[index].SourceDefault = strdupW(srcdir);
else if (targetdir)
- package->folders[index].SourceDefault = dupstrW(targetdir);
+ package->folders[index].SourceDefault = strdupW(targetdir);
HeapFree(GetProcessHeap(), 0, ptargetdir);
parent = load_dynamic_stringW(row,2);
@@ -2084,13 +2098,13 @@
if (!source && package->folders[i].ResolvedTarget)
{
- path = dupstrW(package->folders[i].ResolvedTarget);
+ path = strdupW(package->folders[i].ResolvedTarget);
TRACE(" already resolved to %s\n",debugstr_w(path));
return path;
}
else if (source && package->folders[i].ResolvedSource)
{
- path = dupstrW(package->folders[i].ResolvedSource);
+ path = strdupW(package->folders[i].ResolvedSource);
return path;
}
else if (!source && package->folders[i].Property)
@@ -2114,7 +2128,7 @@
{
TRACE(" TargetDefault = %s\n",debugstr_w(package->folders[i].TargetDefault));
path = build_directory_name(3, p, package->folders[i].TargetDefault, NULL);
- package->folders[i].ResolvedTarget = dupstrW(path);
+ package->folders[i].ResolvedTarget = strdupW(path);
TRACE(" resolved into %s\n",debugstr_w(path));
if (set_prop)
MSI_SetPropertyW(package,name,path);
@@ -2122,7 +2136,7 @@
else
{
path = build_directory_name(3, p, package->folders[i].SourceDefault, NULL);
- package->folders[i].ResolvedSource = dupstrW(path);
+ package->folders[i].ResolvedSource = strdupW(path);
}
HeapFree(GetProcessHeap(),0,p);
}
@@ -3119,7 +3133,7 @@
{
if (package->files[index].State >= 2)
{
- *file_source = dupstrW(package->files[index].TargetPath);
+ *file_source = strdupW(package->files[index].TargetPath);
return ERROR_SUCCESS;
}
else
@@ -3231,7 +3245,7 @@
if (MSI_RecordIsNull(row,5))
{
LPWSTR p;
- dest_path = dupstrW(file_source);
+ dest_path = strdupW(file_source);
p = strrchrW(dest_path,'\\');
if (p)
*p=0;
@@ -3523,7 +3537,8 @@
value_data = parse_value(package, value, &type, &size);
else
{
- value_data = NULL;
+ static const WCHAR szEmpty[] = {0};
+ value_data = (LPSTR)strdupW(szEmpty);
size = 0;
type = REG_SZ;
}
@@ -3759,7 +3774,7 @@
if (j>=0)
{
- LPWSTR p = dupstrW(package->files[j].TargetPath);
+ LPWSTR p = strdupW(package->files[j].TargetPath);
return p;
}
}
@@ -4005,6 +4020,61 @@
return rc;
}
+typedef struct {
+ CLSID clsid;
+ LPWSTR source;
+
+ LPWSTR path;
+ ITypeLib *ptLib;
+} typelib_struct;
+
+BOOL CALLBACK Typelib_EnumResNameProc( HMODULE hModule, LPCWSTR lpszType,
+ LPWSTR lpszName, LONG_PTR lParam)
+{
+ TLIBATTR *attr;
+ typelib_struct *tl_struct = (typelib_struct*) lParam;
+ static const WCHAR fmt[] = {'%','s','\\','%','i',0};
+ int sz;
+ HRESULT res;
+
+ if (!IS_INTRESOURCE(lpszName))
+ {
+ ERR("Not Int Resource Name %s\n",debugstr_w(lpszName));
+ return TRUE;
+ }
+
+ sz = strlenW(tl_struct->source)+4;
+ sz *= sizeof(WCHAR);
+
+ tl_struct->path = HeapAlloc(GetProcessHeap(),0,sz);
+ sprintfW(tl_struct->path,fmt,tl_struct->source, lpszName);
+
+ TRACE("trying %s\n", debugstr_w(tl_struct->path));
+ res = LoadTypeLib(tl_struct->path,&tl_struct->ptLib);
+ if (!SUCCEEDED(res))
+ {
+ HeapFree(GetProcessHeap(),0,tl_struct->path);
+ tl_struct->path = NULL;
+
+ return TRUE;
+ }
+
+ ITypeLib_GetLibAttr(tl_struct->ptLib, &attr);
+ if (IsEqualGUID(&(tl_struct->clsid),&(attr->guid)))
+ {
+ ITypeLib_ReleaseTLibAttr(tl_struct->ptLib, attr);
+ return FALSE;
+ }
+
+ HeapFree(GetProcessHeap(),0,tl_struct->path);
+ tl_struct->path = NULL;
+
+ ITypeLib_ReleaseTLibAttr(tl_struct->ptLib, attr);
+ ITypeLib_Release(tl_struct->ptLib);
+
+ return TRUE;
+}
+
static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package)
{
/*
@@ -4019,8 +4089,6 @@
static const WCHAR Query[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
'T','y','p','e','L','i','b',0};
- ITypeLib *ptLib;
- HRESULT res;
if (!package)
return ERROR_INVALID_HANDLE;
@@ -4042,6 +4110,10 @@
WCHAR component[0x100];
DWORD sz;
INT index;
+ LPWSTR guid;
+ typelib_struct tl_struct;
+ HMODULE module;
+ static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0};
rc = MSI_ViewFetch(view,&row);
if (rc != ERROR_SUCCESS)
@@ -4082,46 +4154,59 @@
continue;
}
- res = LoadTypeLib(package->files[index].TargetPath,&ptLib);
- if (SUCCEEDED(res))
+ guid = load_dynamic_stringW(row,1);
+ module = LoadLibraryExW(package->files[index].TargetPath, NULL,
+ LOAD_LIBRARY_AS_DATAFILE);
+ if (module != NULL)
{
- LPWSTR help;
- WCHAR helpid[0x100];
+ CLSIDFromString(guid, &tl_struct.clsid);
+ tl_struct.source = strdupW(package->files[index].TargetPath);
+ tl_struct.path = NULL;
- sz = 0x100;
- MSI_RecordGetStringW(row,6,helpid,&sz);
+ EnumResourceNamesW(module, szTYPELIB, Typelib_EnumResNameProc,
+ (LONG_PTR)&tl_struct);
- help = resolve_folder(package,helpid,FALSE,FALSE,NULL);
- res = RegisterTypeLib(ptLib,package->files[index].TargetPath,help);
- HeapFree(GetProcessHeap(),0,help);
-
- if (!SUCCEEDED(res))
- ERR("Failed to register type library %s\n",
- debugstr_w(package->files[index].TargetPath));
- else
+ if (tl_struct.path != NULL)
{
- /* Yes the row has more fields than I need, but #1 is
- correct and the only one I need. Why make a new row? */
+ LPWSTR help;
+ WCHAR helpid[0x100];
+ HRESULT res;
- ui_actiondata(package,szRegisterTypeLibraries,row);
+ sz = 0x100;
+ MSI_RecordGetStringW(row,6,helpid,&sz);
+
+ help = resolve_folder(package,helpid,FALSE,FALSE,NULL);
+ res = RegisterTypeLib(tl_struct.ptLib,tl_struct.path,help);
+ HeapFree(GetProcessHeap(),0,help);
+
+ if (!SUCCEEDED(res))
+ ERR("Failed to register type library %s\n",
+ debugstr_w(tl_struct.path));
+ else
+ {
+ ui_actiondata(package,szRegisterTypeLibraries,row);
- TRACE("Registered %s\n",
- debugstr_w(package->files[index].TargetPath));
+ TRACE("Registered %s\n", debugstr_w(tl_struct.path));
+ }
+
+ ITypeLib_Release(tl_struct.ptLib);
+ HeapFree(GetProcessHeap(),0,tl_struct.path);
}
-
- if (ptLib)
- ITypeLib_Release(ptLib);
+ else
+ ERR("Failed to load type library %s\n",
+ debugstr_w(tl_struct.source));
+
+ FreeLibrary(module);
+ HeapFree(GetProcessHeap(),0,tl_struct.source);
}
else
- ERR("Failed to load type library %s\n",
- debugstr_w(package->files[index].TargetPath));
-
+ ERR("Could not load file! %s\n",
+ debugstr_w(package->files[index].TargetPath));
msiobj_release(&row->hdr);
}
MSI_ViewClose(view);
msiobj_release(&view->hdr);
return rc;
-
}
static UINT register_appid(MSIPACKAGE *package, LPCWSTR clsid, LPCWSTR app )
@@ -4362,7 +4447,7 @@
HeapFree(GetProcessHeap(),0,argument);
size += (strlenW(package->files[index].TargetPath))*sizeof(WCHAR);
- argument = (LPWSTR)HeapAlloc(GetProcessHeap(),0,size+sizeof(WCHAR));
+ argument = HeapAlloc(GetProcessHeap(),0,size+sizeof(WCHAR));
strcpyW(argument,package->files[index].TargetPath);
if (deformated)
{
@@ -4882,7 +4967,7 @@
{
LPWSTR keypath;
FIXME("poorly handled shortcut format, advertised shortcut\n");
- keypath = dupstrW(package->components[index].FullKeypath);
+ keypath = strdupW(package->components[index].FullKeypath);
IShellLinkW_SetPath(sl,keypath);
HeapFree(GetProcessHeap(),0,keypath);
}
--- trunk/reactos/lib/msi/action.h 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/lib/msi/action.h 2005-04-26 20:39:02 UTC (rev 14823)
@@ -116,39 +116,3 @@
int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature );
int get_loaded_file(MSIPACKAGE* package, LPCWSTR file);
int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
-
-
-
-inline static char *strdupWtoA( const WCHAR *str )
-{
- char *ret = NULL;
- if (str)
- {
- DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL
-);
- if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
- WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
- }
- return ret;
-}
-
-inline static WCHAR *strdupAtoW( const char *str )
-{
- WCHAR *ret = NULL;
- if (str)
- {
- DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
- if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
- MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
- }
- return ret;
-}
-
-inline static LPWSTR dupstrW(LPCWSTR src)
-{
- LPWSTR dest;
- if (!src) return NULL;
- dest = HeapAlloc(GetProcessHeap(), 0, (strlenW(src)+1)*sizeof(WCHAR));
- strcpyW(dest, src);
- return dest;
-}
--- trunk/reactos/lib/msi/appsearch.c 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/lib/msi/appsearch.c 2005-04-26 20:39:02 UTC (rev 14823)
@@ -406,7 +406,7 @@
/* Sets *matches to whether the file (whose path is filePath) matches the
* versions set in sig.
* Return ERROR_SUCCESS in case of success (whether or not the file matches),
- * something else if a install-halting error occurs.
+ * something else if an install-halting error occurs.
*/
static UINT ACTION_FileVersionMatches(MSISIGNATURE *sig, LPCWSTR filePath,
BOOL *matches)
@@ -481,7 +481,7 @@
* fullFilePath is assumed to be the full path of the file specified in
* findData, which may be necessary to compare the version.
* Return ERROR_SUCCESS in case of success (whether or not the file matches),
- * something else if a install-halting error occurs.
+ * something else if an install-halting error occurs.
*/
static UINT ACTION_FileMatchesSig(MSISIGNATURE *sig,
LPWIN32_FIND_DATAW findData, LPCWSTR fullFilePath, BOOL *matches)
@@ -672,8 +672,8 @@
pathWithDrive[0] = 'A' + i;
if (GetDriveTypeW(pathWithDrive) == DRIVE_FIXED)
{
- strncpyW(pathWithDrive + 3, expanded,
- sizeof(pathWithDrive) / sizeof(pathWithDrive[0]) - 3);
+ lstrcpynW(pathWithDrive + 3, expanded,
+ sizeof(pathWithDrive) / sizeof(pathWithDrive[0]) - 3);
if (sig->File)
rc = ACTION_RecurseSearchDirectory(package, &found, sig,
pathWithDrive, depth);
--- trunk/reactos/lib/msi/cond.tab.c 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/lib/msi/cond.tab.c 2005-04-26 20:39:02 UTC (rev 14823)
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 1.875b. */
+/* A Bison parser, made by GNU Bison 1.875c. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -253,18 +253,25 @@
#if ! defined (yyoverflow) || YYERROR_VERBOSE
+# ifndef YYFREE
+# define YYFREE free
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# endif
+
/* The parser invokes alloca or malloc; define the necessary symbols. */
-# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
+# ifdef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
+# define YYSTACK_ALLOC alloca
+# endif
# else
-# ifndef YYSTACK_USE_ALLOCA
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
-# else
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# endif
+# if defined (alloca) || defined (_ALLOCA_H)
+# define YYSTACK_ALLOC alloca
+# else
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
# endif
# endif
# endif
@@ -277,15 +284,15 @@
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
-# define YYSTACK_ALLOC malloc
-# define YYSTACK_FREE free
+# define YYSTACK_ALLOC YYMALLOC
+# define YYSTACK_FREE YYFREE
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
- || (YYSTYPE_IS_TRIVIAL)))
+ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
@@ -306,7 +313,7 @@
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
-# if 1 < __GNUC__
+# if defined (__GNUC__) && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
@@ -454,14 +461,14 @@
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- "$end", "error", "$undefined", "COND_SPACE", "COND_EOF", "COND_OR",
- "COND_AND", "COND_NOT", "COND_LT", "COND_GT", "COND_EQ", "COND_LPAR",
- "COND_RPAR", "COND_TILDA", "COND_PERCENT", "COND_DOLLARS",
- "COND_QUESTION", "COND_AMPER", "COND_EXCLAM", "COND_IDENT",
- "COND_NUMBER", "COND_LITER", "COND_ERROR", "$accept", "condition",
- "expression", "boolean_term", "boolean_factor", "term", "comp_op_i",
- "comp_op_s", "comp_op_m1", "comp_op_m2", "value_i", "value_s",
- "literal", "symbol_i", "symbol_s", "identifier", "integer", 0
+ "$end", "error", "$undefined", "COND_SPACE", "COND_EOF", "COND_OR",
+ "COND_AND", "COND_NOT", "COND_LT", "COND_GT", "COND_EQ", "COND_LPAR",
+ "COND_RPAR", "COND_TILDA", "COND_PERCENT", "COND_DOLLARS",
+ "COND_QUESTION", "COND_AMPER", "COND_EXCLAM", "COND_IDENT",
+ "COND_NUMBER", "COND_LITER", "COND_ERROR", "$accept", "condition",
+ "expression", "boolean_term", "boolean_factor", "term", "comp_op_i",
+ "comp_op_s", "comp_op_m1", "comp_op_m2", "value_i", "value_s", "literal",
+ "symbol_i", "symbol_s", "identifier", "integer", 0
};
#endif
@@ -624,7 +631,7 @@
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrlab1
+#define YYERROR goto yyerrorlab
/* Like YYERROR except do call yyerror. This remains here temporarily
@@ -659,11 +666,11 @@
are run). */
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- Current.first_line = Rhs[1].first_line; \
- Current.first_column = Rhs[1].first_column; \
- Current.last_line = Rhs[N].last_line; \
- Current.last_column = Rhs[N].last_column;
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ ((Current).first_line = (Rhs)[1].first_line, \
+ (Current).first_column = (Rhs)[1].first_column, \
+ (Current).last_line = (Rhs)[N].last_line, \
+ (Current).last_column = (Rhs)[N].last_column)
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
@@ -707,7 +714,7 @@
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (cinluded). |
+| TOP (included). |
`------------------------------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
@@ -786,7 +793,7 @@
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
-#if YYMAXDEPTH == 0
+#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif
@@ -1714,8 +1721,8 @@
}
-/* Line 999 of yacc.c. */
-#line 1719 "cond.tab.c"
+/* Line 1000 of yacc.c. */
+#line 1726 "cond.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
@@ -1818,25 +1825,27 @@
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
+ if (yychar <= YYEOF)
{
- /* Pop the error token. */
- YYPOPSTACK;
- /* Pop the rest of the stack. */
- while (yyss < yyssp)
- {
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[*yyssp], yyvsp);
- YYPOPSTACK;
- }
- YYABORT;
+ /* If at end of input, pop the error token,
+ then the rest of the stack, then return failure. */
+ if (yychar == YYEOF)
+ for (;;)
+ {
+ YYPOPSTACK;
+ if (yyssp == yyss)
+ YYABORT;
+ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+ yydestruct (yystos[*yyssp], yyvsp);
+ }
}
+ else
+ {
+ YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+ yydestruct (yytoken, &yylval);
+ yychar = YYEMPTY;
- YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
- yydestruct (yytoken, &yylval);
- yychar = YYEMPTY;
-
+ }
}
/* Else will try to reuse lookahead token after shifting the error
@@ -1844,9 +1853,27 @@
goto yyerrlab1;
-/*----------------------------------------------------.
-| yyerrlab1 -- error raised explicitly by an action. |
-`----------------------------------------------------*/
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR. |
+`---------------------------------------------------*/
+yyerrorlab:
+
+#ifdef __GNUC__
+ /* Pacify GCC when the user code never invokes YYERROR and the label
+ yyerrorlab therefore never appears in user code. */
+ if (0)
+ goto yyerrorlab;
+#endif
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+ yystate = *yyssp;
+ goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR. |
+`-------------------------------------------------------------*/
yyerrlab1:
yyerrstatus = 3; /* Each real token shifted decrements this. */
@@ -1870,9 +1897,8 @@
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
yydestruct (yystos[yystate], yyvsp);
- yyvsp--;
- yystate = *--yyssp;
-
+ YYPOPSTACK;
+ yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
@@ -2123,7 +2149,7 @@
ret = HeapAlloc( GetProcessHeap(), 0, (str->len+1) * sizeof (WCHAR) );
if( ret )
{
- strncpyW( ret, str->data, str->len );
+ memcpy( ret, str->data, str->len * sizeof(WCHAR));
ret[str->len]=0;
}
TRACE("Got identifier %s\n",debugstr_w(ret));
--- trunk/reactos/lib/msi/cond.tab.h 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/lib/msi/cond.tab.h 2005-04-26 20:39:02 UTC (rev 14823)
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 1.875b. */
+/* A Bison parser, made by GNU Bison 1.875c. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -86,7 +86,7 @@
comp_m1 fn_comp_m1;
comp_m2 fn_comp_m2;
} YYSTYPE;
-/* Line 1252 of yacc.c. */
+/* Line 1275 of yacc.c. */
#line 91 "cond.tab.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
--- trunk/reactos/lib/msi/cond.y 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/lib/msi/cond.y 2005-04-26 20:39:02 UTC (rev 14823)
@@ -701,7 +701,7 @@
ret = HeapAlloc( GetProcessHeap(), 0, (str->len+1) * sizeof (WCHAR) );
if( ret )
{
- strncpyW( ret, str->data, str->len );
+ memcpy( ret, str->data, str->len * sizeof(WCHAR));
ret[str->len]=0;
}
TRACE("Got identifier %s\n",debugstr_w(ret));
--- trunk/reactos/lib/msi/custom.c 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/lib/msi/custom.c 2005-04-26 20:39:02 UTC (rev 14823)
@@ -145,7 +145,7 @@
else
newbuf = HeapAlloc(GetProcessHeap(),0, sizeof(LPWSTR));
- newbuf[count] = dupstrW(action);
+ newbuf[count] = strdupW(action);
package->CommitAction = newbuf;
}
else
@@ -160,7 +160,7 @@
else
newbuf = HeapAlloc(GetProcessHeap(),0, sizeof(LPWSTR));
- newbuf[count] = dupstrW(action);
+ newbuf[count] = strdupW(action);
package->DeferredAction = newbuf;
}
@@ -326,7 +326,7 @@
newbuf[count].handle = Handle;
newbuf[count].process = process;
- newbuf[count].name = dupstrW(name);
+ newbuf[count].name = strdupW(name);
package->RunningAction = newbuf;
}
@@ -508,8 +508,8 @@
info = HeapAlloc( GetProcessHeap(), 0, sizeof(*info) );
msiobj_addref( &package->hdr );
info->package = package;
- info->target = dupstrW(target);
- info->source = dupstrW(tmp_file);
+ info->target = strdupW(target);
+ info->source = strdupW(tmp_file);
ThreadHandle = CreateThread(NULL,0,DllThread,(LPVOID)info,0,&ThreadId);
@@ -542,7 +542,7 @@
if (deformated)
len += strlenW(deformated);
- cmd = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len);
+ cmd = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len);
strcpyW(cmd,tmp_file);
if (deformated)
@@ -595,7 +595,7 @@
len += strlenW(deformated);
len += 2;
- cmd = (WCHAR*)HeapAlloc(GetProcessHeap(),0,len * sizeof(WCHAR));
+ cmd = HeapAlloc(GetProcessHeap(),0,len * sizeof(WCHAR));
strcpyW(cmd, package->files[index].TargetPath);
if (deformated)
@@ -692,7 +692,7 @@
if (deformated)
len += strlenW(deformated);
- cmd = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len);
+ cmd = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len);
strcpyW(cmd,prop);
if (deformated)
Property changes on: trunk/reactos/lib/msi/database.c
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
--- trunk/reactos/lib/msi/dialog.c 2005-04-26 20:05:25 UTC (rev 14822)
+++ trunk/reactos/lib/msi/dialog.c 2005-04-26 20:39:02 UTC (rev 14823)
@@ -18,6 +18,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#define COBJMACROS
+
#include <stdarg.h>
#include "windef.h"
@@ -28,6 +30,8 @@
#include "msi.h"
#include "msipriv.h"
#include "msidefs.h"
+#include "ocidl.h"
+#include "olectl.h"
#include "wine/debug.h"
#include "wine/unicode.h"
@@ -55,6 +59,7 @@
HWND hwnd;
msi_handler handler;
LPWSTR property;
+ IPicture *pic;
WCHAR name[1];
};
@@ -131,7 +136,7 @@
ret = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if( !ret )
return ret;
- strncpyW( ret, p, len );
+ memcpy( ret, p, len*sizeof(WCHAR) );
ret[len-1] = 0;
return ret;
}
@@ -226,17 +231,16 @@
return r;
}
-static msi_control *msi_dialog_add_control( msi_dialog *dialog,
- MSIRECORD *rec, LPCWSTR szCls, DWORD style )
+static msi_control *msi_dialog_create_window( msi_dialog *dialog,
+ MSIRECORD *rec, LPCWSTR szCls, LPCWSTR name, LPCWSTR text,
+ DWORD style, HWND parent )
{
- DWORD x, y, width, height, attributes;
- LPCWSTR text, name;
+ DWORD x, y, width, height;
LPWSTR font = NULL, title = NULL;
- msi_control *control = NULL;
+ msi_control *control;
style |= WS_CHILD | WS_GROUP;
- name = MSI_RecordGetString( rec, 2 );
control = HeapAlloc( GetProcessHeap(), 0,
sizeof *control + strlenW(name)*sizeof(WCHAR) );
strcpyW( control->name, name );
@@ -244,39 +248,57 @@
dialog->control_list = control;
control->handler = NULL;
control->property = NULL;
+ control->pic = NULL;
x = MSI_RecordGetInteger( rec, 4 );
y = MSI_RecordGetInteger( rec, 5 );
width = MSI_RecordGetInteger( rec, 6 );
height = MSI_RecordGetInteger( rec, 7 );
- attributes = MSI_RecordGetInteger( rec, 8 );
- text = MSI_RecordGetString( rec, 10 );
- TRACE("Dialog %s control %s\n", debugstr_w(dialog->name), debugstr_w(text));
-
x = msi_dialog_scale_unit( dialog, x );
y = msi_dialog_scale_unit( dialog, y );
width = msi_dialog_scale_unit( dialog, width );
height = msi_dialog_scale_unit( dialog, height );
- if( attributes & 1 )
[truncated at 1000 lines; 2820 more skipped]